Changeset 127 for sans/Analysis/branches/ajj_23APR07/IGOR_Package_Files/Put in User Procedures/SANS_Models_v3.00/UniformEllipsoid.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/UniformEllipsoid.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_eor = {"scale","R a (rotation axis) (A)","R b (A)","Contrast (A^-2)","incoh. bkg (cm^-1)"} 22 23 Edit parameters_eor,coef_eor 23 ywave_eor := EllipsoidForm(coef_eor,xwave_eor) 24 Variable/G root:g_eor 25 g_eor := EllipsoidForm(coef_eor,ywave_eor,xwave_eor) 26 // ywave_eor := EllipsoidForm(coef_eor,xwave_eor) 24 27 Display ywave_eor vs xwave_eor 25 28 ModifyGraph log=1,marker=29,msize=2,mode=4 … … 30 33 /////////////////////////////////////////////////////////// 31 34 32 Proc PlotSmearedEllipsoidForm() 33 //no input parameters necessary, it MUST use the experimental q-values 34 // from the experimental data read in from an AVE/QSIG data file 35 // - sets up a dependency to a wrapper, not the actual SmearedModelFunction 36 Proc PlotSmearedEllipsoidForm(str) 37 String str 38 Prompt str,"Pick the data folder conatining the resolution you want",popup,getAList(4) 35 39 36 40 // if no gQvals wave, data must not have been loaded => abort 37 if(ResolutionWavesMissing ())41 if(ResolutionWavesMissingDF(str)) 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_eor,smeared_qvals54 Duplicate/O $(str+"_q") smeared_eor,smeared_qvals 49 55 SetScale d,0,0,"1/cm",smeared_eor 50 56 51 smeared_eor := SmearedEllipsoidForm(smear_coef_eor,$gQvals) 57 Variable/G root:gs_eor=0 58 gs_eor := fSmearedEllipsoidForm(smear_coef_eor,smeared_eor,smeared_qvals) 59 52 60 Display smeared_eor 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) 65 66 SetDataFolder root: 67 End 68 69 //AAO version 70 Function EllipsoidForm(cw,yw,xw) : FitFunc 71 Wave cw,yw,xw 72 73 #if exists("EllipsoidFormX") 74 yw = EllipsoidFormX(cw,yw) 75 #else 76 yw = fEllipsoidForm(cw,xw) 77 #endif 78 return(0) 57 79 End 58 80 … … 60 82 // unsmeared model calculation 61 83 /////////////////////////// 62 Function EllipsoidForm(w,x) : FitFunc84 Function fEllipsoidForm(w,x) : FitFunc 63 85 Wave w 64 86 Variable x … … 174 196 175 197 // this is all there is to the smeared calculation! 176 Function SmearedEllipsoidForm(w,x) :FitFunc 177 Wave w 178 Variable x 179 180 Variable ans 181 SVAR sq = gSig_Q 182 SVAR qb = gQ_bar 183 SVAR sh = gShadow 184 SVAR gQ = gQVals 198 Function SmearedEllipsoidForm(s) :FitFunc 199 Struct ResSmearAAOStruct &s 185 200 186 201 //the name of your unsmeared model is the first argument 187 ans = Smear_Model_20(EllipsoidForm,$sq,$qb,$sh,$gQ,w,x) 188 189 return(ans) 190 End 202 s.yW = Smear_Model_20(EllipsoidForm,s.coefW,s.xW,s.resW) 203 204 return(0) 205 End 206 207 //wrapper to calculate the smeared model as an AAO-Struct 208 // fills the struct and calls the ususal function with the STRUCT parameter 209 // 210 // used only for the dependency, not for fitting 211 // 212 Function fSmearedEllipsoidForm(coefW,yW,xW) 213 Wave coefW,yW,xW 214 215 String str = getWavesDataFolder(yW,0) 216 String DF="root:"+str+":" 217 218 WAVE resW = $(DF+str+"_res") 219 220 STRUCT ResSmearAAOStruct fs 221 WAVE fs.coefW = coefW 222 WAVE fs.yW = yW 223 WAVE fs.xW = xW 224 WAVE fs.resW = resW 225 226 Variable err 227 err = SmearedEllipsoidForm(fs) 228 229 return (0) 230 End
Note: See TracChangeset
for help on using the changeset viewer.