source: sans/Analysis/branches/ajj_23APR07/IGOR_Package_Files/Put in User Procedures/SANS_Models_v3.00/NewModels_2006/GaussSpheres_and_Struct.ipf @ 151

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

(1) - cursors can now be used to select a subrange of USANS data to fit. This is done by th fit wrapper, assigning a subrange of resW to the struct

(2) all of the smeared model functions are now in the latest form of Smear_Model_N() that is NOT a pointwise calculation anymore, since the USANS matrix smearing in inherently not so.

File size: 16.9 KB
Line 
1#pragma rtGlobals=1             // Use modern global access method.
2#pragma IgorVersion = 6.0
3
4//
5// be sure to include all of the necessary files
6//
7#include "GaussSpheres"
8
9#include "HardSphereStruct"
10#include "HPMSA"
11#include "SquareWellStruct"
12#include "StickyHardSphereStruct"
13
14Proc PlotGaussPolySphere_HS(num,qmin,qmax)
15        Variable num=128,qmin=0.001,qmax=0.7
16        Prompt num "Enter number of data points for model: "
17        Prompt qmin "Enter minimum q-value (^-1) for model: "
18        Prompt qmax "Enter maximum q-value (^-1) for model: "
19       
20        Make/O/D/N=(num) xwave_pgs_HS,ywave_pgs_HS
21        xwave_pgs_HS = alog( log(qmin) + x*((log(qmax)-log(qmin))/num) )
22        Make/O/D coef_pgs_HS = {0.01,60,0.2,1e-6,3e-6,0.001}
23        make/O/T parameters_pgs_HS = {"Volume Fraction (scale)","mean radius (A)","polydisp (sig/avg)","SLD sphere (A-2)","SLD solvent (A-2)","bkg (cm-1 sr-1)"}
24        Edit parameters_pgs_HS,coef_pgs_HS
25       
26        Variable/G root:g_pgs_HS
27        g_pgs_HS := GaussPolySphere_HS(coef_pgs_HS,ywave_pgs_HS,xwave_pgs_HS)
28        Display ywave_pgs_HS vs xwave_pgs_HS
29        ModifyGraph log=1,marker=29,msize=2,mode=4
30        Label bottom "q (\\S-1\\M)"
31        Label left "Intensity (cm\\S-1\\M)"
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 PlotSmearedGaussPolySphere_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_pgs_HS = {0.01,60,0.2,1e-6,3e-6,0.001}                                     
49        make/o/t smear_parameters_pgs_HS = {"Volume Fraction (scale)","mean radius (A)","polydisp (sig/avg)","SLD sphere (A-2)","SLD solvent (A-2)","bkg (cm-1 sr-1)"} 
50        Edit smear_parameters_pgs_HS,smear_coef_pgs_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_pgs_HS,smeared_qvals                           
55        SetScale d,0,0,"1/cm",smeared_pgs_HS                                                   
56                                       
57        Variable/G gs_pgs_HS=0
58        gs_pgs_HS := fSmearedGaussPolySphere_HS(smear_coef_pgs_HS,smeared_pgs_HS,smeared_qvals) //this wrapper fills the STRUCT
59       
60        Display smeared_pgs_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        AutoPositionWindow/M=1/R=$(WinName(0,1)) $WinName(0,2)
65       
66        SetDataFolder root:
67End
68
69
70
71Function GaussPolySphere_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=6 form_pgs_HS
78        form_pgs_HS[0] = 1
79        form_pgs_HS[1] = w[1]
80        form_pgs_HS[2] = w[2]
81        form_pgs_HS[3] = w[3]
82        form_pgs_HS[4] = w[4]
83        form_pgs_HS[5] = 0
84       
85        //calculate the diameter of the effective one-component sphere
86        Variable pd,diam,Vpoly,Ravg
87        pd = w[2]
88        Ravg = w[1]
89       
90        Vpoly = (4*pi/3*Ravg^3)*(1+3*pd^2)
91        diam = (6*Vpoly/pi)^(1/3)
92       
93       
94        //setup structure factor coefficient wave
95        Make/O/D/N=2 struct_pgs_HS
96        struct_pgs_HS[0] = diam/2
97        struct_pgs_HS[1] = w[0]
98       
99        //calculate each and combine
100        Duplicate/O xw tmp_pgs_HS_PQ,tmp_pgs_HS_SQ
101        GaussPolySphere(form_pgs_HS,tmp_pgs_HS_PQ,xw)
102        HardSphereStruct(struct_pgs_HS,tmp_pgs_HS_SQ,xw)
103        yw = tmp_pgs_HS_PQ * tmp_pgs_HS_SQ
104        yw *= w[0]
105        yw += w[5]
106       
107        //cleanup waves
108//      Killwaves/Z form_pgs_HS,struct_pgs_HS
109       
110        return (0)
111End
112
113/////////////////////////////////////////
114Proc PlotGaussPolySphere_SW(num,qmin,qmax)
115        Variable num=128,qmin=0.001,qmax=0.7
116        Prompt num "Enter number of data points for model: "
117        Prompt qmin "Enter minimum q-value (^-1) for model: "
118        Prompt qmax "Enter maximum q-value (^-1) for model: "
119       
120        Make/O/D/N=(num) xwave_pgs_SW,ywave_pgs_SW
121        xwave_pgs_SW = alog( log(qmin) + x*((log(qmax)-log(qmin))/num) )
122        Make/O/D coef_pgs_SW = {0.01,60,0.2,1e-6,3e-6,1.0,1.2,0.001}
123        make/O/T parameters_pgs_SW = {"Volume Fraction (scale)","mean radius (A)","polydisp (sig/avg)","SLD sphere (A-2)","SLD solvent (A-2)","well depth (kT)","well width (diam.)","bkg (cm-1 sr-1)"}
124        Edit parameters_pgs_SW,coef_pgs_SW
125       
126        Variable/G root:g_pgs_SW
127        g_pgs_SW := GaussPolySphere_SW(coef_pgs_SW,ywave_pgs_SW,xwave_pgs_SW)
128        Display ywave_pgs_SW vs xwave_pgs_SW
129        ModifyGraph log=1,marker=29,msize=2,mode=4
130        Label bottom "q (\\S-1\\M)"
131        Label left "Intensity (cm\\S-1\\M)"
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 PlotSmearedGaussPolySphere_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_pgs_SW = {0.01,60,0.2,1e-6,3e-6,1.0,1.2,0.001}                                     
149        make/o/t smear_parameters_pgs_SW = {"Volume Fraction (scale)","mean radius (A)","polydisp (sig/avg)","SLD sphere (A-2)","SLD solvent (A-2)","well depth (kT)","well width (diam.)","bkg (cm-1 sr-1)"}   
150        Edit smear_parameters_pgs_SW,smear_coef_pgs_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_pgs_SW,smeared_qvals                           
155        SetScale d,0,0,"1/cm",smeared_pgs_SW                                                   
156                                       
157        Variable/G gs_pgs_SW=0
158        gs_pgs_SW := fSmearedGaussPolySphere_SW(smear_coef_pgs_SW,smeared_pgs_SW,smeared_qvals) //this wrapper fills the STRUCT
159       
160        Display smeared_pgs_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        AutoPositionWindow/M=1/R=$(WinName(0,1)) $WinName(0,2)
165       
166        SetDataFolder root:
167End
168       
169
170Function GaussPolySphere_SW(w,yw,xw) : FitFunc
171        Wave w,yw,xw
172       
173        Variable inten
174       
175        //setup form factor coefficient wave
176        Make/O/D/N=6 form_pgs_SW
177        form_pgs_SW[0] = 1
178        form_pgs_SW[1] = w[1]
179        form_pgs_SW[2] = w[2]
180        form_pgs_SW[3] = w[3]
181        form_pgs_SW[4] = w[4]
182        form_pgs_SW[5] = 0
183       
184        //calculate the diameter of the effective one-component sphere
185        Variable pd,diam,Vpoly,Ravg
186        pd = w[2]
187        Ravg = w[1]
188       
189        Vpoly = (4*pi/3*Ravg^3)*(1+3*pd^2)
190        diam = (6*Vpoly/pi)^(1/3)
191       
192        //setup structure factor coefficient wave
193        Make/O/D/N=4 struct_pgs_SW
194        struct_pgs_SW[0] = diam/2
195        struct_pgs_SW[1] = w[0]
196        struct_pgs_SW[2] = w[5]
197        struct_pgs_SW[3] = w[6]
198       
199        //calculate each and combine
200        Duplicate/O xw tmp_pgs_SW_PQ,tmp_pgs_SW_SQ
201        GaussPolySphere(form_pgs_SW,tmp_pgs_SW_PQ,xw)
202        SquareWellStruct(struct_pgs_SW,tmp_pgs_SW_SQ,xw)
203        yw = tmp_pgs_SW_PQ * tmp_pgs_SW_SQ
204        yw *= w[0]
205        yw += w[7]
206       
207        //cleanup waves
208//      Killwaves/Z form_pgs_SW,struct_pgs_SW
209       
210        return (0)
211End
212
213
214/////////////////////////////////////////
215Proc PlotGaussPolySphere_SC(num,qmin,qmax)
216        Variable num=256,qmin=0.001,qmax=0.7
217        Prompt num "Enter number of data points for model: "
218        Prompt qmin "Enter minimum q-value (^-1) for model: "
219        Prompt qmax "Enter maximum q-value (^-1) for model: "
220       
221        if(!DataFolderExists(":HayPenMSA"))
222                NewDataFolder :HayPenMSA
223        endif
224        Make/O/D/N=17 :HayPenMSA:gMSAWave
225
226        Make/O/D/N=(num) xwave_pgs_SC,ywave_pgs_SC
227        xwave_pgs_SC = alog( log(qmin) + x*((log(qmax)-log(qmin))/num) )
228        Make/O/D coef_pgs_SC = {0.01,60,0.2,1e-6,3e-6,20,0,298,78,0.001}
229        make/O/T parameters_pgs_SC = {"Volume Fraction (scale)","mean radius (A)","polydisp (sig/avg)","SLD sphere (A-2)","SLD solvent (A-2)","charge","movalent salt(M)","Temperature (K)","dielectric const","bkg (cm-1 sr-1)"}
230        Edit parameters_pgs_SC,coef_pgs_SC
231       
232        Variable/G root:g_pgs_SC
233        g_pgs_SC := GaussPolySphere_SC(coef_pgs_SC,ywave_pgs_SC,xwave_pgs_SC)
234        Display ywave_pgs_SC vs xwave_pgs_SC
235        ModifyGraph log=1,marker=29,msize=2,mode=4
236        Label bottom "q (\\S-1\\M)"
237        Label left "Intensity (cm\\S-1\\M)"
238        AutoPositionWindow/M=1/R=$(WinName(0,1)) $WinName(0,2)
239End
240
241// - sets up a dependency to a wrapper, not the actual SmearedModelFunction
242Proc PlotSmearedGaussPolySphere_SC(str)                                                         
243        String str
244        Prompt str,"Pick the data folder containing the resolution you want",popup,getAList(4)
245       
246        // if any of the resolution waves are missing => abort
247        if(ResolutionWavesMissingDF(str))               //updated to NOT use global strings (in GaussUtils)
248                Abort
249        endif
250       
251        SetDataFolder $("root:"+str)
252       
253        if(!DataFolderExists(":HayPenMSA"))
254                NewDataFolder :HayPenMSA
255        endif
256        Make/O/D/N=17 :HayPenMSA:gMSAWave
257       
258        // Setup parameter table for model function
259        Make/O/D smear_coef_pgs_SC = {0.01,60,0.2,1e-6,3e-6,20,0,298,78,0.001}                                 
260        make/o/t smear_parameters_pgs_SC = {"Volume Fraction (scale)","mean radius (A)","polydisp (sig/avg)","SLD sphere (A-2)","SLD solvent (A-2)","charge","movalent salt(M)","Temperature (K)","dielectric const","bkg (cm-1 sr-1)"}
261        Edit smear_parameters_pgs_SC,smear_coef_pgs_SC                                 
262       
263        // output smeared intensity wave, dimensions are identical to experimental QSIG values
264        // make extra copy of experimental q-values for easy plotting
265        Duplicate/O $(str+"_q") smeared_pgs_SC,smeared_qvals                           
266        SetScale d,0,0,"1/cm",smeared_pgs_SC                                                   
267                                       
268        Variable/G gs_pgs_SC=0
269        gs_pgs_SC := fSmearedGaussPolySphere_SC(smear_coef_pgs_SC,smeared_pgs_SC,smeared_qvals) //this wrapper fills the STRUCT
270       
271        Display smeared_pgs_SC vs smeared_qvals                                                                 
272        ModifyGraph log=1,marker=29,msize=2,mode=4
273        Label bottom "q (\\S-1\\M)"
274        Label left "Intensity (cm\\S-1\\M)"
275        AutoPositionWindow/M=1/R=$(WinName(0,1)) $WinName(0,2)
276       
277        SetDataFolder root:
278End
279
280
281Function GaussPolySphere_SC(w,yw,xw) : FitFunc
282        Wave w,yw,xw
283       
284        Variable inten
285       
286        //setup form factor coefficient wave
287        Make/O/D/N=6 form_pgs_SC
288        form_pgs_SC[0] = 1
289        form_pgs_SC[1] = w[1]
290        form_pgs_SC[2] = w[2]
291        form_pgs_SC[3] = w[3]
292        form_pgs_SC[4] = w[4]
293        form_pgs_SC[5] = 0
294       
295        //calculate the diameter of the effective one-component sphere
296        Variable pd,diam,Vpoly,Ravg
297        pd = w[2]
298        Ravg = w[1]
299       
300        Vpoly = (4*pi/3*Ravg^3)*(1+3*pd^2)
301        diam = (6*Vpoly/pi)^(1/3)
302       
303        //setup structure factor coefficient wave
304        Make/O/D/N=6 struct_pgs_SC
305        struct_pgs_SC[0] = diam
306        struct_pgs_SC[1] = w[5]
307        struct_pgs_SC[2] = w[0]
308        struct_pgs_SC[3] = w[7]
309        struct_pgs_SC[4] = w[6]
310        struct_pgs_SC[5] = w[8]
311       
312        //calculate each and combine
313        Duplicate/O xw tmp_pgs_SC_PQ,tmp_pgs_SC_SQ
314        GaussPolySphere(form_pgs_SC,tmp_pgs_SC_PQ,xw)
315        HayterPenfoldMSA(struct_pgs_SC,tmp_pgs_SC_SQ,xw)
316        yw = tmp_pgs_SC_PQ * tmp_pgs_SC_SQ
317        yw *= w[0]
318        yw += w[9]
319       
320        //cleanup waves
321//      Killwaves/Z form_pgs_SC,struct_pgs_SC
322       
323        return (0)
324End
325
326/////////////////////////////////////////
327Proc PlotGaussPolySphere_SHS(num,qmin,qmax)
328        Variable num=256,qmin=0.001,qmax=0.7
329        Prompt num "Enter number of data points for model: "
330        Prompt qmin "Enter minimum q-value (^-1) for model: "
331        Prompt qmax "Enter maximum q-value (^-1) for model: "
332       
333        Make/O/D/N=(num) xwave_pgs_SHS,ywave_pgs_SHS
334        xwave_pgs_SHS = alog( log(qmin) + x*((log(qmax)-log(qmin))/num) )
335        Make/O/D coef_pgs_SHS = {0.01,60,0.2,1e-6,3e-6,0.05,0.2,0.001}
336        make/O/T parameters_pgs_SHS = {"Volume Fraction (scale)","mean radius (A)","polydisp (sig/avg)","SLD sphere (A-2)","SLD solvent (A-2)","perturbation parameter (0.1)","stickiness, tau","bkg (cm-1 sr-1)"}
337        Edit parameters_pgs_SHS,coef_pgs_SHS
338       
339        Variable/G root:g_pgs_SHS
340        g_pgs_SHS := GaussPolySphere_SHS(coef_pgs_SHS,ywave_pgs_SHS,xwave_pgs_SHS)
341        Display ywave_pgs_SHS vs xwave_pgs_SHS
342        ModifyGraph log=1,marker=29,msize=2,mode=4
343        Label bottom "q (\\S-1\\M)"
344        Label left "Intensity (cm\\S-1\\M)"
345        AutoPositionWindow/M=1/R=$(WinName(0,1)) $WinName(0,2)
346End
347
348// - sets up a dependency to a wrapper, not the actual SmearedModelFunction
349Proc PlotSmearedGaussPolySphere_SHS(str)                                                               
350        String str
351        Prompt str,"Pick the data folder containing the resolution you want",popup,getAList(4)
352       
353        // if any of the resolution waves are missing => abort
354        if(ResolutionWavesMissingDF(str))               //updated to NOT use global strings (in GaussUtils)
355                Abort
356        endif
357       
358        SetDataFolder $("root:"+str)
359       
360        // Setup parameter table for model function
361        Make/O/D smear_coef_pgs_SHS = {0.01,60,0.2,1e-6,3e-6,0.05,0.2,0.001}                                   
362        make/o/t smear_parameters_pgs_SHS = {"Volume Fraction (scale)","mean radius (A)","polydisp (sig/avg)","SLD sphere (A-2)","SLD solvent (A-2)","perturbation parameter (0.1)","stickiness, tau","bkg (cm-1 sr-1)"}       
363        Edit smear_parameters_pgs_SHS,smear_coef_pgs_SHS                                       
364       
365        // output smeared intensity wave, dimensions are identical to experimental QSIG values
366        // make extra copy of experimental q-values for easy plotting
367        Duplicate/O $(str+"_q") smeared_pgs_SHS,smeared_qvals                           
368        SetScale d,0,0,"1/cm",smeared_pgs_SHS                                                   
369                                       
370        Variable/G gs_pgs_SHS=0
371        gs_pgs_SHS := fSmearedGaussPolySphere_SHS(smear_coef_pgs_SHS,smeared_pgs_SHS,smeared_qvals)     //this wrapper fills the STRUCT
372       
373        Display smeared_pgs_SHS vs smeared_qvals                                                                       
374        ModifyGraph log=1,marker=29,msize=2,mode=4
375        Label bottom "q (\\S-1\\M)"
376        Label left "Intensity (cm\\S-1\\M)"
377        AutoPositionWindow/M=1/R=$(WinName(0,1)) $WinName(0,2)
378       
379        SetDataFolder root:
380End
381       
382
383Function GaussPolySphere_SHS(w,yw,xw) : FitFunc
384        Wave w,yw,xw
385       
386        Variable inten
387       
388        //setup form factor coefficient wave
389        Make/O/D/N=6 form_pgs_SHS
390        form_pgs_SHS[0] = 1
391        form_pgs_SHS[1] = w[1]
392        form_pgs_SHS[2] = w[2]
393        form_pgs_SHS[3] = w[3]
394        form_pgs_SHS[4] = w[4]
395        form_pgs_SHS[5] = 0
396       
397        //calculate the diameter of the effective one-component sphere
398        Variable pd,diam,Vpoly,Ravg
399        pd = w[2]
400        Ravg = w[1]
401       
402        Vpoly = (4*pi/3*Ravg^3)*(1+3*pd^2)
403        diam = (6*Vpoly/pi)^(1/3)
404       
405        //setup structure factor coefficient wave
406        Make/O/D/N=4 struct_pgs_SHS
407        struct_pgs_SHS[0] = diam/2
408        struct_pgs_SHS[1] = w[0]
409        struct_pgs_SHS[2] = w[5]
410        struct_pgs_SHS[3] = w[6]
411       
412        //calculate each and combine
413        Duplicate/O xw tmp_pgs_SHS_PQ,tmp_pgs_SHS_SQ
414        GaussPolySphere(form_pgs_SHS,tmp_pgs_SHS_PQ,xw)
415        StickyHS_Struct(struct_pgs_SHS,tmp_pgs_SHS_SQ,xw)
416        yw = tmp_pgs_SHS_PQ * tmp_pgs_SHS_SQ
417        yw *= w[0]
418        yw += w[7]
419       
420        //cleanup waves
421//      Killwaves/Z form_pgs_SHS,struct_pgs_SHS
422       
423        return (0)
424End
425
426
427
428// this is all there is to the smeared calculation!
429Function SmearedGaussPolySphere_HS(s) : FitFunc
430        Struct ResSmearAAOStruct &s
431
432//      the name of your unsmeared model (AAO) is the first argument
433        Smear_Model_20(GaussPolySphere_HS,s.coefW,s.xW,s.yW,s.resW)
434
435        return(0)
436End
437
438// this is all there is to the smeared calculation!
439Function SmearedGaussPolySphere_SW(s) : FitFunc
440        Struct ResSmearAAOStruct &s
441
442//      the name of your unsmeared model (AAO) is the first argument
443        Smear_Model_20(GaussPolySphere_SW,s.coefW,s.xW,s.yW,s.resW)
444
445        return(0)
446End
447
448// this is all there is to the smeared calculation!
449Function SmearedGaussPolySphere_SC(s) : FitFunc
450        Struct ResSmearAAOStruct &s
451
452//      the name of your unsmeared model (AAO) is the first argument
453        Smear_Model_20(GaussPolySphere_SC,s.coefW,s.xW,s.yW,s.resW)
454
455        return(0)
456End
457
458// this is all there is to the smeared calculation!
459Function SmearedGaussPolySphere_SHS(s) : FitFunc
460        Struct ResSmearAAOStruct &s
461
462//      the name of your unsmeared model (AAO) is the first argument
463        Smear_Model_20(GaussPolySphere_SHS,s.coefW,s.xW,s.yW,s.resW)
464
465        return(0)
466End
467
468//wrapper to calculate the smeared model as an AAO-Struct
469// fills the struct and calls the ususal function with the STRUCT parameter
470//
471// used only for the dependency, not for fitting
472//
473Function fSmearedGaussPolySphere_HS(coefW,yW,xW)
474        Wave coefW,yW,xW
475       
476        String str = getWavesDataFolder(yW,0)
477        String DF="root:"+str+":"
478       
479        WAVE resW = $(DF+str+"_res")
480       
481        STRUCT ResSmearAAOStruct fs
482        WAVE fs.coefW = coefW   
483        WAVE fs.yW = yW
484        WAVE fs.xW = xW
485        WAVE fs.resW = resW
486       
487        Variable err
488        err = SmearedGaussPolySphere_HS(fs)
489       
490        return (0)
491End
492
493//wrapper to calculate the smeared model as an AAO-Struct
494// fills the struct and calls the ususal function with the STRUCT parameter
495//
496// used only for the dependency, not for fitting
497//
498Function fSmearedGaussPolySphere_SW(coefW,yW,xW)
499        Wave coefW,yW,xW
500       
501        String str = getWavesDataFolder(yW,0)
502        String DF="root:"+str+":"
503       
504        WAVE resW = $(DF+str+"_res")
505       
506        STRUCT ResSmearAAOStruct fs
507        WAVE fs.coefW = coefW   
508        WAVE fs.yW = yW
509        WAVE fs.xW = xW
510        WAVE fs.resW = resW
511       
512        Variable err
513        err = SmearedGaussPolySphere_SW(fs)
514       
515        return (0)
516End
517
518//wrapper to calculate the smeared model as an AAO-Struct
519// fills the struct and calls the ususal function with the STRUCT parameter
520//
521// used only for the dependency, not for fitting
522//
523Function fSmearedGaussPolySphere_SC(coefW,yW,xW)
524        Wave coefW,yW,xW
525       
526        String str = getWavesDataFolder(yW,0)
527        String DF="root:"+str+":"
528       
529        WAVE resW = $(DF+str+"_res")
530       
531        STRUCT ResSmearAAOStruct fs
532        WAVE fs.coefW = coefW   
533        WAVE fs.yW = yW
534        WAVE fs.xW = xW
535        WAVE fs.resW = resW
536       
537        Variable err
538        err = SmearedGaussPolySphere_SC(fs)
539       
540        return (0)
541End
542
543//wrapper to calculate the smeared model as an AAO-Struct
544// fills the struct and calls the ususal function with the STRUCT parameter
545//
546// used only for the dependency, not for fitting
547//
548Function fSmearedGaussPolySphere_SHS(coefW,yW,xW)
549        Wave coefW,yW,xW
550       
551        String str = getWavesDataFolder(yW,0)
552        String DF="root:"+str+":"
553       
554        WAVE resW = $(DF+str+"_res")
555       
556        STRUCT ResSmearAAOStruct fs
557        WAVE fs.coefW = coefW   
558        WAVE fs.yW = yW
559        WAVE fs.xW = xW
560        WAVE fs.resW = resW
561       
562        Variable err
563        err = SmearedGaussPolySphere_SHS(fs)
564       
565        return (0)
566End
567
Note: See TracBrowser for help on using the repository browser.