Changeset 127 for sans/Analysis/branches/ajj_23APR07/IGOR_Package_Files/Put in User Procedures/SANS_Models_v3.00/OblateForm.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/OblateForm.ipf
r42 r127 1 1 #pragma rtGlobals=1 // Use modern global access method. 2 #pragma IgorVersion = 6.0 2 3 3 4 //////////////////////////////////////////////// … … 22 23 make/o/t parameters_oef = {"scale","major core (A)","minor core (A)","major shell (A)","minor shell (A)","Contrast (core-shell) (A-2)","Constrast (shell-solvent) (A-2)","bkg (cm-1)"} 23 24 Edit parameters_oef,coef_oef 24 ywave_oef := OblateForm(coef_oef,xwave_oef) 25 Variable/G root:g_oef 26 g_oef := OblateForm(coef_oef,ywave_oef,xwave_oef) 27 // ywave_oef := OblateForm(coef_oef,xwave_oef) 25 28 Display ywave_oef vs xwave_oef 26 29 ModifyGraph log=1,marker=29,msize=2,mode=4 … … 29 32 AutoPositionWindow/M=1/R=$(WinName(0,1)) $WinName(0,2) 30 33 End 34 31 35 /////////////////////////////////////////////////////////// 32 33 Proc PlotSmearedOblateForm( ) //**** name of your function34 //no input parameters necessary, it MUST use the experimental q-values35 // from the experimental data read in from an AVE/QSIG data file36 37 // if no gQvals wave, data must not have been loaded=> abort38 if(ResolutionWavesMissing ())36 // - sets up a dependency to a wrapper, not the actual SmearedModelFunction 37 Proc PlotSmearedOblateForm(str) 38 String str 39 Prompt str,"Pick the data folder conatining the resolution you want",popup,getAList(4) 40 41 // if any of the resolution waves are missing => abort 42 if(ResolutionWavesMissingDF(str)) //updated to NOT use global strings (in GaussUtils) 39 43 Abort 40 44 endif 45 46 SetDataFolder $("root:"+str) 41 47 42 48 // Setup parameter table for model function … … 47 53 // output smeared intensity wave, dimensions are identical to experimental QSIG values 48 54 // make extra copy of experimental q-values for easy plotting 49 Duplicate/O $gQvals smeared_oef,smeared_qvals 50 SetScale d,0,0,"1/cm",smeared_oef 51 52 smeared_oef := SmearedOblateForm(smear_coef_oef,$gQvals) 55 Duplicate/O $(str+"_q") smeared_oef,smeared_qvals 56 SetScale d,0,0,"1/cm",smeared_oef 57 58 Variable/G gs_oef=0 59 gs_oef := fSmearedOblateForm(smear_coef_oef,smeared_oef,smeared_qvals) //this wrapper fills the STRUCT 60 53 61 Display smeared_oef vs smeared_qvals 54 62 ModifyGraph log=1,marker=29,msize=2,mode=4 … … 56 64 Label left "Intensity (cm\\S-1\\M)" 57 65 AutoPositionWindow/M=1/R=$(WinName(0,1)) $WinName(0,2) 66 67 SetDataFolder root: 68 End 69 70 71 //AAO version 72 Function OblateForm(cw,yw,xw) : FitFunc 73 Wave cw,yw,xw 74 75 #if exists("OblateFormX") 76 yw = OblateFormX(cw,xw) 77 #else 78 yw = fOblateForm(cw,xw) 79 #endif 80 return(0) 58 81 End 59 82 … … 61 84 // unsmeared model calculation 62 85 /////////////////////////// 63 Function OblateForm(w,x) : FitFunc86 Function fOblateForm(w,x) : FitFunc 64 87 Wave w 65 88 Variable x … … 199 222 200 223 // this is all there is to the smeared calculation! 201 Function SmearedOblateForm(w,x) :FitFunc 202 Wave w 203 Variable x 204 205 Variable ans 206 SVAR sq = gSig_Q 207 SVAR qb = gQ_bar 208 SVAR sh = gShadow 209 SVAR gQ = gQVals 210 211 //the name of your unsmeared model is the first argument 212 ans = Smear_Model_20(OblateForm,$sq,$qb,$sh,$gQ,w,x) 213 214 return(ans) 215 End 224 Function SmearedOblateForm(s) :FitFunc 225 Struct ResSmearAAOStruct &s 226 227 ////the name of your unsmeared model is the first argument 228 s.yW = Smear_Model_20(OblateForm,s.coefW,s.xW,s.resW) 229 230 return(0) 231 End 232 233 //wrapper to calculate the smeared model as an AAO-Struct 234 // fills the struct and calls the ususal function with the STRUCT parameter 235 // 236 // used only for the dependency, not for fitting 237 // 238 Function fSmearedOblateForm(coefW,yW,xW) 239 Wave coefW,yW,xW 240 241 String str = getWavesDataFolder(yW,0) 242 String DF="root:"+str+":" 243 244 WAVE resW = $(DF+str+"_res") 245 246 STRUCT ResSmearAAOStruct fs 247 WAVE fs.coefW = coefW 248 WAVE fs.yW = yW 249 WAVE fs.xW = xW 250 WAVE fs.resW = resW 251 252 Variable err 253 err = SmearedOblateForm(fs) 254 255 return (0) 256 End
Note: See TracChangeset
for help on using the changeset viewer.