source: sans/Analysis/branches/ajj_23APR07/IGOR_Package_Files/Put in User Procedures/SANS_Models_v3.00/PolyRectSphere_and_Struct.ipf @ 146

Last change on this file since 146 was 131, checked in by srkline, 15 years ago

Typo in dialog in every model...

File size: 16.9 KB
Line 
1#pragma rtGlobals=1             // Use modern global access method.
2#pragma IgorVersion = 6.0
3
4// be sure to include all the necessary files...
5
6#include "RectPolySpheres"
7
8#include "HardSphereStruct"
9#include "HPMSA"
10#include "SquareWellStruct"
11#include "StickyHardSphereStruct"
12
13Proc PlotPolyRectSphere_HS(num,qmin,qmax)
14        Variable num=256,qmin=0.001,qmax=0.7
15        Prompt num "Enter number of data points for model: "
16        Prompt qmin "Enter minimum q-value (^-1) for model: "
17        Prompt qmax "Enter maximum q-value (^-1) for model: "
18       
19        Make/O/D/n=(num) xwave_RECT_HS,ywave_RECT_HS
20        xwave_RECT_HS =  alog(log(qmin) + x*((log(qmax)-log(qmin))/num))
21        Make/O/D coef_RECT_HS = {0.1,60,0.1,6e-6,0.0001}
22        make/o/t parameters_RECT_HS = {"volume fraction","avg radius (A)","polydispersity","contrast (A-2)","bkg (cm-1)"}
23        Edit/K=1 parameters_RECT_HS,coef_RECT_HS
24       
25        Variable/G root:g_RECT_HS
26        g_RECT_HS := PolyRectSphere_HS(coef_RECT_HS,ywave_RECT_HS,xwave_RECT_HS)
27        Display/K=1 ywave_RECT_HS vs xwave_RECT_HS
28        ModifyGraph log=1,marker=29,msize=2,mode=4
29        Label bottom "q (\\S-1\\M)"
30        Label left "Intensity (cm\\S-1\\M)"
31
32        AutoPositionWindow/M=1/R=$(WinName(0,1)) $WinName(0,2)
33End
34
35// - sets up a dependency to a wrapper, not the actual SmearedModelFunction
36Proc PlotSmearedPolyRectSphere_HS(str)                                                         
37        String str
38        Prompt str,"Pick the data folder containing the resolution you want",popup,getAList(4)
39       
40        // if any of the resolution waves are missing => abort
41        if(ResolutionWavesMissingDF(str))               //updated to NOT use global strings (in GaussUtils)
42                Abort
43        endif
44       
45        SetDataFolder $("root:"+str)
46       
47        // Setup parameter table for model function
48        Make/O/D smear_coef_RECT_HS = {0.1,60,0.1,6e-6,0.0001}
49        make/o/t smear_parameters_RECT_HS = {"volume fraction","avg radius (A)","polydispersity","contrast (A-2)","bkg (cm-1)"}
50        Edit smear_parameters_RECT_HS,smear_coef_RECT_HS                                       
51       
52        // output smeared intensity wave, dimensions are identical to experimental QSIG values
53        // make extra copy of experimental q-values for easy plotting
54        Duplicate/O $(str+"_q") smeared_RECT_HS,smeared_qvals                           
55        SetScale d,0,0,"1/cm",smeared_RECT_HS                                                   
56                                       
57        Variable/G gs_RECT_HS=0
58        gs_RECT_HS := fSmearedPolyRectSphere_HS(smear_coef_RECT_HS,smeared_RECT_HS,smeared_qvals)       //this wrapper fills the STRUCT
59       
60        Display smeared_RECT_HS vs smeared_qvals                                                                       
61        ModifyGraph log=1,marker=29,msize=2,mode=4
62        Label bottom "q (\\S-1\\M)"
63        Label left "Intensity (cm\\S-1\\M)"
64
65        AutoPositionWindow/M=1/R=$(WinName(0,1)) $WinName(0,2)
66       
67        SetDataFolder root:
68End
69       
70
71Function PolyRectSphere_HS(w,yw,xw) : FitFunc
72        Wave w,yw,xw
73       
74        Variable inten
75       
76        //setup form factor coefficient wave
77        Make/O/D/N=5 form_RECT_HS
78        form_RECT_HS[0] = 1
79        form_RECT_HS[1] = w[1]
80        form_RECT_HS[2] = w[2]
81        form_RECT_HS[3] = w[3]
82        form_RECT_HS[4] = 0
83       
84        //calculate the diameter of the effective one-component sphere
85        Variable pd,diam,zz,Vpoly,Ravg
86        pd = w[2]
87        zz = (1/pd)^2 - 1
88        Ravg = w[1]             // <R^3> = Ravg^3*(1+3*pd^2)
89       
90        Vpoly = 4*pi/3*Ravg^3*(1+3*pd^2)
91        diam = (6*Vpoly/pi)^(1/3)
92       
93        //setup structure factor coefficient wave
94        Make/O/D/N=2 struct_RECT_HS
95        struct_RECT_HS[0] = diam/2
96        struct_RECT_HS[1] = w[0]
97       
98        //calculate each and combine
99        Duplicate/O xw temp_RECT_HS_PQ,temp_RECT_HS_SQ          //make waves for the AAO
100        PolyRectSpheres(form_RECT_HS,temp_RECT_HS_PQ,xw)
101        HardSphereStruct(struct_RECT_HS,temp_RECT_HS_SQ,xw)
102        yw = temp_RECT_HS_PQ * temp_RECT_HS_SQ
103        yw *= w[0]
104        yw += w[4]
105       
106        //cleanup waves
107//      Killwaves/Z form_RECT_HS,struct_RECT_HS
108       
109        return (0)
110End
111
112/////////////////////////////////////////
113Proc PlotPolyRectSphere_SW(num,qmin,qmax)
114        Variable num=256,qmin=0.001,qmax=0.7
115        Prompt num "Enter number of data points for model: "
116        Prompt qmin "Enter minimum q-value (^-1) for model: "
117        Prompt qmax "Enter maximum q-value (^-1) for model: "
118       
119        Make/O/D/n=(num) xwave_RECT_SW,ywave_RECT_SW
120        xwave_RECT_SW =  alog(log(qmin) + x*((log(qmax)-log(qmin))/num))
121        Make/O/D coef_RECT_SW = {0.1,60,0.1,6e-6,1.0,1.2,0.0001}
122        make/o/t parameters_RECT_SW = {"volume fraction","avg radius(A)","polydispersity","contrast (A-2)","well depth (kT)","well width (diam.)","bkg (cm-1)"}
123        Edit/K=1 parameters_RECT_SW,coef_RECT_SW
124       
125        Variable/G root:g_RECT_SW
126        g_RECT_SW := PolyRectSphere_SW(coef_RECT_SW,ywave_RECT_SW,xwave_RECT_SW)
127        Display/K=1 ywave_RECT_SW vs xwave_RECT_SW
128        ModifyGraph log=1,marker=29,msize=2,mode=4
129        Label bottom "q (\\S-1\\M)"
130        Label left "Intensity (cm\\S-1\\M)"
131
132        AutoPositionWindow/M=1/R=$(WinName(0,1)) $WinName(0,2)
133End
134
135// - sets up a dependency to a wrapper, not the actual SmearedModelFunction
136Proc PlotSmearedPolyRectSphere_SW(str)                                                         
137        String str
138        Prompt str,"Pick the data folder containing the resolution you want",popup,getAList(4)
139       
140        // if any of the resolution waves are missing => abort
141        if(ResolutionWavesMissingDF(str))               //updated to NOT use global strings (in GaussUtils)
142                Abort
143        endif
144       
145        SetDataFolder $("root:"+str)
146       
147        // Setup parameter table for model function
148        Make/O/D smear_coef_RECT_SW = {0.1,60,0.1,6e-6,1.0,1.2,0.0001}
149        make/o/t smear_parameters_RECT_SW = {"volume fraction","avg radius(A)","polydispersity","contrast (A-2)","well depth (kT)","well width (diam.)","bkg (cm-1)"}
150        Edit smear_parameters_RECT_SW,smear_coef_RECT_SW                                       
151       
152        // output smeared intensity wave, dimensions are identical to experimental QSIG values
153        // make extra copy of experimental q-values for easy plotting
154        Duplicate/O $(str+"_q") smeared_RECT_SW,smeared_qvals                           
155        SetScale d,0,0,"1/cm",smeared_RECT_SW                                                   
156                                       
157        Variable/G gs_RECT_SW=0
158        gs_RECT_SW := fSmearedPolyRectSphere_SW(smear_coef_RECT_SW,smeared_RECT_SW,smeared_qvals)       //this wrapper fills the STRUCT
159       
160        Display smeared_RECT_SW vs smeared_qvals                                                                       
161        ModifyGraph log=1,marker=29,msize=2,mode=4
162        Label bottom "q (\\S-1\\M)"
163        Label left "Intensity (cm\\S-1\\M)"
164
165        AutoPositionWindow/M=1/R=$(WinName(0,1)) $WinName(0,2)
166       
167        SetDataFolder root:
168End
169       
170
171Function PolyRectSphere_SW(w,yw,xw) : FitFunc
172        Wave w,yw,xw
173       
174        Variable inten
175       
176        //setup form factor coefficient wave
177        Make/O/D/N=5 form_RECT_SW
178        form_RECT_SW[0] = 1
179        form_RECT_SW[1] = w[1]
180        form_RECT_SW[2] = w[2]
181        form_RECT_SW[3] = w[3]
182        form_RECT_SW[4] = 0
183       
184        //calculate the diameter of the effective one-component sphere
185        Variable pd,diam,zz,Vpoly,Ravg
186        pd = w[2]
187        zz = (1/pd)^2 - 1
188        Ravg = w[1]             // <R^3> = Ravg^3*(1+3*pd^2)
189       
190        Vpoly = 4*pi/3*Ravg^3*(1+3*pd^2)
191        diam = (6*Vpoly/pi)^(1/3)
192       
193        //setup structure factor coefficient wave
194        Make/O/D/N=4 struct_RECT_SW
195        struct_RECT_SW[0] = diam/2
196        struct_RECT_SW[1] = w[0]
197        struct_RECT_SW[2] = w[4]
198        struct_RECT_SW[3] = w[5]
199       
200        //calculate each and combine
201        Duplicate/O xw temp_RECT_SW_PQ,temp_RECT_SW_SQ          //make waves for the AAO
202        PolyRectSpheres(form_RECT_SW,temp_RECT_SW_PQ,xw)
203        SquareWellStruct(struct_RECT_SW,temp_RECT_SW_SQ,xw)
204        yw = temp_RECT_SW_PQ * temp_RECT_SW_SQ
205        yw *= w[0]
206        yw += w[6]
207       
208        //cleanup waves
209//      Killwaves/Z form_RECT_SW,struct_RECT_SW
210       
211        return (0)
212End
213
214
215/////////////////////////////////////////
216Proc PlotPolyRectSphere_SC(num,qmin,qmax)
217        Variable num=256,qmin=0.001,qmax=0.7
218        Prompt num "Enter number of data points for model: "
219        Prompt qmin "Enter minimum q-value (^-1) for model: "
220        Prompt qmax "Enter maximum q-value (^-1) for model: "
221       
222        if(!DataFolderExists(":HayPenMSA"))
223                NewDataFolder :HayPenMSA
224        endif
225        Make/O/D/N=17 :HayPenMSA:gMSAWave
226       
227        Make/O/D/n=(num) xwave_RECT_SC,ywave_RECT_SC
228        xwave_RECT_SC =  alog(log(qmin) + x*((log(qmax)-log(qmin))/num))
229        Make/O/D coef_RECT_SC = {0.1,60,0.1,6e-6,10,0,298,78,0.0001}
230        make/o/t parameters_RECT_SC = {"volume fraction","avg radius (A)","polydispersity","contrast (A-2)","charge","Monovalent salt (M)","Temperature (K)","dielectric const.","bkg (cm-1)"}
231        Edit/K=1 parameters_RECT_SC,coef_RECT_SC
232       
233        Variable/G root:g_RECT_SC
234        g_RECT_SC := PolyRectSphere_SC(coef_RECT_SC,ywave_RECT_SC,xwave_RECT_SC)
235        Display/K=1 ywave_RECT_SC vs xwave_RECT_SC
236        ModifyGraph log=1,marker=29,msize=2,mode=4
237        Label bottom "q (\\S-1\\M)"
238        Label left "Intensity (cm\\S-1\\M)"
239
240        AutoPositionWindow/M=1/R=$(WinName(0,1)) $WinName(0,2)
241End
242
243// - sets up a dependency to a wrapper, not the actual SmearedModelFunction
244Proc PlotSmearedPolyRectSphere_SC(str)                                                         
245        String str
246        Prompt str,"Pick the data folder containing the resolution you want",popup,getAList(4)
247       
248        // if any of the resolution waves are missing => abort
249        if(ResolutionWavesMissingDF(str))               //updated to NOT use global strings (in GaussUtils)
250                Abort
251        endif
252       
253        SetDataFolder $("root:"+str)
254       
255        if(!DataFolderExists(":HayPenMSA"))
256                NewDataFolder :HayPenMSA
257        endif
258        Make/O/D/N=17 :HayPenMSA:gMSAWave
259       
260        // Setup parameter table for model function
261        Make/O/D smear_coef_RECT_SC = {0.1,60,0.1,6e-6,10,0,298,78,0.0001}
262        make/o/t smear_parameters_RECT_SC = {"volume fraction","avg radius (A)","polydispersity","contrast (A-2)","charge","Monovalent salt (M)","Temperature (K)","dielectric const.","bkg (cm-1)"}
263        Edit smear_parameters_RECT_SC,smear_coef_RECT_SC                                       
264       
265        // output smeared intensity wave, dimensions are identical to experimental QSIG values
266        // make extra copy of experimental q-values for easy plotting
267        Duplicate/O $(str+"_q") smeared_RECT_SC,smeared_qvals                           
268        SetScale d,0,0,"1/cm",smeared_RECT_SC                                                   
269                                       
270        Variable/G gs_RECT_SC=0
271        gs_RECT_SC := fSmearedPolyRectSphere_SC(smear_coef_RECT_SC,smeared_RECT_SC,smeared_qvals)       //this wrapper fills the STRUCT
272       
273        Display smeared_RECT_SC vs smeared_qvals                                                                       
274        ModifyGraph log=1,marker=29,msize=2,mode=4
275        Label bottom "q (\\S-1\\M)"
276        Label left "Intensity (cm\\S-1\\M)"
277
278        AutoPositionWindow/M=1/R=$(WinName(0,1)) $WinName(0,2)
279       
280        SetDataFolder root:
281End
282
283
284Function PolyRectSphere_SC(w,yw,xw) : FitFunc
285        Wave w,yw,xw
286       
287        Variable inten
288       
289        //setup form factor coefficient wave
290        Make/O/D/N=5 form_RECT_SC
291        form_RECT_SC[0] = 1
292        form_RECT_SC[1] = w[1]
293        form_RECT_SC[2] = w[2]
294        form_RECT_SC[3] = w[3]
295        form_RECT_SC[4] = 0
296       
297        //calculate the diameter of the effective one-component sphere
298        Variable pd,diam,zz,Vpoly,Ravg
299        pd = w[2]
300        zz = (1/pd)^2 - 1
301        Ravg = w[1]             // <R^3> = Ravg^3*(1+3*pd^2)
302       
303        Vpoly = 4*pi/3*Ravg^3*(1+3*pd^2)
304        diam = (6*Vpoly/pi)^(1/3)
305       
306        //setup structure factor coefficient wave
307        Make/O/D/N=6 struct_RECT_SC
308        struct_RECT_SC[0] = diam
309        struct_RECT_SC[1] = w[4]
310        struct_RECT_SC[2] = w[0]
311        struct_RECT_SC[3] = w[6]
312        struct_RECT_SC[4] = w[5]
313        struct_RECT_SC[5] = w[7]
314       
315        //calculate each and combine
316        Duplicate/O xw temp_RECT_SC_PQ,temp_RECT_SC_SQ          //make waves for the AAO
317        PolyRectSpheres(form_RECT_SC,temp_RECT_SC_PQ,xw)
318        HayterPenfoldMSA(struct_RECT_SC,temp_RECT_SC_SQ,xw)
319        yw = temp_RECT_SC_PQ * temp_RECT_SC_SQ
320        yw *= w[0]
321        yw += w[8]
322       
323        //cleanup waves
324//      Killwaves/Z form_RECT_SC,struct_RECT_SC
325       
326        return (0)
327End
328
329/////////////////////////////////////////
330Proc PlotPolyRectSphere_SHS(num,qmin,qmax)
331        Variable num=256,qmin=0.001,qmax=0.7
332        Prompt num "Enter number of data points for model: "
333        Prompt qmin "Enter minimum q-value (^-1) for model: "
334        Prompt qmax "Enter maximum q-value (^-1) for model: "
335       
336        Make/O/D/n=(num) xwave_RECT_SHS,ywave_RECT_SHS
337        xwave_RECT_SHS =  alog(log(qmin) + x*((log(qmax)-log(qmin))/num))
338        Make/O/D coef_RECT_SHS = {0.1,60,0.1,6e-6,0.05,0.2,0.0001}
339        make/o/t parameters_RECT_SHS = {"volume fraction","avg radius(A)","polydispersity","contrast (A-2)","perturbation parameter (0.1)","stickiness, tau","bkg (cm-1)"}
340        Edit/K=1 parameters_RECT_SHS,coef_RECT_SHS
341       
342        Variable/G root:g_RECT_SHS
343        g_RECT_SHS := PolyRectSphere_SHS(coef_RECT_SHS,ywave_RECT_SHS,xwave_RECT_SHS)
344        Display/K=1 ywave_RECT_SHS vs xwave_RECT_SHS
345        ModifyGraph log=1,marker=29,msize=2,mode=4
346        Label bottom "q (\\S-1\\M)"
347        Label left "Intensity (cm\\S-1\\M)"
348
349        AutoPositionWindow/M=1/R=$(WinName(0,1)) $WinName(0,2)
350End
351
352// - sets up a dependency to a wrapper, not the actual SmearedModelFunction
353Proc PlotSmearedPolyRectSphere_SHS(str)                                                         
354        String str
355        Prompt str,"Pick the data folder containing the resolution you want",popup,getAList(4)
356       
357        // if any of the resolution waves are missing => abort
358        if(ResolutionWavesMissingDF(str))               //updated to NOT use global strings (in GaussUtils)
359                Abort
360        endif
361       
362        SetDataFolder $("root:"+str)
363       
364        // Setup parameter table for model function
365        Make/O/D smear_coef_RECT_SHS = {0.1,60,0.1,6e-6,0.05,0.2,0.0001}
366        make/o/t smear_parameters_RECT_SHS = {"volume fraction","avg radius(A)","polydispersity","contrast (A-2)","perturbation parameter (0.1)","stickiness, tau","bkg (cm-1)"}
367        Edit smear_parameters_RECT_SHS,smear_coef_RECT_SHS                                     
368       
369        // output smeared intensity wave, dimensions are identical to experimental QSIG values
370        // make extra copy of experimental q-values for easy plotting
371        Duplicate/O $(str+"_q") smeared_RECT_SHS,smeared_qvals                         
372        SetScale d,0,0,"1/cm",smeared_RECT_SHS                                                 
373                                       
374        Variable/G gs_RECT_SHS=0
375        gs_RECT_SHS := fSmearedPolyRectSphere_SHS(smear_coef_RECT_SHS,smeared_RECT_SHS,smeared_qvals)   //this wrapper fills the STRUCT
376       
377        Display smeared_RECT_SHS vs smeared_qvals                                                                       
378        ModifyGraph log=1,marker=29,msize=2,mode=4
379        Label bottom "q (\\S-1\\M)"
380        Label left "Intensity (cm\\S-1\\M)"
381
382        AutoPositionWindow/M=1/R=$(WinName(0,1)) $WinName(0,2)
383       
384        SetDataFolder root:
385End
386       
387
388Function PolyRectSphere_SHS(w,yw,xw) : FitFunc
389        Wave w,yw,xw
390       
391        Variable inten
392       
393        //setup form factor coefficient wave
394        Make/O/D/N=5 form_RECT_SHS
395        form_RECT_SHS[0] = 1
396        form_RECT_SHS[1] = w[1]
397        form_RECT_SHS[2] = w[2]
398        form_RECT_SHS[3] = w[3]
399        form_RECT_SHS[4] = 0
400       
401        //calculate the diameter of the effective one-component sphere
402        Variable pd,diam,zz,Vpoly,Ravg
403        pd = w[2]
404        zz = (1/pd)^2 - 1
405        Ravg = w[1]             // <R^3> = Ravg^3*(1+3*pd^2)
406       
407        Vpoly = 4*pi/3*Ravg^3*(1+3*pd^2)
408        diam = (6*Vpoly/pi)^(1/3)
409       
410        //setup structure factor coefficient wave
411        Make/O/D/N=4 struct_RECT_SHS
412        struct_RECT_SHS[0] = diam/2
413        struct_RECT_SHS[1] = w[0]
414        struct_RECT_SHS[2] = w[4]
415        struct_RECT_SHS[3] = w[5]
416       
417        //calculate each and combine
418        Duplicate/O xw temp_RECT_SHS_PQ,temp_RECT_SHS_SQ                //make waves for the AAO
419        PolyRectSpheres(form_RECT_SHS,temp_RECT_SHS_PQ,xw)
420        StickyHS_Struct(struct_RECT_SHS,temp_RECT_SHS_SQ,xw)
421        yw = temp_RECT_SHS_PQ * temp_RECT_SHS_SQ
422        yw *= w[0]
423        yw += w[6]
424       
425        //cleanup waves
426//      Killwaves/Z form_RECT_SHS,struct_RECT_SHS
427       
428        return (0)
429End
430
431
432
433// this is all there is to the smeared calculation!
434Function SmearedPolyRectSphere_HS(s) :FitFunc
435        Struct ResSmearAAOStruct &s
436
437//      the name of your unsmeared model is the first argument
438        s.yW = Smear_Model_20(PolyRectSphere_HS,s.coefW,s.xW,s.resW)
439
440        return(0)
441End
442
443// this is all there is to the smeared calculation!
444Function SmearedPolyRectSphere_SW(s) :FitFunc
445        Struct ResSmearAAOStruct &s
446
447//      the name of your unsmeared model is the first argument
448        s.yW = Smear_Model_20(PolyRectSphere_SW,s.coefW,s.xW,s.resW)
449
450        return(0)
451End
452
453// this is all there is to the smeared calculation!
454Function SmearedPolyRectSphere_SC(s) :FitFunc
455        Struct ResSmearAAOStruct &s
456
457//      the name of your unsmeared model is the first argument
458        s.yW = Smear_Model_20(PolyRectSphere_SC,s.coefW,s.xW,s.resW)
459
460        return(0)
461End
462
463// this is all there is to the smeared calculation!
464Function SmearedPolyRectSphere_SHS(s) :FitFunc
465        Struct ResSmearAAOStruct &s
466
467//      the name of your unsmeared model is the first argument
468        s.yW = Smear_Model_20(PolyRectSphere_SHS,s.coefW,s.xW,s.resW)
469
470        return(0)
471End
472
473//wrapper to calculate the smeared model as an AAO-Struct
474// fills the struct and calls the ususal function with the STRUCT parameter
475//
476// used only for the dependency, not for fitting
477//
478Function fSmearedPolyRectSphere_HS(coefW,yW,xW)
479        Wave coefW,yW,xW
480       
481        String str = getWavesDataFolder(yW,0)
482        String DF="root:"+str+":"
483       
484        WAVE resW = $(DF+str+"_res")
485       
486        STRUCT ResSmearAAOStruct fs
487        WAVE fs.coefW = coefW   
488        WAVE fs.yW = yW
489        WAVE fs.xW = xW
490        WAVE fs.resW = resW
491       
492        Variable err
493        err = SmearedPolyRectSphere_HS(fs)
494       
495        return (0)
496End
497
498//wrapper to calculate the smeared model as an AAO-Struct
499// fills the struct and calls the ususal function with the STRUCT parameter
500//
501// used only for the dependency, not for fitting
502//
503Function fSmearedPolyRectSphere_SW(coefW,yW,xW)
504        Wave coefW,yW,xW
505       
506        String str = getWavesDataFolder(yW,0)
507        String DF="root:"+str+":"
508       
509        WAVE resW = $(DF+str+"_res")
510       
511        STRUCT ResSmearAAOStruct fs
512        WAVE fs.coefW = coefW   
513        WAVE fs.yW = yW
514        WAVE fs.xW = xW
515        WAVE fs.resW = resW
516       
517        Variable err
518        err = SmearedPolyRectSphere_SW(fs)
519       
520        return (0)
521End
522
523//wrapper to calculate the smeared model as an AAO-Struct
524// fills the struct and calls the ususal function with the STRUCT parameter
525//
526// used only for the dependency, not for fitting
527//
528Function fSmearedPolyRectSphere_SC(coefW,yW,xW)
529        Wave coefW,yW,xW
530       
531        String str = getWavesDataFolder(yW,0)
532        String DF="root:"+str+":"
533       
534        WAVE resW = $(DF+str+"_res")
535       
536        STRUCT ResSmearAAOStruct fs
537        WAVE fs.coefW = coefW   
538        WAVE fs.yW = yW
539        WAVE fs.xW = xW
540        WAVE fs.resW = resW
541       
542        Variable err
543        err = SmearedPolyRectSphere_SC(fs)
544       
545        return (0)
546End
547
548//wrapper to calculate the smeared model as an AAO-Struct
549// fills the struct and calls the ususal function with the STRUCT parameter
550//
551// used only for the dependency, not for fitting
552//
553Function fSmearedPolyRectSphere_SHS(coefW,yW,xW)
554        Wave coefW,yW,xW
555       
556        String str = getWavesDataFolder(yW,0)
557        String DF="root:"+str+":"
558       
559        WAVE resW = $(DF+str+"_res")
560       
561        STRUCT ResSmearAAOStruct fs
562        WAVE fs.coefW = coefW   
563        WAVE fs.yW = yW
564        WAVE fs.xW = xW
565        WAVE fs.resW = resW
566       
567        Variable err
568        err = SmearedPolyRectSphere_SHS(fs)
569       
570        return (0)
571End
Note: See TracBrowser for help on using the repository browser.