Changeset 358 for sans/Dev/trunk/NCNR_User_Procedures/SANS/Analysis
- Timestamp:
- May 8, 2008 3:44:06 PM (15 years ago)
- Location:
- sans/Dev/trunk/NCNR_User_Procedures/SANS/Analysis
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/Dev/trunk/NCNR_User_Procedures/SANS/Analysis/Models/EffectiveDiameter_v40.ipf
r325 r358 54 54 b = hcyl/2 55 55 t1 = a*a*2*b/2 56 t2 = 1 + (b/a)*(1+a/b )*(1+pi*a/b/2)56 t2 = 1 + (b/a)*(1+a/b/2)*(1+pi*a/b/2) 57 57 ddd = 3*t1*t2 58 58 diam = ddd^(1/3) -
sans/Dev/trunk/NCNR_User_Procedures/SANS/Analysis/Models/NewModels_2006/LamellarPS_HG_v40.ipf
r253 r358 54 54 // 55 55 // constants 56 Variable/G root:gEuler = 0.5772156649 // Euler's constant57 Variable/G root:gDelQ = 0.0025 //[=] 1/A, q-resolution, default value56 // Variable/G root:gEuler = 0.5772156649 // Euler's constant 57 // Variable/G root:gDelQ = 0.0025 //[=] 1/A, q-resolution, default value 58 58 59 59 Make/O/D/n=(num) xwave_LamellarPS_HG, ywave_LamellarPS_HG … … 82 82 83 83 // - sets up a dependency to a wrapper, not the actual SmearedModelFunction 84 //Proc PlotSmeared_LamellarPS_HG(str)85 //String str86 //Prompt str,"Pick the data folder containing the resolution you want",popup,getAList(4)87 //88 //// if any of the resolution waves are missing => abort89 //if(ResolutionWavesMissingDF(str)) //updated to NOT use global strings (in GaussUtils)90 //Abort91 //endif92 //93 //SetDataFolder $("root:"+str)94 //95 //// constants84 Proc PlotSmearedLamellarPS_HG(str) 85 String str 86 Prompt str,"Pick the data folder containing the resolution you want",popup,getAList(4) 87 88 // if any of the resolution waves are missing => abort 89 if(ResolutionWavesMissingDF(str)) //updated to NOT use global strings (in GaussUtils) 90 Abort 91 endif 92 93 SetDataFolder $("root:"+str) 94 95 // constants 96 96 // Variable/G root:gEuler = 0.5772156649 // Euler's constant 97 97 // Variable/G root:gDelQ = 0.0025 //[=] 1/A, q-resolution, default value 98 // // Setup parameter table for model function 99 // Make/O/D smear_coef_LamellarPS_HG = {1,40,10,2,0.4e-6,2e-6,6e-6,30,0.001,0.001} //CH#4 100 // make/o/t smear_parameters_LamellarPS_HG = {"Scale","Lamellar spacing, D (A)","Bilayer Thick (delta) (A)","polydisp of Bilayer Thickness","contrast (A^-2)","# of Lamellar plates","Caille parameter","Incoherent Bgd (cm-1)"} 101 // Edit smear_parameters_LamellarPS_HG,smear_coef_LamellarPS_HG //display parameters in a table 102 // 103 // // output smeared intensity wave, dimensions are identical to experimental QSIG values 104 // // make extra copy of experimental q-values for easy plotting 105 // Duplicate/O $(str+"_q") smeared_LamellarPS_HG,smeared_qvals // 106 // SetScale d,0,0,"1/cm",smeared_LamellarPS_HG // 107 // 108 // Variable/G gs_LamellarPS_HG =0 109 // gs_LamellarPS_HG := fLamellarPS_HG_Smeared(smear_coef_LamellarPS_HG ,smeared_LamellarPS_HG ,smeared_qvals) //this wrapper fills the STRUCT 110 // 111 // Display smeared_LamellarPS_HG vs smeared_qvals // 112 // ModifyGraph log=1,marker=29,msize=2,mode=4 113 // Label bottom "q (\\S-1\\M)" 114 // Label left "I(q) (cm\\S-1\\M)" 115 // 116 // SetDataFolder root: 117 //End 98 // Setup parameter table for model function 99 Make/O/D smear_coef_LamellarPS_HG = {1,40,10,2,0.4e-6,2e-6,6e-6,30,0.001,0.001} //CH#4 100 make/o/t smear_parameters_LamellarPS_HG = {"Scale","Lamellar spacing, D (A)","Tail Thick (delT) (A)","HG Thick (delH) (A)","SLD of tails (A^-2)","SLD of HG (A^-2)","SLD of solvent (A^-2)","# of Lamellar plates","Caille parameter","Incoherent Bgd (cm-1)"} 101 Edit smear_parameters_LamellarPS_HG,smear_coef_LamellarPS_HG //display parameters in a table 102 103 // output smeared intensity wave, dimensions are identical to experimental QSIG values 104 // make extra copy of experimental q-values for easy plotting 105 Duplicate/O $(str+"_q") smeared_LamellarPS_HG,smeared_qvals // 106 SetScale d,0,0,"1/cm",smeared_LamellarPS_HG // 107 108 Variable/G gs_LamellarPS_HG =0 109 gs_LamellarPS_HG := fSmearedLamellarPS_HG(smear_coef_LamellarPS_HG ,smeared_LamellarPS_HG ,smeared_qvals) //this wrapper fills the STRUCT 110 111 Display smeared_LamellarPS_HG vs smeared_qvals // 112 ModifyGraph log=1,marker=29,msize=2,mode=4 113 Label bottom "q (\\S-1\\M)" 114 Label left "I(q) (cm\\S-1\\M)" 115 116 SetDataFolder root: 117 AddModelToStrings("SmearedLamellarPS_HG","smear_coef_LamellarPS_HG","LamellarPS_HG") 118 End 118 119 119 120 … … 164 165 // local variables 165 166 Variable inten, qval,Pq,Sq,ii,alpha,temp,t1,t2,t3,dQ,drh,drt 166 167 NVAR Euler = root:gEuler 168 NVAR dQDefault = root:gDelQ 167 Variable Euler = 0.5772156649 168 Variable dQDefault = 0 169 dQ = dQDefault 170 // NVAR Euler = root:gEuler 171 // NVAR dQDefault = root:gDelQ 169 172 // x is the q-value for the calculation 170 173 qval = x 171 174 //get the instrument resolution 172 SVAR/Z sigQ = gSig_Q173 SVAR/Z qStr = gQVals174 175 if(SVAR_Exists(sigQ) && SVAR_Exists(qStr))176 Wave/Z sigWave=$sigQ177 Wave/Z sig_Qwave = $qStr178 if(waveexists(sigWave)&&waveexists(sig_qwave))179 dQ = interp(qval, sig_Qwave, sigWave )180 else181 if(qval>0.01 && qval<0.012)182 print "using default resolution"183 endif184 dQ = dQDefault185 endif186 else187 dQ = dQDefault188 endif175 // SVAR/Z sigQ = gSig_Q 176 // SVAR/Z qStr = gQVals 177 // 178 // if(SVAR_Exists(sigQ) && SVAR_Exists(qStr)) 179 // Wave/Z sigWave=$sigQ 180 // Wave/Z sig_Qwave = $qStr 181 // if(waveexists(sigWave)&&waveexists(sig_qwave)) 182 // dQ = interp(qval, sig_Qwave, sigWave ) 183 // else 184 // if(qval>0.01 && qval<0.012) 185 // print "using default resolution" 186 // endif 187 // dQ = dQDefault 188 // endif 189 // else 190 // dQ = dQDefault 191 // endif 189 192 190 193 drh = SLD_H - SLD_S … … 227 230 // used only for the dependency, not for fitting 228 231 // 229 //Function fLamellarPS_HG_Smeared(coefW,yW,xW)230 //Wave coefW,yW,xW231 //232 //String str = getWavesDataFolder(yW,0)233 //String DF="root:"+str+":"234 //235 //WAVE resW = $(DF+str+"_res")236 //237 //STRUCT ResSmearAAOStruct fs238 //WAVE fs.coefW = coefW239 //WAVE fs.yW = yW240 //WAVE fs.xW = xW241 //WAVE fs.resW = resW242 //243 //Variable err244 // err = LamellarPS_HG_Smeared(fs)245 //246 //return (0)247 //End248 249 //// //the smeared model calculation250 //Function LamellarPS_HG_Smeared(s) :FitFunc251 //Struct ResSmearAAOStruct &s252 // 253 // //the name of your unsmeared model (AAO) is the first argument254 // Smear_Model_20(LamellarPS_HG,s.coefW,s.xW,s.yW,s.resW)255 // 256 //return(0)257 //End258 232 Function fSmearedLamellarPS_HG(coefW,yW,xW) 233 Wave coefW,yW,xW 234 235 String str = getWavesDataFolder(yW,0) 236 String DF="root:"+str+":" 237 238 WAVE resW = $(DF+str+"_res") 239 240 STRUCT ResSmearAAOStruct fs 241 WAVE fs.coefW = coefW 242 WAVE fs.yW = yW 243 WAVE fs.xW = xW 244 WAVE fs.resW = resW 245 246 Variable err 247 err = SmearedLamellarPS_HG(fs) 248 249 return (0) 250 End 251 252 ////the smeared model calculation 253 Function SmearedLamellarPS_HG(s) :FitFunc 254 Struct ResSmearAAOStruct &s 255 256 // the name of your unsmeared model (AAO) is the first argument 257 Smear_Model_76(LamellarPS_HG,s.coefW,s.xW,s.yW,s.resW) 258 259 return(0) 260 End 261 -
sans/Dev/trunk/NCNR_User_Procedures/SANS/Analysis/Models/NewModels_2006/LamellarPS_v40.ipf
r253 r358 54 54 // 55 55 // constants 56 Variable/G root:gEuler = 0.5772156649 // Euler's constant57 Variable/G root:gDelQ = 0.0025 //[=] 1/A, q-resolution, default value56 // Variable/G root:gEuler = 0.5772156649 // Euler's constant 57 // Variable/G root:gDelQ = 0.0025 //[=] 1/A, q-resolution, default value 58 58 59 59 Make/O/D/n=(num) xwave_LamellarPS, ywave_LamellarPS … … 82 82 83 83 // - sets up a dependency to a wrapper, not the actual SmearedModelFunction 84 //Proc PlotSmeared_LamellarPS(str)85 //String str86 //Prompt str,"Pick the data folder containing the resolution you want",popup,getAList(4)87 //88 //// if any of the resolution waves are missing => abort89 //if(ResolutionWavesMissingDF(str)) //updated to NOT use global strings (in GaussUtils)90 //Abort91 //endif92 //93 //SetDataFolder $("root:"+str)94 //95 //// constants84 Proc PlotSmearedLamellarPS(str) 85 String str 86 Prompt str,"Pick the data folder containing the resolution you want",popup,getAList(4) 87 88 // if any of the resolution waves are missing => abort 89 if(ResolutionWavesMissingDF(str)) //updated to NOT use global strings (in GaussUtils) 90 Abort 91 endif 92 93 SetDataFolder $("root:"+str) 94 95 // constants 96 96 // Variable/G root:gEuler = 0.5772156649 // Euler's constant 97 97 // Variable/G root:gDelQ = 0.0025 //[=] 1/A, q-resolution, default value 98 // // Setup parameter table for model function 99 // Make/O/D smear_coef_LamellarPS = {1,400,30,0.15,6e-6,20,0.1,0} //CH#4 100 // make/o/t smear_parameters_LamellarPS = {"Scale","Lamellar spacing, D (A)","Bilayer Thick (delta) (A)","polydisp of Bilayer Thickness","contrast (A^-2)","# of Lamellar plates","Caille parameter","Incoherent Bgd (cm-1)"} 101 // Edit smear_parameters_LamellarPS,smear_coef_LamellarPS //display parameters in a table 102 // 103 // // output smeared intensity wave, dimensions are identical to experimental QSIG values 104 // // make extra copy of experimental q-values for easy plotting 105 // Duplicate/O $(str+"_q") smeared_LamellarPS,smeared_qvals // 106 // SetScale d,0,0,"1/cm",smeared_LamellarPS // 107 // 108 // Variable/G gs_LamellarPS=0 109 // gs_LamellarPS := fLamellarPS_Smeared(smear_coef_LamellarPS,smeared_LamellarPS,smeared_qvals) //this wrapper fills the STRUCT 110 // 111 // Display smeared_LamellarPS vs smeared_qvals // 112 // ModifyGraph log=1,marker=29,msize=2,mode=4 113 // Label bottom "q (\\S-1\\M)" 114 // Label left "I(q) (cm\\S-1\\M)" 115 // 116 // SetDataFolder root: 117 //End 118 119 120 98 // Setup parameter table for model function 99 Make/O/D smear_coef_LamellarPS = {1,400,30,0.15,1e-6,6.3e-6,20,0.1,0} //CH#4 100 make/o/t smear_parameters_LamellarPS = {"Scale","Lamellar spacing, D (A)","Bilayer Thick (delta) (A)","polydisp of Bilayer Thickness","SLD bilayer (A^-2)","SLD solvent (A^-2)","# of Lamellar plates","Caille parameter","Incoherent Bgd (cm-1)"} 101 Edit smear_parameters_LamellarPS,smear_coef_LamellarPS //display parameters in a table 102 103 // output smeared intensity wave, dimensions are identical to experimental QSIG values 104 // make extra copy of experimental q-values for easy plotting 105 Duplicate/O $(str+"_q") smeared_LamellarPS,smeared_qvals // 106 SetScale d,0,0,"1/cm",smeared_LamellarPS // 107 108 Variable/G gs_LamellarPS=0 109 gs_LamellarPS := fSmearedLamellarPS(smear_coef_LamellarPS,smeared_LamellarPS,smeared_qvals) //this wrapper fills the STRUCT 110 111 Display smeared_LamellarPS vs smeared_qvals // 112 ModifyGraph log=1,marker=29,msize=2,mode=4 113 Label bottom "q (\\S-1\\M)" 114 Label left "I(q) (cm\\S-1\\M)" 115 116 SetDataFolder root: 117 AddModelToStrings("SmearedLamellarPS","smear_coef_LamellarPS","LamellarPS") 118 End 121 119 122 120 … … 164 162 // local variables 165 163 Variable inten, qval,Pq,Sq,ii,alpha,temp,t1,t2,t3,dQ 166 167 NVAR Euler = root:gEuler 168 NVAR dQDefault = root:gDelQ 164 Variable Euler = 0.5772156649 165 Variable dQDefault = 0 166 dQ = dqDefault 167 168 // NVAR Euler = root:gEuler 169 // NVAR dQDefault = root:gDelQ 169 170 // x is the q-value for the calculation 170 171 qval = x 171 172 //get the instrument resolution 172 SVAR/Z sigQ = gSig_Q173 SVAR/Z qStr = gQVals174 175 if(SVAR_Exists(sigQ) && SVAR_Exists(qStr))176 Wave/Z sigWave=$sigQ177 Wave/Z sig_Qwave = $qStr178 if(waveexists(sigWave)&&waveexists(sig_qwave))179 dQ = interp(qval, sig_Qwave, sigWave )180 else181 // if(qval>0.01 && qval<0.012)182 // print "using default resolution"183 // endif184 dQ = dQDefault185 endif186 else187 dQ = dQDefault188 endif173 // SVAR/Z sigQ = gSig_Q 174 // SVAR/Z qStr = gQVals 175 // 176 // if(SVAR_Exists(sigQ) && SVAR_Exists(qStr)) 177 // Wave/Z sigWave=$sigQ 178 // Wave/Z sig_Qwave = $qStr 179 // if(waveexists(sigWave)&&waveexists(sig_qwave)) 180 // dQ = interp(qval, sig_Qwave, sigWave ) 181 // else 182 //// if(qval>0.01 && qval<0.012) 183 //// print "using default resolution" 184 //// endif 185 // dQ = dQDefault 186 // endif 187 // else 188 // dQ = dQDefault 189 // endif 189 190 190 191 Pq = 2*contr^2/qval/qval*(1-cos(qval*del)*exp(-0.5*qval^2*sig^2)) … … 221 222 // used only for the dependency, not for fitting 222 223 // 223 //Function fLamellarPS_Smeared(coefW,yW,xW)224 //Wave coefW,yW,xW225 //226 //String str = getWavesDataFolder(yW,0)227 //String DF="root:"+str+":"228 //229 //WAVE resW = $(DF+str+"_res")230 //231 //STRUCT ResSmearAAOStruct fs232 //WAVE fs.coefW = coefW233 //WAVE fs.yW = yW234 //WAVE fs.xW = xW235 //WAVE fs.resW = resW236 //237 //Variable err238 // err = LamellarPS_Smeared(fs)239 //240 //return (0)241 //End224 Function fSmearedLamellarPS(coefW,yW,xW) 225 Wave coefW,yW,xW 226 227 String str = getWavesDataFolder(yW,0) 228 String DF="root:"+str+":" 229 230 WAVE resW = $(DF+str+"_res") 231 232 STRUCT ResSmearAAOStruct fs 233 WAVE fs.coefW = coefW 234 WAVE fs.yW = yW 235 WAVE fs.xW = xW 236 WAVE fs.resW = resW 237 238 Variable err 239 err = SmearedLamellarPS(fs) 240 241 return (0) 242 End 242 243 243 244 //the smeared model calculation 244 //Function LamellarPS_Smeared(s) :FitFunc245 //Struct ResSmearAAOStruct &s246 // 247 // //the name of your unsmeared model (AAO) is the first argument248 // Smear_Model_20(LamellarPS,s.coefW,s.xW,s.yW,s.resW)249 // 250 //return(0)251 //End245 Function SmearedLamellarPS(s) :FitFunc 246 Struct ResSmearAAOStruct &s 247 248 // the name of your unsmeared model (AAO) is the first argument 249 Smear_Model_76(LamellarPS,s.coefW,s.xW,s.yW,s.resW) 250 251 return(0) 252 End 252 253 //// -
sans/Dev/trunk/NCNR_User_Procedures/SANS/Analysis/Models_v3.00/EffectiveDiameter.ipf
r42 r358 53 53 b = hcyl/2 54 54 t1 = a*a*2*b/2 55 t2 = 1 + (b/a)*(1+a/b )*(1+pi*a/b/2)55 t2 = 1 + (b/a)*(1+a/b/2)*(1+pi*a/b/2) 56 56 ddd = 3*t1*t2 57 57 diam = ddd^(1/3)
Note: See TracChangeset
for help on using the changeset viewer.