Changeset 228
- Timestamp:
- Dec 11, 2007 4:19:31 PM (15 years ago)
- Location:
- sans/Analysis/branches/ajj_23APR07/IGOR_Package_Files/Put in User Procedures/SANS_Models_v3.00
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/Analysis/branches/ajj_23APR07/IGOR_Package_Files/Put in User Procedures/SANS_Models_v3.00/Packages/GlobalFit/GlobalFit2_NCNR.ipf
r223 r228 63 63 // "Unload Global Fit", WM_NewGlobalFit1#UnloadNewGlobalFit() 64 64 //end 65 Menu " Macros"65 Menu "SANS Models" 66 66 // "Global Fit", InitGlobalFitPanel() 67 67 Submenu "Packages" … … 1469 1469 DoWindow/K NewGF_GlobalFitMaskingPanel 1470 1470 endif 1471 Execute/P "DELETEINCLUDE <Global Fit 2>" 1471 // Execute/P "DELETEINCLUDE <Global Fit 2>" 1472 Execute/P "DELETEINCLUDE \"GlobalFit2_NCNR\"" 1472 1473 Execute/P "COMPILEPROCEDURES " 1473 KillDataFolder root:Packages:NewGlobalFit1474 KillDataFolder/Z root:Packages:NewGlobalFit 1474 1475 end 1475 1476 -
sans/Analysis/branches/ajj_23APR07/IGOR_Package_Files/Put in User Procedures/SANS_Models_v3.00/Packages/Invariant/Invariant.ipf
r134 r228 22 22 //create the globals 23 23 Proc Init_Invariant() 24 NewDataFolder/O/S root:myGlobals:invariant 24 NewDataFolder/O root:Packages 25 NewDataFolder/O root:Packages:NIST 26 NewDataFolder/O/S root:Packages:NIST:invariant 25 27 Variable/G gNumLow=10 26 28 Variable/G gNumHigh=10 … … 71 73 72 74 Variable num,invar 73 NVAR dQv = root: myGlobals:invariant:gDqv75 NVAR dQv = root:Packages:NIST:invariant:gDqv 74 76 75 77 Duplicate/O qw integrand … … 155 157 156 158 //access the global strings representing the last data file read in 157 SVAR QWave = root: myGlobals:invariant:QWave158 SVAR IWave = root: myGlobals:invariant:IWave159 SVAR SWave = root: myGlobals:invariant:SWave159 SVAR QWave = root:Packages:NIST:invariant:QWave 160 SVAR IWave = root:Packages:NIST:invariant:IWave 161 SVAR SWave = root:Packages:NIST:invariant:SWave 160 162 161 163 Wave qw=$QWave … … 208 210 209 211 //reset the invariant values to zero 210 NVAR meas = root: myGlobals:invariant:gInvMeas211 NVAR lo = root: myGlobals:invariant:gInvLowQ212 NVAR hi = root: myGlobals:invariant:gInvHighQ213 NVAR total = root: myGlobals:invariant:gInvTotal212 NVAR meas = root:Packages:NIST:invariant:gInvMeas 213 NVAR lo = root:Packages:NIST:invariant:gInvLowQ 214 NVAR hi = root:Packages:NIST:invariant:gInvHighQ 215 NVAR total = root:Packages:NIST:invariant:gInvTotal 214 216 meas=0 215 217 lo=0 … … 256 258 PopupMenu ywave,pos={10,60},size={154,19},title="Data File" 257 259 PopupMenu ywave,help={"Select the experimental intensity values"} 258 PopupMenu ywave,mode=1,value=root: myGlobals:invariant:gDataPopList,proc=Inv_FilePopMenuProc260 PopupMenu ywave,mode=1,value=root:Packages:NIST:invariant:gDataPopList,proc=Inv_FilePopMenuProc 259 261 260 262 Button loadButton,pos={10,90},size={130,20},proc=Inv_Load_Proc,title="Load and Plot File" … … 266 268 267 269 SetVariable setvar_0,pos={27,249},size={80,15},title="# points" 268 SetVariable setvar_0,limits={5,50,0},value= root: myGlobals:invariant:gNumLow270 SetVariable setvar_0,limits={5,50,0},value= root:Packages:NIST:invariant:gNumLow 269 271 SetVariable setvar_1,pos={166,249},size={80,15},title="# points" 270 SetVariable setvar_1,limits={5,200,0},value= root: myGlobals:invariant:gNumHigh272 SetVariable setvar_1,limits={5,200,0},value= root:Packages:NIST:invariant:gNumHigh 271 273 CheckBox check_0,pos={23,202},size={50,14},proc=LowCheckProc,title="Guinier" 272 274 CheckBox check_0,value= 1 … … 283 285 ValDisplay valdisp0,pos={51,354},size={180,14},title="In measured Q-range " 284 286 ValDisplay valdisp0,limits={0,0,0},barmisc={0,1000} 285 ValDisplay valdisp0,value= #"root: myGlobals:invariant:gInvMeas"287 ValDisplay valdisp0,value= #"root:Packages:NIST:invariant:gInvMeas" 286 288 ValDisplay valdisp0_1,pos={51,371},size={180,14},title="In low Q extrapolation " 287 289 ValDisplay valdisp0_1,limits={0,0,0},barmisc={0,1000} 288 ValDisplay valdisp0_1,value= #"root: myGlobals:invariant:gInvLowQ"290 ValDisplay valdisp0_1,value= #"root:Packages:NIST:invariant:gInvLowQ" 289 291 ValDisplay valdisp0_2,pos={51,388},size={180,14},title="In high Q extrapolation " 290 292 ValDisplay valdisp0_2,limits={0,0,0},barmisc={0,1000} 291 ValDisplay valdisp0_2,value= #"root: myGlobals:invariant:gInvHighQ"293 ValDisplay valdisp0_2,value= #"root:Packages:NIST:invariant:gInvHighQ" 292 294 ValDisplay valdisp0_3,pos={51,411},size={180,14},title="TOTAL " 293 295 ValDisplay valdisp0_3,limits={0,0,0},barmisc={0,1000} 294 ValDisplay valdisp0_3,value= #"root: myGlobals:invariant:gInvTotal"296 ValDisplay valdisp0_3,value= #"root:Packages:NIST:invariant:gInvTotal" 295 297 296 298 CheckBox check0,pos={10,116},size={101,14},proc=SlitSmearedCheckProc,title="Slit-Smeared Data" 297 CheckBox check0,value= root: myGlobals:invariant:gIsSlitSmeared299 CheckBox check0,value= root:Packages:NIST:invariant:gIsSlitSmeared 298 300 SetVariable setvar0,pos={136,116},size={130,15},title="Slit Height (1/A)" 299 SetVariable setvar0,limits={-inf,inf,0},value= root: myGlobals:invariant:gDqv301 SetVariable setvar0,limits={-inf,inf,0},value= root:Packages:NIST:invariant:gDqv 300 302 301 303 //set up a dependency to calculate the total invariant 302 root: myGlobals:invariant:gInvTotal := root:myGlobals:invariant:gInvLowQ + root:myGlobals:invariant:gInvMeas + root:myGlobals:invariant:gInvHighQ304 root:Packages:NIST:invariant:gInvTotal := root:Packages:NIST:invariant:gInvLowQ + root:Packages:NIST:invariant:gInvMeas + root:Packages:NIST:invariant:gInvHighQ 303 305 EndMacro 304 306 … … 316 318 Variable inv,num 317 319 318 SVAR QWave = root: myGlobals:invariant:QWave320 SVAR QWave = root:Packages:NIST:invariant:QWave 319 321 Wave qw=$QWave 320 SVAR IWave = root: myGlobals:invariant:IWave322 SVAR IWave = root:Packages:NIST:invariant:IWave 321 323 Wave iw=$IWave 322 324 323 NVAR isSlitSmeared=root: myGlobals:invariant:gIsSlitSmeared325 NVAR isSlitSmeared=root:Packages:NIST:invariant:gIsSlitSmeared 324 326 if(isSlitSmeared) 325 327 inv = Invariant_SlitSmeared(qw,iw) … … 332 334 333 335 // update the global display on the panel (there is a dependency for the total) 334 NVAR val = root: myGlobals:invariant:gInvMeas336 NVAR val = root:Packages:NIST:invariant:gInvMeas 335 337 val = inv 336 338 … … 353 355 // print "yesGuinier = ",yesGuinier 354 356 //number of points to use for fit 355 NVAR nbeg=root: myGlobals:invariant:gNumLow357 NVAR nbeg=root:Packages:NIST:invariant:gNumLow 356 358 //define the waves 357 359 Wave extr_lqi=extr_lqi 358 360 Wave extr_lqq=extr_lqq 359 361 360 SVAR QWave = root: myGlobals:invariant:QWave362 SVAR QWave = root:Packages:NIST:invariant:QWave 361 363 Wave qw=$QWave 362 SVAR IWave = root: myGlobals:invariant:IWave364 SVAR IWave = root:Packages:NIST:invariant:IWave 363 365 Wave iw=$IWave 364 SVAR SWave = root: myGlobals:invariant:SWave366 SVAR SWave = root:Packages:NIST:invariant:SWave 365 367 Wave sw=$SWave 366 368 … … 389 391 390 392 //calculate the invariant 391 NVAR isSlitSmeared=root: myGlobals:invariant:gIsSlitSmeared393 NVAR isSlitSmeared=root:Packages:NIST:invariant:gIsSlitSmeared 392 394 if(isSlitSmeared) 393 395 inv = Invariant_SlitSmeared(extr_lqq,extr_lqi) … … 400 402 401 403 // update the global display on the panel (there is a dependency for the total) 402 NVAR val = root: myGlobals:invariant:gInvLowQ404 NVAR val = root:Packages:NIST:invariant:gInvLowQ 403 405 val = inv 404 406 … … 419 421 Wave extr_hqi=extr_hqi 420 422 Wave extr_hqq=extr_hqq 421 SVAR QWave = root: myGlobals:invariant:QWave423 SVAR QWave = root:Packages:NIST:invariant:QWave 422 424 Wave qw=$QWave 423 SVAR IWave = root: myGlobals:invariant:IWave425 SVAR IWave = root:Packages:NIST:invariant:IWave 424 426 Wave iw=$IWave 425 SVAR SWave = root: myGlobals:invariant:SWave427 SVAR SWave = root:Packages:NIST:invariant:SWave 426 428 Wave sw=$SWave 427 429 428 430 Variable/G V_FitMaxIters=300 429 431 Variable num=numpnts(iw),nume,inv 430 NVAR nend=root: myGlobals:invariant:gNumHigh //number of points for the fit432 NVAR nend=root:Packages:NIST:invariant:gNumHigh //number of points for the fit 431 433 432 434 Make/O/D P_coef={0,1,-4} //input … … 439 441 440 442 //calculate the invariant 441 NVAR isSlitSmeared=root: myGlobals:invariant:gIsSlitSmeared443 NVAR isSlitSmeared=root:Packages:NIST:invariant:gIsSlitSmeared 442 444 if(isSlitSmeared) 443 445 inv = Invariant_SlitSmeared(extr_hqq,extr_hqi) … … 450 452 451 453 // update the global display on the panel (there is a dependency for the total) 452 NVAR val = root: myGlobals:invariant:gInvHighQ454 NVAR val = root:Packages:NIST:invariant:gInvHighQ 453 455 val = inv 454 456 … … 463 465 DoWindow/K $"Invariant_Graph" 464 466 endif 465 if (DatafolderExists("root: myGlobals:invariant"))466 KillDatafolder root: myGlobals:invariant467 if (DatafolderExists("root:Packages:NIST:invariant")) 468 KillDatafolder root:Packages:NIST:invariant 467 469 endif 468 470 SetDataFolder root: … … 472 474 end 473 475 474 Menu " Macros"476 Menu "SANS Models" 475 477 Submenu "Packages" 476 478 "Unload Invariant", UnloadInvariant() … … 503 505 tempStr = "Pick the data path" 504 506 Endif 505 String/G root: myGlobals:invariant:gDataPopList =tempStr507 String/G root:Packages:NIST:invariant:gDataPopList =tempStr 506 508 ControlUpdate/W=Invariant_Panel ywave 507 509 … … 578 580 //Print tempName 579 581 580 String cleanLastFileName = CleanupName(root: myGlobals:gLastFileName,0)582 String cleanLastFileName = CleanupName(root:Packages:NIST:gLastFileName,0) 581 583 String dataStr = "root:"+cleanLastFileName+":" 582 584 583 585 // keep global copies of the names rather than reading from the popup 584 586 tempName=dataStr + cleanLastFileName+"_q" 585 String/G root: myGlobals:invariant:QWave=tempName587 String/G root:Packages:NIST:invariant:QWave=tempName 586 588 tempName=dataStr + cleanLastFileName+"_i" 587 String/G root: myGlobals:invariant:IWave=tempName589 String/G root:Packages:NIST:invariant:IWave=tempName 588 590 tempName=dataStr + cleanLastFileName+"_s" 589 String/G root: myGlobals:invariant:SWave=tempName591 String/G root:Packages:NIST:invariant:SWave=tempName 590 592 591 593 //Plot, and adjust the scaling to match the axis scaling set by the popups … … 612 614 Variable checked 613 615 614 NVAR isSlitSmeared=root: myGlobals:invariant:gIsSlitSmeared615 SVAR fileStr=root: myGlobals:gLastFileName616 NVAR isSlitSmeared=root:Packages:NIST:invariant:gIsSlitSmeared 617 SVAR fileStr=root:Packages:NIST:gLastFileName 616 618 617 619 //reset the global to the checkbox state … … 620 622 if(checked) //get the smearing info 621 623 String cleanLastFileName = "root:"+CleanupName(fileStr,0) 622 NVAR dQv=root: myGlobals:invariant:gDqv624 NVAR dQv=root:Packages:NIST:invariant:gDqv 623 625 String tempName = cleanLastFileName+"sq" 624 626 Wave/Z w=$tempName -
sans/Analysis/branches/ajj_23APR07/IGOR_Package_Files/Put in User Procedures/SANS_Models_v3.00/Packages/LinearizedFits/LinearizedFits.ipf
r133 r228 5 5 /////////////////////////////// 6 6 //procedures for creating and initializing the Linearized FIT panel 7 //global variables (numerical only) are kept in root: myGlobals:FIT folder7 //global variables (numerical only) are kept in root:Packages:NIST:FIT folder 8 8 // 9 9 // this is based on the FIT routines in the SANS Reduction package, and has been modified here … … 36 36 If(WinType("A_FitPanel") == 0) 37 37 //create the necessary data folder 38 NewDataFolder/O root:myGlobals 39 NewDataFolder/O root:myGlobals:FIT 38 NewDataFolder/O root:Packages 39 NewDataFolder/O root:Packages:NIST 40 NewDataFolder/O root:Packages:NIST:FIT 40 41 //initialize the values 41 Variable/G root: myGlobals:FIT:gLolim = 0.0242 Variable/G root: myGlobals:FIT:gUplim = 0.0443 Variable/G root: myGlobals:FIT:gExpA = 144 Variable/G root: myGlobals:FIT:gExpB = 145 Variable/G root: myGlobals:FIT:gExpC = 146 Variable/G root: myGlobals:FIT:gBack = 047 String/G root: myGlobals:FIT:gDataPopList = "none"42 Variable/G root:Packages:NIST:FIT:gLolim = 0.02 43 Variable/G root:Packages:NIST:FIT:gUplim = 0.04 44 Variable/G root:Packages:NIST:FIT:gExpA = 1 45 Variable/G root:Packages:NIST:FIT:gExpB = 1 46 Variable/G root:Packages:NIST:FIT:gExpC = 1 47 Variable/G root:Packages:NIST:FIT:gBack = 0 48 String/G root:Packages:NIST:FIT:gDataPopList = "none" 48 49 A_FitPanel() 49 50 else … … 59 60 // already be initialized 60 61 Window A_FitPanel() 61 //String angst = root: myGlobals:gAngstStr62 //String angst = root:Packages:NIST:gAngstStr 62 63 String angst = "A" 63 64 PauseUpdate; Silent 1 // building window... … … 73 74 PopupMenu ywave,pos={13,60},size={154,19},title="Data File" 74 75 PopupMenu ywave,help={"Select the experimental intensity values"} 75 PopupMenu ywave,mode=1,value=root: myGlobals:FIT:gDataPopList,proc=A_FIT_FilePopMenuProc76 PopupMenu ywave,mode=1,value=root:Packages:NIST:FIT:gDataPopList,proc=A_FIT_FilePopMenuProc 76 77 Button loadButton,pos={13,92},size={130,20},proc=A_FIT_Load_Proc,title="Load and Plot File" 77 78 Button loadButton,help={"After choosing a file, load it into memory and plot it with this button."} … … 87 88 SetVariable lolim,pos={64,147},size={134,17},title="Lower Limit" 88 89 SetVariable lolim,help={"Enter the lower q-limit to perform the fit ("+angst+"^-1)"} 89 SetVariable lolim,limits={0,5,0},value= root: myGlobals:FIT:gLolim90 SetVariable lolim,limits={0,5,0},value= root:Packages:NIST:FIT:gLolim 90 91 SetVariable uplim,pos={63,169},size={134,17},title="Upper Limit" 91 92 SetVariable uplim,help={"Enter the upper q-limit to perform the fit ("+angst+"^-1)"} 92 SetVariable uplim,limits={0,5,0},value= root: myGlobals:FIT:gUplim93 SetVariable uplim,limits={0,5,0},value= root:Packages:NIST:FIT:gUplim 93 94 SetVariable expa,pos={13,311},size={80,17},title="pow \"a\"" 94 95 SetVariable expa,help={"This sets the exponent \"a\" for some y-axis formats. The value is ignored if the model does not use an adjustable exponent"} 95 SetVariable expa,limits={-2,10,0},value= root: myGlobals:FIT:gExpA96 SetVariable expa,limits={-2,10,0},value= root:Packages:NIST:FIT:gExpA 96 97 SetVariable expb,pos={98,311},size={80,17},title="pow \"b\"" 97 98 SetVariable expb,help={"This sets the exponent \"b\" for some x-axis formats. The value is ignored if the model does not use an adjustable exponent"} 98 SetVariable expb,limits={0,10,0},value= root: myGlobals:FIT:gExpB99 SetVariable expb,limits={0,10,0},value= root:Packages:NIST:FIT:gExpB 99 100 PopupMenu xmodel,pos={155,280},size={79,19},title="x-axis" 100 101 PopupMenu xmodel,help={"This popup selects how the x-axis will be linearized given the chosen data"} … … 104 105 SetVariable back,pos={70,338},size={139,17},title="background" 105 106 SetVariable back,help={"This constant background value will be subtracted from the experimental intensity before fitting is done"} 106 SetVariable back,limits={-Inf,Inf,0},value= root: myGlobals:FIT:gBack107 SetVariable back,limits={-Inf,Inf,0},value= root:Packages:NIST:FIT:gBack 107 108 SetVariable expc,pos={182,310},size={80,17},title="pow \"c\"" 108 109 SetVariable expc,help={"This sets the exponent \"c\" for some x-axis formats. The value is ignored if the model does not use \"c\" as an adjustable exponent"} 109 SetVariable expc,limits={-10,10,0},value= root: myGlobals:FIT:gExpC110 SetVariable expc,limits={-10,10,0},value= root:Packages:NIST:FIT:gExpC 110 111 Button sh_all,pos={65,193},size={130,20},proc=A_ShowAllButtonProc,title="Show Full q-range" 111 112 Button sh_all,help={"Use this to show the entire q-range of the data rather than just the fitted range."} … … 182 183 tempStr = "Pick the data path" 183 184 Endif 184 String/G root: myGlobals:FIT:gDataPopList =tempStr185 String/G root:Packages:NIST:FIT:gDataPopList =tempStr 185 186 ControlUpdate ywave 186 187 … … 225 226 //check for physical limits on exponent values 226 227 // if bad values found, alert, and reset to good values so the rescaling can continue 227 NVAR gA = root: myGlobals:FIT:gExpA228 NVAR gB = root: myGlobals:FIT:gExpB229 NVAR gC = root: myGlobals:FIT:gExpC228 NVAR gA = root:Packages:NIST:FIT:gExpA 229 NVAR gB = root:Packages:NIST:FIT:gExpB 230 NVAR gC = root:Packages:NIST:FIT:gExpC 230 231 if((pow_a < -2) || (pow_a > 10)) 231 232 DoAlert 0,"Exponent a must be in the range (-2,10) - the exponent a has been reset to 1" … … 740 741 end 741 742 742 Menu " Macros"743 Menu "SANS Models" 743 744 Submenu "Packages" 744 745 "Unload Linear Fitting", UnloadLinFit() -
sans/Analysis/branches/ajj_23APR07/IGOR_Package_Files/Put in User Procedures/SANS_Models_v3.00/Packages/ModelPicker/SANSModelPicker.ipf
r200 r228 53 53 Proc Init_FileList() 54 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 55 NewDataFolder/O root:Packages 56 NewDataFolder/O root:Packages:NIST 57 58 if(!DataFolderExists("root:Packages:NIST:FileList")) 59 NewDataFolder/O/S root:Packages:NIST:FileList 59 60 //create the waves 60 61 Make/O/T/N=0 fileWave,includedFileWave … … 89 90 // if the wave SANS_Model_List does not exist 90 91 Proc ReadNewProcList() 91 KillWaves/Z root: myGlobals:FileList:SANS_Model_List //kill the old list92 KillWaves/Z root:Packages:NIST:FileList:SANS_Model_List //kill the old list 92 93 FileList_GetListButtonProc("") 93 94 End … … 104 105 // 105 106 Proc TypeNewModelList() 106 variable ii=0,num=numpnts(root: myGlobals:FileList:SANS_Model_List)107 variable ii=0,num=numpnts(root:Packages:NIST:FileList:SANS_Model_List) 107 108 printf "Make/O/T/N=%d SANS_Model_List\r\r",num 108 109 do 109 printf "SANS_Model_List[%d] = \"%s\"\r",ii,root: myGlobals:FileList:SANS_Model_List[ii]110 printf "SANS_Model_List[%d] = \"%s\"\r",ii,root:Packages:NIST:FileList:SANS_Model_List[ii] 110 111 ii+=1 111 112 while(ii<num) … … 113 114 114 115 Proc FileList_BuiltInList() 115 SetDataFolder root: myGlobals:FileList116 SetDataFolder root:Packages:NIST:FileList 116 117 117 118 ////paste here... after deleting the old make statement and list … … 197 198 String ProcedureName 198 199 199 SetDataFolder root: myGlobals:FileList200 SetDataFolder root:Packages:NIST:FileList 200 201 Variable num 201 202 num=numpnts(fileWave) … … 214 215 Variable val 215 216 // a switch for me to turn off file checking 216 root: myGlobals:FileList:checkForFiles=val //0==no check, 1=check217 root:Packages:NIST:FileList:checkForFiles=val //0==no check, 1=check 217 218 End 218 219 … … 232 233 ModifyPanel fixedSize=1 233 234 234 ListBox fileList,pos={4,3},size={200,203},listWave=root: myGlobals:FileList:fileWave235 ListBox fileList,selWave=root: myGlobals:FileList:selWave,mode= 4235 ListBox fileList,pos={4,3},size={200,203},listWave=root:Packages:NIST:FileList:fileWave 236 ListBox fileList,selWave=root:Packages:NIST:FileList:selWave,mode= 4 236 237 ListBox inclList,pos={4,212},size={200,100} 237 ListBox inclList,listWave=root: myGlobals:FileList:includedFileWave238 ListBox inclList,selWave=root: myGlobals:FileList:selToDelWave,mode= 4238 ListBox inclList,listWave=root:Packages:NIST:FileList:includedFileWave 239 ListBox inclList,selWave=root:Packages:NIST:FileList:selToDelWave,mode= 4 239 240 Button button0,pos={212,173},size={110,20},proc=FileList_InsertButtonProc,title="Include File(s)" 240 241 Button button0,help={"Includes the selected procedures, functions appear under the SANS Models menu"} … … 269 270 //loop through the selected files in the list... 270 271 // 271 Wave/T fileWave=$"root: myGlobals:FileList:fileWave"272 Wave sel=$"root: myGlobals:FileList:selWave"272 Wave/T fileWave=$"root:Packages:NIST:FileList:fileWave" 273 Wave sel=$"root:Packages:NIST:FileList:selWave" 273 274 274 275 Variable num=numpnts(sel),ii 275 276 String fname="" 276 277 277 // NVAR doCheck=root: myGlobals:FileList:checkForFiles278 // NVAR doCheck=root:Packages:NIST:FileList:checkForFiles 278 279 ii=num-1 //work bottom-up to not lose the index 279 280 do … … 287 288 //try the list of already-included files 288 289 if(cmpstr(fname,"")==0) 289 Wave/T inclFileWave=$"root: myGlobals:FileList:includedFileWave"290 Wave seltoDel=$"root: myGlobals:FileList:selToDelWave"290 Wave/T inclFileWave=$"root:Packages:NIST:FileList:includedFileWave" 291 Wave seltoDel=$"root:Packages:NIST:FileList:selToDelWave" 291 292 num=numpnts(seltoDel) 292 293 ii=num-1 //work bottom-up to not lose the index … … 334 335 String list="" 335 336 336 if(Exists("root: myGlobals:FileList:SANS_Model_List") != 1)337 SetDataFolder root: myGlobals:FileList337 if(Exists("root:Packages:NIST:FileList:SANS_Model_List") != 1) 338 SetDataFolder root:Packages:NIST:FileList 338 339 LoadWave/A/T 339 340 WAVE/T w=$(StringFromList(0,S_WaveNames,";")) 340 341 SetDataFolder root: 341 342 else 342 WAVE/T w=$("root: myGlobals:FileList:SANS_Model_List")343 WAVE/T w=$("root:Packages:NIST:FileList:SANS_Model_List") 343 344 endif 344 345 345 346 // // convert the input wave to a semi-list 346 // SVAR allFiles=root: myGlobals:FileList:allFiles347 // SVAR allFiles=root:Packages:NIST:FileList:allFiles 347 348 // allFiles=MP_TextWave2SemiList(w) 348 349 list=MP_TextWave2SemiList(w) … … 353 354 354 355 // remove the items that have already been included 355 Wave/T includedFileWave=$"root: myGlobals:FileList:includedFileWave"356 Wave/T includedFileWave=$"root:Packages:NIST:FileList:includedFileWave" 356 357 Variable numInc=numpnts(includedFileWave) 357 358 for(ii=0;ii<numInc;ii+=1) … … 360 361 list = SortList(list,";",0) 361 362 num=ItemsInList(list,";") 362 WAVE/T fileWave=$"root: myGlobals:FileList:fileWave"363 WAVE selWave=$"root: myGlobals:FileList:selWave"363 WAVE/T fileWave=$"root:Packages:NIST:FileList:fileWave" 364 WAVE selWave=$"root:Packages:NIST:FileList:selWave" 364 365 Redimension/N=(num) fileWave //make the waves the proper length 365 366 Redimension/N=(num) selWave … … 393 394 394 395 // new way, to catch all files in all subfolders 395 SVAR allFiles=root: myGlobals:FileList:allFiles396 SVAR allFiles=root:Packages:NIST:FileList:allFiles 396 397 allFiles="" //clear the list 397 398 … … 412 413 list = RemoveFromList("DemoLoader.ipf",list,";" ) 413 414 // remove the items that have already been included 414 Wave/T includedFileWave=$"root: myGlobals:FileList:includedFileWave"415 Wave/T includedFileWave=$"root:Packages:NIST:FileList:includedFileWave" 415 416 Variable numInc=numpnts(includedFileWave) 416 417 for(ii=0;ii<numInc;ii+=1) … … 419 420 list = SortList(list,";",0) 420 421 num=ItemsInList(list,";") 421 WAVE/T fileWave=$"root: myGlobals:FileList:fileWave"422 WAVE selWave=$"root: myGlobals:FileList:selWave"422 WAVE/T fileWave=$"root:Packages:NIST:FileList:fileWave" 423 WAVE selWave=$"root:Packages:NIST:FileList:selWave" 423 424 Redimension/N=(num) fileWave //make the waves the proper length 424 425 Redimension/N=(num) selWave … … 434 435 435 436 Variable err=0 436 String/G root: myGlobals:FileList:allFiles=""437 SVAR allFiles = root: myGlobals:FileList:allFiles437 String/G root:Packages:NIST:FileList:allFiles="" 438 SVAR allFiles = root:Packages:NIST:FileList:allFiles 438 439 439 440 PathInfo Igor … … 458 459 459 460 //loop through the selected files in the list... 460 Wave/T fileWave=$"root: myGlobals:FileList:fileWave"461 Wave sel=$"root: myGlobals:FileList:selWave"461 Wave/T fileWave=$"root:Packages:NIST:FileList:fileWave" 462 Wave sel=$"root:Packages:NIST:FileList:selWave" 462 463 //and adjust the included file lists 463 Wave/T includedFileWave=$"root: myGlobals:FileList:includedFileWave"464 Wave selToDel=$"root: myGlobals:FileList:selToDelWave"464 Wave/T includedFileWave=$"root:Packages:NIST:FileList:includedFileWave" 465 Wave selToDel=$"root:Packages:NIST:FileList:selToDelWave" 465 466 466 467 Variable numIncl=numpnts(includedFileWave) … … 473 474 Execute/P "INSERTINCLUDE \"WriteModelData\"" 474 475 475 NVAR doCheck=root: myGlobals:FileList:checkForFiles476 NVAR doCheck=root:Packages:NIST:FileList:checkForFiles 476 477 477 478 ii=num-1 //work bottom-up to not lose the index … … 509 510 510 511 //loop through the selected files in the list... 511 Wave/T includedFileWave=$"root: myGlobals:FileList:includedFileWave"512 Wave selToDel=$"root: myGlobals:FileList:selToDelWave"512 Wave/T includedFileWave=$"root:Packages:NIST:FileList:includedFileWave" 513 Wave selToDel=$"root:Packages:NIST:FileList:selToDelWave" 513 514 // and put the unwanted procedures back in the to-add list 514 Wave/T fileWave=$"root: myGlobals:FileList:fileWave"515 Wave sel=$"root: myGlobals:FileList:selWave"515 Wave/T fileWave=$"root:Packages:NIST:FileList:fileWave" 516 Wave sel=$"root:Packages:NIST:FileList:selWave" 516 517 517 518 … … 578 579 // if root:MenuItemStr exists 579 580 //Menu "SANS Models" 580 // StrVarOrDefault("root: myGlobals:FileList:MenuItemStr_def","ModelPicker_Panel")//, RefreshMenu()581 // StrVarOrDefault("root:Packages:NIST:FileList:MenuItemStr_def","ModelPicker_Panel")//, RefreshMenu() 581 582 // SubMenu "Unsmeared Models" 582 // StrVarOrDefault("root: myGlobals:FileList:MenuItemStr1","ModelPicker_Panel")583 // StrVarOrDefault("root:Packages:NIST:FileList:MenuItemStr1","ModelPicker_Panel") 583 584 // End 584 585 // SubMenu "Smeared Models" 585 // StrVarOrDefault("root: myGlobals:FileList:MenuItemStr2","ModelPicker_Panel")586 // StrVarOrDefault("root:Packages:NIST:FileList:MenuItemStr2","ModelPicker_Panel") 586 587 // End 587 588 // SubMenu "Models 3" … … 608 609 // list += MacroList("WriteM*",sep,"KIND:1,NPARAMS:4") //data writer 609 610 // list += "-"+sep 610 // String/G root: myGlobals:FileList:MenuItemStr_def = TrimListTo255(list)611 // String/G root:Packages:NIST:FileList:MenuItemStr_def = TrimListTo255(list) 611 612 // 612 613 // list = "" … … 615 616 // list = RemoveFromList("FreezeModel", list ,";") // remove FreezeModel, it's not a model 616 617 // // list += "-"+sep 617 // String/G root: myGlobals:FileList:MenuItemStr1 = TrimListTo255(list)618 // String/G root:Packages:NIST:FileList:MenuItemStr1 = TrimListTo255(list) 618 619 // 619 620 // list="" 620 621 // list += MacroList("PlotSmea*",sep,"KIND:1,NPARAMS:1") //smeared plot procedures 621 622 // list += MacroList("PlotSmea*",sep,"KIND:1,NPARAMS:2") //smeared RPA has 2 parameters 622 // String/G root: myGlobals:FileList:MenuItemStr2 = TrimListTo255(list)623 // String/G root:Packages:NIST:FileList:MenuItemStr2 = TrimListTo255(list) 623 624 // 624 625 // BuildMenu "SANS Models" … … 678 679 String prefix 679 680 680 SVAR allFiles=root: myGlobals:FileList:allFiles681 SVAR allFiles=root:Packages:NIST:FileList:allFiles 681 682 // Build a prefix (a number of tabs to indicate the folder level by indentation) 682 683 prefix = "" -
sans/Analysis/branches/ajj_23APR07/IGOR_Package_Files/Put in User Procedures/SANS_Models_v3.00/Packages/PlotUtils2D.ipf
r200 r228 39 39 SetDataFolder root: 40 40 KillWaves $n0,$n1,$n2 // kill the default waveX that were loaded 41 //if(DataFolderExists("root:myGlobals"))42 // String/G root:myGlobals:gLastFileName = filename43 //endif44 41 return //quits the macro 45 42 endif -
sans/Analysis/branches/ajj_23APR07/IGOR_Package_Files/Put in User Procedures/SANS_Models_v3.00/Packages/SumModel/SumSANSModels.ipf
r200 r228 30 30 // (smeared fitting still broken) 31 31 // - created data folders are now buried in myGlobals 32 // DEC 07 33 // - created data folders are now :Packages:NIST:SumModel 32 34 // 33 35 /////////////////////////////// … … 38 40 DoWindow/F Sum_Model_Panel 39 41 if(V_flag==0) 40 if(!DataFolderExists("root: myGlobals"))41 NewDataFolder root: myGlobals42 if(!DataFolderExists("root:Packages:NIST")) 43 NewDataFolder root:Packages:NIST 42 44 endif 43 NewDataFolder/O root: myGlobals:SumModel45 NewDataFolder/O root:Packages:NIST:SumModel 44 46 InitSMPGlobals() 45 47 Sum_Model_Panel() … … 50 52 // 51 53 Function InitSMPGlobals() 52 Variable/G root: myGlobals:SumModel:gNParMod1=053 Variable/G root: myGlobals:SumModel:gNParMod2=054 Variable/G root:Packages:NIST:SumModel:gNParMod1=0 55 Variable/G root:Packages:NIST:SumModel:gNParMod2=0 54 56 end 55 57 … … 71 73 GroupBox group1,pos={5,50},size={216,107},title="Function # 1" 72 74 SetVariable setvar1,pos={14,128},size={140,15},title="# of Parameters" 73 SetVariable setvar1,limits={0,20,1},value= root: myGlobals:SumModel:gNParMod175 SetVariable setvar1,limits={0,20,1},value= root:Packages:NIST:SumModel:gNParMod1 74 76 GroupBox group2,pos={5,171},size={216,107},title="Function # 2" 75 77 SetVariable setvar2,pos={14,249},size={140,15},title="# of Parameters" 76 SetVariable setvar2,limits={0,20,1},value= root: myGlobals:SumModel:gNParMod278 SetVariable setvar2,limits={0,20,1},value= root:Packages:NIST:SumModel:gNParMod2 77 79 Button button0,pos={36,299},size={150,20},proc=PlotSumButtonProc,title="Plot Summed Model" 78 80 Button button1,pos={15,330},size={190,20},proc=PlotSmearedSumButtonProc,title="Plot Smeared Summed Model" … … 157 159 //make the coefficients and parameters based on the panel values 158 160 Variable nParam,n1,n2 159 n1 = root: myGlobals:SumModel:gNParMod1160 n2 = root: myGlobals:SumModel:gNParMod2161 n1 = root:Packages:NIST:SumModel:gNParMod1 162 n2 = root:Packages:NIST:SumModel:gNParMod2 161 163 nParam = n1 + n2 162 164 if(n1==0 || n2==0 || nparam==0) … … 164 166 endif 165 167 // n is ok, keep extra copy so changing panel will not affect functions 166 Variable/G root: myGlobals:SumModel:gN1=n1167 Variable/G root: myGlobals:SumModel:gN2=n2168 Variable/G root:Packages:NIST:SumModel:gN1=n1 169 Variable/G root:Packages:NIST:SumModel:gN2=n2 168 170 169 171 // these are the function names - make global so the fit function 170 172 // can find them 171 173 ControlInfo/W=Sum_Model_Panel popup1_0 172 String/G root: myGlobals:SumModel:gModelStr1=S_Value174 String/G root:Packages:NIST:SumModel:gModelStr1=S_Value 173 175 ControlInfo/W=Sum_Model_Panel popup2_0 174 String/G root: myGlobals:SumModel:gModelStr2=S_Value176 String/G root:Packages:NIST:SumModel:gModelStr2=S_Value 175 177 176 178 //these are the coefficent waves - local only … … 225 227 //make the coefficients and parameters based on the panel values 226 228 Variable nParam,n1,n2 227 n1 = root: myGlobals:SumModel:gNParMod1228 n2 = root: myGlobals:SumModel:gNParMod2229 n1 = root:Packages:NIST:SumModel:gNParMod1 230 n2 = root:Packages:NIST:SumModel:gNParMod2 229 231 nParam = n1 + n2 230 232 if(n1==0 || n2==0 || nparam==0) … … 232 234 endif 233 235 // n is ok, keep extra copy so changing panel will not affect functions 234 Variable/G root: myGlobals:SumModel:gN1=n1235 Variable/G root: myGlobals:SumModel:gN2=n2236 Variable/G root:Packages:NIST:SumModel:gN1=n1 237 Variable/G root:Packages:NIST:SumModel:gN2=n2 236 238 237 239 // these are the function names - make global so the fit function 238 240 // can find them 239 241 ControlInfo/W=Sum_Model_Panel popup1_0 240 String/G root: myGlobals:SumModel:gModelStr1=S_Value242 String/G root:Packages:NIST:SumModel:gModelStr1=S_Value 241 243 ControlInfo/W=Sum_Model_Panel popup2_0 242 String/G root: myGlobals:SumModel:gModelStr2=S_Value244 String/G root:Packages:NIST:SumModel:gModelStr2=S_Value 243 245 244 246 //these are the coefficent waves - local only, in the current data folder! … … 289 291 Wave w,yw,xw 290 292 291 SVAR funcStr1=root: myGlobals:SumModel:gModelStr1 //string names of the functions, set by the macro292 SVAR funcStr2=root: myGlobals:SumModel:gModelStr2293 NVAR n1=root: myGlobals:SumModel:gN1 //number of coefficients, set by the macro294 NVAR n2=root: myGlobals:SumModel:gN2293 SVAR funcStr1=root:Packages:NIST:SumModel:gModelStr1 //string names of the functions, set by the macro 294 SVAR funcStr2=root:Packages:NIST:SumModel:gModelStr2 295 NVAR n1=root:Packages:NIST:SumModel:gN1 //number of coefficients, set by the macro 296 NVAR n2=root:Packages:NIST:SumModel:gN2 295 297 296 298 Variable retVal … … 358 360 end 359 361 360 Menu " Macros"362 Menu "SANS Models" 361 363 Submenu "Packages" 362 364 "Unload Sum SANS Models", UnloadSumModel() -
sans/Analysis/branches/ajj_23APR07/IGOR_Package_Files/Put in User Procedures/SANS_Models_v3.00/Packages/Wrapper.ipf
r223 r228 13 13 14 14 Function Init_WrapperPanel() 15 //make sure that folders exist - this is the first initialization to be called 16 NewDataFolder/O root:Packages 17 NewDataFolder/O root:Packages:NIST 18 15 19 DoWindow/F WrapperPanel 16 20 if(V_flag==0) 17 if(exists("root: coefKWStr")==0)18 String/G root: coefKWStr=""19 endif 20 if(exists("root: suffixKWStr")==0)21 String/G root: suffixKWStr=""21 if(exists("root:Packages:NIST:coefKWStr")==0) 22 String/G root:Packages:NIST:coefKWStr="" 23 endif 24 if(exists("root:Packages:NIST:suffixKWStr")==0) 25 String/G root:Packages:NIST:suffixKWStr="" 22 26 endif 23 27 Execute "WrapperPanel()" … … 422 426 String funcStr 423 427 424 SVAR listStr=root: coefKWStr428 SVAR listStr=root:Packages:NIST:coefKWStr 425 429 String coefStr = StringByKey(funcStr, listStr ,"=",";",0) 426 430 … … 437 441 String coefStr 438 442 439 SVAR listStr=root: suffixKWStr443 SVAR listStr=root:Packages:NIST:suffixKWStr 440 444 String suffixStr = StringByKey(coefStr, listStr ,"=",";",0) 441 445 … … 627 631 String funcStr,coefStr 628 632 629 SVAR listStr=root: coefKWStr633 SVAR listStr=root:Packages:NIST:coefKWStr 630 634 String properCoefStr = StringByKey(funcStr, listStr ,"=",";",0) 631 635 if(cmpstr(coefStr,properCoefStr)==0) -
sans/Analysis/branches/ajj_23APR07/IGOR_Package_Files/Put in User Procedures/SANS_Models_v3.00/PlotManager.ipf
r211 r228 38 38 Button button5,pos={15,323},size={220,20},proc=A_PlotManager_KillAll,title="Remove All Data From Memory" 39 39 ListBox fileList,pos={13,11},size={206,179} 40 ListBox fileList,listWave=root: myGlobals:OneDLoader:fileWave41 ListBox fileList,selWave=root: myGlobals:OneDLoader:selWave,mode= 440 ListBox fileList,listWave=root:Packages:NIST:OneDLoader:fileWave 41 ListBox fileList,selWave=root:Packages:NIST:OneDLoader:selWave,mode= 4 42 42 Button button6,pos={238,153},size={100,20},proc=A_OneDLoader_LoadButton,title="Load File(s)" 43 43 Button button6,help={"Loads the selected files into memory and will graph them if that option is checked"} … … 198 198 Proc A_Init_OneDLoader() 199 199 //create the data folder 200 NewDataFolder/O/S root: myGlobals:OneDLoader200 NewDataFolder/O/S root:Packages:NIST:OneDLoader 201 201 //create the waves 202 202 Make/O/T/N=1 fileWave="" … … 231 231 232 232 num=ItemsInList(newlist,";") 233 WAVE/T fileWave=$"root: myGlobals:OneDLoader:fileWave"234 WAVE selWave=$"root: myGlobals:OneDLoader:selWave"233 WAVE/T fileWave=$"root:Packages:NIST:OneDLoader:fileWave" 234 WAVE selWave=$"root:Packages:NIST:OneDLoader:selWave" 235 235 Redimension/N=(num) fileWave 236 236 Redimension/N=(num) selWave … … 243 243 244 244 //loop through the selected files in the list... 245 Wave/T fileWave=$"root: myGlobals:OneDLoader:fileWave"246 Wave sel=$"root: myGlobals:OneDLoader:selWave"245 Wave/T fileWave=$"root:Packages:NIST:OneDLoader:fileWave" 246 Wave sel=$"root:Packages:NIST:OneDLoader:selWave" 247 247 Variable num=numpnts(sel),ii=0 248 248 String fname="",pathStr="",fullPath="",newFileName="" -
sans/Analysis/branches/ajj_23APR07/IGOR_Package_Files/Put in User Procedures/SANS_Models_v3.00/PlotUtilsMacro.ipf
r220 r228 26 26 String funcStr,coefStr,suffix 27 27 28 if(exists("root: coefKWStr")==0)29 String/G root: coefKWStr=""30 String/G root: suffixKWStr=""31 endif 32 SVAR coefKWStr = root: coefKWStr33 SVAR suffixKWStr = root: suffixKWStr28 if(exists("root:Packages:NIST:coefKWStr")==0) 29 String/G root:Packages:NIST:coefKWStr="" 30 String/G root:Packages:NIST:suffixKWStr="" 31 endif 32 SVAR coefKWStr = root:Packages:NIST:coefKWStr 33 SVAR suffixKWStr = root:Packages:NIST:suffixKWStr 34 34 coefKWStr += funcStr+"="+coefStr+";" 35 35 suffixKWStr += coefStr+"="+suffix+";" … … 93 93 SetDataFolder root: 94 94 KillWaves $n0,$n1,$n2 // kill the default waveX that were loaded 95 //if(DataFolderExists("root: myGlobals"))96 // String/G root: myGlobals:gLastFileName = filename95 //if(DataFolderExists("root:Packages:NIST")) 96 // String/G root:Packages:NIST:gLastFileName = filename 97 97 //endif 98 98 return //quits the macro … … 141 141 SetDataFolder root: 142 142 KillWaves $n0,$n1,$n2,$n3,$n4,$n5 // kill the default waveX that were loaded 143 //if(DataFolderExists("root: myGlobals"))144 // String/G root: myGlobals:gLastFileName = filename143 //if(DataFolderExists("root:Packages:NIST")) 144 // String/G root:Packages:NIST:gLastFileName = filename 145 145 //endif //set the last file loaded to the one NOT loaded 146 146 return //quits the macro … … 215 215 if(V_flag==2) //user selected No, don't load the data 216 216 KillWaves $n0,$n1,$n2,$n3,$n4,$n5 // kill the default waveX that were loaded 217 //if(DataFolderExists("root: myGlobals"))218 // String/G root: myGlobals:gLastFileName = filename217 //if(DataFolderExists("root:Packages:NIST")) 218 // String/G root:Packages:NIST:gLastFileName = filename 219 219 //endif //set the last file loaded to the one NOT loaded 220 220 return //quits the macro … … 236 236 237 237 ////// 238 if(DataFolderExists("root: myGlobals"))239 String/G root: myGlobals:gLastFileName = filename238 if(DataFolderExists("root:Packages:NIST")) 239 String/G root:Packages:NIST:gLastFileName = filename 240 240 endif 241 241 … … 393 393 if(V_flag==2) //user selected No 394 394 KillWaves $n0,$n1,$n2,$n3,$n4 // kill the default waveX that were loaded 395 if(DataFolderExists("root: myGlobals"))396 String/G root: myGlobals:gLastFileName = filename395 if(DataFolderExists("root:Packages:NIST")) 396 String/G root:Packages:NIST:gLastFileName = filename 397 397 endif //set the last file loaded to the one NOT loaded 398 398 return //quits the macro … … 408 408 KillWaves $n0,$n1,$n2,$n3,$n4 409 409 410 if(DataFolderExists("root: myGlobals"))411 String/G root: myGlobals:gLastFileName = filename410 if(DataFolderExists("root:Packages:NIST")) 411 String/G root:Packages:NIST:gLastFileName = filename 412 412 endif 413 413 … … 462 462 if (V_flag == 0) 463 463 //path does not exist - no folder selected 464 String/G root: myGlobals:gCatPathStr = "no folder selected"464 String/G root:Packages:NIST:gCatPathStr = "no folder selected" 465 465 return(1) 466 466 else … … 472 472 return(1) 473 473 endif 474 String/G root: myGlobals:gCatPathStr = dum474 String/G root:Packages:NIST:gCatPathStr = dum 475 475 return(0) //no error 476 476 endif
Note: See TracChangeset
for help on using the changeset viewer.