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