Changeset 128 for sans/Analysis/branches/ajj_23APR07/IGOR_Package_Files/Put in User Procedures/SANS_Models_v3.00/NewModels_2006/LamellarPS.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/LamellarPS.ipf
r127 r128 63 63 Edit parameters_LamellarPS, coef_LamellarPS 64 64 ModifyTable width(parameters_LamellarPS)=160 65 ywave_LamellarPS := LamellarPS(coef_LamellarPS, xwave_LamellarPS) 65 66 Variable/G root:g_LamellarPS 67 g_LamellarPS := LamellarPS(coef_LamellarPS, ywave_LamellarPS, xwave_LamellarPS) 66 68 Display ywave_LamellarPS vs xwave_LamellarPS 67 69 ModifyGraph marker=29, msize=2, mode=4 … … 77 79 End 78 80 79 //// 80 ////this macro sets up all the necessary parameters and waves that are 81 ////needed to calculate the smeared model function. 82 //// 83 ////no input parameters are necessary, it MUST use the experimental q-values 84 //// from the experimental data read in from an AVE/QSIG data file 85 ////////////////////////////////////////////////////// 86 //Macro PlotSmeared_LamellarPS() //Lamellar 87 // 88 // 89 // // if no gQvals wave, data must not have been loaded => abort 90 // If(ResolutionWavesMissing()) //part of GaussUtils 81 // - sets up a dependency to a wrapper, not the actual SmearedModelFunction 82 //Proc PlotSmeared_LamellarPS(str) 83 // String str 84 // Prompt str,"Pick the data folder conatining the resolution you want",popup,getAList(4) 85 // 86 // // if any of the resolution waves are missing => abort 87 // if(ResolutionWavesMissingDF(str)) //updated to NOT use global strings (in GaussUtils) 91 88 // Abort 92 89 // endif 90 // 91 // SetDataFolder $("root:"+str) 93 92 // 94 93 // // constants … … 102 101 // // output smeared intensity wave, dimensions are identical to experimental QSIG values 103 102 // // make extra copy of experimental q-values for easy plotting 104 // Duplicate/O $ gQvalssmeared_LamellarPS,smeared_qvals //103 // Duplicate/O $(str+"_q") smeared_LamellarPS,smeared_qvals // 105 104 // SetScale d,0,0,"1/cm",smeared_LamellarPS // 106 // 107 // smeared_LamellarPS := LamellarPS_Smeared(smear_coef_LamellarPS,$gQvals) // SMEARED function name 108 // Display smeared_LamellarPS vs $gQvals // 105 // 106 // Variable/G gs_LamellarPS=0 107 // gs_LamellarPS := fLamellarPS_Smeared(smear_coef_LamellarPS,smeared_LamellarPS,smeared_qvals) //this wrapper fills the STRUCT 108 // 109 // Display smeared_LamellarPS vs smeared_qvals // 109 110 // ModifyGraph log=1,marker=29,msize=2,mode=4 110 111 // Label bottom "q (\\S-1\\M)" 111 112 // Label left "I(q) (cm\\S-1\\M)" 112 // 113 //End // end macro 113 // 114 // SetDataFolder root: 115 //End 116 117 118 119 120 121 //AAO version, uses XOP if available 122 // simply calls the original single point calculation with 123 // a wave assignment (this will behave nicely if given point ranges) 124 Function LamellarPS(cw,yw,xw) : FitFunc 125 Wave cw,yw,xw 126 127 #if exists("LamellarPSX") 128 yw = LamellarPSX(cw,xw) 129 #else 130 yw = fLamellarPS(cw,xw) 131 #endif 132 return(0) 133 End 114 134 115 135 // instrument resolution IS included here in S(Q) 116 Function LamellarPS(w,x) : FitFunc136 Function fLamellarPS(w,x) : FitFunc 117 137 Wave w 118 138 Variable x … … 191 211 Return (inten+bkg) 192 212 End 193 213 214 //wrapper to calculate the smeared model as an AAO-Struct 215 // fills the struct and calls the ususal function with the STRUCT parameter 216 // 217 // used only for the dependency, not for fitting 218 // 219 //Function fLamellarPS_Smeared(coefW,yW,xW) 220 // Wave coefW,yW,xW 221 // 222 // String str = getWavesDataFolder(yW,0) 223 // String DF="root:"+str+":" 224 // 225 // WAVE resW = $(DF+str+"_res") 226 // 227 // STRUCT ResSmearAAOStruct fs 228 // WAVE fs.coefW = coefW 229 // WAVE fs.yW = yW 230 // WAVE fs.xW = xW 231 // WAVE fs.resW = resW 232 // 233 // Variable err 234 // err = LamellarPS_Smeared(fs) 235 // 236 // return (0) 237 //End 238 194 239 //the smeared model calculation 195 //Function LamellarPS_Smeared(w,x) :FitFunc 196 // Wave w 197 // Variable x 198 // 199 // Variable ans 200 // SVAR sq = gSig_Q 201 // SVAR qb = gQ_bar 202 // SVAR sh = gShadow 203 // SVAR gQ = gQVals 204 // 205 // ans = Smear_Model_20(LamellarPS,$sq,$qb,$sh,$gQ,w,x) 206 // 207 // return(ans) 240 //Function LamellarPS_Smeared(s) :FitFunc 241 // Struct ResSmearAAOStruct &s 242 // 243 //// the name of your unsmeared model (AAO) is the first argument 244 // s.yW = Smear_Model_20(LamellarPS,s.coefW,s.xW,s.resW) 245 // 246 // return(0) 208 247 //End 209 // 248 ////
Note: See TracChangeset
for help on using the changeset viewer.