Changeset 127 for sans/Analysis/branches/ajj_23APR07/IGOR_Package_Files/Put in User Procedures/SANS_Models_v3.00/CoreShellCylinder.ipf
- Timestamp:
- Jul 24, 2007 3:23:44 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/Analysis/branches/ajj_23APR07/IGOR_Package_Files/Put in User Procedures/SANS_Models_v3.00/CoreShellCylinder.ipf
r42 r127 1 1 #pragma rtGlobals=1 // Use modern global access method. 2 #pragma IgorVersion = 6.0 2 3 3 4 //////////////////////////////////////////////// … … 24 25 make/o/t parameters_cscyl = {"scale","core radius (A)","shell THICKNESS (A)","CORE length (A)","SLD core (A^-2)","SLD shell (A^-2)","SLD solvent (A^-2)","incoh. bkg (cm^-1)"} 25 26 Edit parameters_cscyl,coef_cscyl 26 ywave_cscyl := CoreShellCylinderForm(coef_cscyl,xwave_cscyl) 27 Variable/G root:g_cscyl 28 g_cscyl := CoreShellCylinder(coef_cscyl,ywave_cscyl,xwave_cscyl) 29 // ywave_cscyl := CoreShellCylinder(coef_cscyl,xwave_cscyl) 27 30 Display ywave_cscyl vs xwave_cscyl 28 31 ModifyGraph log=1,marker=29,msize=2,mode=4 … … 31 34 AutoPositionWindow/M=1/R=$(WinName(0,1)) $WinName(0,2) 32 35 End 36 33 37 /////////////////////////////////////////////////////////// 34 35 Proc PlotSmearedCSCylinderForm( )36 //no input parameters necessary, it MUST use the experimental q-values37 // from the experimental data read in from an AVE/QSIG data file38 39 // if no gQvals wave, data must not have been loaded=> abort40 if(ResolutionWavesMissing ())38 // - sets up a dependency to a wrapper, not the actual SmearedModelFunction 39 Proc PlotSmearedCSCylinderForm(str) 40 String str 41 Prompt str,"Pick the data folder conatining the resolution you want",popup,getAList(4) 42 43 // if any of the resolution waves are missing => abort 44 if(ResolutionWavesMissingDF(str)) //updated to NOT use global strings (in GaussUtils) 41 45 Abort 42 46 endif 47 48 SetDataFolder $("root:"+str) 43 49 44 50 // Setup parameter table for model function … … 49 55 // output smeared intensity wave, dimensions are identical to experimental QSIG values 50 56 // make extra copy of experimental q-values for easy plotting 51 Duplicate/O $ gQvalssmeared_cscyl,smeared_qvals57 Duplicate/O $(str+"_q") smeared_cscyl,smeared_qvals 52 58 SetScale d,0,0,"1/cm",smeared_cscyl 53 54 smeared_cscyl := SmearedCoreShellCylinderForm(smear_coef_cscyl,$gQvals) 59 60 Variable/G gs_cscyl=0 61 gs_cscyl := fSmearedCoreShellCylinderForm(smear_coef_cscyl,smeared_cscyl,smeared_qvals) //this wrapper fills the STRUCT 62 55 63 Display smeared_cscyl vs smeared_qvals 56 64 ModifyGraph log=1,marker=29,msize=2,mode=4 … … 58 66 Label left "Intensity (cm\\S-1\\M)" 59 67 AutoPositionWindow/M=1/R=$(WinName(0,1)) $WinName(0,2) 68 69 SetDataFolder root: 70 End 71 72 73 //AAO version 74 Function CoreShellCylinder(cw,yw,xw) : FitFunc 75 Wave cw,yw,xw 76 77 #if exists("CoreShellCylinderX") 78 yw = CoreShellCylinderX(cw,xw) 79 #else 80 yw = fCoreShellCylinder(cw,xw) 81 #endif 82 return(0) 60 83 End 61 84 … … 63 86 // unsmeared model calculation 64 87 /////////////////////////// 65 Function CoreShellCylinderForm(w,x) : FitFunc88 Function fCoreShellCylinder(w,x) : FitFunc 66 89 Wave w 67 90 Variable x … … 200 223 201 224 // this is all there is to the smeared calculation! 202 Function SmearedCoreShellCylinderForm(w,x) :FitFunc 203 Wave w 204 Variable x 205 206 Variable ans 207 SVAR sq = gSig_Q 208 SVAR qb = gQ_bar 209 SVAR sh = gShadow 210 SVAR gQ = gQVals 211 212 //the name of your unsmeared model is the first argument 213 ans = Smear_Model_20(CoreShellCylinderForm,$sq,$qb,$sh,$gQ,w,x) 214 215 return(ans) 216 End 217 225 Function SmearedCoreShellCylinderForm(s) :FitFunc 226 Struct ResSmearAAOStruct &s 227 228 ////the name of your unsmeared model is the first argument 229 s.yW = Smear_Model_20(CoreShellCylinder,s.coefW,s.xW,s.resW) 230 231 return(0) 232 End 233 234 235 //wrapper to calculate the smeared model as an AAO-Struct 236 // fills the struct and calls the ususal function with the STRUCT parameter 237 // 238 // used only for the dependency, not for fitting 239 // 240 Function fSmearedCoreShellCylinderForm(coefW,yW,xW) 241 Wave coefW,yW,xW 242 243 String str = getWavesDataFolder(yW,0) 244 String DF="root:"+str+":" 245 246 WAVE resW = $(DF+str+"_res") 247 248 STRUCT ResSmearAAOStruct fs 249 WAVE fs.coefW = coefW 250 WAVE fs.yW = yW 251 WAVE fs.xW = xW 252 WAVE fs.resW = resW 253 254 Variable err 255 err = SmearedCoreShellCylinderForm(fs) 256 257 return (0) 258 End
Note: See TracChangeset
for help on using the changeset viewer.