Changeset 132 for sans/Analysis/branches/ajj_23APR07/IGOR_Package_Files/Put in User Procedures/SANS_Models_v3.00
- Timestamp:
- Jul 26, 2007 1:33:58 PM (16 years ago)
- Location:
- sans/Analysis/branches/ajj_23APR07/IGOR_Package_Files/Put in User Procedures/SANS_Models_v3.00
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/Analysis/branches/ajj_23APR07/IGOR_Package_Files/Put in User Procedures/SANS_Models_v3.00/GaussUtils.ipf
r127 r132 903 903 Wave w,yw,xw 904 904 905 Print "in SANSModel _proto function"905 Print "in SANSModelAAO_proto function" 906 906 return(1) 907 907 end -
sans/Analysis/branches/ajj_23APR07/IGOR_Package_Files/Put in User Procedures/SANS_Models_v3.00/Packages/ModelPicker/SANSModelPicker.ipf
r130 r132 52 52 // the list box in the panel 53 53 Proc Init_FileList() 54 //create the data folder 55 if(!DataFolderExists("root:FileList")) 56 NewDataFolder/O/S root:FileList 54 //create the data folders and globals 55 NewDataFolder/O root:myGlobals //others will need this...make it just in case 56 57 if(!DataFolderExists("root:myGlobals:FileList")) 58 NewDataFolder/O/S root:myGlobals:FileList 57 59 //create the waves 58 60 Make/O/T/N=0 fileWave,includedFileWave … … 65 67 // a switch for me to turn off file checking 66 68 Variable/G checkForFiles=1 //set to true initially 69 checkForFiles = !(stringmatch(ParseFilePath(0,SpecialDirPath("Desktop",0,0,0),":",1,1),"s*ine")) //zero for me 67 70 68 71 //fill the list of procedures … … 75 78 FileList_InsertButtonProc("") 76 79 77 NewDataFolder/O root:myGlobals //others will need this...make it just in case 80 78 81 79 82 SetDataFolder root: … … 86 89 // if the wave SANS_Model_List does not exist 87 90 Proc ReadNewProcList() 88 KillWaves/Z root: FileList:SANS_Model_List //kill the old list91 KillWaves/Z root:myGlobals:FileList:SANS_Model_List //kill the old list 89 92 FileList_GetListButtonProc("") 90 93 End … … 101 104 // 102 105 Proc TypeNewModelList() 103 variable ii=0,num=numpnts(root: FileList:SANS_Model_List)106 variable ii=0,num=numpnts(root:myGlobals:FileList:SANS_Model_List) 104 107 printf "Make/O/T/N/=%d SANS_Model_List\r\r",num 105 108 do 106 printf "SANS_Model_List[%d] = \"%s\"\r",ii,root: FileList:SANS_Model_List[ii]109 printf "SANS_Model_List[%d] = \"%s\"\r",ii,root:myGlobals:FileList:SANS_Model_List[ii] 107 110 ii+=1 108 111 while(ii<num) … … 110 113 111 114 Proc FileList_BuiltInList() 112 SetDataFolder root: FileList115 SetDataFolder root:myGlobals:FileList 113 116 114 117 ////paste here... after deleting the old make statement and list … … 189 192 String ProcedureName 190 193 191 SetDataFolder root: FileList194 SetDataFolder root:myGlobals:FileList 192 195 Variable num 193 196 num=numpnts(fileWave) … … 206 209 Variable val 207 210 // a switch for me to turn off file checking 208 root: FileList:checkForFiles=val //0==no check, 1=check211 root:myGlobals:FileList:checkForFiles=val //0==no check, 1=check 209 212 End 210 213 … … 223 226 DoWindow/C Procedure_List 224 227 ModifyPanel fixedSize=1 225 ListBox fileList,pos={4,3},size={200,100},listWave=root: FileList:fileWave226 ListBox fileList,selWave=root: FileList:selWave,mode= 4228 ListBox fileList,pos={4,3},size={200,100},listWave=root:myGlobals:FileList:fileWave 229 ListBox fileList,selWave=root:myGlobals:FileList:selWave,mode= 4 227 230 ListBox inclList,pos={4,110},size={200,100} 228 ListBox inclList,listWave=root: FileList:includedFileWave229 ListBox inclList,selWave=root: FileList:selToDelWave,mode= 4231 ListBox inclList,listWave=root:myGlobals:FileList:includedFileWave 232 ListBox inclList,selWave=root:myGlobals:FileList:selToDelWave,mode= 4 230 233 Button button0,pos={212,77},size={110,20},proc=FileList_InsertButtonProc,title="Include File(s)" 231 234 Button button0,help={"Includes the selected procedures, functions appear under the SANS Models menu"} … … 257 260 //loop through the selected files in the list... 258 261 // 259 Wave/T fileWave=$"root: FileList:fileWave"260 Wave sel=$"root: FileList:selWave"262 Wave/T fileWave=$"root:myGlobals:FileList:fileWave" 263 Wave sel=$"root:myGlobals:FileList:selWave" 261 264 262 265 Variable num=numpnts(sel),ii 263 266 String fname="" 264 267 265 // NVAR doCheck=root: FileList:checkForFiles268 // NVAR doCheck=root:myGlobals:FileList:checkForFiles 266 269 ii=num-1 //work bottom-up to not lose the index 267 270 do … … 275 278 //try the list of already-included files 276 279 if(cmpstr(fname,"")==0) 277 Wave/T inclFileWave=$"root: FileList:includedFileWave"278 Wave seltoDel=$"root: FileList:selToDelWave"280 Wave/T inclFileWave=$"root:myGlobals:FileList:includedFileWave" 281 Wave seltoDel=$"root:myGlobals:FileList:selToDelWave" 279 282 num=numpnts(seltoDel) 280 283 ii=num-1 //work bottom-up to not lose the index … … 322 325 String list="" 323 326 324 if(Exists("root: FileList:SANS_Model_List") != 1)325 SetDataFolder root: FileList327 if(Exists("root:myGlobals:FileList:SANS_Model_List") != 1) 328 SetDataFolder root:myGlobals:FileList 326 329 LoadWave/A/T 327 330 WAVE/T w=$(StringFromList(0,S_WaveNames,";")) 328 331 SetDataFolder root: 329 332 else 330 WAVE/T w=$("root: FileList:SANS_Model_List")333 WAVE/T w=$("root:myGlobals:FileList:SANS_Model_List") 331 334 endif 332 335 333 336 // // convert the input wave to a semi-list 334 // SVAR allFiles=root: FileList:allFiles337 // SVAR allFiles=root:myGlobals:FileList:allFiles 335 338 // allFiles=MP_TextWave2SemiList(w) 336 339 list=MP_TextWave2SemiList(w) … … 341 344 342 345 // remove the items that have already been included 343 Wave/T includedFileWave=$"root: FileList:includedFileWave"346 Wave/T includedFileWave=$"root:myGlobals:FileList:includedFileWave" 344 347 Variable numInc=numpnts(includedFileWave) 345 348 for(ii=0;ii<numInc;ii+=1) … … 348 351 list = SortList(list,";",0) 349 352 num=ItemsInList(list,";") 350 WAVE/T fileWave=$"root: FileList:fileWave"351 WAVE selWave=$"root: FileList:selWave"353 WAVE/T fileWave=$"root:myGlobals:FileList:fileWave" 354 WAVE selWave=$"root:myGlobals:FileList:selWave" 352 355 Redimension/N=(num) fileWave //make the waves the proper length 353 356 Redimension/N=(num) selWave … … 381 384 382 385 // new way, to catch all files in all subfolders 383 SVAR allFiles=root: FileList:allFiles386 SVAR allFiles=root:myGlobals:FileList:allFiles 384 387 allFiles="" //clear the list 385 388 … … 400 403 list = RemoveFromList("DemoLoader.ipf",list,";" ) 401 404 // remove the items that have already been included 402 Wave/T includedFileWave=$"root: FileList:includedFileWave"405 Wave/T includedFileWave=$"root:myGlobals:FileList:includedFileWave" 403 406 Variable numInc=numpnts(includedFileWave) 404 407 for(ii=0;ii<numInc;ii+=1) … … 407 410 list = SortList(list,";",0) 408 411 num=ItemsInList(list,";") 409 WAVE/T fileWave=$"root: FileList:fileWave"410 WAVE selWave=$"root: FileList:selWave"412 WAVE/T fileWave=$"root:myGlobals:FileList:fileWave" 413 WAVE selWave=$"root:myGlobals:FileList:selWave" 411 414 Redimension/N=(num) fileWave //make the waves the proper length 412 415 Redimension/N=(num) selWave … … 422 425 423 426 Variable err=0 424 String/G root: FileList:allFiles=""425 SVAR allFiles = root: FileList:allFiles427 String/G root:myGlobals:FileList:allFiles="" 428 SVAR allFiles = root:myGlobals:FileList:allFiles 426 429 427 430 PathInfo Igor … … 446 449 447 450 //loop through the selected files in the list... 448 Wave/T fileWave=$"root: FileList:fileWave"449 Wave sel=$"root: FileList:selWave"451 Wave/T fileWave=$"root:myGlobals:FileList:fileWave" 452 Wave sel=$"root:myGlobals:FileList:selWave" 450 453 //and adjust the included file lists 451 Wave/T includedFileWave=$"root: FileList:includedFileWave"452 Wave selToDel=$"root: FileList:selToDelWave"454 Wave/T includedFileWave=$"root:myGlobals:FileList:includedFileWave" 455 Wave selToDel=$"root:myGlobals:FileList:selToDelWave" 453 456 454 457 Variable numIncl=numpnts(includedFileWave) … … 461 464 Execute/P "INSERTINCLUDE \"WriteModelData\"" 462 465 463 NVAR doCheck=root: FileList:checkForFiles466 NVAR doCheck=root:myGlobals:FileList:checkForFiles 464 467 465 468 ii=num-1 //work bottom-up to not lose the index … … 496 499 497 500 //loop through the selected files in the list... 498 Wave/T includedFileWave=$"root: FileList:includedFileWave"499 Wave selToDel=$"root: FileList:selToDelWave"501 Wave/T includedFileWave=$"root:myGlobals:FileList:includedFileWave" 502 Wave selToDel=$"root:myGlobals:FileList:selToDelWave" 500 503 // and put the unwanted procedures back in the to-add list 501 Wave/T fileWave=$"root: FileList:fileWave"502 Wave sel=$"root: FileList:selWave"504 Wave/T fileWave=$"root:myGlobals:FileList:fileWave" 505 Wave sel=$"root:myGlobals:FileList:selWave" 503 506 504 507 … … 564 567 // if root:MenuItemStr exists 565 568 Menu "SANS Models" 566 StrVarOrDefault("root: FileList:MenuItemStr_def","ModelPicker_Panel")//, RefreshMenu()569 StrVarOrDefault("root:myGlobals:FileList:MenuItemStr_def","ModelPicker_Panel")//, RefreshMenu() 567 570 SubMenu "Unsmeared Models" 568 StrVarOrDefault("root: FileList:MenuItemStr1","ModelPicker_Panel")571 StrVarOrDefault("root:myGlobals:FileList:MenuItemStr1","ModelPicker_Panel") 569 572 End 570 573 SubMenu "Smeared Models" 571 StrVarOrDefault("root: FileList:MenuItemStr2","ModelPicker_Panel")574 StrVarOrDefault("root:myGlobals:FileList:MenuItemStr2","ModelPicker_Panel") 572 575 End 573 576 // SubMenu "Models 3" … … 594 597 list += MacroList("WriteM*",sep,"KIND:1,NPARAMS:4") //data writer 595 598 list += "-"+sep 596 String/G root: FileList:MenuItemStr_def = TrimListTo255(list)599 String/G root:myGlobals:FileList:MenuItemStr_def = TrimListTo255(list) 597 600 598 601 list = "" … … 601 604 list = RemoveFromList("FreezeModel", list ,";") // remove FreezeModel, it's not a model 602 605 // list += "-"+sep 603 String/G root: FileList:MenuItemStr1 = TrimListTo255(list)606 String/G root:myGlobals:FileList:MenuItemStr1 = TrimListTo255(list) 604 607 605 608 list="" 606 609 list += MacroList("PlotSmea*",sep,"KIND:1,NPARAMS:1") //smeared plot procedures 607 610 list += MacroList("PlotSmea*",sep,"KIND:1,NPARAMS:2") //smeared RPA has 2 parameters 608 String/G root: FileList:MenuItemStr2 = TrimListTo255(list)611 String/G root:myGlobals:FileList:MenuItemStr2 = TrimListTo255(list) 609 612 610 613 BuildMenu "SANS Models" … … 664 667 String prefix 665 668 666 SVAR allFiles=root: FileList:allFiles669 SVAR allFiles=root:myGlobals:FileList:allFiles 667 670 // Build a prefix (a number of tabs to indicate the folder level by indentation) 668 671 prefix = "" -
sans/Analysis/branches/ajj_23APR07/IGOR_Package_Files/Put in User Procedures/SANS_Models_v3.00/Packages/SumModel/SumSANSModels.ipf
r42 r132 25 25 // selections. 26 26 // 27 // TO FIX: 28 // - add a help button to call the help file 29 // ...(and write the documentation) 30 // - must be thoroughly tested... 27 // JUL 2007 28 // - data folder aware 29 // - AAO, structure aware 30 // (smeared fitting still broken) 31 // - created data folders are now buried in myGlobals 31 32 // 32 33 /////////////////////////////// … … 37 38 DoWindow/F Sum_Model_Panel 38 39 if(V_flag==0) 39 NewDataFolder/O root:SumModel 40 if(!DataFolderExists("root:myGlobals")) 41 NewDataFolder root:myGlobals 42 endif 43 NewDataFolder/O root:myGlobals:SumModel 40 44 InitSMPGlobals() 41 45 Sum_Model_Panel() … … 46 50 // 47 51 Function InitSMPGlobals() 48 Variable/G root: SumModel:gNParMod1=049 Variable/G root: SumModel:gNParMod2=052 Variable/G root:myGlobals:SumModel:gNParMod1=0 53 Variable/G root:myGlobals:SumModel:gNParMod2=0 50 54 end 51 55 … … 67 71 GroupBox group1,pos={5,50},size={216,107},title="Function # 1" 68 72 SetVariable setvar1,pos={14,128},size={140,15},title="# of Parameters" 69 SetVariable setvar1,limits={0,20,1},value= root: SumModel:gNParMod173 SetVariable setvar1,limits={0,20,1},value= root:myGlobals:SumModel:gNParMod1 70 74 GroupBox group2,pos={5,171},size={216,107},title="Function # 2" 71 75 SetVariable setvar2,pos={14,249},size={140,15},title="# of Parameters" 72 SetVariable setvar2,limits={0,20,1},value= root: SumModel:gNParMod276 SetVariable setvar2,limits={0,20,1},value= root:myGlobals:SumModel:gNParMod2 73 77 Button button0,pos={36,299},size={150,20},proc=PlotSumButtonProc,title="Plot Summed Model" 74 78 Button button1,pos={15,330},size={190,20},proc=PlotSmearedSumButtonProc,title="Plot Smeared Summed Model" … … 76 80 EndMacro 77 81 78 // show the availab elmodels82 // show the available models 79 83 // but not the smeared versions 84 // not the f* 85 // not the *X XOPS 86 // 87 // KIND:10 should show only user-defined curve fitting functions 88 // - not XOPs 89 // - not other user-defined functions 80 90 Function/S SumModelPopupList() 81 String list 82 list = FunctionList("!Smear*",";","KIND:14,NINDVARS:1") //don't show smeared models 91 String list,tmp 92 list = FunctionList("!Smear*",";","KIND:10") //don't show smeared models 93 83 94 list = RemoveFromList("Sum_Model", list ,";") 84 list = RemoveFromList("SANSModel_proto", list ,";") 95 96 tmp = FunctionList("*_proto",";","KIND:10") //prototypes 97 list = RemoveFromList(tmp, list ,";") 98 99 tmp = FunctionList("f*",";","KIND:10") //point calculations 100 list = RemoveFromList(tmp, list ,";") 101 102 // this should be a null string with KIND:10 103 tmp = FunctionList("*X",";","KIND:10") //XOPs, also point calculations 104 list = RemoveFromList(tmp, list ,";") 105 85 106 return(list) 86 107 End … … 131 152 //make the coefficients and parameters based on the panel values 132 153 Variable nParam,n1,n2 133 n1 = root: SumModel:gNParMod1134 n2 = root: SumModel:gNParMod2154 n1 = root:myGlobals:SumModel:gNParMod1 155 n2 = root:myGlobals:SumModel:gNParMod2 135 156 nParam = n1 + n2 136 157 if(n1==0 || n2==0 || nparam==0) … … 138 159 endif 139 160 // n is ok, keep extra copy so changing panel will not affect functions 140 Variable/G root: SumModel:gN1=n1141 Variable/G root: SumModel:gN2=n2161 Variable/G root:myGlobals:SumModel:gN1=n1 162 Variable/G root:myGlobals:SumModel:gN2=n2 142 163 143 164 // these are the function names - make global so the fit function 144 165 // can find them 145 166 ControlInfo/W=Sum_Model_Panel popup1_0 146 String/G root: SumModel:gModelStr1=S_Value167 String/G root:myGlobals:SumModel:gModelStr1=S_Value 147 168 ControlInfo/W=Sum_Model_Panel popup2_0 148 String/G root: SumModel:gModelStr2=S_Value169 String/G root:myGlobals:SumModel:gModelStr2=S_Value 149 170 150 171 //these are the coefficent waves - local only … … 164 185 parameters_sum[n1,(n1+n2-1)] = $paramStr2[p-n1] 165 186 166 Edit parameters_sum,coef_sum 167 ywave_sum := Sum_Model(coef_sum,xwave_sum) 187 Edit parameters_sum,coef_sum 188 189 Variable/G root:g_sum 190 g_sum := Sum_Model(coef_sum,ywave_sum,xwave_sum) 168 191 Display ywave_sum vs xwave_sum 169 192 ModifyGraph log=1,marker=29,msize=2,mode=4 … … 174 197 End 175 198 199 // - sets up a dependency to a wrapper, not the actual SmearedModelFunction 176 200 // the usual macro for plotting the smeared model, updated 177 201 // to take input from the panel 178 Proc PlotSmeared_Sum_Model() 179 180 // if no gQvals wave, data must not have been loaded => abort 181 if(ResolutionWavesMissing()) 202 // 203 // - somewhat confusing as the unsmeared coefficients are in root: 204 // and all of the newly created smeared waves and coefficients are in the 205 // selected data folder 206 // 207 Proc PlotSmeared_Sum_Model(str) 208 String str 209 Prompt str,"Pick the data folder containing the resolution you want",popup,getAList(4) 210 211 // if any of the resolution waves are missing => abort 212 if(ResolutionWavesMissingDF(str)) //updated to NOT use global strings (in GaussUtils) 182 213 Abort 183 214 endif 215 216 SetDataFolder $("root:"+str) 184 217 185 218 //make the coefficients and parameters based on the panel values 186 219 Variable nParam,n1,n2 187 n1 = root: SumModel:gNParMod1188 n2 = root: SumModel:gNParMod2220 n1 = root:myGlobals:SumModel:gNParMod1 221 n2 = root:myGlobals:SumModel:gNParMod2 189 222 nParam = n1 + n2 190 223 if(n1==0 || n2==0 || nparam==0) … … 192 225 endif 193 226 // n is ok, keep extra copy so changing panel will not affect functions 194 Variable/G root: SumModel:gN1=n1195 Variable/G root: SumModel:gN2=n2227 Variable/G root:myGlobals:SumModel:gN1=n1 228 Variable/G root:myGlobals:SumModel:gN2=n2 196 229 197 230 // these are the function names - make global so the fit function 198 231 // can find them 199 232 ControlInfo/W=Sum_Model_Panel popup1_0 200 String/G root: SumModel:gModelStr1=S_Value233 String/G root:myGlobals:SumModel:gModelStr1=S_Value 201 234 ControlInfo/W=Sum_Model_Panel popup2_0 202 String/G root: SumModel:gModelStr2=S_Value203 204 //these are the coefficent waves - local only 235 String/G root:myGlobals:SumModel:gModelStr2=S_Value 236 237 //these are the coefficent waves - local only, in the current data folder! 205 238 ControlInfo/W=Sum_Model_Panel popup1_1 206 String/G root:coefStr1=S_Value239 String/G coefStr1=S_Value 207 240 ControlInfo/W=Sum_Model_Panel popup2_1 208 String/G root:coefStr2=S_Value241 String/G coefStr2=S_Value 209 242 210 243 Make/O/D/N=(nParam) smear_coef_sum 211 smear_coef_sum[0,(n1-1)] = $ coefStr1212 smear_coef_sum[n1,(n1+n2-1)] = $ coefStr2[p-n1]244 smear_coef_sum[0,(n1-1)] = $("root:"+coefStr1) 245 smear_coef_sum[n1,(n1+n2-1)] = $("root:"+coefStr2)[p-n1] 213 246 214 247 make/o/t/N=(nParam) smear_parameters_sum 215 248 String paramStr1 = "parameters"+coefStr1[4,strlen(coefStr1)-1] 216 249 String paramStr2 = "parameters"+coefStr2[4,strlen(coefStr2)-1] 217 smear_parameters_sum[0,(n1-1)] = $ paramStr1218 smear_parameters_sum[n1,(n1+n2-1)] = $ paramStr2[p-n1]250 smear_parameters_sum[0,(n1-1)] = $("root:"+paramStr1) 251 smear_parameters_sum[n1,(n1+n2-1)] = $("root:"+paramStr2)[p-n1] 219 252 220 253 Edit smear_parameters_sum,smear_coef_sum … … 222 255 // output smeared intensity wave, dimensions are identical to experimental QSIG values 223 256 // make extra copy of experimental q-values for easy plotting 224 Duplicate/O $ gQvalssmeared_sum,smeared_qvals257 Duplicate/O $(str+"_q") smeared_sum,smeared_qvals 225 258 SetScale d,0,0,"1/cm",smeared_sum 226 227 smeared_sum := Smeared_Sum_Model(smear_coef_sum,$gQvals) 228 Display smeared_sum vs $gQvals 259 260 Variable/G gs_sum=0 261 gs_sum := fSmeared_Sum_Model(smear_coef_sum,smeared_sum,smeared_qvals) //this wrapper fills the STRUCT 262 263 Display smeared_sum vs $(str+"_q") 229 264 ModifyGraph log=1,marker=29,msize=2,mode=4 230 265 Label bottom "q (\\S-1\\M)" … … 232 267 Legend 233 268 AutoPositionWindow/M=1/R=$(WinName(0,1)) $WinName(0,2) 269 270 SetDataFolder root: 234 271 End 235 272 … … 238 275 // sum of the two selected models. 239 276 // 240 Function Sum_Model(w,x) :FitFunc 241 Wave w;Variable x 242 243 SVAR funcStr1=root:SumModel:gModelStr1 //string names of the functions, set by the macro 244 SVAR funcStr2=root:SumModel:gModelStr2 245 NVAR n1=root:SumModel:gN1 //number of coefficients, set by the macro 246 NVAR n2=root:SumModel:gN2 277 // this is an AAO function, there is no XOP version 278 // since it should be the sum of two XOPs 279 // 280 Function Sum_Model(w,yw,xw) : FitFunc 281 Wave w,yw,xw 282 283 SVAR funcStr1=root:myGlobals:SumModel:gModelStr1 //string names of the functions, set by the macro 284 SVAR funcStr2=root:myGlobals:SumModel:gModelStr2 285 NVAR n1=root:myGlobals:SumModel:gN1 //number of coefficients, set by the macro 286 NVAR n2=root:myGlobals:SumModel:gN2 247 287 248 288 Variable retVal 249 289 250 FUNCREF SANSModel _proto f1 = $funcStr1 //convert str to FCN251 FUNCREF SANSModel _proto f2 = $funcStr2290 FUNCREF SANSModelAAO_proto f1 = $funcStr1 //convert str to FCN 291 FUNCREF SANSModelAAO_proto f2 = $funcStr2 252 292 // make temporary coefficient waves for each model 253 293 Make/O/D/N=(n1) temp_cw1 … … 256 296 temp_cw2 = w[p+n1] 257 297 258 // calculate the sum 259 retVal = f1(temp_cw1,x) + f2(temp_cw2,x) 260 return(retVal) 298 // calculate the sum of each of the AAO functions 299 Duplicate/O xw tmp_sum_yw1,tmp_sum_yw2 300 301 f1(temp_cw1,tmp_sum_yw1,xw) 302 f2(temp_cw2,tmp_sum_yw2,xw) 303 yw = tmp_sum_yw1 + tmp_sum_yw2 304 305 return(0) 261 306 end 262 307 263 308 // this is all there is to the smeared calculation! 264 Function Smeared_Sum_Model(w,x) :FitFunc 265 Wave w 266 Variable x 267 268 Variable ans 269 SVAR sq = gSig_Q 270 SVAR qb = gQ_bar 271 SVAR sh = gShadow 272 SVAR gQ = gQVals 273 274 //the name of your unsmeared model is the first argument 275 ans = Smear_Model_20(Sum_Model,$sq,$qb,$sh,$gQ,w,x) 276 277 return(ans) 309 Function Smeared_Sum_Model(s) : FitFunc 310 Struct ResSmearAAOStruct &s 311 312 // the name of your unsmeared model (AAO) is the first argument 313 s.yW = Smear_Model_20(Sum_Model,s.coefW,s.xW,s.resW) 314 315 return(0) 316 End 317 318 //wrapper to calculate the smeared model as an AAO-Struct 319 // fills the struct and calls the ususal function with the STRUCT parameter 320 // 321 // used only for the dependency, not for fitting 322 // 323 Function fSmeared_Sum_Model(coefW,yW,xW) 324 Wave coefW,yW,xW 325 326 String str = getWavesDataFolder(yW,0) 327 String DF="root:"+str+":" 328 329 WAVE resW = $(DF+str+"_res") 330 331 STRUCT ResSmearAAOStruct fs 332 WAVE fs.coefW = coefW 333 WAVE fs.yW = yW 334 WAVE fs.xW = xW 335 WAVE fs.resW = resW 336 337 Variable err 338 err = Smeared_Sum_Model(fs) 339 340 return (0) 278 341 End 279 342
Note: See TracChangeset
for help on using the changeset viewer.