Changeset 404 for sans/Dev/trunk/NCNR_User_Procedures/USANS
- Timestamp:
- Sep 12, 2008 9:25:36 PM (14 years ago)
- Location:
- sans/Dev/trunk/NCNR_User_Procedures/USANS
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/Dev/trunk/NCNR_User_Procedures/USANS/BT5_Loader.ipf
r328 r404 28 28 Function LoadBT5File(fname,type) 29 29 String fname,type 30 31 SVAR USANSFolder = root:Packages:NIST:USANS:Globals:gUSANSFolder 30 32 31 33 Variable num=200,err=0,refnum 32 Make/O/D/N=(num) $( "root:"+type+":Angle")33 Make/O/D/N=(num) $( "root:"+type+":DetCts")34 Make/O/D/N=(num) $( "root:"+type+":ErrDetCts")35 Make/O/D/N=(num) $( "root:"+type+":MonCts")36 Make/O/D/N=(num) $( "root:"+type+":TransCts")37 Wave Angle = $( "root:"+type+":Angle")38 Wave DetCts = $( "root:"+type+":DetCts")39 Wave ErrDetCts = $( "root:"+type+":ErrDetCts")40 Wave MonCts = $( "root:"+type+":MonCts")41 Wave TransCts = $( "root:"+type+":TransCts")34 Make/O/D/N=(num) $(USANSFolder+":"+type+":Angle") 35 Make/O/D/N=(num) $(USANSFolder+":"+type+":DetCts") 36 Make/O/D/N=(num) $(USANSFolder+":"+type+":ErrDetCts") 37 Make/O/D/N=(num) $(USANSFolder+":"+type+":MonCts") 38 Make/O/D/N=(num) $(USANSFolder+":"+type+":TransCts") 39 Wave Angle = $(USANSFolder+":"+type+":Angle") 40 Wave DetCts = $(USANSFolder+":"+type+":DetCts") 41 Wave ErrDetCts = $(USANSFolder+":"+type+":ErrDetCts") 42 Wave MonCts = $(USANSFolder+":"+type+":MonCts") 43 Wave TransCts = $(USANSFolder+":"+type+":TransCts") 42 44 43 45 Open/R refNum as fname //if fname is "", a dialog will be presented … … 128 130 String type 129 131 132 SVAR USANSFolder = root:Packages:NIST:USANS:Globals:gUSANSFolder 133 130 134 Variable pkNotFound,pkPt,pkAngle,pkVal,temp 131 Wave angle = $("root:"+type+":Angle") 132 Wave detCts = $("root:"+type+":DetCts") 135 Wave angle = $(USANSFolder+":"+type+":Angle") 136 Wave detCts = $(USANSFolder+":"+type+":DetCts") 137 133 138 134 139 WaveStats/Q detcts … … 165 170 String type 166 171 Variable pkAngle 167 168 Wave angle = $("root:"+type+":Angle") 172 173 SVAR USANSFolder = root:Packages:NIST:USANS:Globals:gUSANSFolder 174 175 Wave angle = $(USANSFolder+":"+type+":Angle") 169 176 Variable num=numpnts(angle) 170 177 Variable deg2QConv=5.55e-5 //JGB -- 2/24/01 171 178 172 Make/O/N=(num) $( "root:"+type+":Qvals")173 Wave qvals = $( "root:"+type+":Qvals")179 Make/O/N=(num) $(USANSFolder+":"+type+":Qvals") 180 Wave qvals = $(USANSFolder+":"+type+":Qvals") 174 181 Qvals = deg2QConv*(angle[p] - pkAngle) 175 182 … … 187 194 String type 188 195 196 SVAR USANSFolder = root:Packages:NIST:USANS:Globals:gUSANSFolder 197 189 198 Variable levNotFound,levPt,Cts,num,ii 190 Wave angle = $( "root:"+type+":Angle")191 Wave detCts = $( "root:"+type+":DetCts")192 Wave TransCts = $( "root:"+type+":TransCts")199 Wave angle = $(USANSFolder+":"+type+":Angle") 200 Wave detCts = $(USANSFolder+":"+type+":DetCts") 201 Wave TransCts = $(USANSFolder+":"+type+":TransCts") 193 202 FindLevel/Q/P angle,2 //use angles greater than 2 deg 194 203 levNotFound=V_Flag //V_Flag==1 if no pk found … … 207 216 208 217 //update the note 209 Wave DetCts = $( "root:"+type+":DetCts")218 Wave DetCts = $(USANSFolder+":"+type+":DetCts") 210 219 String str,strVal 211 220 str=note(DetCts) -
sans/Dev/trunk/NCNR_User_Procedures/USANS/COR_Graph.ipf
r328 r404 23 23 // 24 24 Function DoCORGraph() 25 26 SVAR USANSFolder = root:Packages:NIST:USANS:Globals:gUSANSFolder 25 27 26 28 DoWindow/F COR_Graph … … 32 34 SetVariable gTransWide,pos={210,12},size={135,15},title="Trans - Wide",format="%5.4f" 33 35 SetVariable gTransWide,help={"Average counts on transmssion detector at wide angles"} 34 SetVariable gTransWide,limits={0,1,0.001},value= root:Globals:MainPanel:gTransWide36 SetVariable gTransWide,limits={0,1,0.001},value= $(USANSFolder+":Globals:MainPanel:gTransWide") 35 37 SetVariable gTransRock,pos={210,27},size={135,15},title="Trans - Rock",format="%5.4f" 36 38 SetVariable gTransRock,help={"Transmission counts at the zero-angle peak"} 37 SetVariable gTransRock,limits={0,1,0.001},value= root:Globals:MainPanel:gTransRock39 SetVariable gTransRock,limits={0,1,0.001},value= $(USANSFolder+":Globals:MainPanel:gTransRock") 38 40 SetVariable gEmpCts,pos={210,42},size={135,15},title="EMP Level",format="%7.4f" 39 SetVariable gEmpCts,limits={-Inf,Inf,0.1},value= root:Globals:MainPanel:gEmpCts41 SetVariable gEmpCts,limits={-Inf,Inf,0.1},value= $(USANSFolder+":Globals:MainPanel:gEmpCts") 40 42 SetVariable gEmpCts,help={"High q limit of empty cell scattering normalized to 1.0e6 monitor counts"} 41 43 SetVariable gBkgCts,pos={210,57},size={135,15},title="BKG Level",format="%7.4f" 42 SetVariable gBkgCts,limits={-Inf,Inf,0.1},value= root:Globals:MainPanel:gBkgCts44 SetVariable gBkgCts,limits={-Inf,Inf,0.1},value= $(USANSFolder+":Globals:MainPanel:gBkgCts") 43 45 SetVariable gBkgCts,help={"Background scattering level normalized to 1.0e6 monitor counts"} 44 46 SetVariable gThick,pos={210,72},size={135,15},title="SAM Thick(cm)",format="%5.4f" 45 47 SetVariable gThick,help={"Thickness of the sample in centimeters"} 46 SetVariable gThick,limits={0,5,0.01},value= root:Globals:MainPanel:gThick48 SetVariable gThick,limits={0,5,0.01},value= $(USANSFolder+":Globals:MainPanel:gThick") 47 49 Button UpdateButton,pos={115,19},size={88,20},proc=UpdateButtonProc,title="Update Trans" 48 50 Button UpdateButton,help={"Updates both the wide and rocking transmission values based on the raw data files"} … … 94 96 // 95 97 Function GraphSAM() 98 99 SVAR USANSFolder = root:Packages:NIST:USANS:Globals:gUSANSFolder 100 96 101 //is it already on the graph? 97 SetDataFolder root:Graph102 SetDataFolder $(USANSFolder+":Graph") 98 103 String list="" 99 104 list = Wavelist("DetCts_SAM*",";","WIN:COR_Graph") 100 SetDataFolder root:101 105 if(strlen(list)!=0) 102 106 //Print "SAM already on graph" … … 104 108 Endif 105 109 //append the data if it exists 106 If(waveExists($" root:Graph:DetCts_SAM")==1)110 If(waveExists($"DetCts_SAM")==1) 107 111 DoWindow/F COR_Graph 108 AppendToGraph :Graph:DetCts_SAM vs :Graph:Qvals_SAM112 AppendToGraph DetCts_SAM vs Qvals_SAM 109 113 ModifyGraph rgb(DetCts_SAM)=(1,12815,52428) 110 114 ModifyGraph mode(DetCts_SAM)=3,marker(DetCts_SAM)=19,msize(DetCts_SAM)=2 111 115 ModifyGraph tickUnit=1 112 ErrorBars DetCts_SAM Y,wave=( :Graph:ErrDetCts_SAM,:Graph:ErrDetCts_SAM)116 ErrorBars DetCts_SAM Y,wave=(ErrDetCts_SAM,ErrDetCts_SAM) 113 117 endif 118 SetDataFolder root: 114 119 End 115 120 … … 117 122 // 118 123 Function GraphEMP() 119 SetDataFolder root:Graph 124 125 SVAR USANSFolder = root:Packages:NIST:USANS:Globals:gUSANSFolder 126 127 SetDataFolder $(USANSFolder+":Graph") 120 128 String list="" 121 129 list = Wavelist("DetCts_EMP*",";","WIN:COR_Graph") 122 SetDataFolder root:123 130 if(strlen(list)!=0) 124 131 // Print "EMP already on graph" … … 126 133 Endif 127 134 //append the data if it exists 128 If(waveExists($" root:Graph:DetCts_EMP")==1)135 If(waveExists($"DetCts_EMP")==1) 129 136 DoWindow/F COR_Graph 130 AppendToGraph :Graph:DetCts_EMP vs :Graph:Qvals_EMP137 AppendToGraph DetCts_EMP vs Qvals_EMP 131 138 ModifyGraph msize(DetCts_EMP)=2,rgb(DetCts_EMP)=(1,39321,19939) 132 139 ModifyGraph mode(DetCts_EMP)=3,marker(DetCts_EMP)=19 133 140 ModifyGraph tickUnit=1 134 ErrorBars DetCts_EMP Y,wave=( :Graph:ErrDetCts_EMP,:Graph:ErrDetCts_EMP)141 ErrorBars DetCts_EMP Y,wave=(ErrDetCts_EMP,ErrDetCts_EMP) 135 142 endif 143 SetDataFolder root: 136 144 return(0) 137 145 End … … 140 148 // 141 149 Function GraphCOR() 142 SetDataFolder root:Graph 150 SVAR USANSFolder = root:Packages:NIST:USANS:Globals:gUSANSFolder 151 152 SetDataFolder $(USANSFolder+":Graph") 153 143 154 String list="" 144 155 list = Wavelist("DetCts_COR*",";","WIN:COR_Graph") 145 SetDataFolder root:146 156 if(strlen(list)!=0) 147 157 // Print "COR already on graph" … … 149 159 Endif 150 160 //append the data if it exists 151 If(waveExists($" root:Graph:DetCts_COR")==1)161 If(waveExists($"DetCts_COR")==1) 152 162 DoWindow/F COR_Graph 153 AppendToGraph :Graph:DetCts_COR vs :Graph:Qvals_COR163 AppendToGraph DetCts_COR vs Qvals_COR 154 164 ModifyGraph msize(DetCts_COR)=2,rgb(DetCts_COR)=(52428,34958,1) 155 165 ModifyGraph mode(DetCts_COR)=3,marker(DetCts_COR)=19 156 166 ModifyGraph tickUnit=1 157 ErrorBars DetCts_COR Y,wave=( :Graph:ErrDetCts_COR,:Graph:ErrDetCts_COR)167 ErrorBars DetCts_COR Y,wave=(ErrDetCts_COR,ErrDetCts_COR) 158 168 endif 169 170 SetDataFolder root: 159 171 return(0) 160 172 End … … 162 174 // add horizoontal lines for the background and empty cell levels 163 175 Function GraphEMPBKGLevels() 176 177 SVAR USANSFolder = root:Packages:NIST:USANS:Globals:gUSANSFolder 178 164 179 //if the data is on the graph, remove them and replot, to properly reset the scale 165 180 DoUpdate … … 172 187 Endif 173 188 DoUpdate 174 AppendToGraph :EMP:EMPLevel,:BKG:BKGLevel189 AppendToGraph $(USANSFolder+":EMP:EMPLevel"),$(USANSFolder+":BKG:BKGLevel") 175 190 ModifyGraph rgb(empLevel)=(0,0,0),lsize(bkgLevel)=2,rgb(bkgLevel)=(52428,1,1) 176 191 ModifyGraph lsize(empLevel)=2,offset={0,0} 177 192 ModifyGraph tickUnit=1 178 193 GetAxis/W=COR_Graph/Q bottom 179 SetScale/I x V_min,V_max,"", :EMP:EMPLevel,:BKG:BKGLevel194 SetScale/I x V_min,V_max,"",$(USANSFolder+":EMP:EMPLevel"),$(USANSFolder+":BKG:BKGLevel") 180 195 return(0) 181 196 End … … 188 203 Function SaveButtonProc(ctrlName) : ButtonControl 189 204 String ctrlName 205 206 SVAR USANSFolder = root:Packages:NIST:USANS:Globals:gUSANSFolder 190 207 191 208 PathInfo/S savePathName … … 199 216 200 217 //check for data save type (controlled by radio buttons) 201 NVAR gRadioVal= root:Globals:MainPanel:gTypeCheck//1=COR,2=SAM,3=EMP218 NVAR gRadioVal=$(USANSFolder+":Globals:MainPanel:gTypeCheck") //1=COR,2=SAM,3=EMP 202 219 switch(gRadioVal) 203 220 case 1: //COR … … 220 237 //if so, read off the point range (cursors should be on the same wave as the save type) 221 238 if(useCrsrs) 222 Wave xwave=$( "root:Graph:Qvals_"+type)239 Wave xwave=$(USANSFolder+":Graph:Qvals_"+type) 223 240 ptA=x2pnt(xwave,xcsr(A)) 224 241 ptB=x2pnt(xwave,xcsr(B)) … … 244 261 Variable checked 245 262 246 NVAR gRadioVal=root:Globals:MainPanel:gTypeCheck //1=COR,2=SAM,3=EMP 263 SVAR USANSFolder = root:Packages:NIST:USANS:Globals:gUSANSFolder 264 265 NVAR gRadioVal=$(USANSFolder+":Globals:MainPanel:gTypeCheck") //1=COR,2=SAM,3=EMP 247 266 String type="" 248 267 switch(gRadioVal) … … 267 286 Variable ok=WhichListItem(yname, str,";",0) 268 287 if(ok != -1) 269 Wave ywave=$( "root:Graph:DetCts_"+type)288 Wave ywave=$(USANSFolder+":Graph:DetCts_"+type) 270 289 Showinfo/W=COR_Graph 271 290 Cursor/A=1/P/S=1 A,$yname,0 … … 293 312 String ctrlName 294 313 Variable checked 295 296 NVAR gRadioVal=root:Globals:MainPanel:gTypeCheck 314 315 SVAR USANSFolder = root:Packages:NIST:USANS:Globals:gUSANSFolder 316 317 NVAR gRadioVal=$(USANSFolder+":Globals:MainPanel:gTypeCheck") 297 318 298 319 strswitch(ctrlName) … … 323 344 Function UpdateButtonProc(ctrlName) : ButtonControl 324 345 String ctrlName 325 326 Wave samCts=$"root:SAM:DetCts" 327 Wave empCts=$"root:EMP:DetCts" 346 347 SVAR USANSFolder = root:Packages:NIST:USANS:Globals:gUSANSFolder 348 349 Wave samCts=$(USANSFolder+":SAM:DetCts") 350 Wave empCts=$(USANSFolder+":EMP:DetCts") 328 351 if((WaveExists(samCts)==0) || (WaveExists(empCts)==0)) 329 Variable/G root:Globals:MainPanel:gTransWide=NaN //error330 Variable/G root:Globals:MainPanel:gTransRock=NaN352 Variable/G $(USANSFolder+":Globals:MainPanel:gTransWide")=NaN //error 353 Variable/G $(USANSFolder+":Globals:MainPanel:gTransRock")=NaN 331 354 return(1) 332 355 Endif … … 338 361 samRock = NumberByKey("PEAKVAL",samNote,":",";") 339 362 empRock = NumberByKey("PEAKVAL",empNote,":",";") 340 Variable/G root:Globals:MainPanel:gTransWide=samWide/empWide341 Variable/G root:Globals:MainPanel:gTransRock=samRock/empRock363 Variable/G $(USANSFolder+":Globals:MainPanel:gTransWide")=samWide/empWide 364 Variable/G $(USANSFolder+":Globals:MainPanel:gTransRock")=samRock/empRock 342 365 343 366 return(0) … … 385 408 Function QpkFromNote(type) 386 409 String type 387 388 Wave/Z detCts=$("root:Graph:DetCts_"+type) 410 411 SVAR USANSFolder = root:Packages:NIST:USANS:Globals:gUSANSFolder 412 413 Wave/Z detCts=$(USANSFolder+":Graph:DetCts_"+type) 389 414 if(!WaveExists(detCts)) 390 415 return(NaN) … … 406 431 String type 407 432 Variable zeroAngle 433 434 SVAR USANSFolder = root:Packages:NIST:USANS:Globals:gUSANSFolder 408 435 409 436 //SETS the wave note with the PEAKANG value … … 418 445 //use the listBox wave directly 419 446 420 Wave/T listW=$( "root:Globals:MainPanel:"+type+"Wave")447 Wave/T listW=$(USANSFolder+":Globals:MainPanel:"+type+"Wave") 421 448 Variable ii,num=numpnts(listW) 422 449 String fname="",fpath="" … … 447 474 448 475 //find the peak value at the supplied angle, rather than automatic... 449 Wave tmpangle = $( "root:"+type+":Angle")450 Wave tmpdetCts = $( "root:"+type+":DetCts")476 Wave tmpangle = $(USANSFolder+":"+type+":Angle") 477 Wave tmpdetCts = $(USANSFolder+":"+type+":DetCts") 451 478 Variable pkHt=0 452 479 pkHt = interp(zeroAngle,tmpangle,tmpdetcts) … … 463 490 // 464 491 //copy the data to plot to the root:Graph directory, and give clear names 465 if(WaveExists($( "root:"+type+":Qvals")))466 Duplicate/O $( "root:"+type+":Qvals"),$("root:Graph:Qvals_"+type)467 Endif 468 Duplicate/O $( "root:"+type+":Angle"),$("root:Graph:Angle_"+type)469 Duplicate/O $( "root:"+type+":DetCts"),$("root:Graph:DetCts_"+type)470 Duplicate/O $( "root:"+type+":ErrDetCts"),$("root:Graph:ErrDetCts_"+type)492 if(WaveExists($(USANSFolder+":"+type+":Qvals"))) 493 Duplicate/O $(USANSFolder+":"+type+":Qvals"),$(USANSFolder+":Graph:Qvals_"+type) 494 Endif 495 Duplicate/O $(USANSFolder+":"+type+":Angle"),$(USANSFolder+":Graph:Angle_"+type) 496 Duplicate/O $(USANSFolder+":"+type+":DetCts"),$(USANSFolder+":Graph:DetCts_"+type) 497 Duplicate/O $(USANSFolder+":"+type+":ErrDetCts"),$(USANSFolder+":Graph:ErrDetCts_"+type) 471 498 472 499 //now plot the data (or just bring the graph to the front) -
sans/Dev/trunk/NCNR_User_Procedures/USANS/LakeDesmearing_JB.ipf
r379 r404 54 54 // main entry routine 55 55 Proc Desmear() 56 57 SVAR USANSFolder = root:Packages:NIST:USANS:Globals:gUSANSFolder 58 56 59 //check for the correct data folder, initialize if necessary 57 60 // 58 if(DataFolderExists( "root:DSM") == 0)61 if(DataFolderExists($(USANSFolder+":DSM")) == 0) 59 62 Execute "Init_Desmearing()" 60 63 endif 61 64 62 65 //always initialize these 63 String/G root:DSM:gStr1= ""64 String/G root:DSM:gStr2= ""65 String/G root:DSM:gIterStr= ""66 String/G $(USANSFolder+":DSM:gStr1") = "" 67 String/G $(USANSFolder+":DSM:gStr2") = "" 68 String/G $(USANSFolder+":DSM:gIterStr") = "" 66 69 67 70 DoWindow/F Desmear_Graph … … 73 76 Proc Init_Desmearing() 74 77 //set up the folder(s) needed 75 NewDataFolder/O root:DSM76 NewDataFolder/O root:myGlobals//in case it wasn't created elsewhere77 78 String/G root:DSM:gCurFile=""79 80 Variable/G root:DSM:gMaxFastIter= 100 //max number of iter in Fast convergence81 Variable/G root:DSM:gMaxSlowIter= 1000082 83 Variable/G root:DSM:gNptsExtrap= 10 //points for high q extrapolation84 Variable/G root:DSM:gChi2Target= 1 //chi^2 target85 Variable/G root:DSM:gPowerM= -486 Variable/G root:DSM:gDqv= 0.117 //2005 measured slit height - see John87 Variable/G root:DSM:gNq= 188 Variable/G root:DSM:gS= 0 // global varaible for Midpnt()89 Variable/G root:DSM:gSmoothFac=0.0390 91 Variable/G root:DSM:gChi2Final= 0 //chi^2 final92 Variable/G root:DSM:gIterations= 0 //total number of iterations93 94 String/G root:DSM:gStr1= "" //information strings95 String/G root:DSM:gStr2= ""96 String/G root:DSM:gIterStr= ""97 Variable/G root:DSM:gChi2Smooth= 098 99 Variable/G root:DSM:gFreshMask=178 NewDataFolder/O $(USANSFolder+":DSM") 79 NewDataFolder/O $(USANSFolder+":myGlobals") //in case it wasn't created elsewhere 80 81 String/G $(USANSFolder+":DSM:gCurFile")="" 82 83 Variable/G $(USANSFolder+":DSM:gMaxFastIter") = 100 //max number of iter in Fast convergence 84 Variable/G $(USANSFolder+":DSM:gMaxSlowIter") = 10000 85 86 Variable/G $(USANSFolder+":DSM:gNptsExtrap") = 10 //points for high q extrapolation 87 Variable/G $(USANSFolder+":DSM:gChi2Target") = 1 //chi^2 target 88 Variable/G $(USANSFolder+":DSM:gPowerM") = -4 89 Variable/G $(USANSFolder+":DSM:gDqv") = 0.117 //2005 measured slit height - see John 90 Variable/G $(USANSFolder+":DSM:gNq") = 1 91 Variable/G $(USANSFolder+":DSM:gS") = 0 // global varaible for Midpnt() 92 Variable/G $(USANSFolder+":DSM:gSmoothFac")=0.03 93 94 Variable/G $(USANSFolder+":DSM:gChi2Final") = 0 //chi^2 final 95 Variable/G $(USANSFolder+":DSM:gIterations") = 0 //total number of iterations 96 97 String/G $(USANSFolder+":DSM:gStr1") = "" //information strings 98 String/G $(USANSFolder+":DSM:gStr2") = "" 99 String/G $(USANSFolder+":DSM:gIterStr") = "" 100 Variable/G $(USANSFolder+":DSM:gChi2Smooth") = 0 101 102 Variable/G $(USANSFolder+":DSM:gFreshMask")=1 100 103 End 101 104 … … 163 166 Variable m 164 167 Wave FW,Q_exp 165 166 NVAR dqv = root:DSM:gDqv 167 NVAR NN = root:DSM:gNq 168 169 SVAR USANSFolder = root:Packages:NIST:USANS:Globals:gUSANSFolder 170 171 NVAR dqv = $(USANSFolder+":DSM:gDqv") 172 NVAR NN = $(USANSFolder+":DSM:gNq") 168 173 169 174 // Calculate Remainder fractions and put into separate array. 170 175 Variable lower,ii,ss,jj 171 Duplicate/O Q_exp root:DSM:R_wave172 wave r_wave = root:DSM:R_wave176 Duplicate/O Q_exp $(USANSFolder+":DSM:R_wave") 177 wave r_wave = $(USANSFolder+":DSM:R_wave") 173 178 174 179 // Make/O/D/N=75 root:DSM:SS_save //debug … … 241 246 Function DU(ii,jj) 242 247 Variable ii,jj 243 244 Wave Q_exp = root:DSM:Q_exp 248 249 SVAR USANSFolder = root:Packages:NIST:USANS:Globals:gUSANSFolder 250 251 Wave Q_exp = $(USANSFolder+":DSM:Q_exp") 245 252 Variable DU 246 253 … … 259 266 Variable ii,jj 260 267 261 Wave Q_exp=root:DSM:Q_exp 268 SVAR USANSFolder = root:Packages:NIST:USANS:Globals:gUSANSFolder 269 270 Wave Q_exp=$(USANSFolder+":DSM:Q_exp") 262 271 Variable IG,UL,UU 263 272 … … 284 293 Variable ii,jj 285 294 295 SVAR USANSFolder = root:Packages:NIST:USANS:Globals:gUSANSFolder 296 286 297 Variable FF 287 NVAR dqv = root:DSM:gDqv298 NVAR dqv = $(USANSFolder+":DSM:gDqv") 288 299 289 300 FF = (1.0/dqv)*(0.5+HH(ii,jj)) … … 295 306 Variable ii,jj 296 307 308 SVAR USANSFolder = root:Packages:NIST:USANS:Globals:gUSANSFolder 309 297 310 Variable GG 298 NVAR dqv = root:DSM:gDqv311 NVAR dqv = $(USANSFolder+":DSM:gDqv") 299 312 300 313 GG = (1.0/dqv)*(0.5-HH(ii,jj)) … … 305 318 Variable ii,jj 306 319 307 Wave Q_exp=root:DSM:Q_exp 320 SVAR USANSFolder = root:Packages:NIST:USANS:Globals:gUSANSFolder 321 322 Wave Q_exp=$(USANSFolder+":DSM:Q_exp") 308 323 Variable HH 309 324 … … 316 331 Function CC(ii,jj) 317 332 Variable ii,jj 318 319 wave Q_exp = root:DSM:Q_exp 333 334 SVAR USANSFolder = root:Packages:NIST:USANS:Globals:gUSANSFolder 335 336 wave Q_exp = $(USANSFolder+":DSM:Q_exp") 320 337 Variable CC 321 338 … … 339 356 Function QROMO(A,B,qi,m) 340 357 Variable A,B,qi,m 358 359 SVAR USANSFolder = root:Packages:NIST:USANS:Globals:gUSANSFolder 341 360 342 361 Variable EPS,JMAX,JMAXP,KM,K … … 346 365 K=KM+1 347 366 348 Make/O/D/N=(JMAX) root:DSM:S_wave349 Make/O/D/N=(JMAX+1) root:DSM:H_wave350 wave S_wave= root:DSM:S_wave351 wave H_wave= root:DSM:H_wave367 Make/O/D/N=(JMAX) $(USANSFolder+":DSM:S_wave") 368 Make/O/D/N=(JMAX+1) $(USANSFolder+":DSM:H_wave") 369 wave S_wave=$(USANSFolder+":DSM:S_wave") 370 wave H_wave=$(USANSFolder+":DSM:H_wave") 352 371 S_wave=0 353 372 H_wave=0 … … 386 405 387 406 Variable ii,mm,nmax,ns,dif,den,ho,hp,wi,dift 407 408 SVAR USANSFolder = root:Packages:NIST:USANS:Globals:gUSANSFolder 388 409 389 410 NMAX=10 390 411 391 Make/O/D/N=(NMAX) root:DSM:Ci,root:DSM:Di392 wave Ci = root:DSM:Ci393 wave Di = root:DSM:Di412 Make/O/D/N=(NMAX) $(USANSFolder+":DSM:Ci"),$(USANSFolder+":DSM:Di") 413 wave Ci = $(USANSFolder+":DSM:Ci") 414 wave Di = $(USANSFolder+":DSM:Di") 394 415 395 416 NS=1 … … 438 459 439 460 Variable it,tnm,del,ddel,x,summ,jj 440 441 NVAR S_ret = root:DSM:gS 461 462 SVAR USANSFolder = root:Packages:NIST:USANS:Globals:gUSANSFolder 463 464 NVAR S_ret = $(USANSFolder+":DSM:gS") 442 465 443 466 IF (N == 0) … … 490 513 Variable lo,hi,dialog //=1 will present dialog for name 491 514 515 SVAR USANSFolder = root:Packages:NIST:USANS:Globals:gUSANSFolder 516 492 517 String termStr="\r\n" 493 String destStr = "root:DSM:"518 String destStr = USANSFolder+":DSM:" 494 519 String formatStr = "%15.6g %15.6g %15.6g %15.6g %15.6g %15.6g"+termStr 495 520 … … 543 568 String samStr="",dateStr="",str1,str2 544 569 545 NVAR m = root:DSM:gPowerM// power law exponent546 NVAR chiFinal = root:DSM:gChi2Final//chi^2 final547 NVAR iter = root:DSM:gIterations//total number of iterations570 NVAR m = $(USANSFolder+":DSM:gPowerM") // power law exponent 571 NVAR chiFinal = $(USANSFolder+":DSM:gChi2Final") //chi^2 final 572 NVAR iter = $(USANSFolder+":DSM:gIterations:") //total number of iterations 548 573 549 574 //get the number of spline passes from the wave note … … 584 609 Wave w 585 610 611 SVAR USANSFolder = root:Packages:NIST:USANS:Globals:gUSANSFolder 612 586 613 Variable num_extr=25 587 614 588 SetDataFolder root:DSM615 SetDataFolder $(USANSFolder+":DSM") 589 616 590 617 Make/O/D/N=(num_extr) extr_hqq,extr_hqi … … 614 641 Wave qw,iw,sw 615 642 Variable nbeg,nend,num_extr 643 644 SVAR USANSFolder = root:Packages:NIST:USANS:Globals:gUSANSFolder 616 645 617 646 Variable/G V_FitMaxIters=300 … … 624 653 // Print "num,num_new",num,num_new 625 654 626 SetDataFolder root:DSM655 SetDataFolder $(USANSFolder+":DSM") 627 656 Make/O/D/N=(num_new) Q_ext,I_ext,S_ext 628 657 … … 694 723 Wave qw,iw,sw 695 724 Variable nend 696 697 Setdatafolder root:DSM 725 726 SVAR USANSFolder = root:Packages:NIST:USANS:Globals:gUSANSFolder 727 728 Setdatafolder $(USANSFolder+":DSM") 698 729 699 730 // Wave extr_lqi=extr_lqi … … 742 773 743 774 Proc Desmear_Graph() 775 SVAR USANSFolder = root:Packages:NIST:USANS:Globals:gUSANSFolder 776 744 777 PauseUpdate; Silent 1 // building window... 745 778 Display /W=(5,44,408,558) /K=1 … … 770 803 CheckBox DSMControl_0b,help={"Toggle Log/Lin Q display"},value= 1 771 804 TitleBox DSMControl_0c,pos={120,37},size={104,19},font="Courier",fSize=10 772 TitleBox DSMControl_0c,variable= root:DSM:gStr1805 TitleBox DSMControl_0c,variable= $(USANSFolder+":DSM:gStr1") 773 806 //second message string not used currently 774 807 // TitleBox DSMControl_0d,pos={120,57},size={104,19},font="Courier",fSize=10 … … 797 830 SetVariable DSMControl_2b,pos={31,70},size={100,15},title="# of points" 798 831 SetVariable DSMControl_2b,help={"Set the number of points for the power-law extrapolation"} 799 SetVariable DSMControl_2b,limits={5,100,1},value= root:DSM:gNptsExtrap832 SetVariable DSMControl_2b,limits={5,100,1},value= $(USANSFolder+":DSM:gNptsExtrap") 800 833 SetVariable DSMControl_2b,disable=1 801 834 CheckBox DSMControl_2c,pos={157,45},size={105,14},proc=DSM_ExtrapolationCheckProc,title="Show Extrapolation" … … 805 838 SetVariable DSMControl_2d,help={"Power Law exponent from the fit = the DESMEARED slope - override as needed"} 806 839 SetVariable DSMControl_2d format="%5.2f" 807 SetVariable DSMControl_2d,limits={-inf,inf,0},value= root:DSM:gPowerM840 SetVariable DSMControl_2d,limits={-inf,inf,0},value= $(USANSFolder+":DSM:gPowerM") 808 841 SetVariable DSMControl_2d,disable=1 809 842 … … 830 863 SetVariable DSMControl_3f,help={"Smoothing factor for the smoothing spline"} 831 864 SetVariable DSMControl_3f format="%5.4f" 832 SetVariable DSMControl_3f,limits={0.01,2,0.01},value= root:DSM:gSmoothFac865 SetVariable DSMControl_3f,limits={0.01,2,0.01},value= $(USANSFolder+"DSM:gSmoothFac") 833 866 SetVariable DSMControl_3f,disable=1 834 867 CheckBox DSMControl_3g,pos={268,39},size={90,14},title="Log-scale smoothing?" … … 846 879 SetVariable DSMControl_4b,pos={35,63},size={120,15},title="Chi^2 target" 847 880 SetVariable DSMControl_4b,help={"Set the targetchi^2 for convergence (recommend chi^2=1)"} 848 SetVariable DSMControl_4b,limits={0,inf,0.1},value= root:DSM:gChi2Target881 SetVariable DSMControl_4b,limits={0,inf,0.1},value= $(USANSFolder+":DSM:gChi2Target") 849 882 SetVariable DSMControl_4b,disable=1 850 883 SetVariable DSMControl_4c,pos={35,35},size={80,15},title="dQv" 851 884 SetVariable DSMControl_4c,help={"Slit height as read in from the data file. 0.117 is the NIST value, override if necessary"} 852 SetVariable DSMControl_4c,limits={-inf,inf,0},value= root:DSM:gDqv885 SetVariable DSMControl_4c,limits={-inf,inf,0},value= $(USANSFolder+":DSM:gDqv") 853 886 SetVariable DSMControl_4c,disable=1 854 887 TitleBox DSMControl_4d,pos={160,37},size={104,19},font="Courier",fSize=10 855 TitleBox DSMControl_4d,variable= root:DSM:gIterStr888 TitleBox DSMControl_4d,variable= $(USANSFolder+":DSM:gIterStr") 856 889 TitleBox DSMControl_4d,disable=1 857 890 … … 912 945 913 946 Proc AppendSmeared() 914 SetDataFolder root:DSM 947 SVAR USANSFolder = root:Packages:NIST:USANS:Globals:gUSANSFolder 948 949 SetDataFolder $(USANSFolder+":DSM") 915 950 // if( strsearch(TraceNameList("Desmear_Graph", "", 1),"I_exp_orig",0,2) == -1) //Igor 5 916 951 if( strsearch(TraceNameList("Desmear_Graph", "", 1),"I_exp_orig",0) == -1) … … 927 962 TextBox/K/N=text1 928 963 // TextBox/C/N=text1/F=0/A=MT/E=2/X=5.50/Y=0.00 root:DSM:gCurFile //Igor 5 929 TextBox/C/N=text1/F=0/A=MT/E=1/X=5.50/Y=0.00 root:DSM:gCurFile964 TextBox/C/N=text1/F=0/A=MT/E=1/X=5.50/Y=0.00 $(USANSFolder+"DSM:gCurFile") 930 965 End 931 966 932 967 Proc AppendMask() 968 SVAR USANSFolder = root:Packages:NIST:USANS:Globals:gUSANSFolder 969 933 970 // if( strsearch(TraceNameList("Desmear_Graph", "", 1),"MaskData",0,2) == -1) //Igor 5 934 971 if( strsearch(TraceNameList("Desmear_Graph", "", 1),"MaskData",0) == -1) 935 SetDataFolder root:DSM:972 SetDataFolder $(USANSFolder+":DSM:") 936 973 AppendToGraph/W=Desmear_Graph MaskData vs Q_exp_orig 937 974 ModifyGraph mode(MaskData)=3,marker(MaskData)=8,msize(MaskData)=2.5,opaque(MaskData)=1 … … 942 979 943 980 Proc AppendSmoothed() 981 SVAR USANSFolder = root:Packages:NIST:USANS:Globals:gUSANSFolder 982 944 983 // if( strsearch(TraceNameList("Desmear_Graph", "", 1),"I_smth",0,2) == -1) //Igor 5 945 984 if( strsearch(TraceNameList("Desmear_Graph", "", 1),"I_smth",0) == -1) 946 SetDataFolder root:DSM:985 SetDataFolder $(USANSFolder+":DSM:") 947 986 AppendToGraph/W=Desmear_Graph I_smth vs Q_smth 948 987 ModifyGraph/W=Desmear_Graph rgb(I_smth)=(3,52428,1),lsize(I_smth)=2 … … 952 991 953 992 Function RemoveSmoothed() 954 SetDataFolder root:DSM: 993 SVAR USANSFolder = root:Packages:NIST:USANS:Globals:gUSANSFolder 994 995 SetDataFolder $(USANSFolder+":DSM:") 955 996 RemoveFromGraph/W=Desmear_Graph/Z I_smth 956 997 setdatafolder root: … … 958 999 959 1000 Function RemoveMask() 960 SetDataFolder root:DSM: 1001 SVAR USANSFolder = root:Packages:NIST:USANS:Globals:gUSANSFolder 1002 1003 SetDataFolder $(USANSFolder+":DSM:") 961 1004 RemoveFromGraph/W=Desmear_Graph/Z MaskData 962 1005 setdatafolder root: … … 964 1007 965 1008 Proc AppendDesmeared() 1009 SVAR USANSFolder = root:Packages:NIST:USANS:Globals:gUSANSFolder 1010 966 1011 // if( strsearch(TraceNameList("Desmear_Graph", "", 1),"I_dsm",0,2) == -1) //Igor 5 967 1012 if( strsearch(TraceNameList("Desmear_Graph", "", 1),"I_dsm",0) == -1) 968 SetDataFolder root:DSM:1013 SetDataFolder $(USANSFolder+":DSM:") 969 1014 AppendToGraph/W=Desmear_Graph I_dsm vs Q_dsm 970 1015 ModifyGraph mode(I_dsm)=3,marker(I_dsm)=19 … … 976 1021 977 1022 Function RemoveDesmeared() 978 SetDataFolder root:DSM: 1023 SVAR USANSFolder = root:Packages:NIST:USANS:Globals:gUSANSFolder 1024 1025 SetDataFolder $(USANSFolder+":DSM:") 979 1026 RemoveFromGraph/W=Desmear_Graph/Z I_dsm 980 1027 setdatafolder root: … … 982 1029 983 1030 Function AppendExtrapolation() 1031 SVAR USANSFolder = root:Packages:NIST:USANS:Globals:gUSANSFolder 1032 984 1033 // if( strsearch(TraceNameList("Desmear_Graph", "", 1),"extr_hqi",0,2) == -1) //Igor 5 985 1034 if( strsearch(TraceNameList("Desmear_Graph", "", 1),"extr_hqi",0) == -1) 986 SetDataFolder root:DSM:1035 SetDataFolder $(USANSFolder+":DSM:") 987 1036 AppendToGraph/W=Desmear_Graph extr_hqi vs extr_hqq 988 1037 ModifyGraph/W=Desmear_Graph lSize(extr_hqi)=2 … … 992 1041 993 1042 Function RemoveExtrapolation() 994 SetDataFolder root:DSM: 1043 SVAR USANSFolder = root:Packages:NIST:USANS:Globals:gUSANSFolder 1044 1045 SetDataFolder $(USANSFolder+":DSM:") 995 1046 RemoveFromGraph/W=Desmear_Graph/Z extr_hqi 996 1047 setdatafolder root: … … 1007 1058 String ctrlName 1008 1059 1060 SVAR USANSFolder = root:Packages:NIST:USANS:Globals:gUSANSFolder 1061 1009 1062 String qStr,iStr,sStr,sqStr 1010 1063 Variable nq,dqv,numBad,val … … 1016 1069 Execute "U_LoadOneDDataWithName(\"\")" 1017 1070 //define the waves that the smoothing will be looking for... 1018 SVAR fname = root:myGlobals:gLastFileName//this changes as any data is loaded1019 SVAR curFile = root:DSM:gCurFile//keep this for title, save1071 SVAR fname = $(USANSFolder+":myGlobals:gLastFileName") //this changes as any data is loaded 1072 SVAR curFile = $(USANSFolder+":DSM:gCurFile") //keep this for title, save 1020 1073 curFile = fname 1021 1074 … … 1025 1078 sqStr = CleanupName((fName + "sq"),0) //the sq-wave, which should have -dQv as the elements 1026 1079 1027 Duplicate/O $qStr root:DSM:Q_exp //root:DSM:Q_exp_orig1028 Duplicate/O $iStr root:DSM:I_exp //root:DSM:I_exp_orig1029 Duplicate/O $sStr root:DSM:S_exp //root:DSM:S_exp_orig1030 wave Q_exp = root:DSM:Q_exp1031 Wave I_exp = root:DSM:I_exp1032 Wave S_exp = root:DSM:S_exp1080 Duplicate/O $qStr $(USANSFolder+":DSM:Q_exp ") 1081 Duplicate/O $iStr $(USANSFolder+":DSM:I_exp") 1082 Duplicate/O $sStr $(USANSFolder+":DSM:S_exp ") 1083 wave Q_exp = $(USANSFolder+":DSM:Q_exp") 1084 Wave I_exp = $(USANSFolder+":DSM:I_exp") 1085 Wave S_exp = $(USANSFolder+":DSM:S_exp") 1033 1086 Wave/Z sigQ = $sqStr 1034 1087 … … 1036 1089 // ? and trim the low q to be >= 3.0e-5 (1/A), below this USANS is not reliable. 1037 1090 NumBad = RemoveBadQPoints(Q_exp,I_exp,S_exp,0) 1038 SVAR str1 = root:DSM:gStr11091 SVAR str1 = $(USANSFolder+":DSM:gStr1") 1039 1092 sprintf str1,"%d negative q-values were removed",numBad 1040 1093 … … 1045 1098 // sprintf str2,"%d q-values below q = %g were removed",numBad,val 1046 1099 1047 Duplicate/O root:DSM:Q_exp root:DSM:Q_exp_orig1048 Duplicate/O root:DSM:I_exp root:DSM:I_exp_orig1049 Duplicate/O root:DSM:S_exp root:DSM:S_exp_orig1050 wave I_exp_orig = root:DSM:I_exp_orig1051 1052 nq = numpnts( root:DSM:Q_exp)1100 Duplicate/O $(USANSFolder+":DSM:Q_exp") $(USANSFolder+":DSM:Q_exp_orig") 1101 Duplicate/O $(USANSFolder+":DSM:I_exp") $(USANSFolder+":DSM:I_exp_orig") 1102 Duplicate/O $(USANSFolder+":DSM:S_exp") $(USANSFolder+":DSM:S_exp_orig") 1103 wave I_exp_orig = $(USANSFolder+":DSM:I_exp_orig") 1104 1105 nq = numpnts($(USANSFolder+":DSM:Q_exp")) 1053 1106 1054 1107 if(WaveExists(sigQ)) //try to read dQv … … 1060 1113 DoAlert 0,"Could not find dQv in the data file - using " + num2str(dqv) 1061 1114 endif 1062 NVAR gDqv = root:DSM:gDqv//needs to be global for Weights_L()1063 NVAR gNq = root:DSM:gNq1115 NVAR gDqv = $(USANSFolder+":DSM:gDqv") //needs to be global for Weights_L() 1116 NVAR gNq = $(USANSFolder+":DSM:gNq") 1064 1117 //reset the globals 1065 1118 gDqv = dqv … … 1132 1185 String ctrlName 1133 1186 1187 SVAR USANSFolder = root:Packages:NIST:USANS:Globals:gUSANSFolder 1188 1134 1189 // Variable aExists= strlen(CsrInfo(A)) > 0 //Igor 5 1135 1190 Variable aExists= strlen(CsrWave(A)) > 0 //Igor 4 … … 1138 1193 endif 1139 1194 1140 Duplicate/O root:DSM:Q_exp_orig,root:DSM:Q_msk1141 Duplicate/O root:DSM:I_exp_orig,root:DSM:I_msk1142 Duplicate/O root:DSM:S_exp_orig,root:DSM:S_msk1143 Wave Q_msk= root:DSM:Q_msk1144 Wave I_msk= root:DSM:I_msk1145 Wave S_msk= root:DSM:S_msk1195 Duplicate/O $(USANSFolder+":DSM:Q_exp_orig"),$(USANSFolder+":DSM:Q_msk") 1196 Duplicate/O $(USANSFolder+":DSM:I_exp_orig"),$(USANSFolder+":DSM:I_msk") 1197 Duplicate/O $(USANSFolder+":DSM:S_exp_orig"),$(USANSFolder+":DSM:S_msk") 1198 Wave Q_msk=$(USANSFolder+":DSM:Q_msk") 1199 Wave I_msk=$(USANSFolder+":DSM:I_msk") 1200 Wave S_msk=$(USANSFolder+":DSM:S_msk") 1146 1201 1147 1202 //finish up - trim the data sets and reassign the working set 1148 Wave MaskData= root:DSM:MaskData1203 Wave MaskData=$(USANSFolder+":DSM:MaskData") 1149 1204 1150 1205 RemoveMaskedPoints(MaskData,Q_msk,I_msk,S_msk) 1151 1206 1152 1207 //reset the number of points 1153 NVAR gNq = root:DSM:gNq1208 NVAR gNq = $(USANSFolder+":DSM:gNq") 1154 1209 gNq = numpnts(Q_msk) 1155 1210 … … 1165 1220 String ctrlName 1166 1221 1167 Wave MaskData=root:DSM:MaskData 1222 SVAR USANSFolder = root:Packages:NIST:USANS:Globals:gUSANSFolder 1223 1224 Wave MaskData=$(USANSFolder+":DSM:MaskData") 1168 1225 MaskData = NaN 1169 1226 … … 1177 1234 String ctrlName 1178 1235 1179 Wave data=root:DSM:I_exp_orig 1236 SVAR USANSFolder = root:Packages:NIST:USANS:Globals:gUSANSFolder 1237 1238 Wave data=$(USANSFolder+":DSM:I_exp_orig") 1180 1239 1181 1240 // Variable aExists= strlen(CsrInfo(A)) > 0 //Igor 5 … … 1184 1243 // need to get rid of old smoothed data if data is re-masked 1185 1244 Execute "RemoveSmoothed()" 1186 SetDataFolder root:DSM1245 SetDataFolder $(USANSFolder+":DSM") 1187 1246 Killwaves/Z I_smth,Q_smth,S_smth 1188 SetDataFolder root:1189 1247 1190 1248 if(aExists) //mask the selected point 1191 1249 // toggle NaN (keep) or Data value (= masked) 1192 Wave MaskData =root:DSM:MaskData1250 Wave MaskData 1193 1251 MaskData[pcsr(A)] = (numType(MaskData[pcsr(A)])==0) ? NaN : data[pcsr(A)] //if NaN, doesn't plot 1194 1252 else … … 1196 1254 ShowInfo 1197 1255 //if the mask wave does not exist, make one 1198 if(exists("root:DSM:MaskData") != 1) 1199 Duplicate/O root:DSM:Q_exp_orig root:DSM:MaskData 1200 Wave MaskData=root:DSM:MaskData 1256 if(exists("MaskData") != 1) 1257 Duplicate/O Q_exp_orig MaskData 1201 1258 MaskData = NaN //use all data 1202 1259 endif 1203 1260 Execute "AppendMask()" 1204 1261 endif 1205 1262 1263 SetDataFolder root: 1264 1206 1265 return(0) 1207 1266 End … … 1212 1271 Function DSM_MaskLTCursor(ctrlName) : ButtonControl 1213 1272 String ctrlName 1214 1215 Wave data=root:DSM:I_exp_orig 1273 1274 SVAR USANSFolder = root:Packages:NIST:USANS:Globals:gUSANSFolder 1275 1276 // Variable aExists= strlen(CsrInfo(A)) > 0 //Igor 5 1277 Variable aExists= strlen(CsrWave(A)) > 0 //Igor 4 1278 1279 if(!aExists) 1280 return(1) 1281 endif 1282 // need to get rid of old smoothed data if data is re-masked 1283 Execute "RemoveSmoothed()" 1284 SetDataFolder $(USANSFolder+":DSM") 1285 Killwaves/Z I_smth,Q_smth,S_smth 1286 1287 Wave data=I_exp_orig 1288 1289 Variable pt,ii 1290 pt = pcsr(A) 1291 for(ii=pt;ii>=0;ii-=1) 1292 // toggle NaN (keep) or Data value (= masked) 1293 Wave MaskData 1294 MaskData[ii] = (numType(MaskData[ii])==0) ? NaN : data[ii] //if NaN, doesn't plot 1295 endfor 1296 1297 SetDataFolder root: 1298 return(0) 1299 End 1300 1301 // when the mask button is pressed, A must be on the graph 1302 // Displays MaskData wave on the graph 1303 // 1304 Function DSM_MaskGTCursor(ctrlName) : ButtonControl 1305 String ctrlName 1306 1307 SVAR USANSFolder = root:Packages:NIST:USANS:Globals:gUSANSFolder 1308 1216 1309 1217 1310 // Variable aExists= strlen(CsrInfo(A)) > 0 //Igor 5 … … 1225 1318 SetDataFolder root:DSM 1226 1319 Killwaves/Z I_smth,Q_smth,S_smth 1227 SetDataFolder root: 1228 1229 Wave MaskData=root:DSM:MaskData 1230 Variable pt,ii 1231 pt = pcsr(A) 1232 for(ii=pt;ii>=0;ii-=1) 1233 // toggle NaN (keep) or Data value (= masked) 1234 MaskData[ii] = (numType(MaskData[ii])==0) ? NaN : data[ii] //if NaN, doesn't plot 1235 endfor 1236 return(0) 1237 End 1238 1239 // when the mask button is pressed, A must be on the graph 1240 // Displays MaskData wave on the graph 1241 // 1242 Function DSM_MaskGTCursor(ctrlName) : ButtonControl 1243 String ctrlName 1244 1245 Wave data=root:DSM:I_exp_orig 1246 1247 // Variable aExists= strlen(CsrInfo(A)) > 0 //Igor 5 1248 Variable aExists= strlen(CsrWave(A)) > 0 //Igor 4 1249 1250 if(!aExists) 1251 return(1) 1252 endif 1253 // need to get rid of old smoothed data if data is re-masked 1254 Execute "RemoveSmoothed()" 1255 SetDataFolder root:DSM 1256 Killwaves/Z I_smth,Q_smth,S_smth 1257 SetDataFolder root: 1258 1259 Wave MaskData=root:DSM:MaskData 1320 1321 Wave data=I_exp_orig 1322 1260 1323 Variable pt,ii,endPt 1261 1324 endPt=numpnts(MaskData) … … 1263 1326 for(ii=pt;ii<endPt;ii+=1) 1264 1327 // toggle NaN (keep) or Data value (= masked) 1328 Wave MaskData 1265 1329 MaskData[ii] = (numType(MaskData[ii])==0) ? NaN : data[ii] //if NaN, doesn't plot 1266 1330 endfor 1331 1332 SetDataFolder root: 1333 1267 1334 return(0) 1268 1335 End 1269 1336 1270 1337 Function CleanUpJunk() 1338 SVAR USANSFolder = root:Packages:NIST:USANS:Globals:gUSANSFolder 1339 1271 1340 // clean up the old junk on the graph, /Z for no error 1272 1341 Execute "RemoveExtrapolation()" … … 1279 1348 1280 1349 //always initialize these 1281 String/G root:DSM:gStr1= ""1282 String/G root:DSM:gStr2= ""1283 String/G root:DSM:gIterStr= ""1350 String/G $(USANSFolder+":DSM:gStr1") = "" 1351 String/G $(USANSFolder+":DSM:gStr2") = "" 1352 String/G $(USANSFolder+":DSM:gIterStr") = "" 1284 1353 1285 1354 // clean up the old waves from smoothing and desmearing steps 1286 SetDataFolder root:DSM1355 SetDataFolder $(USANSFolder+":DSM") 1287 1356 Killwaves/Z I_smth,I_dsm,I_dsm_sm,Q_smth,Q_dsm,S_smth,S_dsm,Yi_SS,Yq_SS 1288 1357 Killwaves/Z Weights,FW,R_wave,S_wave,H_wave,Di,Ci … … 1302 1371 String ctrlName 1303 1372 1304 NVAR nend = root:DSM:gNptsExtrap 1305 NVAR m_pred = root:DSM:gPowerM 1306 1307 SetDataFolder root:DSM 1373 SVAR USANSFolder = root:Packages:NIST:USANS:Globals:gUSANSFolder 1374 1375 NVAR nend = $(USANSFolder+":DSM:gNptsExtrap") 1376 NVAR m_pred = $(USANSFolder+":DSM:gPowerM") 1377 1378 SetDataFolder $(USANSFolder+":DSM") 1308 1379 //use masked data if it exists 1309 1380 if(exists("I_msk")==1 && exists("Q_msk")==1 && exists("S_msk")==1) 1310 wave Qw = root:DSM:Q_msk1311 Wave Iw = root:DSM:I_msk1312 Wave Sw = root:DSM:S_msk1381 wave Qw = $(USANSFolder+":DSM:Q_msk") 1382 Wave Iw = $(USANSFolder+":DSM:I_msk") 1383 Wave Sw = $(USANSFolder+":DSM:S_msk") 1313 1384 else 1314 1385 //start from the "_exp" waves 1315 1386 if(exists("I_exp")==1 && exists("Q_exp")==1 && exists("S_exp")==1) 1316 wave Qw = root:DSM:Q_exp1317 Wave Iw = root:DSM:I_exp1318 Wave Sw = root:DSM:S_exp1387 wave Qw = $(USANSFolder+":DSM:Q_exp") 1388 Wave Iw = $(USANSFolder+":DSM:I_exp") 1389 Wave Sw = $(USANSFolder+":DSM:S_exp") 1319 1390 endif 1320 1391 endif … … 1347 1418 String ctrlName 1348 1419 1349 SetDataFolder root:DSM 1420 SVAR USANSFolder = root:Packages:NIST:USANS:Globals:gUSANSFolder 1421 1422 SetDataFolder $(USANSFolder+":DSM") 1350 1423 1351 1424 Variable ii,new_n,pass,nq_ext,offset,doLog=1 … … 1362 1435 //start from the "msk", creating smth waves 1363 1436 if(exists("I_msk")==1 && exists("Q_msk")==1 && exists("S_msk")==1) 1364 wave Q_msk = root:DSM:Q_msk 1365 Wave I_msk = root:DSM:I_msk 1366 Wave S_msk = root:DSM:S_msk 1437 wave Q_msk,I_msk,S_msk 1367 1438 Duplicate/O I_msk,I_smth,Q_smth,S_smth 1368 1439 I_smth = I_msk … … 1372 1443 //start from the "_exp" waves 1373 1444 if(exists("I_exp")==1 && exists("Q_exp")==1 && exists("S_exp")==1) 1374 wave Q_exp = root:DSM:Q_exp 1375 Wave I_exp = root:DSM:I_exp 1376 Wave S_exp = root:DSM:S_exp 1445 wave Q_exp,I_exp,S_exp 1377 1446 Duplicate/O I_exp,I_smth,Q_smth,S_smth 1378 1447 I_smth = I_exp … … 1383 1452 endif 1384 1453 1385 wave Q_smth = root:DSM:Q_smth 1386 Wave I_smth = root:DSM:I_smth 1387 Wave S_smth = root:DSM:S_smth 1454 wave Q_smth,I_smth,S_smth 1388 1455 1389 1456 // extend the data to avoid end effects … … 1399 1466 1400 1467 //whether extending or not, the working data is "_ext", set by ExtendToSmooth() 1401 setDataFolder root:DSM 1402 wave Q_ext = root:DSM:Q_ext 1403 Wave I_ext = root:DSM:I_ext 1404 Wave S_ext = root:DSM:S_ext 1468 SetDataFolder $(USANSFolder+":DSM") 1469 wave Q_ext,I_ext ,S_ext 1405 1470 1406 1471 noteStr=note(I_smth) … … 1415 1480 if(doLog) 1416 1481 //convert to log scale 1417 Duplicate/O I_ext root:DSM:I_log,root:DSM:I_log_err 1418 Wave I_log = root:DSM:I_log 1419 Wave I_log_err = root:DSM:I_log_err 1482 Duplicate/O I_ext I_log,I_log_err 1483 Wave I_log ,I_log_err 1420 1484 I_log = log(I_ext) 1421 1485 WaveStats/Q I_log … … 1441 1505 endif 1442 1506 1443 NVAR sParam = root:DSM:gSmoothFac1507 NVAR sParam = $(USANSFolder+":DSM:gSmoothFac") 1444 1508 1445 1509 ControlInfo/W=Desmear_Graph DSMControl_3c //SSCheck … … 1490 1554 1491 1555 //reset the global 1492 NVAR gNq = root:DSM:gNq1556 NVAR gNq = $(USANSFolder+":DSM:gNq") 1493 1557 gNq = nq 1494 1558 //report the chi^2 difference between the smoothed curve and the experimental data … … 1506 1570 Function DSM_SmoothUndoButtonProc(ctrlName) : ButtonControl 1507 1571 String ctrlName 1572 1573 SVAR USANSFolder = root:Packages:NIST:USANS:Globals:gUSANSFolder 1508 1574 1509 1575 Execute "RemoveSmoothed()" 1510 SetDataFolder root:DSM1576 SetDataFolder $(USANSFolder+":DSM") 1511 1577 Killwaves/Z I_smth,Q_smth,S_smth,Q_ext,I_ext,S_ext,Yi_SS,Yq_SS 1512 1578 SetDataFolder root: … … 1518 1584 Wave I_smth 1519 1585 1586 SVAR USANSFolder = root:Packages:NIST:USANS:Globals:gUSANSFolder 1587 1520 1588 //start from the "msk", if they exist 1521 1589 if(exists("I_msk")==1 && exists("Q_msk")==1 && exists("S_msk")==1) 1522 Wave iw = root:DSM:I_msk1523 Wave sw = root:DSM:S_msk1590 Wave iw = $(USANSFolder+":DSM:I_msk") 1591 Wave sw = $(USANSFolder+":DSM:S_msk") 1524 1592 else 1525 1593 //start from the "_exp" waves 1526 1594 if(exists("I_exp")==1 && exists("Q_exp")==1 && exists("S_exp")==1) 1527 Wave iw = root:DSM:I_exp1528 Wave sw = root:DSM:S_exp1595 Wave iw = $(USANSFolder+":DSM:I_exp") 1596 Wave sw = $(USANSFolder+":DSM:S_exp") 1529 1597 endif 1530 1598 endif … … 1547 1615 String ctrlName 1548 1616 1617 SVAR USANSFolder = root:Packages:NIST:USANS:Globals:gUSANSFolder 1618 1549 1619 String saveStr 1550 SVAR curFile = root:DSM:gCurFile1620 SVAR curFile = $(USANSFolder+":DSM:gCurFile") 1551 1621 saveStr = CleanupName((curFile),0) //the output filename 1552 1622 // … … 1600 1670 String ctrlName 1601 1671 1602 SetDataFolder root:DSM 1672 SVAR USANSFolder = root:Packages:NIST:USANS:Globals:gUSANSFolder 1673 1674 SetDataFolder $(USANSFolder+":DSM") 1603 1675 if(exists("I_smth")==1 && exists("Q_smth")==1 && exists("S_smth")==1) 1604 wave Q_smth = root:DSM:Q_smth 1605 Wave I_smth = root:DSM:I_smth 1606 Wave S_smth = root:DSM:S_smth 1676 wave Q_smth , I_smth ,S_smth 1607 1677 Duplicate/O I_smth,I_work,Q_work,S_work 1608 1678 I_work = I_smth … … 1612 1682 //start from the "msk", creating work waves 1613 1683 if(exists("I_msk")==1 && exists("Q_msk")==1 && exists("S_msk")==1) 1614 wave Q_msk = root:DSM:Q_msk 1615 Wave I_msk = root:DSM:I_msk 1616 Wave S_msk = root:DSM:S_msk 1684 wave Q_msk,I_msk,S_msk 1617 1685 Duplicate/O I_msk,I_work,Q_work,S_work 1618 1686 I_work = I_msk … … 1622 1690 //start from the "_exp" waves 1623 1691 if(exists("I_exp")==1 && exists("Q_exp")==1 && exists("S_exp")==1) 1624 wave Q_exp = root:DSM:Q_exp 1625 Wave I_exp = root:DSM:I_exp 1626 Wave S_exp = root:DSM:S_exp 1692 wave Q_exp,I_exp,S_exp 1627 1693 Duplicate/O I_exp,I_work,Q_work,S_work 1628 1694 I_work = I_exp … … 1632 1698 endif 1633 1699 endif 1634 SetDataFolder root:1635 1636 NVAR nq = root:DSM:gNq1637 NVAR m = root:DSM:gPowerM1638 NVAR chi2_target = root:DSM:gChi2Target1639 NVAR maxFastIter = root:DSM:gMaxFastIter1640 NVAR maxSlowIter = root:DSM:gMaxSlowIter1700 //SetDataFolder root: 1701 1702 NVAR nq = gNq 1703 NVAR m = gPowerM 1704 NVAR chi2_target = gChi2Target 1705 NVAR maxFastIter = gMaxFastIter 1706 NVAR maxSlowIter = gMaxSlowIter 1641 1707 1642 1708 // SET WEIGHTING OF EXPERIMENTAL DATA. 1643 Duplicate/O Q_work root:DSM:weights1644 Wave weights = root:DSM:weights1709 Duplicate/O Q_work weights 1710 Wave weights = weights 1645 1711 weights = 1/S_work^2 1646 1712 1647 1713 // calculate weighting array for smearing of data 1648 Make/O/D/N=(nq,nq) root:DSM:FW1649 Wave FW = root:DSM:FW1714 Make/O/D/N=(nq,nq) FW 1715 Wave FW 1650 1716 Weights_L(m,FW,Q_work) 1651 1717 … … 1655 1721 // y_old = I_old, y_new = I_dsm, I_dsm_sm = ys_new, 1656 1722 // duplicate preserves the wave note! 1657 Duplicate/O I_work root:DSM:I_old,root:DSM:Is_old,root:DSM:I_dsm,root:DSM:I_dsm_sm 1658 Duplicate/O Q_work root:DSM:Q_dsm,root:DSM:S_dsm //sets Q_dsm correctly 1659 wave S_dsm = root:DSM:S_dsm //set correctly at end of this function 1660 wave I_old = root:DSM:I_old 1661 wave Is_old = root:DSM:Is_old 1662 wave I_dsm = root:DSM:I_dsm 1663 wave I_dsm_sm = root:DSM:I_dsm_sm 1723 Duplicate/O I_work I_old,Is_old,root:DSM:I_dsm,root:DSM:I_dsm_sm 1724 Duplicate/O Q_work Q_dsm,S_dsm //sets Q_dsm correctly 1725 wave S_dsm,I_old,Is_old,I_dsm,I_dsm_sm 1664 1726 I_old = I_work 1665 1727 Is_old = 0 … … 1706 1768 Execute "AppendDesmeared()" 1707 1769 DoUpdate 1708 1770 SetDataFolder $(USANSFolder+":DSM") 1771 1772 1709 1773 // step (6) - refine the desmearing using slow convergence 1710 1774 Print "Starting slow convergence..... " … … 1745 1809 1746 1810 // adjust the error 1747 SetDataFolder root:DSM1811 SetDataFolder $(USANSFolder+":DSM") 1748 1812 Duplicate/O S_work err 1749 1813 S_dsm = abs(err/I_work*I_dsm) //proportional error … … 1751 1815 // S_dsm = S_Work 1752 1816 1753 NVAR gChi = root:DSM:gChi2Final //chi^2 final1754 NVAR gIter = root:DSM:gIterations //total number of iterations1817 NVAR gChi = gChi2Final //chi^2 final 1818 NVAR gIter = gIterations //total number of iterations 1755 1819 gChi = chi2_new 1756 1820 gIter = Iter 1757 1821 1758 SVAR str = root:DSM:gIterStr1822 SVAR str = gIterStr 1759 1823 sprintf str,"%d iterations required",iter 1760 1824 … … 1765 1829 Function DSM_RevertButtonProc(ctrlName) : ButtonControl 1766 1830 String ctrlName 1767 1831 1832 SVAR USANSFolder = root:Packages:NIST:USANS:Globals:gUSANSFolder 1833 1834 1768 1835 CleanUpJunk() 1769 1836 1837 SetDataFolder $(USANSFolder+":DSM") 1838 1770 1839 //reset the working waves to the original 1771 wave Q_exp_orig = root:DSM:Q_exp_orig 1772 wave I_exp_orig = root:DSM:I_exp_orig 1773 wave S_exp_orig = root:DSM:S_exp_orig 1774 1775 Duplicate/O Q_exp_orig root:DSM:Q_exp 1776 Duplicate/O I_exp_orig root:DSM:I_exp 1777 Duplicate/O S_exp_orig root:DSM:S_exp 1840 wave Q_exp_orig,I_exp_orig,S_exp_orig 1841 1842 Duplicate/O Q_exp_orig Q_exp 1843 Duplicate/O I_exp_orig I_exp 1844 Duplicate/O S_exp_orig S_exp 1778 1845 // kill the data folder 1779 1846 // re-initialize? 1780 1847 1848 SetDataFolder root: 1849 1781 1850 return(0) 1782 1851 End -
sans/Dev/trunk/NCNR_User_Procedures/USANS/Main_USANS.ipf
r377 r404 25 25 "Desmear USANS Data",Desmear() 26 26 "-" 27 "Load USANS Data", U_LoadOneDData()27 "Load USANS Data",A_LoadOneDData() 28 28 "Convert to 6 Columns",Convert3ColTo6Col() 29 29 "-" … … 53 53 // 54 54 Proc Init_MainUSANS() 55 NewDataFolder/O root:Globals 56 NewDataFolder/O/S root:Globals:MainPanel 55 NewDataFolder/O root:Packages 56 NewDataFolder/O root:Packages:NIST 57 NewDataFolder/O root:Packages:NIST:USANS 58 NewDataFolder/O root:Packages:NIST:USANS:Globals 59 NewDataFolder/O/S root:Packages:NIST:USANS:Globals:MainPanel 60 61 String/G root:Packages:NIST:USANS:Globals:gUSANSFolder = "root:Packages:NIST:USANS" 62 String USANSFolder = root:Packages:NIST:USANS:Globals:gUSANSFolder 63 //NB This is also hardcoded a bit further down - search for "WHY WHY WHY" AJJ Sept 08 57 64 58 65 Make/O/T/N=1 fileWave,samWave,empWave,curWave //Added curWave Sept 06 A. Jackson … … 81 88 SetDataFolder root: 82 89 83 NewDataFolder/O root:RAW84 NewDataFolder/O root:SAM85 NewDataFolder/O root:COR86 NewDataFolder/O root:EMP87 NewDataFolder/O root:BKG88 NewDataFolder/O root:SWAP89 NewDataFolder/O root:Graph90 NewDataFolder/O $(USANSFolder+":RAW") 91 NewDataFolder/O $(USANSFolder+":SAM") 92 NewDataFolder/O $(USANSFolder+":COR") 93 NewDataFolder/O $(USANSFolder+":EMP") 94 NewDataFolder/O $(USANSFolder+":BKG") 95 NewDataFolder/O $(USANSFolder+":SWAP") 96 NewDataFolder/O $(USANSFolder+":Graph") 90 97 91 98 //dummy waves for bkg and emp levels 92 Make/O root:EMP:empLevel,root:BKG:bkgLevel 93 root:EMP:empLevel := root:Globals:MainPanel:gEmpCts //dependency to connect to SetVariable in panel 94 root:BKG:bkgLevel := root:Globals:MainPanel:gBkgCts 99 Make/O $(USANSFolder+":EMP:empLevel"),$(USANSFolder+":BKG:bkgLevel") 100 //WHY WHY WHY????? 101 //Explicit dependency 102 root:Packages:NIST:USANS:EMP:empLevel := root:Packages:NIST:USANS:Globals:MainPanel:gEmpCts //dependency to connect to SetVariable in panel 103 root:Packages:NIST:USANS:BKG:bkgLevel := root:Packages:NIST:USANS:Globals:MainPanel:gBkgCts 104 95 105 96 106 //INSTRUMENTAL CONSTANTS 97 Variable/G root:Globals:MainPanel:gTheta_H = 3.9e-6 //Darwin FWHM (pre- NOV 2004)98 Variable/G root:Globals:MainPanel:gTheta_V = 0.014 //Vertical divergence (pre- NOV 2004)107 Variable/G root:Packages:NIST:USANS:Globals:MainPanel:gTheta_H = 3.9e-6 //Darwin FWHM (pre- NOV 2004) 108 Variable/G root:Packages:NIST:USANS:Globals:MainPanel:gTheta_V = 0.014 //Vertical divergence (pre- NOV 2004) 99 109 //Variable/G root:Globals:MainPanel:gDomega = 2.7e-7 //Solid angle of detector (pre- NOV 2004) 100 Variable/G root:Globals:MainPanel:gDomega = 7.1e-7 //Solid angle of detector (NOV 2004)101 Variable/G root:Globals:MainPanel:gDefaultMCR= 1e6 //factor for normalization110 Variable/G root:Packages:NIST:USANS:Globals:MainPanel:gDomega = 7.1e-7 //Solid angle of detector (NOV 2004) 111 Variable/G root:Packages:NIST:USANS:Globals:MainPanel:gDefaultMCR= 1e6 //factor for normalization 102 112 103 113 //Variable/G root:Globals:MainPanel:gDQv = 0.037 //divergence, in terms of Q (1/A) (pre- NOV 2004) 104 Variable/G root:Globals:MainPanel:gDQv = 0.117 //divergence, in terms of Q (1/A) (NOV 2004)114 Variable/G root:Packages:NIST:USANS:Globals:MainPanel:gDQv = 0.117 //divergence, in terms of Q (1/A) (NOV 2004) 105 115 106 116 … … 128 138 DrawText 293,55,"Current Data" 129 139 ListBox fileLB,pos={5,55},size={110,230},proc=FileListBoxProc 130 ListBox fileLB,listWave=root: Globals:MainPanel:fileWave131 ListBox fileLB,selWave=root: Globals:MainPanel:selFileW,mode= 4132 ListBox samLB,pos={149,55},size={110,90},listWave=root: Globals:MainPanel:samWave140 ListBox fileLB,listWave=root:Packages:NIST:USANS:Globals:MainPanel:fileWave 141 ListBox fileLB,selWave=root:Packages:NIST:USANS:Globals:MainPanel:selFileW,mode= 4 142 ListBox samLB,pos={149,55},size={110,90},listWave=root:Packages:NIST:USANS:Globals:MainPanel:samWave 133 143 ListBox samLB,mode= 1,selRow= -1 134 144 Button ClearSamButton,pos={224,148},size={35,21},proc=ClearButtonProc,title="Clr" … … 143 153 Button DelEmpButton,help={"Deletes the selected file(s) from the list of empty scans"} 144 154 ListBox empLB,pos={151,194},size={110,90} 145 ListBox empLB,listWave=root: Globals:MainPanel:empWave,mode= 1,selRow= 0155 ListBox empLB,listWave=root:Packages:NIST:USANS:Globals:MainPanel:empWave,mode= 1,selRow= 0 146 156 Button toSamList,pos={118,55},size={25,90},proc=toSamListButtonProc,title="S->" 147 157 Button toSamList,help={"Adds the selected file(s) to the list of sample scans"} … … 149 159 Button toEmpList,help={"Adds the selected file(s) to the list of empty (cell) scans"} 150 160 ListBox StatusLB,pos={11,358},size={386,77} 151 ListBox StatusLB,listWave=root: Globals:MainPanel:statusWave161 ListBox StatusLB,listWave=root:Packages:NIST:USANS:Globals:MainPanel:statusWave 152 162 Button pickPathButton,pos={6,8},size={80,20},proc=PickBT5PathButton,title="DataPath..." 153 163 Button pickPathButton,help={"Select the data folder where the raw ICP data files are located"} … … 167 177 Button AddCurToEMP,help={"Adds the current data file to the list of empty scans"} 168 178 ListBox CurFileBox,pos={295,55},size={100,230},proc=FileListBoxProc,disable=1 169 ListBox CurFileBox,listWave=root: Globals:MainPanel:curWave,mode=1179 ListBox CurFileBox,listWave=root:Packages:NIST:USANS:Globals:MainPanel:curWave,mode=1 170 180 SetVariable FilterSetVar,pos={8,289},size={106,18},title="Filter",fSize=12 171 SetVariable FilterSetVar,value= root: Globals:MainPanel:FilterStr181 SetVariable FilterSetVar,value= root:Packages:NIST:USANS:Globals:MainPanel:FilterStr 172 182 CheckBox UseCurrentData,pos={298,290},size={10,10},proc=UseCurrentDataProc,title="Enable Current Data" 173 183 CheckBox UseCurrentData,value=0 … … 184 194 PauseUpdate; Silent 1 // building window... 185 195 String fldrSav= GetDataFolder(1) 186 SetDataFolder root:RAW: 196 String USANSFolder = root:Packages:NIST:USANS:Globals:gUSANSFolder 197 SetDataFolder $(USANSFolder+":RAW:") 187 198 //String textStr = StringForRawGraph() 188 199 //textStr=StringByKey("FILE",textStr,":",";")+" MONRATE:"+num2str(mean(MonCts)/NumberByKey("TIMEPT",textStr,":",";")) … … 232 243 String ctrlName 233 244 245 SVAR USANSFolder = root:Packages:NIST:USANS:Globals:gUSANSFolder 246 234 247 //get selected files from listbox (everything) 235 248 //use the listBox wave directly 236 Wave/T listW=$ "root:Globals:MainPanel:empWave"249 Wave/T listW=$(USANSFolder+":Globals:MainPanel:empWave") 237 250 //Wave for indication of current data set AJJ Sept 2006 238 Wave isCurrent = $ "root:Globals:MainPanel:EMPisCurrent"251 Wave isCurrent = $(USANSFolder+":Globals:MainPanel:EMPisCurrent") 239 252 Variable ii,num=numpnts(listW) 240 253 String fname="",fpath="",curPathStr="" … … 283 296 284 297 //copy the data to plot to the root:Graph directory, and give clear names 285 if(WaveExists($( "root:EMP:Qvals")))286 Duplicate/O $( "root:EMP:Qvals"),$("root:Graph:Qvals_EMP")298 if(WaveExists($(USANSFolder+":EMP:Qvals"))) 299 Duplicate/O $(USANSFolder+":EMP:Qvals"),$(USANSFolder+":Graph:Qvals_EMP") 287 300 Endif 288 Duplicate/O $( "root:EMP:Angle"),$("root:Graph:Angle_EMP")289 Duplicate/O $( "root:EMP:DetCts"),$("root:Graph:DetCts_EMP")290 Duplicate/O $( "root:EMP:ErrDetCts"),$("root:Graph:ErrDetCts_EMP")301 Duplicate/O $(USANSFolder+":EMP:Angle"),$(USANSFolder+":Graph:Angle_EMP") 302 Duplicate/O $(USANSFolder+":EMP:DetCts"),$(USANSFolder+":Graph:DetCts_EMP") 303 Duplicate/O $(USANSFolder+":EMP:ErrDetCts"),$(USANSFolder+":Graph:ErrDetCts_EMP") 291 304 292 305 //now plot the data (or just bring the graph to the front) … … 307 320 String ctrlName 308 321 322 SVAR USANSFolder = root:Packages:NIST:USANS:Globals:gUSANSFolder 323 309 324 //get selected files from listbox (everything) 310 325 //use the listBox wave directly 311 Wave/T listW=$ "root:Globals:MainPanel:samWave"326 Wave/T listW=$(USANSFolder+":Globals:MainPanel:samWave") 312 327 //Wave for indication of current data set AJJ Sept 2006 313 Wave isCurrent = $ "root:Globals:MainPanel:SAMisCurrent"328 Wave isCurrent = $(USANSFolder+":Globals:MainPanel:SAMisCurrent") 314 329 Variable ii,num=numpnts(listW) 315 330 String fname="",fpath="",curPathStr="" … … 318 333 PathInfo bt5CurPathName 319 334 curPathStr = S_Path 335 336 print fpath 320 337 321 338 if(cmpstr("",listW[0])==0) … … 357 374 // 358 375 //copy the data to plot to the root:Graph directory, and give clear names 359 if(WaveExists($( "root:SAM:Qvals")))360 Duplicate/O $( "root:SAM:Qvals"),$("root:Graph:Qvals_SAM")376 if(WaveExists($(USANSFolder+":SAM:Qvals"))) 377 Duplicate/O $(USANSFolder+":SAM:Qvals"),$(USANSFolder+":Graph:Qvals_SAM") 361 378 Endif 362 Duplicate/O $( "root:SAM:Angle"),$("root:Graph:Angle_SAM")363 Duplicate/O $( "root:SAM:DetCts"),$("root:Graph:DetCts_SAM")364 Duplicate/O $( "root:SAM:ErrDetCts"),$("root:Graph:ErrDetCts_SAM")379 Duplicate/O $(USANSFolder+":SAM:Angle"),$(USANSFolder+":Graph:Angle_SAM") 380 Duplicate/O $(USANSFolder+":SAM:DetCts"),$(USANSFolder+":Graph:DetCts_SAM") 381 Duplicate/O $(USANSFolder+":SAM:ErrDetCts"),$(USANSFolder+":Graph:ErrDetCts_SAM") 365 382 366 383 //now plot the data (or just bring the graph to the front) … … 374 391 String type 375 392 376 Wave angle = $("root:"+Type+":Angle") 377 Wave detCts = $("root:"+Type+":DetCts") 378 Wave ErrdetCts = $("root:"+Type+":ErrDetCts") 379 Wave MonCts = $("root:"+Type+":MonCts") 380 Wave TransCts = $("root:"+Type+":TransCts") 393 SVAR USANSFolder = root:Packages:NIST:USANS:Globals:gUSANSFolder 394 395 Wave angle = $(USANSFolder+":"+Type+":Angle") 396 Wave detCts = $(USANSFolder+":"+Type+":DetCts") 397 Wave ErrdetCts = $(USANSFolder+":"+Type+":ErrDetCts") 398 Wave MonCts = $(USANSFolder+":"+Type+":MonCts") 399 Wave TransCts = $(USANSFolder+":"+Type+":TransCts") 381 400 382 401 Sort Angle DetCts,ErrDetCts,MonCts,TransCts,Angle … … 395 414 String type 396 415 397 String noteStr = note($("root:"+Type+":DetCts")) 416 SVAR USANSFolder = root:Packages:NIST:USANS:Globals:gUSANSFolder 417 418 String noteStr = note($(USANSFolder+":"+Type+":DetCts")) 398 419 Variable ctTime 399 420 ctTime = NumberByKey("TIMEPT",noteStr,":",";") 421 print ctTime 400 422 //normalize by counting time 401 Wave detCts = $( "root:"+Type+":DetCts")402 Wave ErrdetCts = $( "root:"+Type+":ErrDetCts")403 Wave MonCts = $( "root:"+Type+":MonCts")404 Wave TransCts = $( "root:"+Type+":TransCts")423 Wave detCts = $(USANSFolder+":"+Type+":DetCts") 424 Wave ErrdetCts = $(USANSFolder+":"+Type+":ErrDetCts") 425 Wave MonCts = $(USANSFolder+":"+Type+":MonCts") 426 Wave TransCts = $(USANSFolder+":"+Type+":TransCts") 405 427 406 428 detCts /= ctTime … … 411 433 //normalize to monitor countrate [=] counts/monitor 412 434 //trans countrate does not need to be normalized 413 NVAR defaultMCR= root:Globals:MainPanel:gDefaultMCR435 NVAR defaultMCR=$(USANSFolder+":Globals:MainPanel:gDefaultMCR") 414 436 DetCts /= monCts/defaultMCR 415 437 ErrDetCts /= MonCts/defaultMCR … … 432 454 String fromType,toType 433 455 434 Duplicate/O $("root:"+fromType+":Angle"),$("root:"+toType+":Angle") 435 Duplicate/O $("root:"+fromType+":DetCts"),$("root:"+toType+":DetCts") 436 Duplicate/O $("root:"+fromType+":ErrDetCts"),$("root:"+toType+":ErrDetCts") 437 Duplicate/O $("root:"+fromType+":MonCts"),$("root:"+toType+":MonCts") 438 Duplicate/O $("root:"+fromType+":TransCts"),$("root:"+toType+":TransCts") 456 SVAR USANSFolder = root:Packages:NIST:USANS:Globals:gUSANSFolder 457 458 Duplicate/O $(USANSFolder+":"+fromType+":Angle"),$(USANSFolder+":"+toType+":Angle") 459 Duplicate/O $(USANSFolder+":"+fromType+":DetCts"),$(USANSFolder+":"+toType+":DetCts") 460 Duplicate/O $(USANSFolder+":"+fromType+":ErrDetCts"),$(USANSFolder+":"+toType+":ErrDetCts") 461 Duplicate/O $(USANSFolder+":"+fromType+":MonCts"),$(USANSFolder+":"+toType+":MonCts") 462 Duplicate/O $(USANSFolder+":"+fromType+":TransCts"),$(USANSFolder+":"+toType+":TransCts") 439 463 440 464 //check for qvals wave, move if it's there 441 if(WaveExists($( "root:"+fromType+":Qvals")))442 Duplicate/O $( "root:"+fromType+":Qvals"),$("root:"+toType+":Qvals")465 if(WaveExists($(USANSFolder+":"+fromType+":Qvals"))) 466 Duplicate/O $(USANSFolder+":"+fromType+":Qvals"),$(USANSFolder+":"+toType+":Qvals") 443 467 Endif 444 468 … … 450 474 Function AppendDataWaves(fromType,toType) 451 475 String fromType,toType 476 477 SVAR USANSFolder = root:Packages:NIST:USANS:Globals:gUSANSFolder 452 478 453 479 String fromNote="",toNote="",newNote="",fromfile="",toFile="" 454 480 455 ConcatenateData( ("root:"+toType+":Angle"),("root:"+fromType+":Angle") ) //appends "from" at the end of "to" 456 ConcatenateData( ("root:"+toType+":DetCts"),("root:"+fromType+":DetCts") ) 457 ConcatenateData( ("root:"+toType+":ErrDetCts"),("root:"+fromType+":ErrDetCts") ) 458 ConcatenateData( ("root:"+toType+":MonCts"),("root:"+fromType+":MonCts") ) 459 ConcatenateData( ("root:"+toType+":TransCts"),("root:"+fromType+":TransCts") ) 481 482 ConcatenateData( (USANSFolder+":"+toType+":Angle"),(USANSFolder+":"+fromType+":Angle") ) //appends "from" at the end of "to" 483 ConcatenateData( (USANSFolder+":"+toType+":DetCts"),(USANSFolder+":"+fromType+":DetCts") ) 484 ConcatenateData( (USANSFolder+":"+toType+":ErrDetCts"),(USANSFolder+":"+fromType+":ErrDetCts") ) 485 ConcatenateData( (USANSFolder+":"+toType+":MonCts"),(USANSFolder+":"+fromType+":MonCts") ) 486 ConcatenateData( (USANSFolder+":"+toType+":TransCts"),(USANSFolder+":"+fromType+":TransCts") ) 460 487 461 488 462 489 //adjust the wavenote, to account for the new dataset 463 fromNote = note($( "root:"+fromType+":DetCts"))490 fromNote = note($(USANSFolder+":"+fromType+":DetCts")) 464 491 fromFile = StringByKey("FILE",fromNote,":",";") 465 toNote = note($( "root:"+toType+":DetCts"))492 toNote = note($(USANSFolder+":"+toType+":DetCts")) 466 493 toFile = StringByKey("FILE",toNote,":",";") 467 494 toFile += "," + fromfile 468 495 toNote = ReplaceStringByKey("FILE",toNote,toFile,":",";") 469 Note/K $( "root:"+toType+":DetCts")470 Note $( "root:"+toType+":DetCts"),toNote496 Note/K $(USANSFolder+":"+toType+":DetCts") 497 Note $(USANSFolder+":"+toType+":DetCts"),toNote 471 498 472 499 Return(0) … … 540 567 String ctrlName 541 568 569 SVAR USANSFolder = root:Packages:NIST:USANS:Globals:gUSANSFolder 570 542 571 String fname="" 543 572 … … 546 575 //take the selection, and simply plot the counts vs. angle - don't save the data anyplace special 547 576 //get the selected wave 548 Wave/T fileWave=$ "root:Globals:MainPanel:fileWave"549 Wave sel=$ "root:Globals:MainPanel:selFileW"577 Wave/T fileWave=$(USANSFolder+":Globals:MainPanel:fileWave") 578 Wave sel=$(USANSFolder+":Globals:MainPanel:selFileW") 550 579 Variable ii=0,num=numpnts(sel),err 551 580 … … 561 590 while(ii<num) 562 591 elseif (cmpstr(ctrlName,"CurFileBox" )== 0) 563 Wave/T fileWave=$ "root:Globals:MainPanel:curWave"592 Wave/T fileWave=$(USANSFolder+":Globals:MainPanel:curWave") 564 593 PathInfo bt5CurPathName 565 594 fname = S_Path … … 622 651 Function StatusButtonProc(ctrlName) 623 652 String ctrlName 653 654 SVAR USANSFolder = root:Packages:NIST:USANS:Globals:gUSANSFolder 655 624 656 String fname="" 657 625 658 626 659 if(cmpstr(ctrlName,"fileLB")==0) 627 660 //Print "Status Button" 628 661 //display the (first) selected wave 629 Wave/T fileWave=$ "root:Globals:MainPanel:fileWave"630 Wave sel=$ "root:Globals:MainPanel:selFileW"662 Wave/T fileWave=$(USANSFolder+":Globals:MainPanel:fileWave") 663 Wave sel=$(USANSFolder+":Globals:MainPanel:selFileW") 631 664 Variable ii=0,num=numpnts(sel) 632 665 … … 641 674 while(ii<num) 642 675 elseif(cmpstr(ctrlName,"CurFileBox")==0) 643 Wave/T fileWave=$ "root:Globals:MainPanel:curWave"676 Wave/T fileWave=$(USANSFolder+":Globals:MainPanel:curWave") 644 677 PathInfo bt5CurPathName 645 678 fname = S_Path … … 657 690 String ctrlName 658 691 692 SVAR USANSFolder = root:Packages:NIST:USANS:Globals:gUSANSFolder 693 659 694 //Print "toSamList button" 660 Wave/T fileWave=$ "root:Globals:MainPanel:fileWave"661 Wave/T samWave=$ "root:Globals:MainPanel:samWave"662 Wave sel=$ "root:Globals:MainPanel:selFileW"695 Wave/T fileWave=$(USANSFolder+":Globals:MainPanel:fileWave") 696 Wave/T samWave=$(USANSFolder+":Globals:MainPanel:samWave") 697 Wave sel=$(USANSFolder+":Globals:MainPanel:selFileW") 663 698 //Wave to indicate Current status 664 Wave isCurrent = $ "root:Globals:MainPanel:SAMisCurrent"699 Wave isCurrent = $(USANSFolder+":Globals:MainPanel:SAMisCurrent") 665 700 666 701 … … 698 733 String ctrlName 699 734 735 SVAR USANSFolder = root:Packages:NIST:USANS:Globals:gUSANSFolder 736 700 737 //Print "toEmptyList button" 701 Wave/T fileWave=$ "root:Globals:MainPanel:fileWave"702 Wave/T empWave=$ "root:Globals:MainPanel:empWave"703 Wave sel=$ "root:Globals:MainPanel:selFileW"738 Wave/T fileWave=$(USANSFolder+":Globals:MainPanel:fileWave") 739 Wave/T empWave=$(USANSFolder+":Globals:MainPanel:empWave") 740 Wave sel=$(USANSFolder+":Globals:MainPanel:selFileW") 704 741 //Wave to indicate Current status 705 Wave isCurrent = $ "root:Globals:MainPanel:EMPisCurrent"742 Wave isCurrent = $(USANSFolder+":Globals:MainPanel:EMPisCurrent") 706 743 707 744 … … 739 776 Function DelSamButtonProc(ctrlName) : ButtonControl 740 777 String ctrlName 741 778 779 SVAR USANSFolder = root:Packages:NIST:USANS:Globals:gUSANSFolder 780 742 781 ControlInfo SamLB 743 782 Variable selRow=V_Value … … 745 784 DeletePoints selRow,1,lw 746 785 //Clear out current flag AJJ Sept O6 747 Wave isCurrent = $ "root:Globals:MainPanel:SAMisCurrent"786 Wave isCurrent = $(USANSFolder+":Globals:MainPanel:SAMisCurrent") 748 787 DeletePoints selRow, 1, isCurrent 749 788 End … … 755 794 Function DelEmpButtonProc(ctrlName) : ButtonControl 756 795 String ctrlName 757 796 797 SVAR USANSFolder = root:Packages:NIST:USANS:Globals:gUSANSFolder 798 758 799 ControlInfo EmpLB 759 800 Variable selRow=V_Value … … 761 802 DeletePoints selRow,1,lw 762 803 //Clear out current flag AJJ Sept O6 763 Wave isCurrent = $ "root:Globals:MainPanel:EMPisCurrent"804 Wave isCurrent = $(USANSFolder+":Globals:MainPanel:EMPisCurrent") 764 805 DeletePoints selRow, 1, isCurrent 765 806 End … … 776 817 String ctrlName 777 818 778 SVAR FilterStr = root:Globals:MainPanel:FilterStr 819 SVAR USANSFolder = root:Packages:NIST:USANS:Globals:gUSANSFolder 820 821 SVAR FilterStr = $(USANSFolder+":Globals:MainPanel:FilterStr") 822 print FilterStr 779 823 String filter 780 824 … … 809 853 newList = SortList(newList,";",0) //get them in order 810 854 num=ItemsInList(newlist,";") 811 Wave/T fileWave = $ " root:Globals:MainPanel:fileWave"812 Wave selFileW = $ "root:Globals:MainPanel:selFileW"855 Wave/T fileWave = $(USANSFolder+":Globals:MainPanel:fileWave") 856 Wave selFileW = $(USANSFolder+":Globals:MainPanel:selFileW") 813 857 Redimension/N=(num) fileWave 814 858 Redimension/N=(num) selFileW … … 827 871 Function ClearButtonProc(ctrlName) : ButtonControl 828 872 String ctrlName 829 830 SetDataFolder root:Globals:MainPanel 873 874 SVAR USANSFolder = root:Packages:NIST:USANS:Globals:gUSANSFolder 875 876 SetDataFolder $(USANSFolder+":Globals:MainPanel") 831 877 strswitch(ctrlName) 832 878 case "ClearSamButton": … … 870 916 String fname 871 917 918 SVAR USANSFolder = root:Packages:NIST:USANS:Globals:gUSANSFolder 919 872 920 Variable err=0,refNum 873 Wave/T statusWave=$ "root:Globals:MainPanel:statusWave"921 Wave/T statusWave=$(USANSFolder+":Globals:MainPanel:statusWave") 874 922 875 923 Open/R refNum as fname //READ-ONLY.......if fname is "", a dialog will be presented … … 918 966 Function TitleForRawGraph() 919 967 920 WAVE detCts=$"root:RAW:detCts" 921 WAVE monCts = $"root:RAW:monCts" 968 SVAR USANSFolder = root:Packages:NIST:USANS:Globals:gUSANSFolder 969 970 WAVE detCts=$(USANSFolder+":RAW:detCts") 971 WAVE monCts = $(USANSFolder+":RAW:monCts") 922 972 String str=note(detCts) 923 973 … … 957 1007 //the user must supply the correct sample thickness, BKGLevel, and EMPLevel for extrapolation 958 1008 Function DoCorrectData() 1009 1010 SVAR USANSFolder = root:Packages:NIST:USANS:Globals:gUSANSFolder 959 1011 960 1012 //constants 961 1013 // NVAR thetaH = root:Globals:MainPanel:gTheta_H //Darwin FWHM 962 1014 // NVAR thetaV = root:Globals:MainPanel:gTheta_V //Vertical divergence 963 NVAR dOmega = root:Globals:MainPanel:gDomega //Solid angle of detector 964 NVAR defaultMCR = root:Globals:MainPanel:gDefaultMCR 1015 NVAR dOmega = $(USANSFolder+":Globals:MainPanel:gDomega") //Solid angle of detector 1016 NVAR defaultMCR = $(USANSFolder+":Globals:MainPanel:gDefaultMCR") 1017 965 1018 //waves 966 Wave iqSAM = $ "root:SAM:DetCts"967 Wave errSAM = $ "root:SAM:ErrDetCts"968 Wave qvalSAM = $ "root:SAM:Qvals"969 Wave iqEMP = $ "root:EMP:DetCts"970 Wave errEMP = $ "root:EMP:ErrDetCts"971 Wave qvalEMP = $ "root:EMP:Qvals"1019 Wave iqSAM = $(USANSFolder+":SAM:DetCts") 1020 Wave errSAM = $(USANSFolder+":SAM:ErrDetCts") 1021 Wave qvalSAM = $(USANSFolder+":SAM:Qvals") 1022 Wave iqEMP = $(USANSFolder+":EMP:DetCts") 1023 Wave errEMP = $(USANSFolder+":EMP:ErrDetCts") 1024 Wave qvalEMP = $(USANSFolder+":EMP:Qvals") 972 1025 //BKG,EMP levels,trans,thick 973 NVAR bkgLevel = root:Globals:MainPanel:gBkgCts974 NVAR empLevel = root:Globals:MainPanel:gEmpCts975 NVAR Trock = root:Globals:MainPanel:gTransRock976 NVAR Twide = root:Globals:MainPanel:gTransWide977 NVAR thick = root:Globals:MainPanel:gThick1026 NVAR bkgLevel = $(USANSFolder+":Globals:MainPanel:gBkgCts") 1027 NVAR empLevel = $(USANSFolder+":Globals:MainPanel:gEmpCts") 1028 NVAR Trock = $(USANSFolder+":Globals:MainPanel:gTransRock") 1029 NVAR Twide = $(USANSFolder+":Globals:MainPanel:gTransWide") 1030 NVAR thick = $(USANSFolder+":Globals:MainPanel:gThick") 978 1031 //New waves in COR folder, same length as SAM data 979 Duplicate/O iqSAM,$ "root:COR:DetCts"980 Duplicate/O errSAM,$ "root:COR:ErrDetCts"981 Duplicate/O qvalSAM,$ "root:COR:Qvals"982 Wave iqCOR = $ "root:COR:DetCts"983 Wave qvalCOR = $ "root:COR:Qvals"984 Wave errCOR = $ "root:COR:ErrDetCts"1032 Duplicate/O iqSAM,$(USANSFolder+":COR:DetCts") 1033 Duplicate/O errSAM,$(USANSFolder+":COR:ErrDetCts") 1034 Duplicate/O qvalSAM,$(USANSFolder+":COR:Qvals") 1035 Wave iqCOR = $(USANSFolder+":COR:DetCts") 1036 Wave qvalCOR = $(USANSFolder+":COR:Qvals") 1037 Wave errCOR = $(USANSFolder+":COR:ErrDetCts") 985 1038 986 1039 //correction done here … … 1012 1065 1013 1066 //copy to Graph directory to plot 1014 Duplicate/O $( "root:COR:Qvals"),$("root:Graph:Qvals_COR")1015 Duplicate/O $( "root:COR:DetCts"),$("root:Graph:DetCts_COR")1016 Duplicate/O $( "root:COR:ErrDetCts"),$("root:Graph:ErrDetCts_COR")1067 Duplicate/O $(USANSFolder+":COR:Qvals"),$(USANSFolder+":Graph:Qvals_COR") 1068 Duplicate/O $(USANSFolder+":COR:DetCts"),$(USANSFolder+":Graph:DetCts_COR") 1069 Duplicate/O $(USANSFolder+":COR:ErrDetCts"),$(USANSFolder+":Graph:ErrDetCts_COR") 1017 1070 1018 1071 //now plot the data (or just bring the graph to the front) … … 1027 1080 Function CleanOutFolder(type) 1028 1081 String type 1029 1030 SetDataFolder $("root:"+type) 1082 1083 SVAR USANSFolder = root:Packages:NIST:USANS:Globals:gUSANSFolder 1084 1085 SetDataFolder $(USANSFolder+":"+type) 1031 1086 Killwaves/Z DetCts,Qvals,ErrDetCts,Angle,MonCts,TransCts 1032 1087 1033 SetDataFolder root:Graph1088 SetDataFolder $(USANSFolder+":Graph") 1034 1089 KillWaves/Z $("DetCts_"+type),$("ErrDetCts_"+type),$("Qvals_"+type) 1035 1090 … … 1053 1108 Function RefreshCurrentButtonProc(ctrlName) : ButtonControl 1054 1109 String ctrlName 1110 1111 SVAR USANSFolder = root:Packages:NIST:USANS:Globals:gUSANSFolder 1055 1112 1056 1113 //Prod the web update page … … 1092 1149 newList = SortList(newList,";",0) //get them in order 1093 1150 num=ItemsInList(newlist,";") 1094 Wave/T curWave = $ " root:Globals:MainPanel:curWave"1151 Wave/T curWave = $(USANSFolder+" :Globals:MainPanel:curWave") 1095 1152 Redimension/N=(num) curWave 1096 1153 curWave="" … … 1104 1161 String ctrlName 1105 1162 1106 Wave/T curWave=$"root:Globals:MainPanel:curWave" 1107 Wave/T samWave=$"root:Globals:MainPanel:samWave" 1108 Wave isCurrent = $"root:Globals:MainPanel:SAMisCurrent" 1163 SVAR USANSFolder = root:Packages:NIST:USANS:Globals:gUSANSFolder 1164 1165 Wave/T curWave=$(USANSFolder+":Globals:MainPanel:curWave") 1166 Wave/T samWave=$(USANSFolder+":Globals:MainPanel:samWave") 1167 Wave isCurrent = $(USANSFolder+":Globals:MainPanel:SAMisCurrent") 1109 1168 1110 1169 Variable num, ii = 0 … … 1133 1192 String ctrlName 1134 1193 1135 Wave/T curWave=$"root:Globals:MainPanel:curWave" 1136 Wave/T empWave=$"root:Globals:MainPanel:empWave" 1137 Wave isCurrent = $"root:Globals:MainPanel:EMPisCurrent" 1194 SVAR USANSFolder = root:Packages:NIST:USANS:Globals:gUSANSFolder 1195 1196 Wave/T curWave=$(USANSFolder+":Globals:MainPanel:curWave") 1197 Wave/T empWave=$(USANSFolder+":Globals:MainPanel:empWave") 1198 Wave isCurrent = $(USANSFolder+":Globals:MainPanel:EMPisCurrent") 1138 1199 1139 1200 Variable num, ii=0 … … 1163 1224 String ctrlName 1164 1225 Variable checked 1165 1166 NVAR isChecked = root:Globals:MainPanel:gUseCurrentData 1226 1227 SVAR USANSFolder = root:Packages:NIST:USANS:Globals:gUSANSFolder 1228 1229 NVAR isChecked = $(USANSFolder+":Globals:MainPanel:gUseCurrentData") 1167 1230 1168 1231 if (checked == 1) -
sans/Dev/trunk/NCNR_User_Procedures/USANS/USANS_Includes.ipf
r377 r404 12 12 #include "COR_Graph",version >= 2.20 13 13 #include "Main_USANS",version >= 2.20 14 #include "PlotUtils _USANS",version >= 2.2014 #include "PlotUtilsMacro_v40",version >= 2.20 15 15 #include "WriteUSANSData",version >= 2.20 16 16 #include "LakeDesmearing_JB",version >= 2.20 -
sans/Dev/trunk/NCNR_User_Procedures/USANS/WriteUSANSData.ipf
r328 r404 18 18 Variable lo,hi,dialog //=1 will present dialog for name 19 19 20 SVAR USANSFolder = root:Packages:NIST:USANS:Globals:gUSANSFolder 21 22 20 23 String termStr="\r\n" //VAX uses only <CR> as terminator, but only CRLF seems to FTP correctly to VAX 21 24 String destStr="",formatStr = "%15.6g %15.6g %15.6g %15.6g %15.6g %15.6g"+termStr 22 destStr = "root:"+type25 destStr = USANSFolder+":"+type 23 26 24 27 Variable refNum,integer,realval … … 45 48 // 46 49 Duplicate/O qvals,dumWave 47 NVAR DQv= root:Globals:MainPanel:gDQv50 NVAR DQv=$(USANSFolder+":Globals:MainPanel:gDQv") 48 51 dumWave = - DQv 49 52 /// … … 72 75 73 76 //tailor the output given the type of data written out... 74 WAVE inten_EMP=$( "root:EMP:DetCts")77 WAVE inten_EMP=$(USANSFolder+":EMP:DetCts") 75 78 String samStr="",empStr="",dateStr="",samLabelStr="",paramStr="",empLevStr="",bkgLevStr="" 76 79 String pkStr="" 77 NVAR TransWide = root:Globals:MainPanel:gTransWide78 NVAR TransRock = root:Globals:MainPanel:gTransRock79 NVAR empCts = root:Globals:MainPanel:gEmpCts80 NVAR bkgCts = root:Globals:MainPanel:gBkgCts81 NVAR thick = root:Globals:MainPanel:gThick80 NVAR TransWide = $(USANSFolder+":Globals:MainPanel:gTransWide") 81 NVAR TransRock = $(USANSFolder+":Globals:MainPanel:gTransRock") 82 NVAR empCts = $(USANSFolder+":Globals:MainPanel:gEmpCts") 83 NVAR bkgCts = $(USANSFolder+":Globals:MainPanel:gBkgCts") 84 NVAR thick = $(USANSFolder+":Globals:MainPanel:gThick") 82 85 83 86 strswitch(type)
Note: See TracChangeset
for help on using the changeset viewer.