Changeset 127 for sans/Analysis/branches/ajj_23APR07/IGOR_Package_Files/Put in User Procedures/SANS_Models_v3.00/CoreShell.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/CoreShell.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_css = {"scale","core radius (A)","shell thickness (A)","Core SLD (A-2)","Shell SLD (A-2)","Solvent SLD (A-2)","bkg (cm-1)"} 23 24 Edit parameters_css,coef_css 24 ywave_css := CoreShellForm(coef_css,xwave_css) 25 Variable/G root:g_css 26 g_css := CoreShellForm(coef_css,ywave_css,xwave_css) 27 // ywave_css := CoreShellForm(coef_css,xwave_css) 25 28 Display ywave_css vs xwave_css 26 29 ModifyGraph log=1,marker=29,msize=2,mode=4 … … 31 34 32 35 /////////////////////////////////////////////////////////// 33 34 Proc PlotSmearedCoreShellSphere( ) //**** name of your function35 //no input parameters necessary, it MUST use the experimental q-values36 // from the experimental data read in from an AVE/QSIG data file36 // - sets up a dependency to a wrapper, not the actual SmearedModelFunction 37 Proc PlotSmearedCoreShellSphere(str) 38 String str 39 Prompt str,"Pick the data folder conatining the resolution you want",popup,getAList(4) 37 40 38 // if no gQvals wave, data must not have been loaded=> abort39 if(ResolutionWavesMissing ())41 // if any of the resolution waves are missing => abort 42 if(ResolutionWavesMissingDF(str)) //updated to NOT use global strings (in GaussUtils) 40 43 Abort 41 44 endif 45 46 SetDataFolder $("root:"+str) 42 47 43 48 // Setup parameter table for model function … … 49 54 // make extra copy of experimental q-values for easy plotting 50 55 51 Duplicate/O $ gQvalssmeared_css,smeared_qvals56 Duplicate/O $(str+"_q") smeared_css,smeared_qvals 52 57 SetScale d,0,0,"1/cm",smeared_css 53 54 smeared_css := SmearedCoreShellForm(smear_coef_css,$gQvals) 58 59 Variable/G gs_css=0 60 gs_css := fSmearedCoreShellForm(smear_coef_css,smeared_css,smeared_qvals) //this wrapper fills the STRUCT 61 55 62 Display smeared_css vs smeared_qvals 56 63 ModifyGraph log=1,marker=29,msize=2,mode=4 … … 58 65 Label left "Intensity (cm\\S-1\\M)" 59 66 AutoPositionWindow/M=1/R=$(WinName(0,1)) $WinName(0,2) 67 68 SetDataFolder root: 69 End 70 71 72 //AAO version 73 Function CoreShellForm(cw,yw,xw) : FitFunc 74 Wave cw,yw,xw 75 76 #if exists("CoreShellFormX") 77 yw = CoreShellFormX(cw,xw) 78 #else 79 yw = fCoreShellForm(cw,xw) 80 #endif 81 return(0) 60 82 End 61 83 … … 63 85 // unsmeared model calculation 64 86 /////////////////////////// 65 Function CoreShellForm(w,x) : FitFunc87 Function fCoreShellForm(w,x) : FitFunc 66 88 Wave w 67 89 Variable x … … 117 139 118 140 // this is all there is to the smeared calculation! 119 Function SmearedCoreShellForm(w,x) :FitFunc 120 Wave w 121 Variable x 141 Function SmearedCoreShellForm(s) :FitFunc 142 Struct ResSmearAAOStruct &s 143 144 ////the name of your unsmeared model is the first argument 145 s.yW = Smear_Model_20(CoreShellForm,s.coefW,s.xW,s.resW) 146 147 return(0) 148 End 149 150 //wrapper to calculate the smeared model as an AAO-Struct 151 // fills the struct and calls the ususal function with the STRUCT parameter 152 // 153 // used only for the dependency, not for fitting 154 // 155 Function fSmearedCoreShellForm(coefW,yW,xW) 156 Wave coefW,yW,xW 122 157 123 Variable ans 124 SVAR sq = gSig_Q 125 SVAR qb = gQ_bar 126 SVAR sh = gShadow 127 SVAR gQ = gQVals 158 String str = getWavesDataFolder(yW,0) 159 String DF="root:"+str+":" 128 160 129 //the name of your unsmeared model is the first argument 130 ans = Smear_Model_20(CoreShellForm,$sq,$qb,$sh,$gQ,w,x) 131 132 return(ans) 161 WAVE resW = $(DF+str+"_res") 162 163 STRUCT ResSmearAAOStruct fs 164 WAVE fs.coefW = coefW 165 WAVE fs.yW = yW 166 WAVE fs.xW = xW 167 WAVE fs.resW = resW 168 169 Variable err 170 err = SmearedCoreShellForm(fs) 171 172 return (0) 133 173 End
Note: See TracChangeset
for help on using the changeset viewer.