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

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

Changed Plot* and PlotSmeared?* naming schemes to be all consistent prefixes for the actual function name, so that the macros can be constructed from the function name, or vice versa.

also some tweaks to the wrapper to make sure that plot and append really work

File size: 17.2 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 "LogNormalSphere"
8
9#include "HardSphereStruct"
10#include "HPMSA"
11#include "SquareWellStruct"
12#include "StickyHardSphereStruct"
13
14Proc PlotLogNormalSphere_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_lns_HS,ywave_lns_HS
21        xwave_lns_HS = alog( log(qmin) + x*((log(qmax)-log(qmin))/num) )
22        Make/O/D coef_lns_HS = {0.01,60,0.2,1e-6,3e-6,0.001}
23        make/O/T parameters_lns_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_lns_HS,coef_lns_HS
25       
26        Variable/G root:g_lns_HS
27        g_lns_HS := LogNormalSphere_HS(coef_lns_HS,ywave_lns_HS,xwave_lns_HS)
28        Display ywave_lns_HS vs xwave_lns_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 PlotSmearedLogNormalSphere_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_lns_HS = {0.01,60,0.2,1e-6,3e-6,0.001}                                     
49        make/o/t smear_parameters_lns_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_lns_HS,smear_coef_lns_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_lns_HS,smeared_qvals                           
55        SetScale d,0,0,"1/cm",smeared_lns_HS                                                   
56                                       
57        Variable/G gs_lns_HS=0
58        gs_lns_HS := fSmearedLogNormalSphere_HS(smear_coef_lns_HS,smeared_lns_HS,smeared_qvals) //this wrapper fills the STRUCT
59       
60        Display smeared_lns_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
70Function LogNormalSphere_HS(w,yw,xw) : FitFunc
71        Wave w,yw,xw
72       
73        Variable inten
74       
75        //setup form factor coefficient wave
76        Make/O/D/N=6 form_lns_HS
77        form_lns_HS[0] = 1
78        form_lns_HS[1] = w[1]
79        form_lns_HS[2] = w[2]
80        form_lns_HS[3] = w[3]
81        form_lns_HS[4] = w[4]
82        form_lns_HS[5] = 0
83       
84        //calculate the diameter of the effective one-component sphere
85        Variable r3,mu,sig,diam
86        sig = w[2]                              //polydispersity
87        mu = ln(w[1])                   //ln of mean radius
88        r3 = exp(3*mu + 9/2*sig^2)              // <R^3> calculated directly for log-normal distr.
89       
90        diam = 2*(r3)^(1/3)
91       
92       
93        //setup structure factor coefficient wave
94        Make/O/D/N=2 struct_lns_HS
95        struct_lns_HS[0] = diam/2
96        struct_lns_HS[1] = w[0]
97       
98        //calculate each and combine
99        Duplicate/O xw tmp_lns_HS_PQ,tmp_lns_HS_SQ
100        LogNormalSphere(form_lns_HS,tmp_lns_HS_PQ,xw)
101        HardSphereStruct(struct_lns_HS,tmp_lns_HS_SQ,xw)
102        yw = tmp_lns_HS_PQ *tmp_lns_HS_SQ
103        yw *= w[0]
104        yw += w[5]
105       
106        //cleanup waves
107//      Killwaves/Z form_lns_HS,struct_lns_HS
108       
109        return (0)
110End
111
112/////////////////////////////////////////
113Proc PlotLogNormalSphere_SW(num,qmin,qmax)
114        Variable num=128,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_lns_SW,ywave_lns_SW
120        xwave_lns_SW = alog( log(qmin) + x*((log(qmax)-log(qmin))/num) )
121        Make/O/D coef_lns_SW = {0.01,60,0.2,1e-6,3e-6,1.0,1.2,0.001}
122        make/O/T parameters_lns_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)"}
123        Edit parameters_lns_SW,coef_lns_SW
124       
125        Variable/G root:g_lns_SW
126        g_lns_SW := LogNormalSphere_SW(coef_lns_SW,ywave_lns_SW,xwave_lns_SW)
127        Display ywave_lns_SW vs xwave_lns_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        AutoPositionWindow/M=1/R=$(WinName(0,1)) $WinName(0,2)
132End
133
134// - sets up a dependency to a wrapper, not the actual SmearedModelFunction
135Proc PlotSmearedLogNormalSphere_SW(str)                                                         
136        String str
137        Prompt str,"Pick the data folder containing the resolution you want",popup,getAList(4)
138       
139        // if any of the resolution waves are missing => abort
140        if(ResolutionWavesMissingDF(str))               //updated to NOT use global strings (in GaussUtils)
141                Abort
142        endif
143       
144        SetDataFolder $("root:"+str)
145       
146        // Setup parameter table for model function
147        Make/O/D smear_coef_lns_SW = {0.01,60,0.2,1e-6,3e-6,1.0,1.2,0.001}                                     
148        make/o/t smear_parameters_lns_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)"}   
149        Edit smear_parameters_lns_SW,smear_coef_lns_SW                                 
150       
151        // output smeared intensity wave, dimensions are identical to experimental QSIG values
152        // make extra copy of experimental q-values for easy plotting
153        Duplicate/O $(str+"_q") smeared_lns_SW,smeared_qvals                           
154        SetScale d,0,0,"1/cm",smeared_lns_SW                                                   
155                                       
156        Variable/G gs_lns_SW=0
157        gs_lns_SW := fSmearedLogNormalSphere_SW(smear_coef_lns_SW,smeared_lns_SW,smeared_qvals) //this wrapper fills the STRUCT
158       
159        Display smeared_lns_SW vs smeared_qvals                                                                 
160        ModifyGraph log=1,marker=29,msize=2,mode=4
161        Label bottom "q (\\S-1\\M)"
162        Label left "Intensity (cm\\S-1\\M)"
163        AutoPositionWindow/M=1/R=$(WinName(0,1)) $WinName(0,2)
164       
165        SetDataFolder root:
166End
167       
168
169Function LogNormalSphere_SW(w,yw,xw) : FitFunc
170        Wave w,yw,xw
171       
172        Variable inten
173       
174        //setup form factor coefficient wave
175        Make/O/D/N=6 form_lns_SW
176        form_lns_SW[0] = 1
177        form_lns_SW[1] = w[1]
178        form_lns_SW[2] = w[2]
179        form_lns_SW[3] = w[3]
180        form_lns_SW[4] = w[4]
181        form_lns_SW[5] = 0
182       
183        //calculate the diameter of the effective one-component sphere
184        Variable r3,mu,sig,diam
185        sig = w[2]                              //polydispersity
186        mu = ln(w[1])                   //ln of mean radius
187        r3 = exp(3*mu + 9/2*sig^2)              // <R^3> calculated directly for log-normal distr.
188       
189        diam = 2*(r3)^(1/3)
190       
191        //setup structure factor coefficient wave
192        Make/O/D/N=4 struct_lns_SW
193        struct_lns_SW[0] = diam/2
194        struct_lns_SW[1] = w[0]
195        struct_lns_SW[2] = w[5]
196        struct_lns_SW[3] = w[6]
197       
198        //calculate each and combine
199        Duplicate/O xw tmp_lns_SW_PQ,tmp_lns_SW_SQ
200        LogNormalSphere(form_lns_SW,tmp_lns_SW_PQ,xw)
201        SquareWellStruct(struct_lns_SW,tmp_lns_SW_SQ,xw)
202        yw = tmp_lns_SW_PQ * tmp_lns_SW_SQ
203        yw *= w[0]
204        yw += w[7]
205       
206        //cleanup waves
207//      Killwaves/Z form_lns_SW,struct_lns_SW
208       
209        return (0)
210End
211
212
213/////////////////////////////////////////
214Proc PlotLogNormalSphere_SC(num,qmin,qmax)
215        Variable num=256,qmin=0.001,qmax=0.7
216        Prompt num "Enter number of data points for model: "
217        Prompt qmin "Enter minimum q-value (^-1) for model: "
218        Prompt qmax "Enter maximum q-value (^-1) for model: "
219       
220        if(!DataFolderExists(":HayPenMSA"))
221                NewDataFolder :HayPenMSA
222        endif
223        Make/O/D/N=17 :HayPenMSA:gMSAWave
224
225        Make/O/D/N=(num) xwave_lns_SC,ywave_lns_SC
226        xwave_lns_SC = alog( log(qmin) + x*((log(qmax)-log(qmin))/num) )
227        Make/O/D coef_lns_SC = {0.01,60,0.2,1e-6,3e-6,20,0,298,78,0.001}
228        make/O/T parameters_lns_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)"}
229        Edit parameters_lns_SC,coef_lns_SC
230       
231        Variable/G root:g_lns_SC
232        g_lns_SC := LogNormalSphere_SC(coef_lns_SC,ywave_lns_SC,xwave_lns_SC)
233        Display ywave_lns_SC vs xwave_lns_SC
234        ModifyGraph log=1,marker=29,msize=2,mode=4
235        Label bottom "q (\\S-1\\M)"
236        Label left "Intensity (cm\\S-1\\M)"
237        AutoPositionWindow/M=1/R=$(WinName(0,1)) $WinName(0,2)
238End
239
240// - sets up a dependency to a wrapper, not the actual SmearedModelFunction
241Proc PlotSmearedLogNormalSphere_SC(str)                                                         
242        String str
243        Prompt str,"Pick the data folder containing the resolution you want",popup,getAList(4)
244       
245        // if any of the resolution waves are missing => abort
246        if(ResolutionWavesMissingDF(str))               //updated to NOT use global strings (in GaussUtils)
247                Abort
248        endif
249       
250        SetDataFolder $("root:"+str)
251       
252        if(!DataFolderExists(":HayPenMSA"))
253                NewDataFolder :HayPenMSA
254        endif
255        Make/O/D/N=17 :HayPenMSA:gMSAWave
256       
257        // Setup parameter table for model function
258        Make/O/D smear_coef_lns_SC = {0.01,60,0.2,1e-6,3e-6,20,0,298,78,0.001}                                 
259        make/o/t smear_parameters_lns_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)"}
260        Edit smear_parameters_lns_SC,smear_coef_lns_SC                                 
261       
262        // output smeared intensity wave, dimensions are identical to experimental QSIG values
263        // make extra copy of experimental q-values for easy plotting
264        Duplicate/O $(str+"_q") smeared_lns_SC,smeared_qvals                           
265        SetScale d,0,0,"1/cm",smeared_lns_SC                                                   
266                                       
267        Variable/G gs_lns_SC=0
268        gs_lns_SC := fSmearedLogNormalSphere_SC(smear_coef_lns_SC,smeared_lns_SC,smeared_qvals) //this wrapper fills the STRUCT
269       
270        Display smeared_lns_SC vs smeared_qvals                                                                 
271        ModifyGraph log=1,marker=29,msize=2,mode=4
272        Label bottom "q (\\S-1\\M)"
273        Label left "Intensity (cm\\S-1\\M)"
274        AutoPositionWindow/M=1/R=$(WinName(0,1)) $WinName(0,2)
275       
276        SetDataFolder root:
277End
278
279
280
281Function LogNormalSphere_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_lns_SC
288        form_lns_SC[0] = 1
289        form_lns_SC[1] = w[1]
290        form_lns_SC[2] = w[2]
291        form_lns_SC[3] = w[3]
292        form_lns_SC[4] = w[4]
293        form_lns_SC[5] = 0
294       
295        //calculate the diameter of the effective one-component sphere
296        Variable r3,mu,sig,diam
297        sig = w[2]                              //polydispersity
298        mu = ln(w[1])                   //ln of mean radius
299        r3 = exp(3*mu + 9/2*sig^2)              // <R^3> calculated directly for log-normal distr.
300       
301        diam = 2*(r3)^(1/3)
302       
303        //setup structure factor coefficient wave
304        Make/O/D/N=6 struct_lns_SC
305        struct_lns_SC[0] = diam
306        struct_lns_SC[1] = w[5]
307        struct_lns_SC[2] = w[0]
308        struct_lns_SC[3] = w[7]
309        struct_lns_SC[4] = w[6]
310        struct_lns_SC[5] = w[8]
311       
312        //calculate each and combine
313        Duplicate/O xw tmp_lns_SC_PQ,tmp_lns_SC_SQ
314        LogNormalSphere(form_lns_SC,tmp_lns_SC_PQ,xw)
315        HayterPenfoldMSA(struct_lns_SC,tmp_lns_SC_SQ,xw)
316        yw = tmp_lns_SC_PQ * tmp_lns_SC_SQ
317        yw *= w[0]
318        yw += w[9]
319       
320        //cleanup waves
321//      Killwaves/Z form_lns_SC,struct_lns_SC
322       
323        return (0)
324End
325
326/////////////////////////////////////////
327Proc PlotLogNormalSphere_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_lns_SHS,ywave_lns_SHS
334        xwave_lns_SHS = alog( log(qmin) + x*((log(qmax)-log(qmin))/num) )
335        Make/O/D coef_lns_SHS = {0.01,60,0.2,1e-6,3e-6,0.05,0.2,0.001}
336        make/O/T parameters_lns_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_lns_SHS,coef_lns_SHS
338       
339        Variable/G root:g_lns_SHS
340        g_lns_SHS := LogNormalSphere_SHS(coef_lns_SHS,ywave_lns_SHS,xwave_lns_SHS)
341        Display ywave_lns_SHS vs xwave_lns_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 PlotSmearedLogNormalSphere_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_lns_SHS = {0.01,60,0.2,1e-6,3e-6,0.05,0.2,0.001}                                   
362        make/o/t smear_parameters_lns_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_lns_SHS,smear_coef_lns_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_lns_SHS,smeared_qvals                           
368        SetScale d,0,0,"1/cm",smeared_lns_SHS                                                   
369                                       
370        Variable/G gs_lns_SHS=0
371        gs_lns_SHS := fSmearedLogNormalSphere_SHS(smear_coef_lns_SHS,smeared_lns_SHS,smeared_qvals)     //this wrapper fills the STRUCT
372       
373        Display smeared_lns_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 LogNormalSphere_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_lns_SHS
390        form_lns_SHS[0] = 1
391        form_lns_SHS[1] = w[1]
392        form_lns_SHS[2] = w[2]
393        form_lns_SHS[3] = w[3]
394        form_lns_SHS[4] = w[4]
395        form_lns_SHS[5] = 0
396       
397        //calculate the diameter of the effective one-component sphere
398        Variable r3,mu,sig,diam
399        sig = w[2]                              //polydispersity
400        mu = ln(w[1])                   //ln of mean radius
401        r3 = exp(3*mu + 9/2*sig^2)              // <R^3> calculated directly for log-normal distr.
402       
403        diam = 2*(r3)^(1/3)
404       
405        //setup structure factor coefficient wave
406        Make/O/D/N=4 struct_lns_SHS
407        struct_lns_SHS[0] = diam/2
408        struct_lns_SHS[1] = w[0]
409        struct_lns_SHS[2] = w[5]
410        struct_lns_SHS[3] = w[6]
411       
412        //calculate each and combine
413        Duplicate/O xw tmp_lns_SHS_PQ,tmp_lns_SHS_SQ
414        LogNormalSphere(form_lns_SHS,tmp_lns_SHS_PQ,xw)
415        StickyHS_Struct(struct_lns_SHS,tmp_lns_SHS_SQ,xw)
416        yw = tmp_lns_SHS_PQ * tmp_lns_SHS_SQ
417        yw *= w[0]
418        yw += w[7]
419       
420        //cleanup waves
421//      Killwaves/Z form_lns_SHS,struct_lns_SHS
422       
423        return (0)
424End
425
426
427// this is all there is to the smeared calculation!
428Function SmearedLogNormalSphere_HS(s) : FitFunc
429        Struct ResSmearAAOStruct &s
430
431//      the name of your unsmeared model (AAO) is the first argument
432        Smear_Model_20(LogNormalSphere_HS,s.coefW,s.xW,s.yW,s.resW)
433
434        return(0)
435End
436
437// this is all there is to the smeared calculation!
438Function SmearedLogNormalSphere_SW(s) : FitFunc
439        Struct ResSmearAAOStruct &s
440
441//      the name of your unsmeared model (AAO) is the first argument
442        Smear_Model_20(LogNormalSphere_SW,s.coefW,s.xW,s.yW,s.resW)
443
444        return(0)
445End
446
447// this is all there is to the smeared calculation!
448Function SmearedLogNormalSphere_SC(s) : FitFunc
449        Struct ResSmearAAOStruct &s
450
451//      the name of your unsmeared model (AAO) is the first argument
452        Smear_Model_20(LogNormalSphere_SC,s.coefW,s.xW,s.yW,s.resW)
453
454        return(0)
455End
456
457// this is all there is to the smeared calculation!
458Function SmearedLogNormalSphere_SHS(s) : FitFunc
459        Struct ResSmearAAOStruct &s
460
461//      the name of your unsmeared model (AAO) is the first argument
462        Smear_Model_20(LogNormalSphere_SHS,s.coefW,s.xW,s.yW,s.resW)
463
464        return(0)
465End
466
467//wrapper to calculate the smeared model as an AAO-Struct
468// fills the struct and calls the ususal function with the STRUCT parameter
469//
470// used only for the dependency, not for fitting
471//
472Function fSmearedLogNormalSphere_HS(coefW,yW,xW)
473        Wave coefW,yW,xW
474       
475        String str = getWavesDataFolder(yW,0)
476        String DF="root:"+str+":"
477       
478        WAVE resW = $(DF+str+"_res")
479       
480        STRUCT ResSmearAAOStruct fs
481        WAVE fs.coefW = coefW   
482        WAVE fs.yW = yW
483        WAVE fs.xW = xW
484        WAVE fs.resW = resW
485       
486        Variable err
487        err = SmearedLogNormalSphere_HS(fs)
488       
489        return (0)
490End
491
492//wrapper to calculate the smeared model as an AAO-Struct
493// fills the struct and calls the ususal function with the STRUCT parameter
494//
495// used only for the dependency, not for fitting
496//
497Function fSmearedLogNormalSphere_SW(coefW,yW,xW)
498        Wave coefW,yW,xW
499       
500        String str = getWavesDataFolder(yW,0)
501        String DF="root:"+str+":"
502       
503        WAVE resW = $(DF+str+"_res")
504       
505        STRUCT ResSmearAAOStruct fs
506        WAVE fs.coefW = coefW   
507        WAVE fs.yW = yW
508        WAVE fs.xW = xW
509        WAVE fs.resW = resW
510       
511        Variable err
512        err = SmearedLogNormalSphere_SW(fs)
513       
514        return (0)
515End
516
517//wrapper to calculate the smeared model as an AAO-Struct
518// fills the struct and calls the ususal function with the STRUCT parameter
519//
520// used only for the dependency, not for fitting
521//
522Function fSmearedLogNormalSphere_SC(coefW,yW,xW)
523        Wave coefW,yW,xW
524       
525        String str = getWavesDataFolder(yW,0)
526        String DF="root:"+str+":"
527       
528        WAVE resW = $(DF+str+"_res")
529       
530        STRUCT ResSmearAAOStruct fs
531        WAVE fs.coefW = coefW   
532        WAVE fs.yW = yW
533        WAVE fs.xW = xW
534        WAVE fs.resW = resW
535       
536        Variable err
537        err = SmearedLogNormalSphere_SC(fs)
538       
539        return (0)
540End
541
542//wrapper to calculate the smeared model as an AAO-Struct
543// fills the struct and calls the ususal function with the STRUCT parameter
544//
545// used only for the dependency, not for fitting
546//
547Function fSmearedLogNormalSphere_SHS(coefW,yW,xW)
548        Wave coefW,yW,xW
549       
550        String str = getWavesDataFolder(yW,0)
551        String DF="root:"+str+":"
552       
553        WAVE resW = $(DF+str+"_res")
554       
555        STRUCT ResSmearAAOStruct fs
556        WAVE fs.coefW = coefW   
557        WAVE fs.yW = yW
558        WAVE fs.xW = xW
559        WAVE fs.resW = resW
560       
561        Variable err
562        err = SmearedLogNormalSphere_SHS(fs)
563       
564        return (0)
565End
566
Note: See TracBrowser for help on using the repository browser.