Changeset 127 for sans/Analysis/branches/ajj_23APR07/IGOR_Package_Files/Put in User Procedures/SANS_Models_v3.00/HollowCylinders.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/HollowCylinders.ipf
r42 r127 1 1 #pragma rtGlobals=1 // Use modern global access method. 2 #pragma IgorVersion = 6.0 2 3 3 4 //////////////////////////////////////////////// … … 21 22 make/o/t parameters_Hcyl = {"scale","core radius (A)","shell radius (A)","length (A)","contrast (A^-2)","incoh. bkg (cm^-1)"} 22 23 Edit parameters_Hcyl,coef_Hcyl 23 ywave_Hcyl := HollowCylinderForm(coef_Hcyl,xwave_Hcyl) 24 Variable/G root:g_hcyl 25 g_Hcyl := HollowCylinder(coef_Hcyl,ywave_Hcyl,xwave_Hcyl) 26 // ywave_Hcyl := HollowCylinder(coef_Hcyl,xwave_Hcyl) 24 27 Display ywave_Hcyl vs xwave_Hcyl 25 28 ModifyGraph log=1,marker=29,msize=2,mode=4 … … 28 31 AutoPositionWindow/M=1/R=$(WinName(0,1)) $WinName(0,2) 29 32 End 33 30 34 /////////////////////////////////////////////////////////// 31 32 Proc PlotSmearedHollowCylinderForm( )33 //no input parameters necessary, it MUST use the experimental q-values34 // from the experimental data read in from an AVE/QSIG data file35 36 // if no gQvals wave, data must not have been loaded=> abort37 if(ResolutionWavesMissing ())35 // - sets up a dependency to a wrapper, not the actual SmearedModelFunction 36 Proc PlotSmearedHollowCylinderForm(str) 37 String str 38 Prompt str,"Pick the data folder conatining 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) 38 42 Abort 39 43 endif 44 45 SetDataFolder $("root:"+str) 40 46 41 47 // Setup parameter table for model function … … 46 52 // output smeared intensity wave, dimensions are identical to experimental QSIG values 47 53 // make extra copy of experimental q-values for easy plotting 48 Duplicate/O $ gQvalssmeared_Hcyl,smeared_qvals54 Duplicate/O $(str+"_q") smeared_Hcyl,smeared_qvals 49 55 SetScale d,0,0,"1/cm",smeared_Hcyl 50 51 smeared_Hcyl := SmearedHollowCylinderForm(smear_coef_Hcyl,$gQvals) 56 57 Variable/G gs_Hcyl=0 58 gs_Hcyl := fSmearedHollowCylinder(smear_coef_Hcyl,smeared_Hcyl,smeared_qvals) //this wrapper fills the STRUCT 59 52 60 Display smeared_Hcyl vs smeared_qvals 53 61 ModifyGraph log=1,marker=29,msize=2,mode=4 … … 55 63 Label left "Intensity (cm\\S-1\\M)" 56 64 AutoPositionWindow/M=1/R=$(WinName(0,1)) $WinName(0,2) 57 End 58 65 66 SetDataFolder root: 67 End 68 69 70 //AAO version 71 Function HollowCylinder(cw,yw,xw) : FitFunc 72 Wave cw,yw,xw 73 74 #if exists("HollowCylinderX") 75 yw = HollowCylinderX(cw,xw) 76 #else 77 yw = fHollowCylinder(cw,xw) 78 #endif 79 return(0) 80 End 59 81 /////////////////////////////////////////////////////////////// 60 82 // unsmeared model calculation 61 83 /////////////////////////// 62 Function HollowCylinderForm(w,x) : FitFunc84 Function fHollowCylinder(w,x) : FitFunc 63 85 Wave w 64 86 Variable x … … 186 208 187 209 // this is all there is to the smeared calculation! 188 Function SmearedHollowCylinderForm(w,x) :FitFunc 189 Wave w 190 Variable x 191 192 Variable ans 193 SVAR sq = gSig_Q 194 SVAR qb = gQ_bar 195 SVAR sh = gShadow 196 SVAR gQ = gQVals 197 198 //the name of your unsmeared model is the first argument 199 ans = Smear_Model_20(HollowCylinderForm,$sq,$qb,$sh,$gQ,w,x) 200 201 return(ans) 202 End 210 Function SmearedHollowCylinder(s) :FitFunc 211 Struct ResSmearAAOStruct &s 212 213 ////the name of your unsmeared model is the first argument 214 s.yW = Smear_Model_20(HollowCylinder,s.coefW,s.xW,s.resW) 215 216 return(0) 217 End 218 219 //wrapper to calculate the smeared model as an AAO-Struct 220 // fills the struct and calls the ususal function with the STRUCT parameter 221 // 222 // used only for the dependency, not for fitting 223 // 224 Function fSmearedHollowCylinder(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 = SmearedHollowCylinder(fs) 240 241 return (0) 242 End
Note: See TracChangeset
for help on using the changeset viewer.