Changeset 128 for sans/Analysis/branches/ajj_23APR07/IGOR_Package_Files/Put in User Procedures/SANS_Models_v3.00/NewModels_2006/LamellarFF_HG.ipf
- Timestamp:
- Jul 25, 2007 3:07:20 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/NewModels_2006/LamellarFF_HG.ipf
r127 r128 35 35 Edit parameters_LamellarFF_HG, coef_LamellarFF_HG 36 36 ModifyTable width(parameters_LamellarFF_HG)=160 37 ywave_LamellarFF_HG := LamellarFF_HG(coef_LamellarFF_HG, xwave_LamellarFF_HG) 37 38 Variable/G root:g_LamellarFF_HG 39 g_LamellarFF_HG := LamellarFF_HG(coef_LamellarFF_HG, ywave_LamellarFF_HG, xwave_LamellarFF_HG) 38 40 Display ywave_LamellarFF_HG vs xwave_LamellarFF_HG 39 41 ModifyGraph marker=29, msize=2, mode=4 … … 45 47 End 46 48 47 // 48 //this macro sets up all the necessary parameters and waves that are 49 //needed to calculate the smeared model function. 50 // 51 //no input parameters are necessary, it MUST use the experimental q-values 52 // from the experimental data read in from an AVE/QSIG data file 53 //////////////////////////////////////////////////// 54 Proc PlotSmeared_LamellarFF_HG() //Lamellar 49 // - sets up a dependency to a wrapper, not the actual SmearedModelFunction 50 Proc PlotSmeared_LamellarFF_HG(str) 51 String str 52 Prompt str,"Pick the data folder conatining the resolution you want",popup,getAList(4) 55 53 56 // if no gQvals wave, data must not have been loaded=> abort57 If(ResolutionWavesMissing()) //part of GaussUtils54 // if any of the resolution waves are missing => abort 55 if(ResolutionWavesMissingDF(str)) //updated to NOT use global strings (in GaussUtils) 58 56 Abort 59 57 endif 58 59 SetDataFolder $("root:"+str) 60 60 61 61 // Setup parameter table for model function … … 66 66 // output smeared intensity wave, dimensions are identical to experimental QSIG values 67 67 // make extra copy of experimental q-values for easy plotting 68 Duplicate/O $ gQvalssmeared_LamellarFF_HG,smeared_qvals //68 Duplicate/O $(str+"_q") smeared_LamellarFF_HG,smeared_qvals // 69 69 SetScale d,0,0,"1/cm",smeared_LamellarFF_HG // 70 71 smeared_LamellarFF_HG := LamellarFF_HG_Smeared(smear_coef_LamellarFF_HG,$gQvals) // SMEARED function name 70 71 Variable/G gs_LamellarFF_HG=0 72 gs_LamellarFF_HG := fLamellarFF_HG_Smeared(smear_coef_LamellarFF_HG,smeared_LamellarFF_HG,smeared_qvals) //this wrapper fills the STRUCT 73 72 74 Display smeared_LamellarFF_HG vs smeared_qvals // 73 75 ModifyGraph log=1,marker=29,msize=2,mode=4 … … 75 77 Label left "I(q) (cm\\S-1\\M)" 76 78 AutoPositionWindow/M=1/R=$(WinName(0,1)) $WinName(0,2) 77 End // end macro 79 80 SetDataFolder root: 81 End 82 83 84 85 //AAO version, uses XOP if available 86 // simply calls the original single point calculation with 87 // a wave assignment (this will behave nicely if given point ranges) 88 Function LamellarFF_HG(cw,yw,xw) : FitFunc 89 Wave cw,yw,xw 90 91 #if exists("LamellarFF_HGX") 92 yw = LamellarFF_HGX(cw,xw) 93 #else 94 yw = fLamellarFF_HG(cw,xw) 95 #endif 96 return(0) 97 End 78 98 79 99 //CH#1 … … 82 102 // based on the wave (array) of parameters that you send it (w) 83 103 // 84 Function LamellarFF_HG(w,x) : FitFunc104 Function fLamellarFF_HG(w,x) : FitFunc 85 105 Wave w 86 106 Variable x … … 124 144 End 125 145 146 //wrapper to calculate the smeared model as an AAO-Struct 147 // fills the struct and calls the ususal function with the STRUCT parameter 148 // 149 // used only for the dependency, not for fitting 150 // 151 Function fLamellarFF_HG_Smeared(coefW,yW,xW) 152 Wave coefW,yW,xW 153 154 String str = getWavesDataFolder(yW,0) 155 String DF="root:"+str+":" 156 157 WAVE resW = $(DF+str+"_res") 158 159 STRUCT ResSmearAAOStruct fs 160 WAVE fs.coefW = coefW 161 WAVE fs.yW = yW 162 WAVE fs.xW = xW 163 WAVE fs.resW = resW 164 165 Variable err 166 err = LamellarFF_HG_Smeared(fs) 167 168 return (0) 169 End 170 126 171 //the smeared model calculation 127 Function LamellarFF_HG_Smeared(w,x) :FitFunc 128 Wave w 129 Variable x 130 131 Variable ans 132 SVAR sq = gSig_Q 133 SVAR qb = gQ_bar 134 SVAR sh = gShadow 135 SVAR gQ = gQVals 136 137 ans = Smear_Model_20(LamellarFF_HG,$sq,$qb,$sh,$gQ,w,x) 172 Function LamellarFF_HG_Smeared(s) :FitFunc 173 Struct ResSmearAAOStruct &s 138 174 139 return(ans) 175 // the name of your unsmeared model (AAO) is the first argument 176 s.yW = Smear_Model_20(LamellarFF_HG,s.coefW,s.xW,s.resW) 177 178 return(0) 140 179 End
Note: See TracChangeset
for help on using the changeset viewer.