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 "ProlateCoreShell_v40" |
---|
6 | #include "EffectiveDiameter_v40" |
---|
7 | |
---|
8 | #include "HardSphereStruct_v40" |
---|
9 | #include "HPMSA_v40" |
---|
10 | #include "SquareWellStruct_v40" |
---|
11 | #include "StickyHardSphereStruct_v40" |
---|
12 | |
---|
13 | Proc PlotProlate_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_PEF_HS,ywave_PEF_HS |
---|
20 | xwave_PEF_HS = alog(log(qmin) + x*((log(qmax)-log(qmin))/num)) |
---|
21 | Make/O/D coef_PEF_HS = {0.01,100,50,110,60,1e-6,2e-6,6.3e-6,0.0001} |
---|
22 | make/o/t parameters_PEF_HS = {"volume fraction","major core radius (A)","minor core radius (A)","major shell radius (A)","minor shell radius (A)","SLD core (A-2)","SLD shell (A-2)","SLD solvent (A-2)","bkg (cm-1)"} |
---|
23 | Edit parameters_PEF_HS,coef_PEF_HS |
---|
24 | |
---|
25 | Variable/G root:g_PEF_HS |
---|
26 | g_PEF_HS := Prolate_HS(coef_PEF_HS,ywave_PEF_HS,xwave_PEF_HS) |
---|
27 | Display ywave_PEF_HS vs xwave_PEF_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("Prolate_HS","coef_PEF_HS","parameters_PEF_HS","PEF_HS") |
---|
35 | End |
---|
36 | |
---|
37 | // - sets up a dependency to a wrapper, not the actual SmearedModelFunction |
---|
38 | Proc PlotSmearedProlate_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_PEF_HS = {0.01,100,50,110,60,1e-6,2e-6,6.3e-6,0.0001} |
---|
51 | make/o/t smear_parameters_PEF_HS = {"volume fraction","major core radius (A)","minor core radius (A)","major shell radius (A)","minor shell radius (A)","SLD core (A-2)","SLD shell (A-2)","SLD solvent (A-2)","bkg (cm-1)"} |
---|
52 | Edit smear_parameters_PEF_HS,smear_coef_PEF_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_PEF_HS,smeared_qvals |
---|
57 | SetScale d,0,0,"1/cm",smeared_PEF_HS |
---|
58 | |
---|
59 | Variable/G gs_PEF_HS=0 |
---|
60 | gs_PEF_HS := fSmearedProlate_HS(smear_coef_PEF_HS,smeared_PEF_HS,smeared_qvals) //this wrapper fills the STRUCT |
---|
61 | |
---|
62 | Display smeared_PEF_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("SmearedProlate_HS","smear_coef_PEF_HS","smear_parameters_PEF_HS","PEF_HS") |
---|
71 | End |
---|
72 | |
---|
73 | |
---|
74 | Function Prolate_HS(w,yw,xw) : FitFunc |
---|
75 | Wave w,yw,xw |
---|
76 | |
---|
77 | Variable inten,Ras,Rbs |
---|
78 | Ras = w[3] //Ras is the rotation axis |
---|
79 | Rbs = w[4] |
---|
80 | |
---|
81 | //setup form factor coefficient wave |
---|
82 | Make/O/D/N=9 form_PEF_HS |
---|
83 | form_PEF_HS[0] = 1 |
---|
84 | form_PEF_HS[1] = w[1] |
---|
85 | form_PEF_HS[2] = w[2] |
---|
86 | form_PEF_HS[3] = w[3] |
---|
87 | form_PEF_HS[4] = w[4] |
---|
88 | form_PEF_HS[5] = w[5] |
---|
89 | form_PEF_HS[6] = w[6] |
---|
90 | form_PEF_HS[7] = w[7] |
---|
91 | form_PEF_HS[8] = 0 |
---|
92 | |
---|
93 | //setup structure factor coefficient wave |
---|
94 | Make/O/D/N=2 struct_PEF_HS |
---|
95 | struct_PEF_HS[0] = 0.5*DiamEllip(Ras,Rbs) |
---|
96 | struct_PEF_HS[1] = w[0] |
---|
97 | |
---|
98 | //calculate each and combine |
---|
99 | Duplicate/O xw temp_PEF_HS_PQ,temp_PEF_HS_SQ //make waves for the AAO |
---|
100 | ProlateForm(form_PEF_HS,temp_PEF_HS_PQ,xw) |
---|
101 | HardSphereStruct(struct_PEF_HS,temp_PEF_HS_SQ,xw) |
---|
102 | yw = temp_PEF_HS_PQ *temp_PEF_HS_SQ |
---|
103 | yw *= w[0] |
---|
104 | yw += w[8] |
---|
105 | |
---|
106 | //cleanup waves |
---|
107 | // Killwaves/Z form_PEF_HS,struct_PEF_HS |
---|
108 | |
---|
109 | return (yw) |
---|
110 | End |
---|
111 | |
---|
112 | Proc PlotProlate_SW(num,qmin,qmax) |
---|
113 | Variable num=128,qmin=0.001,qmax=0.7 |
---|
114 | Prompt num "Enter number of data points for model: " |
---|
115 | Prompt qmin "Enter minimum q-value (A^-1) for model: " |
---|
116 | Prompt qmax "Enter maximum q-value (A^-1) for model: " |
---|
117 | |
---|
118 | Make/O/D/n=(num) xwave_PEF_SW,ywave_PEF_SW |
---|
119 | xwave_PEF_SW = alog(log(qmin) + x*((log(qmax)-log(qmin))/num)) |
---|
120 | Make/O/D coef_PEF_SW = {0.01,100,50,110,60,1e-6,2e-6,6.3e-6,1.0,1.2,0.0001} |
---|
121 | make/o/t parameters_PEF_SW = {"volume fraction","major core radius (A)","minor core radius (A)","major shell radius (A)","minor shell radius (A)","SLD core (A-2)","SLD shell (A-2)","SLD solvent (A-2)","well depth (kT)","well width (diam.)","bkg (cm-1)"} |
---|
122 | Edit parameters_PEF_SW,coef_PEF_SW |
---|
123 | |
---|
124 | Variable/G root:g_PEF_SW |
---|
125 | g_PEF_SW := Prolate_SW(coef_PEF_SW,ywave_PEF_SW,xwave_PEF_SW) |
---|
126 | Display ywave_PEF_SW vs xwave_PEF_SW |
---|
127 | ModifyGraph log=1,marker=29,msize=2,mode=4 |
---|
128 | Label bottom "q (A\\S-1\\M)" |
---|
129 | Label left "Intensity (cm\\S-1\\M)" |
---|
130 | |
---|
131 | AutoPositionWindow/M=1/R=$(WinName(0,1)) $WinName(0,2) |
---|
132 | |
---|
133 | AddModelToStrings("Prolate_SW","coef_PEF_SW","parameters_PEF_SW","PEF_SW") |
---|
134 | End |
---|
135 | |
---|
136 | // - sets up a dependency to a wrapper, not the actual SmearedModelFunction |
---|
137 | Proc PlotSmearedProlate_SW(str) |
---|
138 | String str |
---|
139 | Prompt str,"Pick the data folder containing the resolution you want",popup,getAList(4) |
---|
140 | |
---|
141 | // if any of the resolution waves are missing => abort |
---|
142 | if(ResolutionWavesMissingDF(str)) //updated to NOT use global strings (in GaussUtils) |
---|
143 | Abort |
---|
144 | endif |
---|
145 | |
---|
146 | SetDataFolder $("root:"+str) |
---|
147 | |
---|
148 | // Setup parameter table for model function |
---|
149 | Make/O/D smear_coef_PEF_SW = {0.01,100,50,110,60,1e-6,2e-6,6.3e-6,1.0,1.2,0.0001} |
---|
150 | make/o/t smear_parameters_PEF_SW = {"volume fraction","major core radius (A)","minor core radius (A)","major shell radius (A)","minor shell radius (A)","SLD core (A-2)","SLD shell (A-2)","SLD solvent (A-2)","well depth (kT)","well width (diam.)","bkg (cm-1)"} |
---|
151 | Edit smear_parameters_PEF_SW,smear_coef_PEF_SW |
---|
152 | |
---|
153 | // output smeared intensity wave, dimensions are identical to experimental QSIG values |
---|
154 | // make extra copy of experimental q-values for easy plotting |
---|
155 | Duplicate/O $(str+"_q") smeared_PEF_SW,smeared_qvals |
---|
156 | SetScale d,0,0,"1/cm",smeared_PEF_SW |
---|
157 | |
---|
158 | Variable/G gs_PEF_SW=0 |
---|
159 | gs_PEF_SW := fSmearedProlate_SW(smear_coef_PEF_SW,smeared_PEF_SW,smeared_qvals) //this wrapper fills the STRUCT |
---|
160 | |
---|
161 | Display smeared_PEF_SW vs smeared_qvals |
---|
162 | ModifyGraph log=1,marker=29,msize=2,mode=4 |
---|
163 | Label bottom "q (A\\S-1\\M)" |
---|
164 | Label left "Intensity (cm\\S-1\\M)" |
---|
165 | |
---|
166 | AutoPositionWindow/M=1/R=$(WinName(0,1)) $WinName(0,2) |
---|
167 | |
---|
168 | SetDataFolder root: |
---|
169 | AddModelToStrings("SmearedProlate_SW","smear_coef_PEF_SW","smear_parameters_PEF_SW","PEF_SW") |
---|
170 | End |
---|
171 | |
---|
172 | |
---|
173 | Function Prolate_SW(w,yw,xw) : FitFunc |
---|
174 | Wave w,yw,xw |
---|
175 | |
---|
176 | Variable inten,Ras,Rbs |
---|
177 | Ras = w[3] //Ras is the rotation axis |
---|
178 | Rbs = w[4] |
---|
179 | |
---|
180 | //setup form factor coefficient wave |
---|
181 | Make/O/D/N=9 form_PEF_SW |
---|
182 | form_PEF_SW[0] = 1 |
---|
183 | form_PEF_SW[1] = w[1] |
---|
184 | form_PEF_SW[2] = w[2] |
---|
185 | form_PEF_SW[3] = w[3] |
---|
186 | form_PEF_SW[4] = w[4] |
---|
187 | form_PEF_SW[5] = w[5] |
---|
188 | form_PEF_SW[6] = w[6] |
---|
189 | form_PEF_SW[7] = w[7] |
---|
190 | form_PEF_SW[8] = 0 |
---|
191 | |
---|
192 | //setup structure factor coefficient wave |
---|
193 | Make/O/D/N=4 struct_PEF_SW |
---|
194 | struct_PEF_SW[0] = 0.5*DiamEllip(Ras,Rbs) |
---|
195 | struct_PEF_SW[1] = w[0] |
---|
196 | struct_PEF_SW[2] = w[8] |
---|
197 | struct_PEF_SW[3] = w[9] |
---|
198 | |
---|
199 | //calculate each and combine |
---|
200 | Duplicate/O xw temp_PEF_SW_PQ,temp_PEF_SW_SQ //make waves for the AAO |
---|
201 | ProlateForm(form_PEF_SW,temp_PEF_SW_PQ,xw) |
---|
202 | SquareWellStruct(struct_PEF_SW,temp_PEF_SW_SQ,xw) |
---|
203 | yw = temp_PEF_SW_PQ * temp_PEF_SW_SQ |
---|
204 | yw *= w[0] |
---|
205 | yw += w[10] |
---|
206 | |
---|
207 | //cleanup waves |
---|
208 | // Killwaves/Z form_PEF_SW,struct_PEF_SW |
---|
209 | |
---|
210 | return (0) |
---|
211 | End |
---|
212 | |
---|
213 | Proc PlotProlate_SC(num,qmin,qmax) |
---|
214 | Variable num=128,qmin=0.001,qmax=0.7 |
---|
215 | Prompt num "Enter number of data points for model: " |
---|
216 | Prompt qmin "Enter minimum q-value (A^-1) for model: " |
---|
217 | Prompt qmax "Enter maximum q-value (A^-1) for model: " |
---|
218 | |
---|
219 | if(!DataFolderExists(":HayPenMSA")) |
---|
220 | NewDataFolder :HayPenMSA |
---|
221 | endif |
---|
222 | Make/O/D/N=17 :HayPenMSA:gMSAWave |
---|
223 | |
---|
224 | Make/O/D/n=(num) xwave_PEF_SC,ywave_PEF_SC |
---|
225 | xwave_PEF_SC = alog(log(qmin) + x*((log(qmax)-log(qmin))/num)) |
---|
226 | Make/O/D coef_PEF_SC = {0.01,100,50,110,60,1e-6,2e-6,6.3e-6,20,0,298,78,0.0001} |
---|
227 | make/o/t parameters_PEF_SC = {"volume fraction","major core radius (A)","minor core radius (A)","major shell radius (A)","minor shell radius (A)","SLD core (A-2)","SLD shell (A-2)","SLD solvent (A-2)","charge","movalent salt(M)","Temperature (K)","dielectric const","bkg (cm-1)"} |
---|
228 | Edit parameters_PEF_SC,coef_PEF_SC |
---|
229 | |
---|
230 | Variable/G root:g_PEF_SC |
---|
231 | g_PEF_SC := Prolate_SC(coef_PEF_SC,ywave_PEF_SC,xwave_PEF_SC) |
---|
232 | Display ywave_PEF_SC vs xwave_PEF_SC |
---|
233 | ModifyGraph log=1,marker=29,msize=2,mode=4 |
---|
234 | Label bottom "q (A\\S-1\\M)" |
---|
235 | Label left "Intensity (cm\\S-1\\M)" |
---|
236 | |
---|
237 | AutoPositionWindow/M=1/R=$(WinName(0,1)) $WinName(0,2) |
---|
238 | |
---|
239 | AddModelToStrings("Prolate_SC","coef_PEF_SC","parameters_PEF_SC","PEF_SC") |
---|
240 | End |
---|
241 | |
---|
242 | // - sets up a dependency to a wrapper, not the actual SmearedModelFunction |
---|
243 | Proc PlotSmearedProlate_SC(str) |
---|
244 | String str |
---|
245 | Prompt str,"Pick the data folder containing the resolution you want",popup,getAList(4) |
---|
246 | |
---|
247 | // if any of the resolution waves are missing => abort |
---|
248 | if(ResolutionWavesMissingDF(str)) //updated to NOT use global strings (in GaussUtils) |
---|
249 | Abort |
---|
250 | endif |
---|
251 | |
---|
252 | SetDataFolder $("root:"+str) |
---|
253 | |
---|
254 | if(!DataFolderExists(":HayPenMSA")) |
---|
255 | NewDataFolder :HayPenMSA |
---|
256 | endif |
---|
257 | Make/O/D/N=17 :HayPenMSA:gMSAWave |
---|
258 | |
---|
259 | // Setup parameter table for model function |
---|
260 | Make/O/D smear_coef_PEF_SC = {0.01,100,50,110,60,1e-6,2e-6,6.3e-6,20,0,298,78,0.0001} |
---|
261 | make/o/t smear_parameters_PEF_SC = {"volume fraction","major core radius (A)","minor core radius (A)","major shell radius (A)","minor shell radius (A)","SLD core (A-2)","SLD shell (A-2)","SLD solvent (A-2)","charge","movalent salt(M)","Temperature (K)","dielectric const","bkg (cm-1)"} |
---|
262 | Edit smear_parameters_PEF_SC,smear_coef_PEF_SC |
---|
263 | |
---|
264 | // output smeared intensity wave, dimensions are identical to experimental QSIG values |
---|
265 | // make extra copy of experimental q-values for easy plotting |
---|
266 | Duplicate/O $(str+"_q") smeared_PEF_SC,smeared_qvals |
---|
267 | SetScale d,0,0,"1/cm",smeared_PEF_SC |
---|
268 | |
---|
269 | Variable/G gs_PEF_SC=0 |
---|
270 | gs_PEF_SC := fSmearedProlate_SC(smear_coef_PEF_SC,smeared_PEF_SC,smeared_qvals) //this wrapper fills the STRUCT |
---|
271 | |
---|
272 | Display smeared_PEF_SC vs smeared_qvals |
---|
273 | ModifyGraph log=1,marker=29,msize=2,mode=4 |
---|
274 | Label bottom "q (A\\S-1\\M)" |
---|
275 | Label left "Intensity (cm\\S-1\\M)" |
---|
276 | |
---|
277 | AutoPositionWindow/M=1/R=$(WinName(0,1)) $WinName(0,2) |
---|
278 | |
---|
279 | SetDataFolder root: |
---|
280 | AddModelToStrings("SmearedProlate_SC","smear_coef_PEF_SC","smear_parameters_PEF_SC","PEF_SC") |
---|
281 | End |
---|
282 | |
---|
283 | |
---|
284 | Function Prolate_SC(w,yw,xw) : FitFunc |
---|
285 | Wave w,yw,xw |
---|
286 | |
---|
287 | Variable inten,Ras,Rbs |
---|
288 | Ras = w[3] //Ras is the rotation axis |
---|
289 | Rbs = w[4] |
---|
290 | |
---|
291 | //setup form factor coefficient wave |
---|
292 | Make/O/D/N=9 form_PEF_SC |
---|
293 | form_PEF_SC[0] = 1 |
---|
294 | form_PEF_SC[1] = w[1] |
---|
295 | form_PEF_SC[2] = w[2] |
---|
296 | form_PEF_SC[3] = w[3] |
---|
297 | form_PEF_SC[4] = w[4] |
---|
298 | form_PEF_SC[5] = w[5] |
---|
299 | form_PEF_SC[6] = w[6] |
---|
300 | form_PEF_SC[7] = w[7] |
---|
301 | form_PEF_SC[8] = 0 |
---|
302 | |
---|
303 | //setup structure factor coefficient wave |
---|
304 | Make/O/D/N=6 struct_PEF_SC |
---|
305 | struct_PEF_SC[0] = DiamEllip(Ras,Rbs) |
---|
306 | struct_PEF_SC[1] = w[8] |
---|
307 | struct_PEF_SC[2] = w[0] |
---|
308 | struct_PEF_SC[3] = w[10] |
---|
309 | struct_PEF_SC[4] = w[9] |
---|
310 | struct_PEF_SC[5] = w[11] |
---|
311 | |
---|
312 | //calculate each and combine |
---|
313 | Duplicate/O xw temp_PEF_SC_PQ,temp_PEF_SC_SQ //make waves for the AAO |
---|
314 | ProlateForm(form_PEF_SC,temp_PEF_SC_PQ,xw) |
---|
315 | HayterPenfoldMSA(struct_PEF_SC,temp_PEF_SC_SQ,xw) |
---|
316 | yw = temp_PEF_SC_PQ * temp_PEF_SC_SQ |
---|
317 | yw *= w[0] |
---|
318 | yw += w[12] |
---|
319 | |
---|
320 | //cleanup waves |
---|
321 | // Killwaves/Z form_PEF_SC,struct_PEF_SC |
---|
322 | |
---|
323 | return (0) |
---|
324 | End |
---|
325 | |
---|
326 | |
---|
327 | Proc PlotProlate_SHS(num,qmin,qmax) |
---|
328 | Variable num=128,qmin=0.001,qmax=0.7 |
---|
329 | Prompt num "Enter number of data points for model: " |
---|
330 | Prompt qmin "Enter minimum q-value (A^-1) for model: " |
---|
331 | Prompt qmax "Enter maximum q-value (A^-1) for model: " |
---|
332 | |
---|
333 | Make/O/D/n=(num) xwave_PEF_SHS,ywave_PEF_SHS |
---|
334 | xwave_PEF_SHS = alog(log(qmin) + x*((log(qmax)-log(qmin))/num)) |
---|
335 | Make/O/D coef_PEF_SHS = {0.01,100,50,110,60,1e-6,2e-6,6.3e-6,0.05,0.2,0.0001} |
---|
336 | make/o/t parameters_PEF_SHS = {"volume fraction","major core radius (A)","minor core radius (A)","major shell radius (A)","minor shell radius (A)","SLD core (A-2)","SLD shell (A-2)","SLD solvent (A-2)","perturbation parameter (0.1)","stickiness, tau","bkg (cm-1)"} |
---|
337 | Edit parameters_PEF_SHS,coef_PEF_SHS |
---|
338 | |
---|
339 | Variable/G root:g_PEF_SHS |
---|
340 | g_PEF_SHS := Prolate_SHS(coef_PEF_SHS,ywave_PEF_SHS,xwave_PEF_SHS) |
---|
341 | Display ywave_PEF_SHS vs xwave_PEF_SHS |
---|
342 | ModifyGraph log=1,marker=29,msize=2,mode=4 |
---|
343 | Label bottom "q (A\\S-1\\M)" |
---|
344 | Label left "Intensity (cm\\S-1\\M)" |
---|
345 | |
---|
346 | AutoPositionWindow/M=1/R=$(WinName(0,1)) $WinName(0,2) |
---|
347 | |
---|
348 | AddModelToStrings("Prolate_SHS","coef_PEF_SHS","parameters_PEF_SHS","PEF_SHS") |
---|
349 | End |
---|
350 | |
---|
351 | // - sets up a dependency to a wrapper, not the actual SmearedModelFunction |
---|
352 | Proc PlotSmearedProlate_SHS(str) |
---|
353 | String str |
---|
354 | Prompt str,"Pick the data folder containing the resolution you want",popup,getAList(4) |
---|
355 | |
---|
356 | // if any of the resolution waves are missing => abort |
---|
357 | if(ResolutionWavesMissingDF(str)) //updated to NOT use global strings (in GaussUtils) |
---|
358 | Abort |
---|
359 | endif |
---|
360 | |
---|
361 | SetDataFolder $("root:"+str) |
---|
362 | |
---|
363 | // Setup parameter table for model function |
---|
364 | Make/O/D smear_coef_PEF_SHS = {0.01,100,50,110,60,1e-6,2e-6,6.3e-6,0.05,0.2,0.0001} |
---|
365 | make/o/t smear_parameters_PEF_SHS = {"volume fraction","major core radius (A)","minor core radius (A)","major shell radius (A)","minor shell radius (A)","SLD core (A-2)","SLD shell (A-2)","SLD solvent (A-2)","perturbation parameter (0.1)","stickiness, tau","bkg (cm-1)"} |
---|
366 | Edit smear_parameters_PEF_SHS,smear_coef_PEF_SHS |
---|
367 | |
---|
368 | // output smeared intensity wave, dimensions are identical to experimental QSIG values |
---|
369 | // make extra copy of experimental q-values for easy plotting |
---|
370 | Duplicate/O $(str+"_q") smeared_PEF_SHS,smeared_qvals |
---|
371 | SetScale d,0,0,"1/cm",smeared_PEF_SHS |
---|
372 | |
---|
373 | Variable/G gs_PEF_SHS=0 |
---|
374 | gs_PEF_SHS := fSmearedProlate_SHS(smear_coef_PEF_SHS,smeared_PEF_SHS,smeared_qvals) //this wrapper fills the STRUCT |
---|
375 | |
---|
376 | Display smeared_PEF_SHS vs smeared_qvals |
---|
377 | ModifyGraph log=1,marker=29,msize=2,mode=4 |
---|
378 | Label bottom "q (A\\S-1\\M)" |
---|
379 | Label left "Intensity (cm\\S-1\\M)" |
---|
380 | |
---|
381 | AutoPositionWindow/M=1/R=$(WinName(0,1)) $WinName(0,2) |
---|
382 | |
---|
383 | SetDataFolder root: |
---|
384 | AddModelToStrings("SmearedProlate_SHS","smear_coef_PEF_SHS","smear_parameters_PEF_SHS","PEF_SHS") |
---|
385 | End |
---|
386 | |
---|
387 | |
---|
388 | Function Prolate_SHS(w,yw,xw) : FitFunc |
---|
389 | Wave w,yw,xw |
---|
390 | |
---|
391 | Variable inten,Ras,Rbs |
---|
392 | Ras = w[3] //Ras is the rotation axis |
---|
393 | Rbs = w[4] |
---|
394 | |
---|
395 | //setup form factor coefficient wave |
---|
396 | Make/O/D/N=9 form_PEF_SHS |
---|
397 | form_PEF_SHS[0] = 1 |
---|
398 | form_PEF_SHS[1] = w[1] |
---|
399 | form_PEF_SHS[2] = w[2] |
---|
400 | form_PEF_SHS[3] = w[3] |
---|
401 | form_PEF_SHS[4] = w[4] |
---|
402 | form_PEF_SHS[5] = w[5] |
---|
403 | form_PEF_SHS[6] = w[6] |
---|
404 | form_PEF_SHS[7] = w[7] |
---|
405 | form_PEF_SHS[8] = 0 |
---|
406 | |
---|
407 | //setup structure factor coefficient wave |
---|
408 | Make/O/D/N=4 struct_PEF_SHS |
---|
409 | struct_PEF_SHS[0] = 0.5*DiamEllip(Ras,Rbs) |
---|
410 | struct_PEF_SHS[1] = w[0] |
---|
411 | struct_PEF_SHS[2] = w[8] |
---|
412 | struct_PEF_SHS[3] = w[9] |
---|
413 | |
---|
414 | //calculate each and combine |
---|
415 | Duplicate/O xw temp_PEF_SHS_PQ,temp_PEF_SHS_SQ //make waves for the AAO |
---|
416 | ProlateForm(form_PEF_SHS,temp_PEF_SHS_PQ,xw) |
---|
417 | StickyHS_Struct(struct_PEF_SHS,temp_PEF_SHS_SQ,xw) |
---|
418 | yw = temp_PEF_SHS_PQ * temp_PEF_SHS_SQ |
---|
419 | yw *= w[0] |
---|
420 | yw += w[10] |
---|
421 | |
---|
422 | //cleanup waves |
---|
423 | // Killwaves/Z form_PEF_SHS,struct_PEF_SHS |
---|
424 | |
---|
425 | return (0) |
---|
426 | End |
---|
427 | |
---|
428 | |
---|
429 | // this is all there is to the smeared calculation! |
---|
430 | Function SmearedProlate_HS(s) :FitFunc |
---|
431 | Struct ResSmearAAOStruct &s |
---|
432 | |
---|
433 | // the name of your unsmeared model is the first argument |
---|
434 | Smear_Model_20(Prolate_HS,s.coefW,s.xW,s.yW,s.resW) |
---|
435 | |
---|
436 | return(0) |
---|
437 | End |
---|
438 | |
---|
439 | // this is all there is to the smeared calculation! |
---|
440 | Function SmearedProlate_SW(s) :FitFunc |
---|
441 | Struct ResSmearAAOStruct &s |
---|
442 | |
---|
443 | // the name of your unsmeared model is the first argument |
---|
444 | Smear_Model_20(Prolate_Sw,s.coefW,s.xW,s.yW,s.resW) |
---|
445 | |
---|
446 | return(0) |
---|
447 | End |
---|
448 | |
---|
449 | // this is all there is to the smeared calculation! |
---|
450 | Function SmearedProlate_SC(s) :FitFunc |
---|
451 | Struct ResSmearAAOStruct &s |
---|
452 | |
---|
453 | // the name of your unsmeared model is the first argument |
---|
454 | Smear_Model_20(Prolate_SC,s.coefW,s.xW,s.yW,s.resW) |
---|
455 | |
---|
456 | return(0) |
---|
457 | End |
---|
458 | |
---|
459 | // this is all there is to the smeared calculation! |
---|
460 | Function SmearedProlate_SHS(s) :FitFunc |
---|
461 | Struct ResSmearAAOStruct &s |
---|
462 | |
---|
463 | // the name of your unsmeared model is the first argument |
---|
464 | Smear_Model_20(Prolate_SHS,s.coefW,s.xW,s.yW,s.resW) |
---|
465 | |
---|
466 | return(0) |
---|
467 | End |
---|
468 | |
---|
469 | //wrapper to calculate the smeared model as an AAO-Struct |
---|
470 | // fills the struct and calls the ususal function with the STRUCT parameter |
---|
471 | // |
---|
472 | // used only for the dependency, not for fitting |
---|
473 | // |
---|
474 | Function fSmearedProlate_HS(coefW,yW,xW) |
---|
475 | Wave coefW,yW,xW |
---|
476 | |
---|
477 | String str = getWavesDataFolder(yW,0) |
---|
478 | String DF="root:"+str+":" |
---|
479 | |
---|
480 | WAVE resW = $(DF+str+"_res") |
---|
481 | |
---|
482 | STRUCT ResSmearAAOStruct fs |
---|
483 | WAVE fs.coefW = coefW |
---|
484 | WAVE fs.yW = yW |
---|
485 | WAVE fs.xW = xW |
---|
486 | WAVE fs.resW = resW |
---|
487 | |
---|
488 | Variable err |
---|
489 | err = SmearedProlate_HS(fs) |
---|
490 | |
---|
491 | return (0) |
---|
492 | End |
---|
493 | |
---|
494 | //wrapper to calculate the smeared model as an AAO-Struct |
---|
495 | // fills the struct and calls the ususal function with the STRUCT parameter |
---|
496 | // |
---|
497 | // used only for the dependency, not for fitting |
---|
498 | // |
---|
499 | Function fSmearedProlate_SW(coefW,yW,xW) |
---|
500 | Wave coefW,yW,xW |
---|
501 | |
---|
502 | String str = getWavesDataFolder(yW,0) |
---|
503 | String DF="root:"+str+":" |
---|
504 | |
---|
505 | WAVE resW = $(DF+str+"_res") |
---|
506 | |
---|
507 | STRUCT ResSmearAAOStruct fs |
---|
508 | WAVE fs.coefW = coefW |
---|
509 | WAVE fs.yW = yW |
---|
510 | WAVE fs.xW = xW |
---|
511 | WAVE fs.resW = resW |
---|
512 | |
---|
513 | Variable err |
---|
514 | err = SmearedProlate_SW(fs) |
---|
515 | |
---|
516 | return (0) |
---|
517 | End |
---|
518 | |
---|
519 | //wrapper to calculate the smeared model as an AAO-Struct |
---|
520 | // fills the struct and calls the ususal function with the STRUCT parameter |
---|
521 | // |
---|
522 | // used only for the dependency, not for fitting |
---|
523 | // |
---|
524 | Function fSmearedProlate_SC(coefW,yW,xW) |
---|
525 | Wave coefW,yW,xW |
---|
526 | |
---|
527 | String str = getWavesDataFolder(yW,0) |
---|
528 | String DF="root:"+str+":" |
---|
529 | |
---|
530 | WAVE resW = $(DF+str+"_res") |
---|
531 | |
---|
532 | STRUCT ResSmearAAOStruct fs |
---|
533 | WAVE fs.coefW = coefW |
---|
534 | WAVE fs.yW = yW |
---|
535 | WAVE fs.xW = xW |
---|
536 | WAVE fs.resW = resW |
---|
537 | |
---|
538 | Variable err |
---|
539 | err = SmearedProlate_SC(fs) |
---|
540 | |
---|
541 | return (0) |
---|
542 | End |
---|
543 | |
---|
544 | //wrapper to calculate the smeared model as an AAO-Struct |
---|
545 | // fills the struct and calls the ususal function with the STRUCT parameter |
---|
546 | // |
---|
547 | // used only for the dependency, not for fitting |
---|
548 | // |
---|
549 | Function fSmearedProlate_SHS(coefW,yW,xW) |
---|
550 | Wave coefW,yW,xW |
---|
551 | |
---|
552 | String str = getWavesDataFolder(yW,0) |
---|
553 | String DF="root:"+str+":" |
---|
554 | |
---|
555 | WAVE resW = $(DF+str+"_res") |
---|
556 | |
---|
557 | STRUCT ResSmearAAOStruct fs |
---|
558 | WAVE fs.coefW = coefW |
---|
559 | WAVE fs.yW = yW |
---|
560 | WAVE fs.xW = xW |
---|
561 | WAVE fs.resW = resW |
---|
562 | |
---|
563 | Variable err |
---|
564 | err = SmearedProlate_SHS(fs) |
---|
565 | |
---|
566 | return (0) |
---|
567 | End |
---|