1 | #pragma rtGlobals=1 // Use modern global access method. |
---|
2 | #pragma IgorVersion=6.1 |
---|
3 | |
---|
4 | // be sure to include all the necessary files... |
---|
5 | #include "EffectiveDiameter_v40" |
---|
6 | #include "Cylinder_v40" |
---|
7 | |
---|
8 | #include "HardSphereStruct_v40" |
---|
9 | #include "HPMSA_v40" |
---|
10 | #include "SquareWellStruct_v40" |
---|
11 | #include "StickyHardSphereStruct_v40" |
---|
12 | |
---|
13 | Proc PlotCylinder_HS(num,qmin,qmax) |
---|
14 | Variable num=128,qmin=0.001,qmax=0.7 |
---|
15 | Prompt num "Enter number of data points for model: " |
---|
16 | Prompt qmin "Enter minimum q-value (A^-1) for model: " |
---|
17 | Prompt qmax "Enter maximum q-value (A^-1) for model: " |
---|
18 | |
---|
19 | Make/O/D/n=(num) xwave_CYL_HS,ywave_CYL_HS |
---|
20 | xwave_CYL_HS = alog(log(qmin) + x*((log(qmax)-log(qmin))/num)) |
---|
21 | Make/O/D coef_CYL_HS = {0.01,20.,400,1e-6,6.3e-6,0.01} |
---|
22 | make/o/t parameters_CYL_HS = {"volume fraction","radius (A)","length (A)","SLD cylinder (A^-2)","SLD solvent (A^-2)","incoh. bkg (cm^-1)"} |
---|
23 | Edit parameters_CYL_HS,coef_CYL_HS |
---|
24 | |
---|
25 | Variable/G root:g_CYL_HS |
---|
26 | g_CYL_HS := Cylinder_HS(coef_CYL_HS,ywave_CYL_HS,xwave_CYL_HS) |
---|
27 | Display ywave_CYL_HS vs xwave_CYL_HS |
---|
28 | ModifyGraph log=1,marker=29,msize=2,mode=4 |
---|
29 | Label bottom "q (A\\S-1\\M)" |
---|
30 | Label left "Intensity (cm\\S-1\\M)" |
---|
31 | |
---|
32 | AutoPositionWindow/M=1/R=$(WinName(0,1)) $WinName(0,2) |
---|
33 | |
---|
34 | AddModelToStrings("Cylinder_HS","coef_CYL_HS","parameters_CYL_HS","CYL_HS") |
---|
35 | End |
---|
36 | |
---|
37 | // - sets up a dependency to a wrapper, not the actual SmearedModelFunction |
---|
38 | Proc PlotSmearedCylinder_HS(str) |
---|
39 | String str |
---|
40 | Prompt str,"Pick the data folder containing the resolution you want",popup,getAList(4) |
---|
41 | |
---|
42 | // if any of the resolution waves are missing => abort |
---|
43 | if(ResolutionWavesMissingDF(str)) //updated to NOT use global strings (in GaussUtils) |
---|
44 | Abort |
---|
45 | endif |
---|
46 | |
---|
47 | SetDataFolder $("root:"+str) |
---|
48 | |
---|
49 | // Setup parameter table for model function |
---|
50 | Make/O/D smear_coef_CYL_HS = {0.01,20.,400,1e-6,6.3e-6,0.01} |
---|
51 | make/o/t smear_parameters_CYL_HS = {"volume fraction","radius (A)","length (A)","SLD cylinder (A^-2)","SLD solvent (A^-2)","incoh. bkg (cm^-1)"} |
---|
52 | Edit smear_parameters_CYL_HS,smear_coef_CYL_HS |
---|
53 | |
---|
54 | // output smeared intensity wave, dimensions are identical to experimental QSIG values |
---|
55 | // make extra copy of experimental q-values for easy plotting |
---|
56 | Duplicate/O $(str+"_q") smeared_CYL_HS,smeared_qvals |
---|
57 | SetScale d,0,0,"1/cm",smeared_CYL_HS |
---|
58 | |
---|
59 | Variable/G gs_CYL_HS=0 |
---|
60 | gs_CYL_HS := fSmearedCylinder_HS(smear_coef_CYL_HS,smeared_CYL_HS,smeared_qvals) //this wrapper fills the STRUCT |
---|
61 | |
---|
62 | Display smeared_CYL_HS vs smeared_qvals |
---|
63 | ModifyGraph log=1,marker=29,msize=2,mode=4 |
---|
64 | Label bottom "q (A\\S-1\\M)" |
---|
65 | Label left "Intensity (cm\\S-1\\M)" |
---|
66 | |
---|
67 | AutoPositionWindow/M=1/R=$(WinName(0,1)) $WinName(0,2) |
---|
68 | |
---|
69 | SetDataFolder root: |
---|
70 | AddModelToStrings("SmearedCylinder_HS","smear_coef_CYL_HS","smear_parameters_CYL_HS","CYL_HS") |
---|
71 | End |
---|
72 | |
---|
73 | |
---|
74 | Function Cylinder_HS(w,yw,xw) : FitFunc |
---|
75 | Wave w,yw,xw |
---|
76 | |
---|
77 | Variable inten,rad,len |
---|
78 | rad=w[1] |
---|
79 | len=w[2] |
---|
80 | |
---|
81 | //setup form factor coefficient wave |
---|
82 | Make/O/D/N=6 form_CYL_HS |
---|
83 | form_CYL_HS[0] = 1 |
---|
84 | form_CYL_HS[1] = w[1] |
---|
85 | form_CYL_HS[2] = w[2] |
---|
86 | form_CYL_HS[3] = w[3] |
---|
87 | form_CYL_HS[4] = w[4] |
---|
88 | form_CYL_HS[5] = 0 |
---|
89 | |
---|
90 | //setup structure factor coefficient wave |
---|
91 | Make/O/D/N=2 struct_CYL_HS |
---|
92 | struct_CYL_HS[0] = 0.5*DiamCyl(len,rad) |
---|
93 | struct_CYL_HS[1] = w[0] |
---|
94 | |
---|
95 | //calculate each and combine |
---|
96 | Duplicate/O xw temp_CYL_HS_PQ,temp_CYL_HS_SQ //make waves for the AAO |
---|
97 | CylinderForm(form_CYL_HS,temp_CYL_HS_PQ,xw) |
---|
98 | HardSphereStruct(struct_CYL_HS,temp_CYL_HS_SQ,xw) |
---|
99 | yw = temp_CYL_HS_PQ * temp_CYL_HS_SQ |
---|
100 | yw *= w[0] |
---|
101 | yw += w[5] |
---|
102 | |
---|
103 | //cleanup waves (don't do this - it takes a lot of time...) |
---|
104 | // Killwaves/Z form_CYL_HS,struct_CYL_HS |
---|
105 | |
---|
106 | return (0) |
---|
107 | End |
---|
108 | |
---|
109 | Proc PlotCylinder_SW(num,qmin,qmax) |
---|
110 | Variable num=128,qmin=0.001,qmax=0.7 |
---|
111 | Prompt num "Enter number of data points for model: " |
---|
112 | Prompt qmin "Enter minimum q-value (A^-1) for model: " |
---|
113 | Prompt qmax "Enter maximum q-value (A^-1) for model: " |
---|
114 | |
---|
115 | Make/O/D/n=(num) xwave_CYL_SW,ywave_CYL_SW |
---|
116 | xwave_CYL_SW = alog(log(qmin) + x*((log(qmax)-log(qmin))/num)) |
---|
117 | Make/O/D coef_CYL_SW = {0.01,20.,400,1e-6,6.3e-6,1.0,1.2,0.01} |
---|
118 | make/o/t parameters_CYL_SW = {"volume fraction","radius (A)","length (A)","SLD cylinder (A^-2)","SLD solvent (A^-2)","well depth (kT)","well width (diam.)","incoh. bkg (cm^-1)"} |
---|
119 | Edit parameters_CYL_SW,coef_CYL_SW |
---|
120 | |
---|
121 | Variable/G root:g_CYL_SW |
---|
122 | g_CYL_SW := Cylinder_SW(coef_CYL_SW,ywave_CYL_SW,xwave_CYL_SW) |
---|
123 | Display ywave_CYL_SW vs xwave_CYL_SW |
---|
124 | ModifyGraph log=1,marker=29,msize=2,mode=4 |
---|
125 | Label bottom "q (A\\S-1\\M)" |
---|
126 | Label left "Intensity (cm\\S-1\\M)" |
---|
127 | |
---|
128 | AutoPositionWindow/M=1/R=$(WinName(0,1)) $WinName(0,2) |
---|
129 | |
---|
130 | AddModelToStrings("Cylinder_SW","coef_CYL_SW","parameters_CYL_SW","CYL_SW") |
---|
131 | End |
---|
132 | |
---|
133 | // - sets up a dependency to a wrapper, not the actual SmearedModelFunction |
---|
134 | Proc PlotSmearedCylinder_SW(str) |
---|
135 | String str |
---|
136 | Prompt str,"Pick the data folder containing the resolution you want",popup,getAList(4) |
---|
137 | |
---|
138 | // if any of the resolution waves are missing => abort |
---|
139 | if(ResolutionWavesMissingDF(str)) //updated to NOT use global strings (in GaussUtils) |
---|
140 | Abort |
---|
141 | endif |
---|
142 | |
---|
143 | SetDataFolder $("root:"+str) |
---|
144 | |
---|
145 | // Setup parameter table for model function |
---|
146 | Make/O/D smear_coef_CYL_SW = {0.01,20.,400,1e-6,6.3e-6,1.0,1.2,0.01} |
---|
147 | make/o/t smear_parameters_CYL_SW = {"volume fraction","radius (A)","length (A)","SLD cylinder (A^-2)","SLD solvent (A^-2)","well depth (kT)","well width (diam.)","incoh. bkg (cm^-1)"} |
---|
148 | Edit smear_parameters_CYL_SW,smear_coef_CYL_SW |
---|
149 | |
---|
150 | // output smeared intensity wave, dimensions are identical to experimental QSIG values |
---|
151 | // make extra copy of experimental q-values for easy plotting |
---|
152 | Duplicate/O $(str+"_q") smeared_CYL_SW,smeared_qvals |
---|
153 | SetScale d,0,0,"1/cm",smeared_CYL_SW |
---|
154 | |
---|
155 | Variable/G gs_CYL_SW=0 |
---|
156 | gs_CYL_SW := fSmearedCylinder_SW(smear_coef_CYL_SW,smeared_CYL_SW,smeared_qvals) //this wrapper fills the STRUCT |
---|
157 | |
---|
158 | Display smeared_CYL_SW vs smeared_qvals |
---|
159 | ModifyGraph log=1,marker=29,msize=2,mode=4 |
---|
160 | Label bottom "q (A\\S-1\\M)" |
---|
161 | Label left "Intensity (cm\\S-1\\M)" |
---|
162 | |
---|
163 | AutoPositionWindow/M=1/R=$(WinName(0,1)) $WinName(0,2) |
---|
164 | |
---|
165 | SetDataFolder root: |
---|
166 | AddModelToStrings("SmearedCylinder_SW","smear_coef_CYL_SW","smear_parameters_CYL_SW","CYL_SW") |
---|
167 | End |
---|
168 | |
---|
169 | |
---|
170 | Function Cylinder_SW(w,yw,xw) : FitFunc |
---|
171 | Wave w,yw,xw |
---|
172 | |
---|
173 | Variable inten,rad,len |
---|
174 | rad=w[1] |
---|
175 | len=w[2] |
---|
176 | |
---|
177 | //setup form factor coefficient wave |
---|
178 | Make/O/D/N=6 form_CYL_SW |
---|
179 | form_CYL_SW[0] = 1 |
---|
180 | form_CYL_SW[1] = w[1] |
---|
181 | form_CYL_SW[2] = w[2] |
---|
182 | form_CYL_SW[3] = w[3] |
---|
183 | form_CYL_SW[4] = w[4] |
---|
184 | form_CYL_SW[5] = 0 |
---|
185 | |
---|
186 | //setup structure factor coefficient wave |
---|
187 | Make/O/D/N=4 struct_CYL_SW |
---|
188 | struct_CYL_SW[0] = 0.5*DiamCyl(len,rad) |
---|
189 | struct_CYL_SW[1] = w[0] |
---|
190 | struct_CYL_SW[2] = w[5] |
---|
191 | struct_CYL_SW[3] = w[6] |
---|
192 | |
---|
193 | //calculate each and combine |
---|
194 | Duplicate/O xw temp_CYL_SW_PQ,temp_CYL_SW_SQ //make waves for the AAO |
---|
195 | CylinderForm(form_CYL_SW,temp_CYL_SW_PQ,xw) |
---|
196 | SquareWellStruct(struct_CYL_SW,temp_CYL_SW_SQ,xw) |
---|
197 | yw = temp_CYL_SW_PQ * temp_CYL_SW_SQ |
---|
198 | yw *= w[0] |
---|
199 | yw += w[7] |
---|
200 | |
---|
201 | //cleanup waves |
---|
202 | // Killwaves/Z form_CYL_SW,struct_CYL_SW |
---|
203 | |
---|
204 | return (0) |
---|
205 | End |
---|
206 | |
---|
207 | Proc PlotCylinder_SC(num,qmin,qmax) |
---|
208 | Variable num=128,qmin=0.001,qmax=0.7 |
---|
209 | Prompt num "Enter number of data points for model: " |
---|
210 | Prompt qmin "Enter minimum q-value (A^-1) for model: " |
---|
211 | Prompt qmax "Enter maximum q-value (A^-1) for model: " |
---|
212 | |
---|
213 | if(!DataFolderExists(":HayPenMSA")) |
---|
214 | NewDataFolder :HayPenMSA |
---|
215 | endif |
---|
216 | Make/O/D/N=17 :HayPenMSA:gMSAWave |
---|
217 | |
---|
218 | Make/O/D/n=(num) xwave_CYL_SC,ywave_CYL_SC |
---|
219 | xwave_CYL_SC = alog(log(qmin) + x*((log(qmax)-log(qmin))/num)) |
---|
220 | Make/O/D coef_CYL_SC = {0.01,20.,400,1e-6,6.3e-6,20,0,298,78,0.01} |
---|
221 | make/o/t parameters_CYL_SC = {"volume fraction","radius (A)","length (A)","SLD cylinder (A^-2)","SLD solvent (A^-2)","charge","movalent salt(M)","Temperature (K)","dielectric const","incoh. bkg (cm^-1)"} |
---|
222 | Edit parameters_CYL_SC,coef_CYL_SC |
---|
223 | |
---|
224 | Variable/G root:g_CYL_SC |
---|
225 | g_CYL_SC := Cylinder_SC(coef_CYL_SC,ywave_CYL_SC,xwave_CYL_SC) |
---|
226 | Display ywave_CYL_SC vs xwave_CYL_SC |
---|
227 | ModifyGraph log=1,marker=29,msize=2,mode=4 |
---|
228 | Label bottom "q (A\\S-1\\M)" |
---|
229 | Label left "Intensity (cm\\S-1\\M)" |
---|
230 | |
---|
231 | AutoPositionWindow/M=1/R=$(WinName(0,1)) $WinName(0,2) |
---|
232 | |
---|
233 | AddModelToStrings("Cylinder_SC","coef_CYL_SC","parameters_CYL_SC","CYL_SC") |
---|
234 | End |
---|
235 | |
---|
236 | // - sets up a dependency to a wrapper, not the actual SmearedModelFunction |
---|
237 | Proc PlotSmearedCylinder_SC(str) |
---|
238 | String str |
---|
239 | Prompt str,"Pick the data folder containing the resolution you want",popup,getAList(4) |
---|
240 | |
---|
241 | // if any of the resolution waves are missing => abort |
---|
242 | if(ResolutionWavesMissingDF(str)) //updated to NOT use global strings (in GaussUtils) |
---|
243 | Abort |
---|
244 | endif |
---|
245 | |
---|
246 | SetDataFolder $("root:"+str) |
---|
247 | |
---|
248 | if(!DataFolderExists(":HayPenMSA")) |
---|
249 | NewDataFolder :HayPenMSA |
---|
250 | endif |
---|
251 | Make/O/D/N=17 :HayPenMSA:gMSAWave |
---|
252 | |
---|
253 | // Setup parameter table for model function |
---|
254 | Make/O/D smear_coef_CYL_SC = {0.01,20.,400,1e-6,6.3e-6,20,0,298,78,0.01} |
---|
255 | make/o/t smear_parameters_CYL_SC = {"volume fraction","radius (A)","length (A)","SLD cylinder (A^-2)","SLD solvent (A^-2)","charge","movalent salt(M)","Temperature (K)","dielectric const","incoh. bkg (cm^-1)"} |
---|
256 | Edit smear_parameters_CYL_SC,smear_coef_CYL_SC |
---|
257 | |
---|
258 | // output smeared intensity wave, dimensions are identical to experimental QSIG values |
---|
259 | // make extra copy of experimental q-values for easy plotting |
---|
260 | Duplicate/O $(str+"_q") smeared_CYL_SC,smeared_qvals |
---|
261 | SetScale d,0,0,"1/cm",smeared_CYL_SC |
---|
262 | |
---|
263 | Variable/G gs_CYL_SC=0 |
---|
264 | gs_CYL_SC := fSmearedCylinder_SC(smear_coef_CYL_SC,smeared_CYL_SC,smeared_qvals) //this wrapper fills the STRUCT |
---|
265 | |
---|
266 | Display smeared_CYL_SC vs smeared_qvals |
---|
267 | ModifyGraph log=1,marker=29,msize=2,mode=4 |
---|
268 | Label bottom "q (A\\S-1\\M)" |
---|
269 | Label left "Intensity (cm\\S-1\\M)" |
---|
270 | |
---|
271 | AutoPositionWindow/M=1/R=$(WinName(0,1)) $WinName(0,2) |
---|
272 | |
---|
273 | SetDataFolder root: |
---|
274 | AddModelToStrings("SmearedCylinder_SC","smear_coef_CYL_SC","smear_parameters_CYL_SC","CYL_SC") |
---|
275 | End |
---|
276 | |
---|
277 | |
---|
278 | Function Cylinder_SC(w,yw,xw) : FitFunc |
---|
279 | Wave w,yw,xw |
---|
280 | |
---|
281 | Variable inten,rad,len |
---|
282 | rad=w[1] |
---|
283 | len=w[2] |
---|
284 | |
---|
285 | //setup form factor coefficient wave |
---|
286 | Make/O/D/N=6 form_CYL_SC |
---|
287 | form_CYL_SC[0] = 1 |
---|
288 | form_CYL_SC[1] = w[1] |
---|
289 | form_CYL_SC[2] = w[2] |
---|
290 | form_CYL_SC[3] = w[3] |
---|
291 | form_CYL_SC[4] = w[4] |
---|
292 | form_CYL_SC[5] = 0 |
---|
293 | |
---|
294 | //setup structure factor coefficient wave |
---|
295 | Make/O/D/N=6 struct_CYL_SC |
---|
296 | struct_CYL_SC[0] = DiamCyl(len,rad) |
---|
297 | struct_CYL_SC[1] = w[5] |
---|
298 | struct_CYL_SC[2] = w[0] |
---|
299 | struct_CYL_SC[3] = w[7] |
---|
300 | struct_CYL_SC[4] = w[6] |
---|
301 | struct_CYL_SC[5] = w[8] |
---|
302 | |
---|
303 | //calculate each and combine |
---|
304 | Duplicate/O xw temp_CYL_SC_PQ,temp_CYL_SC_SQ //make waves for the AAO |
---|
305 | CylinderForm(form_CYL_SC,temp_CYL_SC_PQ,xw) |
---|
306 | HayterPenfoldMSA(struct_CYL_SC,temp_CYL_SC_SQ,xw) |
---|
307 | yw = temp_CYL_SC_PQ * temp_CYL_SC_SQ |
---|
308 | yw *= w[0] |
---|
309 | yw += w[9] |
---|
310 | |
---|
311 | //cleanup waves |
---|
312 | // Killwaves/Z form_CYL_SC,struct_CYL_SC |
---|
313 | |
---|
314 | return (0) |
---|
315 | End |
---|
316 | |
---|
317 | |
---|
318 | Proc PlotCylinder_SHS(num,qmin,qmax) |
---|
319 | Variable num=128,qmin=0.001,qmax=0.7 |
---|
320 | Prompt num "Enter number of data points for model: " |
---|
321 | Prompt qmin "Enter minimum q-value (A^-1) for model: " |
---|
322 | Prompt qmax "Enter maximum q-value (A^-1) for model: " |
---|
323 | |
---|
324 | Make/O/D/n=(num) xwave_CYL_SHS,ywave_CYL_SHS |
---|
325 | xwave_CYL_SHS = alog(log(qmin) + x*((log(qmax)-log(qmin))/num)) |
---|
326 | Make/O/D coef_CYL_SHS = {0.01,20.0,400,1e-6,6.3e-6,0.05,0.2,0.01} |
---|
327 | make/o/t parameters_CYL_SHS = {"volume fraction","radius (A)","length (A)","SLD cylinder (A^-2)","SLD solvent (A^-2)","perturbation parameter (0.1)","stickiness, tau","incoh. bkg (cm^-1)"} |
---|
328 | Edit parameters_CYL_SHS,coef_CYL_SHS |
---|
329 | |
---|
330 | Variable/G root:g_CYL_SHS |
---|
331 | g_CYL_SHS := Cylinder_SHS(coef_CYL_SHS,ywave_CYL_SHS,xwave_CYL_SHS) |
---|
332 | Display ywave_CYL_SHS vs xwave_CYL_SHS |
---|
333 | ModifyGraph log=1,marker=29,msize=2,mode=4 |
---|
334 | Label bottom "q (A\\S-1\\M)" |
---|
335 | Label left "Intensity (cm\\S-1\\M)" |
---|
336 | |
---|
337 | AutoPositionWindow/M=1/R=$(WinName(0,1)) $WinName(0,2) |
---|
338 | |
---|
339 | AddModelToStrings("Cylinder_SHS","coef_CYL_SHS","parameters_CYL_SHS","CYL_SHS") |
---|
340 | End |
---|
341 | |
---|
342 | // - sets up a dependency to a wrapper, not the actual SmearedModelFunction |
---|
343 | Proc PlotSmearedCylinder_SHS(str) |
---|
344 | String str |
---|
345 | Prompt str,"Pick the data folder containing the resolution you want",popup,getAList(4) |
---|
346 | |
---|
347 | // if any of the resolution waves are missing => abort |
---|
348 | if(ResolutionWavesMissingDF(str)) //updated to NOT use global strings (in GaussUtils) |
---|
349 | Abort |
---|
350 | endif |
---|
351 | |
---|
352 | SetDataFolder $("root:"+str) |
---|
353 | |
---|
354 | // Setup parameter table for model function |
---|
355 | Make/O/D smear_coef_CYL_SHS = {0.01,20.0,400,1e-6,6.3e-6,0.05,0.2,0.01} |
---|
356 | make/o/t smear_parameters_CYL_SHS = {"volume fraction","radius (A)","length (A)","SLD cylinder (A^-2)","SLD solvent (A^-2)","perturbation parameter (0.1)","stickiness, tau","incoh. bkg (cm^-1)"} |
---|
357 | Edit smear_parameters_CYL_SHS,smear_coef_CYL_SHS |
---|
358 | |
---|
359 | // output smeared intensity wave, dimensions are identical to experimental QSIG values |
---|
360 | // make extra copy of experimental q-values for easy plotting |
---|
361 | Duplicate/O $(str+"_q") smeared_CYL_SHS,smeared_qvals |
---|
362 | SetScale d,0,0,"1/cm",smeared_CYL_SHS |
---|
363 | |
---|
364 | Variable/G gs_CYL_SHS=0 |
---|
365 | gs_CYL_SHS := fSmearedCylinder_SHS(smear_coef_CYL_SHS,smeared_CYL_SHS,smeared_qvals) //this wrapper fills the STRUCT |
---|
366 | |
---|
367 | Display smeared_CYL_SHS vs smeared_qvals |
---|
368 | ModifyGraph log=1,marker=29,msize=2,mode=4 |
---|
369 | Label bottom "q (A\\S-1\\M)" |
---|
370 | Label left "Intensity (cm\\S-1\\M)" |
---|
371 | |
---|
372 | AutoPositionWindow/M=1/R=$(WinName(0,1)) $WinName(0,2) |
---|
373 | |
---|
374 | SetDataFolder root: |
---|
375 | AddModelToStrings("SmearedCylinder_SHS","smear_coef_CYL_SHS","smear_parameters_CYL_SHS","CYL_SHS") |
---|
376 | End |
---|
377 | |
---|
378 | |
---|
379 | Function Cylinder_SHS(w,yw,xw) : FitFunc |
---|
380 | Wave w,yw,xw |
---|
381 | |
---|
382 | Variable inten,rad,len |
---|
383 | rad=w[1] |
---|
384 | len=w[2] |
---|
385 | |
---|
386 | //setup form factor coefficient wave |
---|
387 | Make/O/D/N=6 form_CYL_SHS |
---|
388 | form_CYL_SHS[0] = 1 |
---|
389 | form_CYL_SHS[1] = w[1] |
---|
390 | form_CYL_SHS[2] = w[2] |
---|
391 | form_CYL_SHS[3] = w[3] |
---|
392 | form_CYL_SHS[4] = w[4] |
---|
393 | form_CYL_SHS[5] = 0 |
---|
394 | |
---|
395 | //setup structure factor coefficient wave |
---|
396 | Make/O/D/N=4 struct_CYL_SHS |
---|
397 | struct_CYL_SHS[0] = 0.5*DiamCyl(len,rad) |
---|
398 | struct_CYL_SHS[1] = w[0] |
---|
399 | struct_CYL_SHS[2] = w[5] |
---|
400 | struct_CYL_SHS[3] = w[6] |
---|
401 | |
---|
402 | //calculate each and combine |
---|
403 | Duplicate/O xw temp_CYL_SHS_PQ,temp_CYL_SHS_SQ //make waves for the AAO |
---|
404 | CylinderForm(form_CYL_SHS,temp_CYL_SHS_PQ,xw) |
---|
405 | StickyHS_Struct(struct_CYL_SHS,temp_CYL_SHS_SQ,xw) |
---|
406 | yw = temp_CYL_SHS_PQ * temp_CYL_SHS_SQ |
---|
407 | yw *= w[0] |
---|
408 | yw += w[7] |
---|
409 | |
---|
410 | //cleanup waves |
---|
411 | // Killwaves/Z form_CYL_SHS,struct_CYL_SHS |
---|
412 | |
---|
413 | return (0) |
---|
414 | End |
---|
415 | |
---|
416 | |
---|
417 | |
---|
418 | // this is all there is to the smeared calculation! |
---|
419 | Function SmearedCylinder_HS(s) :FitFunc |
---|
420 | Struct ResSmearAAOStruct &s |
---|
421 | |
---|
422 | // the name of your unsmeared model is the first argument |
---|
423 | Smear_Model_20(Cylinder_HS,s.coefW,s.xW,s.yW,s.resW) |
---|
424 | |
---|
425 | return(0) |
---|
426 | End |
---|
427 | |
---|
428 | // this is all there is to the smeared calculation! |
---|
429 | Function SmearedCylinder_SW(s) :FitFunc |
---|
430 | Struct ResSmearAAOStruct &s |
---|
431 | |
---|
432 | // the name of your unsmeared model is the first argument |
---|
433 | Smear_Model_20(Cylinder_SW,s.coefW,s.xW,s.yW,s.resW) |
---|
434 | |
---|
435 | return(0) |
---|
436 | End |
---|
437 | |
---|
438 | // this is all there is to the smeared calculation! |
---|
439 | Function SmearedCylinder_SC(s) :FitFunc |
---|
440 | Struct ResSmearAAOStruct &s |
---|
441 | |
---|
442 | // the name of your unsmeared model is the first argument |
---|
443 | Smear_Model_20(Cylinder_SC,s.coefW,s.xW,s.yW,s.resW) |
---|
444 | |
---|
445 | return(0) |
---|
446 | End |
---|
447 | |
---|
448 | // this is all there is to the smeared calculation! |
---|
449 | Function SmearedCylinder_SHS(s) :FitFunc |
---|
450 | Struct ResSmearAAOStruct &s |
---|
451 | |
---|
452 | // the name of your unsmeared model is the first argument |
---|
453 | Smear_Model_20(Cylinder_SHS,s.coefW,s.xW,s.yW,s.resW) |
---|
454 | |
---|
455 | return(0) |
---|
456 | End |
---|
457 | |
---|
458 | //wrapper to calculate the smeared model as an AAO-Struct |
---|
459 | // fills the struct and calls the ususal function with the STRUCT parameter |
---|
460 | // |
---|
461 | // used only for the dependency, not for fitting |
---|
462 | // |
---|
463 | Function fSmearedCylinder_HS(coefW,yW,xW) |
---|
464 | Wave coefW,yW,xW |
---|
465 | |
---|
466 | String str = getWavesDataFolder(yW,0) |
---|
467 | String DF="root:"+str+":" |
---|
468 | |
---|
469 | WAVE resW = $(DF+str+"_res") |
---|
470 | |
---|
471 | STRUCT ResSmearAAOStruct fs |
---|
472 | WAVE fs.coefW = coefW |
---|
473 | WAVE fs.yW = yW |
---|
474 | WAVE fs.xW = xW |
---|
475 | WAVE fs.resW = resW |
---|
476 | |
---|
477 | Variable err |
---|
478 | err = SmearedCylinder_HS(fs) |
---|
479 | |
---|
480 | return (0) |
---|
481 | End |
---|
482 | |
---|
483 | //wrapper to calculate the smeared model as an AAO-Struct |
---|
484 | // fills the struct and calls the ususal function with the STRUCT parameter |
---|
485 | // |
---|
486 | // used only for the dependency, not for fitting |
---|
487 | // |
---|
488 | Function fSmearedCylinder_SW(coefW,yW,xW) |
---|
489 | Wave coefW,yW,xW |
---|
490 | |
---|
491 | String str = getWavesDataFolder(yW,0) |
---|
492 | String DF="root:"+str+":" |
---|
493 | |
---|
494 | WAVE resW = $(DF+str+"_res") |
---|
495 | |
---|
496 | STRUCT ResSmearAAOStruct fs |
---|
497 | WAVE fs.coefW = coefW |
---|
498 | WAVE fs.yW = yW |
---|
499 | WAVE fs.xW = xW |
---|
500 | WAVE fs.resW = resW |
---|
501 | |
---|
502 | Variable err |
---|
503 | err = SmearedCylinder_SW(fs) |
---|
504 | |
---|
505 | return (0) |
---|
506 | End |
---|
507 | |
---|
508 | //wrapper to calculate the smeared model as an AAO-Struct |
---|
509 | // fills the struct and calls the ususal function with the STRUCT parameter |
---|
510 | // |
---|
511 | // used only for the dependency, not for fitting |
---|
512 | // |
---|
513 | Function fSmearedCylinder_SC(coefW,yW,xW) |
---|
514 | Wave coefW,yW,xW |
---|
515 | |
---|
516 | String str = getWavesDataFolder(yW,0) |
---|
517 | String DF="root:"+str+":" |
---|
518 | |
---|
519 | WAVE resW = $(DF+str+"_res") |
---|
520 | |
---|
521 | STRUCT ResSmearAAOStruct fs |
---|
522 | WAVE fs.coefW = coefW |
---|
523 | WAVE fs.yW = yW |
---|
524 | WAVE fs.xW = xW |
---|
525 | WAVE fs.resW = resW |
---|
526 | |
---|
527 | Variable err |
---|
528 | err = SmearedCylinder_SC(fs) |
---|
529 | |
---|
530 | return (0) |
---|
531 | End |
---|
532 | |
---|
533 | //wrapper to calculate the smeared model as an AAO-Struct |
---|
534 | // fills the struct and calls the ususal function with the STRUCT parameter |
---|
535 | // |
---|
536 | // used only for the dependency, not for fitting |
---|
537 | // |
---|
538 | Function fSmearedCylinder_SHS(coefW,yW,xW) |
---|
539 | Wave coefW,yW,xW |
---|
540 | |
---|
541 | String str = getWavesDataFolder(yW,0) |
---|
542 | String DF="root:"+str+":" |
---|
543 | |
---|
544 | WAVE resW = $(DF+str+"_res") |
---|
545 | |
---|
546 | STRUCT ResSmearAAOStruct fs |
---|
547 | WAVE fs.coefW = coefW |
---|
548 | WAVE fs.yW = yW |
---|
549 | WAVE fs.xW = xW |
---|
550 | WAVE fs.resW = resW |
---|
551 | |
---|
552 | Variable err |
---|
553 | err = SmearedCylinder_SHS(fs) |
---|
554 | |
---|
555 | return (0) |
---|
556 | End |
---|