- Timestamp:
- Feb 25, 2016 4:30:38 PM (7 years ago)
- Location:
- sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS
- Files:
-
- 1 added
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/VC_BeamCenter.ipf
r981 r982 13 13 14 14 15 Function V_FindBeamCenter() 16 DoWindow/F PanelFit 17 if(V_flag==0) 18 Execute "DetectorPanelFit()" 19 endif 20 End 15 21 // 16 22 // TODO - may need to adjust the display for the different pixel dimensions … … 27 33 NewPanel /W=(662,418,1586,960)/N=PanelFit/K=1 28 34 // ShowTools/A 29 35 30 36 PopupMenu popup_0,pos={20,20},size={109,20},proc=SetDetPanelPopMenuProc,title="Detector Panel" 31 37 PopupMenu popup_0,mode=1,popvalue="FL",value= #"\"FL;FR;FT;FB;MR;ML;MT;MB;B;\"" … … 38 44 39 45 40 duplicate/O root:Packages:NIST:VSANS:VCALC: Front:det_FL curDispPanel46 duplicate/O root:Packages:NIST:VSANS:VCALC:entry:entry:instrument:detector_FL:det_FL curDispPanel 41 47 SetScale/P x 0,1, curDispPanel 42 48 SetScale/P y 0,1, curDispPanel … … 155 161 NVAR pixSize_X = root:Packages:NIST:VSANS:VCALC:gFront_L_pixelX 156 162 NVAR pixSize_Y = root:Packages:NIST:VSANS:VCALC:gFront_L_pixelY 157 wave newW = $("root:Packages:NIST:VSANS:VCALC:Front:det_"+str)163 // wave newW = $("root:Packages:NIST:VSANS:VCALC:entry:entry:instrument:detector_"+str+":det_"+str) 158 164 break 159 165 case "FR": … … 162 168 NVAR pixSize_X = root:Packages:NIST:VSANS:VCALC:gFront_R_pixelX 163 169 NVAR pixSize_Y = root:Packages:NIST:VSANS:VCALC:gFront_R_pixelY 164 wave newW = $("root:Packages:NIST:VSANS:VCALC:Front:det_"+str)170 // wave newW = $("root:Packages:NIST:VSANS:VCALC:Front:det_"+str) 165 171 break 166 172 case "ML": … … 169 175 NVAR pixSize_X = root:Packages:NIST:VSANS:VCALC:gMiddle_L_pixelX 170 176 NVAR pixSize_Y = root:Packages:NIST:VSANS:VCALC:gMiddle_L_pixelY 171 wave newW = $("root:Packages:NIST:VSANS:VCALC:Middle:det_"+str)177 // wave newW = $("root:Packages:NIST:VSANS:VCALC:Middle:det_"+str) 172 178 break 173 179 case "MR": … … 176 182 NVAR pixSize_X = root:Packages:NIST:VSANS:VCALC:gMiddle_R_pixelX 177 183 NVAR pixSize_Y = root:Packages:NIST:VSANS:VCALC:gMiddle_R_pixelY 178 wave newW = $("root:Packages:NIST:VSANS:VCALC:Middle:det_"+str)184 // wave newW = $("root:Packages:NIST:VSANS:VCALC:Middle:det_"+str) 179 185 break 180 186 … … 184 190 NVAR pixSize_X = root:Packages:NIST:VSANS:VCALC:gFront_T_pixelX 185 191 NVAR pixSize_Y = root:Packages:NIST:VSANS:VCALC:gFront_T_pixelY 186 wave newW = $("root:Packages:NIST:VSANS:VCALC:Front:det_"+str)192 // wave newW = $("root:Packages:NIST:VSANS:VCALC:Front:det_"+str) 187 193 break 188 194 case "FB": … … 191 197 NVAR pixSize_X = root:Packages:NIST:VSANS:VCALC:gFront_B_pixelX 192 198 NVAR pixSize_Y = root:Packages:NIST:VSANS:VCALC:gFront_B_pixelY 193 wave newW = $("root:Packages:NIST:VSANS:VCALC:Front:det_"+str)199 // wave newW = $("root:Packages:NIST:VSANS:VCALC:Front:det_"+str) 194 200 break 195 201 case "MT": … … 198 204 NVAR pixSize_X = root:Packages:NIST:VSANS:VCALC:gMiddle_T_pixelX 199 205 NVAR pixSize_Y = root:Packages:NIST:VSANS:VCALC:gMiddle_T_pixelY 200 wave newW = $("root:Packages:NIST:VSANS:VCALC:Middle:det_"+str)206 // wave newW = $("root:Packages:NIST:VSANS:VCALC:Middle:det_"+str) 201 207 break 202 208 case "MB": … … 205 211 NVAR pixSize_X = root:Packages:NIST:VSANS:VCALC:gMiddle_B_pixelX 206 212 NVAR pixSize_Y = root:Packages:NIST:VSANS:VCALC:gMiddle_B_pixelY 207 wave newW = $("root:Packages:NIST:VSANS:VCALC:Middle:det_"+str)213 // wave newW = $("root:Packages:NIST:VSANS:VCALC:Middle:det_"+str) 208 214 break 209 215 … … 215 221 endswitch 216 222 217 218 219 223 wave newW = $("root:Packages:NIST:VSANS:VCALC:entry:entry:instrument:detector_"+str+":det_"+str) 224 220 225 Variable scale = 5 221 226 … … 395 400 return 0 396 401 End 402 403 404 // TODO 405 // -- some of this is hard-wired in 406 // -- this is still alll in terms of pixels, which still may not be what I want 407 // -- the x-scale of the T/B panels is artificially compressed to "fake" 4mm per pixel in x-direction 408 // 409 Function V_RescaleToBeamCenter(folderStr,detStr,xCtr,yCtr) 410 String folderStr,detStr 411 Variable xCtr,yCtr 412 413 Wave w = $("root:Packages:NIST:VSANS:"+folderStr+":entry:entry:instrument:detector_"+detStr+":data") 414 415 Variable nPix = 128 416 Variable nTubes = 48 417 418 strswitch(detStr) // string switch 419 case "MT": // top panels 420 case "FT": 421 // SetScale/I x -xCtr,npix-xCtr,"",w 422 SetScale/I x -xCtr/2,(npix-xCtr)/2,"",w // fake 4mm by compressing the scale 423 SetScale/I y -yCtr,nTubes-yCtr,"",w 424 break // exit from switch 425 case "MB": // bottom panels 426 case "FB": 427 // SetScale/I x -xCtr,npix-xCtr,"",w 428 SetScale/I x -xCtr/2,(npix-xCtr)/2,"",w 429 SetScale/I y -yCtr,nTubes-yCtr,"",w 430 break // exit from switch 431 case "ML": // left panels 432 case "FL": 433 SetScale/I x -xCtr,nTubes-xCtr,"",w 434 SetScale/I y -yCtr,npix-yCtr,"",w 435 break // exit from switch 436 case "MR": // Right panels 437 case "FR": 438 SetScale/I x -xCtr,nTubes-xCtr,"",w 439 SetScale/I y -yCtr,npix-yCtr,"",w 440 break // exit from switch 441 442 default: // optional default expression executed 443 Print "Error in V_RescaleToBeamCenter()" 444 endswitch 445 446 return(0) 447 end 448 449 Function V_RestorePanels() 450 451 V_RescaleToBeamCenter("RAW","MB",64,55) 452 V_RescaleToBeamCenter("RAW","MT",64,-8.7) 453 V_RescaleToBeamCenter("RAW","MR",-8.1,64) 454 V_RescaleToBeamCenter("RAW","ML",55,64) 455 V_RescaleToBeamCenter("RAW","FB",64,55) 456 V_RescaleToBeamCenter("RAW","FT",64,-8.7) 457 V_RescaleToBeamCenter("RAW","FR",-8.1,64) 458 V_RescaleToBeamCenter("RAW","FL",55,64) 459 460 461 return(0) 462 end 463 464 Function V_SpreadOutPanels() 465 466 V_RescaleToBeamCenter("RAW","MB",64,78) 467 V_RescaleToBeamCenter("RAW","MT",64,-30) 468 V_RescaleToBeamCenter("RAW","MR",-30,64) 469 V_RescaleToBeamCenter("RAW","ML",78,64) 470 V_RescaleToBeamCenter("RAW","FB",64,78) 471 V_RescaleToBeamCenter("RAW","FT",64,-30) 472 V_RescaleToBeamCenter("RAW","FR",-30,64) 473 V_RescaleToBeamCenter("RAW","FL",78,64) 474 return(0) 475 end -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/VC_DetectorBinning_Q.ipf
r963 r982 47 47 // space is allocated for all of the detectors and Q's on initialization 48 48 // calculate Qtot, qxqyqz arrays from geometry 49 V _CalculateQFrontPanels()49 VC_CalculateQFrontPanels() 50 50 51 51 // fill the panels with fake sphere scattering data 52 52 // TODO: am I in the right data folder?? 53 SetDataFolder root:Packages:NIST:VSANS:VCALC:Front 54 55 WAVE det_FL = det_FL 56 WAVE det_FR = det_FR 57 WAVE det_FT = det_FT 58 WAVE det_FB = det_FB 59 60 WAVE qTot_FL = qTot_FL 61 WAVE qTot_FR = qTot_FR 62 WAVE qTot_FT = qTot_FT 63 WAVE qTot_FB = qTot_FB 53 // SetDataFolder root:Packages:NIST:VSANS:VCALC:Front 54 55 String folderStr = "VCALC" 56 String detStr = "" 57 58 String folderPath = "root:Packages:NIST:VSANS:"+folderStr 59 String instPath = ":entry:entry:instrument:detector_" 60 61 detStr = "FL" 62 WAVE det_FL = $(folderPath+instPath+detStr+":det_"+detStr) 63 WAVE qTot_FL = $(folderPath+instPath+detStr+":qTot_"+detStr) 64 65 detStr = "FR" 66 WAVE det_FR = $(folderPath+instPath+detStr+":det_"+detStr) 67 WAVE qTot_FR = $(folderPath+instPath+detStr+":qTot_"+detStr) 68 69 detStr = "FT" 70 WAVE det_FT = $(folderPath+instPath+detStr+":det_"+detStr) 71 WAVE qTot_FT = $(folderPath+instPath+detStr+":qTot_"+detStr) 72 73 detStr = "FB" 74 WAVE det_FB = $(folderPath+instPath+detStr+":det_"+detStr) 75 WAVE qTot_FB = $(folderPath+instPath+detStr+":qTot_"+detStr) 64 76 65 77 FillPanel_wModelData(det_FL,qTot_FL,"FL") … … 74 86 // -- I can get the separation L/R from the panel - only this "open" width is visible. 75 87 //TODO - make this a proper shadow - TB extent of the LR panels matters too, not just the LR separation 76 V _SetShadow_TopBottom("Front","FT") // TODO: -- be sure the data folder is properly set (within the function...)77 V _SetShadow_TopBottom("Front","FB")88 VC_SetShadow_TopBottom("VCALC","FT") // TODO: -- be sure the data folder is properly set (within the function...) 89 VC_SetShadow_TopBottom("VCALC","FB") 78 90 79 91 // do the q-binning for each of the panels to get I(Q) … … 82 94 // plot the results 83 95 Execute "Front_IQ_Graph()" 84 Execute "FrontPanels_AsQ()"96 FrontPanels_AsQ() 85 97 86 98 return(0) … … 102 114 // when anything changes 103 115 // 104 Function V_CalculateQFrontPanels() 116 // TODO 117 // NOTE -- this is VCALC ONLY. data is not referenced for hdf here, and data is rescaled based on VCALC assumptions 118 // 119 Function VC_CalculateQFrontPanels() 105 120 106 121 Variable xCtr,yCtr,sdd,lam,pixSizeX,pixSizeY,nPix_X,nPix_Y 107 122 Variable F_LR_sep,F_TB_sep,F_offset,F_sdd_offset 123 124 String folderPath = "root:Packages:NIST:VSANS:VCALC" 125 String instPath = ":entry:entry:instrument:detector_" 126 String detStr="" 108 127 109 128 // get the values from the panel + constants … … 125 144 F_sdd_offset = VCALC_getTopBottomSDDOffset("FT") //T/B are 300 mm farther back //TODO: make all detector parameters global, not hard-wired 126 145 127 SetDataFolder root:Packages:NIST:VSANS:VCALC:Front 128 Wave det_FL,det_FR // these are (48,128) (nominal, may change) 129 Wave det_FT,det_FB // these are (128,48) 130 131 //FRONT/LEFT 132 WAVE qTot_FL,qx_FL,qy_FL,qz_FL 146 // detector data to bin 147 // SetDataFolder root:Packages:NIST:VSANS:VCALC:Front 148 Wave det_FL = $(folderPath+instPath+"FL"+":det_FL") 149 Wave det_FR = $(folderPath+instPath+"FR"+":det_FR") // these are (48,128) (nominal, may change) 150 151 Wave det_FT = $(folderPath+instPath+"FT"+":det_FT") 152 Wave det_FB = $(folderPath+instPath+"FB"+":det_FB") // these are (128,48) 153 154 //FRONT/LEFT 155 detStr = "FL" 156 Wave qTot_FL = $(folderPath+instPath+detStr+":qTot_"+detStr) // 2D q-values 157 Wave qx_FL = $(folderPath+instPath+detStr+":qx_"+detStr) 158 Wave qy_FL = $(folderPath+instPath+detStr+":qy_"+detStr) 159 Wave qz_FL = $(folderPath+instPath+detStr+":qz_"+detStr) 160 133 161 qTot_FL = 0 134 162 qx_FL = 0 … … 147 175 xCtr = nPix_X+(F_LR_sep/2/pixSizeX) // TODO -- check -- starting from 47 rather than 48 (but I'm in pixel units for centers)?? 148 176 yCtr = nPix_Y/2 149 V _Detector_2Q(det_FL,qTot_FL,qx_FL,qy_FL,qz_FL,xCtr,yCtr,sdd,lam,pixSizeX,pixSizeY)177 VC_Detector_2Q(det_FL,qTot_FL,qx_FL,qy_FL,qz_FL,xCtr,yCtr,sdd,lam,pixSizeX,pixSizeY) 150 178 // Print "xy for FL = ",xCtr,yCtr 151 179 … … 159 187 160 188 //FRONT/RIGHT 161 SetDataFolder root:Packages:NIST:VSANS:VCALC:Front 162 WAVE qTot_FR,qx_FR,qy_FR,qz_FR 189 // SetDataFolder root:Packages:NIST:VSANS:VCALC:Front 190 detStr = "FR" 191 Wave qTot_FR = $(folderPath+instPath+detStr+":qTot_"+detStr) // 2D q-values 192 Wave qx_FR = $(folderPath+instPath+detStr+":qx_"+detStr) 193 Wave qy_FR = $(folderPath+instPath+detStr+":qy_"+detStr) 194 Wave qz_FR = $(folderPath+instPath+detStr+":qz_"+detStr) 195 163 196 qTot_FR = 0 164 197 qx_FR = 0 … … 175 208 xCtr = -(F_LR_sep/2/pixSizeX)-1 176 209 yCtr = nPix_Y/2 177 V _Detector_2Q(det_FR,qTot_FR,qx_FR,qy_FR,qz_FR,xCtr,yCtr,sdd,lam,pixSizeX,pixSizeY)210 VC_Detector_2Q(det_FR,qTot_FR,qx_FR,qy_FR,qz_FR,xCtr,yCtr,sdd,lam,pixSizeX,pixSizeY) 178 211 // Print "xy for FR = ",xCtr,yCtr 179 212 SetScale/I x WaveMin(qx_FR),WaveMax(qx_FR),"", det_FR //this sets the left and right ends of the data scaling … … 182 215 183 216 //FRONT/TOP 184 SetDataFolder root:Packages:NIST:VSANS:VCALC:Front 185 WAVE qTot_FT,qx_FT,qy_FT,qz_FT 217 // SetDataFolder root:Packages:NIST:VSANS:VCALC:Front 218 detStr = "FT" 219 Wave qTot_FT = $(folderPath+instPath+detStr+":qTot_"+detStr) // 2D q-values 220 Wave qx_FT = $(folderPath+instPath+detStr+":qx_"+detStr) 221 Wave qy_FT = $(folderPath+instPath+detStr+":qy_"+detStr) 222 Wave qz_FT = $(folderPath+instPath+detStr+":qz_"+detStr) 223 186 224 qTot_FT = 0 187 225 qx_FT = 0 … … 199 237 yCtr = -(F_TB_sep/2/pixSizeY)-1 200 238 // global sdd_offset is in (mm), convert to meters here for the Q-calculation 201 V _Detector_2Q(det_FT,qTot_FT,qx_FT,qy_FT,qz_FT,xCtr,yCtr,sdd+F_sdd_offset/1000,lam,pixSizeX,pixSizeY)239 VC_Detector_2Q(det_FT,qTot_FT,qx_FT,qy_FT,qz_FT,xCtr,yCtr,sdd+F_sdd_offset/1000,lam,pixSizeX,pixSizeY) 202 240 // Print "xy for FT = ",xCtr,yCtr 203 241 SetScale/I x WaveMin(qx_FT),WaveMax(qx_FT),"", det_FT //this sets the left and right ends of the data scaling … … 206 244 207 245 //FRONT/BOTTOM 208 SetDataFolder root:Packages:NIST:VSANS:VCALC:Front 209 WAVE qTot_FB,qx_FB,qy_FB,qz_FB 246 // SetDataFolder root:Packages:NIST:VSANS:VCALC:Front 247 detStr = "FB" 248 Wave qTot_FB = $(folderPath+instPath+detStr+":qTot_"+detStr) // 2D q-values 249 Wave qx_FB = $(folderPath+instPath+detStr+":qx_"+detStr) 250 Wave qy_FB = $(folderPath+instPath+detStr+":qy_"+detStr) 251 Wave qz_FB = $(folderPath+instPath+detStr+":qz_"+detStr) 252 210 253 qTot_FB = 0 211 254 qx_FB = 0 … … 223 266 yCtr = nPix_Y+(F_TB_sep/2/pixSizeY) // TODO -- check -- starting from 47 rather than 48 (but I'm in pixel units for centers)?? 224 267 // global sdd_offset is in (mm), convert to meters here for the Q-calculation 225 V _Detector_2Q(det_FB,qTot_FB,qx_FB,qy_FB,qz_FB,xCtr,yCtr,sdd+F_sdd_offset/1000,lam,pixSizeX,pixSizeY)268 VC_Detector_2Q(det_FB,qTot_FB,qx_FB,qy_FB,qz_FB,xCtr,yCtr,sdd+F_sdd_offset/1000,lam,pixSizeX,pixSizeY) 226 269 // Print "xy for FB = ",xCtr,yCtr 227 270 SetScale/I x WaveMin(qx_FB),WaveMax(qx_FB),"", det_FB //this sets the left and right ends of the data scaling … … 239 282 // ? skip the masking? but then I bin the detector data directly to get I(q), skipping the masked NaN values... 240 283 // 241 Function V _SetShadow_TopBottom(folderStr,type)284 Function VC_SetShadow_TopBottom(folderStr,type) 242 285 String folderStr,type 243 286 … … 258 301 259 302 //detector data 260 Wave det = $("root:Packages:NIST:VSANS: VCALC:"+folderStr+":det_"+type)303 Wave det = $("root:Packages:NIST:VSANS:"+folderStr+":entry:entry:instrument:detector_"+type+":det_"+type) 261 304 262 305 // TODO - these are to be set from globals, not hard-wired … … 290 333 // are rescaled as needed 291 334 // 292 Window FrontPanels_AsQ() : Graph 293 294 SetDataFolder root:Packages:NIST:VSANS:VCALC:Front 295 335 Function FrontPanels_AsQ() 336 337 String frontStr = "root:Packages:NIST:VSANS:VCALC:entry:entry:instrument:" 338 // SetDataFolder root:Packages:NIST:VSANS:VCALC:Front 339 SetDataFolder $(frontStr+"detector_FB") 340 Wave det_FB = det_FB 341 SetDataFolder $(frontStr+"detector_FT") 342 Wave det_FT = det_FT 343 SetDataFolder $(frontStr+"detector_FL") 344 Wave det_FL = det_FL 345 SetDataFolder $(frontStr+"detector_FR") 346 Wave det_FR = det_FR 347 296 348 CheckDisplayed /W=VCALC#Panels_Q det_FB 297 349 if(V_flag == 0) … … 346 398 Proc BinAllFrontPanels() 347 399 348 SetDeltaQ("Front","FL") 349 SetDeltaQ("Front","FT") 400 SetDeltaQ("VCALC","FL") 401 SetDeltaQ("VCALC","FR") 402 SetDeltaQ("VCALC","FT") 403 SetDeltaQ("VCALC","FB") 350 404 351 405 Variable binType … … 354 408 355 409 if(binType == 1) 356 V _BinQxQy_to_1D("","FL")357 V _BinQxQy_to_1D("","FR")358 V _BinQxQy_to_1D("","FT")359 V _BinQxQy_to_1D("","FB")410 VC_BinQxQy_to_1D("VCALC","FL") 411 VC_BinQxQy_to_1D("VCALC","FR") 412 VC_BinQxQy_to_1D("VCALC","FT") 413 VC_BinQxQy_to_1D("VCALC","FB") 360 414 endif 361 415 362 416 if(binType == 2) 363 V _BinQxQy_to_1D("","FLR")364 V _BinQxQy_to_1D("","FTB")417 VC_BinQxQy_to_1D("VCALC","FLR") 418 VC_BinQxQy_to_1D("VCALC","FTB") 365 419 endif 366 420 367 421 if(binType == 3) 368 V _BinQxQy_to_1D("","FLRTB")422 VC_BinQxQy_to_1D("VCALC","FLRTB") 369 423 endif 370 424 … … 372 426 if(binType == 4) 373 427 /// this is for a tall, narrow slit mode 374 V _fBinDetector_byRows("Front","FL")375 V _fBinDetector_byRows("Front","FR")376 V _fBinDetector_byRows("Front","FT")377 V _fBinDetector_byRows("Front","FB")428 VC_fBinDetector_byRows("VCALC","FL") 429 VC_fBinDetector_byRows("VCALC","FR") 430 VC_fBinDetector_byRows("VCALC","FT") 431 VC_fBinDetector_byRows("VCALC","FB") 378 432 endif 379 433 … … 398 452 // space is allocated for all of the detectors and Q's on initialization 399 453 // calculate Qtot, qxqyqz arrays from geometry 400 V _CalculateQMiddlePanels()454 VC_CalculateQMiddlePanels() 401 455 402 456 // fill the panels with fake sphere scattering data 403 457 // TODO: am I in the right data folder?? 404 SetDataFolder root:Packages:NIST:VSANS:VCALC:Middle 405 406 WAVE det_ML = det_ML 407 WAVE det_MR = det_MR 408 WAVE det_MT = det_MT 409 WAVE det_MB = det_MB 410 411 WAVE qTot_ML = qTot_ML 412 WAVE qTot_MR = qTot_MR 413 WAVE qTot_MT = qTot_MT 414 WAVE qTot_MB = qTot_MB 458 // SetDataFolder root:Packages:NIST:VSANS:VCALC:Middle 459 460 String folderStr = "VCALC" 461 String detStr = "" 462 463 String folderPath = "root:Packages:NIST:VSANS:"+folderStr 464 String instPath = ":entry:entry:instrument:detector_" 465 466 detStr = "ML" 467 WAVE det_ML = $(folderPath+instPath+detStr+":det_"+detStr) 468 WAVE qTot_ML = $(folderPath+instPath+detStr+":qTot_"+detStr) 469 470 detStr = "MR" 471 WAVE det_MR = $(folderPath+instPath+detStr+":det_"+detStr) 472 WAVE qTot_MR = $(folderPath+instPath+detStr+":qTot_"+detStr) 473 474 detStr = "MT" 475 WAVE det_MT = $(folderPath+instPath+detStr+":det_"+detStr) 476 WAVE qTot_MT = $(folderPath+instPath+detStr+":qTot_"+detStr) 477 478 detStr = "MB" 479 WAVE det_MB = $(folderPath+instPath+detStr+":det_"+detStr) 480 WAVE qTot_MB = $(folderPath+instPath+detStr+":qTot_"+detStr) 415 481 416 482 FillPanel_wModelData(det_ML,qTot_ML,"ML") … … 424 490 // view of how much of the detectors are actually collecting data 425 491 // -- I can get the separation L/R from the panel - only this "open" width is visible. 426 V _SetShadow_TopBottom("Middle","MT") // TODO: -- be sure the data folder is properly set (within the function...)427 V _SetShadow_TopBottom("Middle","MB")492 VC_SetShadow_TopBottom("VCALC","MT") // TODO: -- be sure the data folder is properly set (within the function...) 493 VC_SetShadow_TopBottom("VCALC","MB") 428 494 429 495 // do the q-binning for each of the panels to get I(Q) … … 432 498 // plot the results 433 499 Execute "Middle_IQ_Graph()" 434 Execute "MiddlePanels_AsQ()"500 MiddlePanels_AsQ() 435 501 436 502 return(0) … … 451 517 // when anything changes 452 518 // 453 Function V _CalculateQMiddlePanels()519 Function VC_CalculateQMiddlePanels() 454 520 455 521 Variable xCtr,yCtr,sdd,lam,pixSizeX,pixSizeY,nPix_X,nPix_Y 456 522 Variable M_LR_sep,M_TB_sep,M_offset, M_sdd_offset 457 523 524 525 String folderPath = "root:Packages:NIST:VSANS:VCALC" 526 String instPath = ":entry:entry:instrument:detector_" 527 String detStr="" 528 458 529 M_LR_sep = VCALC_getPanelSeparation("MLR") 459 530 M_TB_sep = VCALC_getPanelSeparation("MTB") … … 472 543 M_sdd_offset = VCALC_getTopBottomSDDOffset("MT") //T/B are 30 cm farther back //TODO: make all detector parameters global, not hard-wired 473 544 474 SetDataFolder root:Packages:NIST:VSANS:VCALC:Middle 475 Wave det_ML,det_MR // these are (48,128) nominal, may change 476 Wave det_MT,det_MB // these are (128,48) 477 478 //Middle/LEFT 479 WAVE qTot_ML,qx_ML,qy_ML,qz_ML 545 546 // SetDataFolder root:Packages:NIST:VSANS:VCALC:Middle 547 Wave det_ML = $(folderPath+instPath+"ML"+":det_ML") 548 Wave det_MR = $(folderPath+instPath+"MR"+":det_MR") // these are (48,128) (nominal, may change) 549 550 Wave det_MT = $(folderPath+instPath+"MT"+":det_MT") 551 Wave det_MB = $(folderPath+instPath+"MB"+":det_MB") // these are (128,48) 552 553 //Middle/LEFT 554 detStr = "ML" 555 Wave qTot_ML = $(folderPath+instPath+detStr+":qTot_"+detStr) // 2D q-values 556 Wave qx_ML = $(folderPath+instPath+detStr+":qx_"+detStr) 557 Wave qy_ML = $(folderPath+instPath+detStr+":qy_"+detStr) 558 Wave qz_ML = $(folderPath+instPath+detStr+":qz_"+detStr) 559 480 560 qTot_ML = 0 481 561 qx_ML = 0 … … 492 572 xCtr = nPix_X+(M_LR_sep/2/pixSizeX) // TODO -- check -- starting from 47 rather than 48 (but I'm in pixel units for centers)?? 493 573 yCtr = nPix_Y/2 494 V _Detector_2Q(det_ML,qTot_ML,qx_ML,qy_ML,qz_ML,xCtr,yCtr,sdd,lam,pixSizeX,pixSizeY)574 VC_Detector_2Q(det_ML,qTot_ML,qx_ML,qy_ML,qz_ML,xCtr,yCtr,sdd,lam,pixSizeX,pixSizeY) 495 575 // Print "xy for ML = ",xCtr,yCtr 496 576 … … 505 585 506 586 //Middle/RIGHT 507 SetDataFolder root:Packages:NIST:VSANS:VCALC:Middle 508 WAVE qTot_MR,qx_MR,qy_MR,qz_MR 587 // SetDataFolder root:Packages:NIST:VSANS:VCALC:Middle 588 detStr = "MR" 589 Wave qTot_MR = $(folderPath+instPath+detStr+":qTot_"+detStr) // 2D q-values 590 Wave qx_MR = $(folderPath+instPath+detStr+":qx_"+detStr) 591 Wave qy_MR = $(folderPath+instPath+detStr+":qy_"+detStr) 592 Wave qz_MR = $(folderPath+instPath+detStr+":qz_"+detStr) 593 509 594 qTot_MR = 0 510 595 qx_MR = 0 … … 522 607 xCtr = -(M_LR_sep/2/pixSizeX)-1 523 608 yCtr = nPix_Y/2 524 V _Detector_2Q(det_MR,qTot_MR,qx_MR,qy_MR,qz_MR,xCtr,yCtr,sdd,lam,pixSizeX,pixSizeY)609 VC_Detector_2Q(det_MR,qTot_MR,qx_MR,qy_MR,qz_MR,xCtr,yCtr,sdd,lam,pixSizeX,pixSizeY) 525 610 // Print "xy for MR = ",xCtr,yCtr 526 611 SetScale/I x WaveMin(qx_MR),WaveMax(qx_MR),"", det_MR //this sets the left and right ends of the data scaling … … 529 614 530 615 //Middle/TOP 531 SetDataFolder root:Packages:NIST:VSANS:VCALC:Middle 532 WAVE qTot_MT,qx_MT,qy_MT,qz_MT 616 // SetDataFolder root:Packages:NIST:VSANS:VCALC:Middle 617 detStr = "MT" 618 Wave qTot_MT = $(folderPath+instPath+detStr+":qTot_"+detStr) // 2D q-values 619 Wave qx_MT = $(folderPath+instPath+detStr+":qx_"+detStr) 620 Wave qy_MT = $(folderPath+instPath+detStr+":qy_"+detStr) 621 Wave qz_MT = $(folderPath+instPath+detStr+":qz_"+detStr) 622 533 623 qTot_MT = 0 534 624 qx_MT = 0 … … 545 635 xCtr = nPix_X/2 546 636 yCtr = -(M_TB_sep/2/pixSizeY)-1 547 548 V _Detector_2Q(det_MT,qTot_MT,qx_MT,qy_MT,qz_MT,xCtr,yCtr,sdd+M_sdd_offset/1000,lam,pixSizeX,pixSizeY)637 // global sdd_offset is in (mm), convert to meters here for the Q-calculation 638 VC_Detector_2Q(det_MT,qTot_MT,qx_MT,qy_MT,qz_MT,xCtr,yCtr,sdd+M_sdd_offset/1000,lam,pixSizeX,pixSizeY) 549 639 // Print "xy for MT = ",xCtr,yCtr 550 SetScale/I x WaveMin(qx_MT),WaveMax(qx_MT),"", det_MT //this sets the le MTand right ends of the data scaling640 SetScale/I x WaveMin(qx_MT),WaveMax(qx_MT),"", det_MT //this sets the left and right ends of the data scaling 551 641 SetScale/I y WaveMin(qy_MT),WaveMax(qy_MT),"", det_MT 552 642 ////////////////// 553 643 554 644 //Middle/BOTTOM 555 SetDataFolder root:Packages:NIST:VSANS:VCALC:Middle 556 WAVE qTot_MB,qx_MB,qy_MB,qz_MB 645 // SetDataFolder root:Packages:NIST:VSANS:VCALC:Middle 646 detStr = "MB" 647 Wave qTot_MB = $(folderPath+instPath+detStr+":qTot_"+detStr) // 2D q-values 648 Wave qx_MB = $(folderPath+instPath+detStr+":qx_"+detStr) 649 Wave qy_MB = $(folderPath+instPath+detStr+":qy_"+detStr) 650 Wave qz_MB = $(folderPath+instPath+detStr+":qz_"+detStr) 651 557 652 qTot_MB = 0 558 653 qx_MB = 0 … … 570 665 yCtr = nPix_Y+(M_TB_sep/2/pixSizeY) // TODO -- check -- starting from 47 rather than 48 (but I'm in pixel units for centers)?? 571 666 // global sdd_offset is in (mm), convert to meters here for the Q-calculation 572 V _Detector_2Q(det_MB,qTot_MB,qx_MB,qy_MB,qz_MB,xCtr,yCtr,sdd+M_sdd_offset/1000,lam,pixSizeX,pixSizeY)667 VC_Detector_2Q(det_MB,qTot_MB,qx_MB,qy_MB,qz_MB,xCtr,yCtr,sdd+M_sdd_offset/1000,lam,pixSizeX,pixSizeY) 573 668 // Print "xy for MB = ",xCtr,yCtr 574 669 SetScale/I x WaveMin(qx_MB),WaveMax(qx_MB),"", det_MB //this sets the left and right ends of the data scaling … … 582 677 583 678 584 Window MiddlePanels_AsQ() : Graph 679 Function MiddlePanels_AsQ() 585 680 // DoWindow/F MiddlePanels_AsQ 586 681 // if(V_flag == 0) … … 588 683 // Display /W=(1477,44,1978,517) 589 684 590 SetDataFolder root:Packages:NIST:VSANS:VCALC:Middle 685 String midStr = "root:Packages:NIST:VSANS:VCALC:entry:entry:instrument:" 686 // SetDataFolder root:Packages:NIST:VSANS:VCALC:Middle 687 SetDataFolder $(midStr+"detector_MB") 688 Wave det_MB = det_MB 689 SetDataFolder $(midStr+"detector_MT") 690 Wave det_MT = det_MT 691 SetDataFolder $(midStr+"detector_ML") 692 Wave det_ML = det_ML 693 SetDataFolder $(midStr+"detector_MR") 694 Wave det_MR = det_MR 591 695 592 696 CheckDisplayed /W=VCALC#Panels_Q det_MB 697 593 698 if(V_flag == 0) 594 699 AppendImage/W=VCALC#Panels_Q det_MB … … 643 748 Proc BinAllMiddlePanels() 644 749 645 SetDeltaQ("Middle","ML") 646 SetDeltaQ("Middle","MT") 750 SetDeltaQ("VCALC","ML") 751 SetDeltaQ("VCALC","MR") 752 SetDeltaQ("VCALC","MT") 753 SetDeltaQ("VCALC","MB") 647 754 648 755 Variable binType … … 651 758 652 759 if(binType == 1) 653 V _BinQxQy_to_1D("","ML")654 V _BinQxQy_to_1D("","MR")655 V _BinQxQy_to_1D("","MT")656 V _BinQxQy_to_1D("","MB")760 VC_BinQxQy_to_1D("VCALC","ML") 761 VC_BinQxQy_to_1D("VCALC","MR") 762 VC_BinQxQy_to_1D("VCALC","MT") 763 VC_BinQxQy_to_1D("VCALC","MB") 657 764 endif 658 765 659 766 if(binType == 2) 660 V _BinQxQy_to_1D("","MLR")661 V _BinQxQy_to_1D("","MTB")767 VC_BinQxQy_to_1D("VCALC","MLR") 768 VC_BinQxQy_to_1D("VCALC","MTB") 662 769 endif 663 770 664 771 if(binType == 3) 665 V _BinQxQy_to_1D("","MLRTB")772 VC_BinQxQy_to_1D("VCALC","MLRTB") 666 773 endif 667 774 … … 669 776 if(binType == 4) 670 777 /// this is for a tall, narrow slit mode 671 V _fBinDetector_byRows("Middle","ML")672 V _fBinDetector_byRows("Middle","MR")673 V _fBinDetector_byRows("Middle","MT")674 V _fBinDetector_byRows("Middle","MB")778 VC_fBinDetector_byRows("VCALC","ML") 779 VC_fBinDetector_byRows("VCALC","MR") 780 VC_fBinDetector_byRows("VCALC","MT") 781 VC_fBinDetector_byRows("VCALC","MB") 675 782 endif 676 783 End … … 687 794 688 795 if(binType==1) 689 ClearIQIfDisplayed(" MLRTB")690 ClearIQIfDisplayed(" MLR")691 ClearIQIfDisplayed(" MTB")796 ClearIQIfDisplayed("VCALC","MLRTB") 797 ClearIQIfDisplayed("VCALC","MLR") 798 ClearIQIfDisplayed("VCALC","MTB") 692 799 693 800 SetDataFolder root:Packages:NIST:VSANS:VCALC … … 711 818 712 819 if(binType==2) 713 ClearIQIfDisplayed(" MLRTB")714 ClearIQIfDisplayed(" MT")715 ClearIQIfDisplayed(" ML")716 ClearIQIfDisplayed(" MR")717 ClearIQIfDisplayed(" MB")820 ClearIQIfDisplayed("VCALC","MLRTB") 821 ClearIQIfDisplayed("VCALC","MT") 822 ClearIQIfDisplayed("VCALC","ML") 823 ClearIQIfDisplayed("VCALC","MR") 824 ClearIQIfDisplayed("VCALC","MB") 718 825 719 826 … … 739 846 740 847 if(binType==3) 741 ClearIQIfDisplayed(" MLR")742 ClearIQIfDisplayed(" MTB")743 ClearIQIfDisplayed(" MT")744 ClearIQIfDisplayed(" ML")745 ClearIQIfDisplayed(" MR")746 ClearIQIfDisplayed(" MB")848 ClearIQIfDisplayed("VCALC","MLR") 849 ClearIQIfDisplayed("VCALC","MTB") 850 ClearIQIfDisplayed("VCALC","MT") 851 ClearIQIfDisplayed("VCALC","ML") 852 ClearIQIfDisplayed("VCALC","MR") 853 ClearIQIfDisplayed("VCALC","MB") 747 854 748 855 SetDataFolder root:Packages:NIST:VSANS:VCALC … … 765 872 766 873 if(binType==4) // slit aperture binning - Mt, ML, MR, MB are averaged 767 ClearIQIfDisplayed(" MLRTB")768 ClearIQIfDisplayed(" MLR")769 ClearIQIfDisplayed(" MTB")874 ClearIQIfDisplayed("VCALC","MLRTB") 875 ClearIQIfDisplayed("VCALC","MLR") 876 ClearIQIfDisplayed("VCALC","MTB") 770 877 771 878 SetDataFolder root:Packages:NIST:VSANS:VCALC … … 805 912 // space is allocated for all of the detectors and Q's on initialization 806 913 // calculate Qtot, qxqyqz arrays from geometry 807 V _CalculateQBackPanels()914 VC_CalculateQBackPanels() 808 915 809 916 // fill the panels with fake sphere scattering data 810 917 // TODO: am I in the right data folder?? 811 SetDataFolder root:Packages:NIST:VSANS:VCALC: Back918 SetDataFolder root:Packages:NIST:VSANS:VCALC:entry:entry:instrument:detector_B 812 919 813 920 WAVE det_B = det_B … … 821 928 // view of how much of the detectors are actually collecting data 822 929 // -- I can get the separation L/R from the panel - only this "open" width is visible. 823 // V _SetShadow_TopBottom("","MT") // TODO: -- be sure the data folder is properly set (within the function...)824 // V _SetShadow_TopBottom("","MB")930 // VC_SetShadow_TopBottom("","MT") // TODO: -- be sure the data folder is properly set (within the function...) 931 // VC_SetShadow_TopBottom("","MB") 825 932 826 933 // do the q-binning for each of the panels to get I(Q) … … 849 956 // when anything changes 850 957 // 851 Function V _CalculateQBackPanels()958 Function VC_CalculateQBackPanels() 852 959 853 960 Variable xCtr,yCtr,sdd,lam,pixSizeX,pixSizeY 854 961 Variable B_offset 855 962 963 String folderPath = "root:Packages:NIST:VSANS:VCALC" 964 String instPath = ":entry:entry:instrument:detector_" 965 String detStr = "" 966 856 967 B_offset = VCALC_getLateralOffset("B") 857 968 … … 860 971 861 972 // TODO (make the N along the tube length a variable, since this can be reset @ acquisition) 862 SetDataFolder root:Packages:NIST:VSANS:VCALC:Back863 W ave det_B // this is(320,320)973 // SetDataFolder root:Packages:NIST:VSANS:VCALC:Back 974 WAVE det_B = $(folderPath+instPath+"B"+":det_B") // this is nominally (320,320) 864 975 865 976 //Back detector 866 WAVE qTot_B,qx_B,qy_B,qz_B 977 //root:Packages:NIST:VSANS:VCALC:entry:entry:instrument:detector_B:qTot_B 978 detStr = "B" 979 Wave qTot_B = $(folderPath+instPath+detStr+":qTot_"+detStr) // 2D q-values 980 Wave qx_B = $(folderPath+instPath+detStr+":qx_"+detStr) 981 Wave qy_B = $(folderPath+instPath+detStr+":qy_"+detStr) 982 Wave qz_B = $(folderPath+instPath+detStr+":qz_"+detStr) 983 867 984 qTot_B = 0 868 985 qx_B = 0 … … 877 994 xCtr = trunc( DimSize(det_B,0)/2 ) //should be 160 878 995 yCtr = trunc( DimSize(det_B,1)/2 ) //should be 160 879 V _Detector_2Q(det_B,qTot_B,qx_B,qy_B,qz_B,xCtr,yCtr,sdd,lam,pixSizeX,pixSizeY)996 VC_Detector_2Q(det_B,qTot_B,qx_B,qy_B,qz_B,xCtr,yCtr,sdd,lam,pixSizeX,pixSizeY) 880 997 881 998 //set the wave scaling for the detector image so that it can be plotted in q-space … … 898 1015 // Display /W=(1477,44,1978,517) 899 1016 900 SetDataFolder root:Packages:NIST:VSANS:VCALC: Back1017 SetDataFolder root:Packages:NIST:VSANS:VCALC:entry:entry:instrument:detector_B 901 1018 902 1019 CheckDisplayed /W=VCALC#Panels_Q det_B … … 943 1060 Proc BinAllBackPanels() 944 1061 945 SetDeltaQ(" Back","B")1062 SetDeltaQ("VCALC","B") 946 1063 947 1064 Variable binType … … 949 1066 binType = V_Value // V_value counts menu items from 1, so 1=1, 2=2, 3=4 950 1067 951 V _BinQxQy_to_1D("","B")1068 VC_BinQxQy_to_1D("VCALC","B") 952 1069 953 1070 // TODO -- this is only a temporary fix for slit mode 954 1071 if(binType == 4) 955 1072 /// this is for a tall, narrow slit mode 956 V _fBinDetector_byRows("Back","B")1073 VC_fBinDetector_byRows("VCALC","B") 957 1074 endif 958 1075 … … 962 1079 Window Back_IQ_Graph() : Graph 963 1080 964 SetDataFolder root:Packages:NIST:VSANS:VCALC 1081 SetDataFolder root:Packages:NIST:VSANS:VCALC:entry:entry:instrument:detector_B 965 1082 966 1083 Variable binType … … 1022 1139 1023 1140 Variable binType 1141 String fldr = "VCALC" 1024 1142 1025 1143 ControlInfo/W=VCALC popup_b … … 1029 1147 1030 1148 if(binType==1) 1031 ClearIQIfDisplayed(" FLRTB")1032 ClearIQIfDisplayed(" FLR")1033 ClearIQIfDisplayed(" FTB")1149 ClearIQIfDisplayed("VCALC","FLRTB") 1150 ClearIQIfDisplayed("VCALC","FLR") 1151 ClearIQIfDisplayed("VCALC","FTB") 1034 1152 1035 1153 SetDataFolder root:Packages:NIST:VSANS:VCALC … … 1056 1174 1057 1175 if(binType==2) 1058 ClearIQIfDisplayed(" FLRTB")1059 ClearIQIfDisplayed(" FT")1060 ClearIQIfDisplayed(" FL")1061 ClearIQIfDisplayed(" FR")1062 ClearIQIfDisplayed(" FB")1176 ClearIQIfDisplayed("VCALC","FLRTB") 1177 ClearIQIfDisplayed("VCALC","FT") 1178 ClearIQIfDisplayed("VCALC","FL") 1179 ClearIQIfDisplayed("VCALC","FR") 1180 ClearIQIfDisplayed("VCALC","FB") 1063 1181 1064 1182 … … 1084 1202 1085 1203 if(binType==3) 1086 ClearIQIfDisplayed(" FLR")1087 ClearIQIfDisplayed(" FTB")1088 ClearIQIfDisplayed(" FT")1089 ClearIQIfDisplayed(" FL")1090 ClearIQIfDisplayed(" FR")1091 ClearIQIfDisplayed(" FB")1204 ClearIQIfDisplayed("VCALC","FLR") 1205 ClearIQIfDisplayed("VCALC","FTB") 1206 ClearIQIfDisplayed("VCALC","FT") 1207 ClearIQIfDisplayed("VCALC","FL") 1208 ClearIQIfDisplayed("VCALC","FR") 1209 ClearIQIfDisplayed("VCALC","FB") 1092 1210 1093 1211 SetDataFolder root:Packages:NIST:VSANS:VCALC … … 1111 1229 1112 1230 if(binType==4) //slit mode 1113 ClearIQIfDisplayed(" FLRTB")1114 ClearIQIfDisplayed(" FLR")1115 ClearIQIfDisplayed(" FTB")1231 ClearIQIfDisplayed("VCALC","FLRTB") 1232 ClearIQIfDisplayed("VCALC","FLR") 1233 ClearIQIfDisplayed("VCALC","FTB") 1116 1234 1117 1235 SetDataFolder root:Packages:NIST:VSANS:VCALC … … 1142 1260 EndMacro 1143 1261 1144 Function ClearIQIfDisplayed(type) 1145 String type 1146 1147 SetDataFolder root:Packages:NIST:VSANS:VCALC 1148 CheckDisplayed/W=VCALC#Panels_IQ $("iBin_qxqy_"+type) 1149 if(V_flag==1) 1150 RemoveFromGraph/W=VCALC#Panels_IQ $("iBin_qxqy_"+type) 1151 endif 1262 1263 Function ClearIQIfDisplayed(fldr,type) 1264 String fldr,type 1265 1266 SetDataFolder $("root:Packages:NIST:VSANS:"+fldr) 1267 1268 if(cmpstr(fldr,"VCALC") == 0) 1269 CheckDisplayed/W=VCALC#Panels_IQ $("iBin_qxqy_"+type) 1270 if(V_flag==1) 1271 RemoveFromGraph/W=VCALC#Panels_IQ $("iBin_qxqy_"+type) 1272 endif 1273 else 1274 CheckDisplayed/W=V_1D_Data $("iBin_qxqy_"+type) 1275 if(V_flag==1) 1276 RemoveFromGraph/W=V_1D_Data $("iBin_qxqy_"+type) 1277 endif 1278 endif 1279 1152 1280 SetDataFolder root: 1153 1281 -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/VC_DetectorBinning_Slit.ipf
r955 r982 28 28 // LR banks are defined as (48,256) (n,m), sumRows gives sum w/ dimension (n x 1) 29 29 // 30 Function V_fBinDetector_byRows(folderStr,type) 31 String folderStr,type 30 // updated to new folder structure Feb 2016 31 // folderStr = RAW,SAM, VCALC or other 32 // detStr is the panel identifer "ML", etc. 33 Function VC_fBinDetector_byRows(folderStr,detStr) 34 String folderStr,detStr 32 35 33 SetDataFolder root:Packages:NIST:VSANS:VCALC36 // SetDataFolder root:Packages:NIST:VSANS:VCALC 34 37 35 38 Variable pixSizeX,pixSizeY,delQx, delQy 39 Variable isVCALC=0 40 41 if(cmpstr(folderStr,"VCALC") == 0) 42 isVCALC = 1 43 endif 36 44 37 WAVE inten = $("root:Packages:NIST:VSANS:VCALC:"+folderStr+":det_"+type) // 2D detector data 38 WAVE/Z iErr = $("iErr_"+type) // 2D errors -- may not exist, especially for simulation 39 Wave qTotal = $("root:Packages:NIST:VSANS:VCALC:"+folderStr+":qTot_"+type) // 2D q-values 40 Wave qx = $("root:Packages:NIST:VSANS:VCALC:"+folderStr+":qx_"+type) 41 Wave qy = $("root:Packages:NIST:VSANS:VCALC:"+folderStr+":qy_"+type) 45 String folderPath = "root:Packages:NIST:VSANS:"+folderStr 46 String instPath = ":entry:entry:instrument:detector_" 42 47 43 pixSizeX = VCALC_getPixSizeX(type) 44 pixSizeY = VCALC_getPixSizeY(type) 48 if(isVCALC) 49 WAVE inten = $(folderPath+instPath+detStr+":det_"+detStr) // 2D detector data 50 WAVE/Z iErr = $("asdf_iErr_"+detStr) // TODO: 2D errors -- may not exist, especially for simulation 51 else 52 Wave inten = V_getDetectorDataW(folderStr,detStr) 53 Wave iErr = V_getDetectorDataErrW(folderStr,detStr) 54 endif 55 56 Wave qTotal = $(folderPath+instPath+detStr+":qTot_"+detStr) // 2D q-values 57 Wave qx = $(folderPath+instPath+detStr+":qx_"+detStr) 58 Wave qy = $(folderPath+instPath+detStr+":qy_"+detStr) 59 60 // ?? TODO not needed here? 61 // pixSizeX = VCALC_getPixSizeX(detStr) 62 // pixSizeY = VCALC_getPixSizeY(detStr) 45 63 46 64 delQx = abs(qx[0][0] - qx[1][0]) … … 52 70 nq = DimSize(inten,0) //nq == the number of columns (x dimension) 53 71 54 SetDataFolder root:Packages:NIST:VSANS:VCALC72 // SetDataFolder $(folderPath+instPath+detStr) 55 73 56 Make/O/D/N=(nq) $( "iBin_qxqy_"+type)57 Make/O/D/N=(nq) $( "qBin_qxqy_"+type)58 Make/O/D/N=(nq) $( "nBin_qxqy_"+type)59 Make/O/D/N=(nq) $( "iBin2_qxqy_"+type)60 Make/O/D/N=(nq) $( "eBin_qxqy_"+type)61 Make/O/D/N=(nq) $( "eBin2D_qxqy_"+type)74 Make/O/D/N=(nq) $(folderPath+":"+"iBin_qxqy_"+detStr) 75 Make/O/D/N=(nq) $(folderPath+":"+"qBin_qxqy_"+detStr) 76 Make/O/D/N=(nq) $(folderPath+":"+"nBin_qxqy_"+detStr) 77 Make/O/D/N=(nq) $(folderPath+":"+"iBin2_qxqy_"+detStr) 78 Make/O/D/N=(nq) $(folderPath+":"+"eBin_qxqy_"+detStr) 79 Make/O/D/N=(nq) $(folderPath+":"+"eBin2D_qxqy_"+detStr) 62 80 63 Wave iBin_qxqy = $( "iBin_qxqy_"+type)64 Wave qBin_qxqy = $( "qBin_qxqy_"+type)65 Wave nBin_qxqy = $( "nBin_qxqy_"+type)66 Wave iBin2_qxqy = $( "iBin2_qxqy_"+type)67 Wave eBin_qxqy = $( "eBin_qxqy_"+type)68 Wave eBin2D_qxqy = $( "eBin2D_qxqy_"+type)81 Wave iBin_qxqy = $(folderPath+":"+"iBin_qxqy_"+detStr) 82 Wave qBin_qxqy = $(folderPath+":"+"qBin_qxqy_"+detStr) 83 Wave nBin_qxqy = $(folderPath+":"+"nBin_qxqy_"+detStr) 84 Wave iBin2_qxqy = $(folderPath+":"+"iBin2_qxqy_"+detStr) 85 Wave eBin_qxqy = $(folderPath+":"+"eBin_qxqy_"+detStr) 86 Wave eBin2D_qxqy = $(folderPath+":"+"eBin2D_qxqy_"+detStr) 69 87 70 88 // sum the rows … … 96 114 97 115 116 // TODO -- update to new folder structure 117 // unused -- update if necessary 98 118 Proc CopyIQWaves() 99 119 … … 124 144 End 125 145 146 // TODO -- update to new folder structure 147 // unused -- update if necessary 126 148 Window slit_vs_pin_graph() : Graph 127 149 PauseUpdate; Silent 1 // building window... -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/VC_DetectorBinning_Utils.ipf
r955 r982 15 15 // TODO: hard wired for a sphere - change this to allow minimal selections and altering of coefficients 16 16 // TODO: add the "fake" 2D simulation to fill the panels which are then later averaged as I(Q) 17 // 18 // NOTE - this is a VCALC only routine, so it's not been made completely generic 19 // 17 20 Function FillPanel_wModelData(det,qTot,type) 18 21 Wave det,qTot 19 22 String type 20 23 21 SetDataFolder root:Packages:NIST:VSANS:VCALC:Front24 // SetDataFolder root:Packages:NIST:VSANS:VCALC:Front 22 25 23 26 // q-values and detector arrays already allocated and calculated … … 26 29 Variable imon,trans,thick,sdd,pixSizeX,pixSizeY,sdd_offset 27 30 28 //imon = V _BeamIntensity()*CountTime31 //imon = VC_BeamIntensity()*CountTime 29 32 imon = VCALC_getImon() //TODO: currently from the panel, not calculated 30 33 trans = 0.8 … … 50 53 strswitch(funcStr) 51 54 case "Big Debye": 52 tmpInten = V _Debye(10,3000,0.0001,qTot[p][q])55 tmpInten = VC_Debye(10,3000,0.0001,qTot[p][q]) 53 56 break 54 57 case "Big Sphere": 55 tmpInten = V _SphereForm(1,900,1e-6,0.01,qTot[p][q])58 tmpInten = VC_SphereForm(1,900,1e-6,0.01,qTot[p][q]) 56 59 break 57 60 case "Debye": 58 tmpInten = V _Debye(10,300,0.0001,qTot[p][q])61 tmpInten = VC_Debye(10,300,0.0001,qTot[p][q]) 59 62 break 60 63 case "Sphere": 61 tmpInten = V _SphereForm(1,60,1e-6,0.001,qTot[p][q])64 tmpInten = VC_SphereForm(1,60,1e-6,0.001,qTot[p][q]) 62 65 break 63 66 case "AgBeh": 64 tmpInten = V _BroadPeak(1e-9,3,20,100.0,0.1,3,0.1,qTot[p][q])67 tmpInten = VC_BroadPeak(1e-9,3,20,100.0,0.1,3,0.1,qTot[p][q]) 65 68 break 66 69 case "Vycor": 67 tmpInten = V _BroadPeak(1e-9,3,20,500.0,0.015,3,0.1,qTot[p][q])70 tmpInten = VC_BroadPeak(1e-9,3,20,500.0,0.015,3,0.1,qTot[p][q]) 68 71 break 69 72 case "Empty Cell": 70 tmpInten = V _EC_Empirical(2.2e-8,3.346,0.0065,9.0,0.016,qTot[p][q])73 tmpInten = VC_EC_Empirical(2.2e-8,3.346,0.0065,9.0,0.016,qTot[p][q]) 71 74 break 72 75 case "Blocked Beam": 73 tmpInten = V _BlockedBeam(1,qTot[p][q])76 tmpInten = VC_BlockedBeam(1,qTot[p][q]) 74 77 break 75 78 default: 76 tmpInten = V _Debye(10,300,0.1,qTot[p][q])79 tmpInten = VC_Debye(10,300,0.1,qTot[p][q]) 77 80 endswitch 78 81 … … 154 157 // -- sdd in meters 155 158 // -- lambda in Angstroms 156 Function V _Detector_2Q(data,qTot,qx,qy,qz,xCtr,yCtr,sdd,lam,pixSizeX,pixSizeY)159 Function VC_Detector_2Q(data,qTot,qx,qy,qz,xCtr,yCtr,sdd,lam,pixSizeX,pixSizeY) 157 160 Wave data,qTot,qx,qy,qz 158 161 Variable xCtr,yCtr,sdd,lam,pixSizeX,pixSizeY … … 160 163 // loop over the array and calculate the values - this is done as a wave assignment 161 164 // TODO -- be sure that it's p,q -- or maybe p+1,q+1 as used in WriteQIS.ipf 162 qTot = V _CalcQval(p,q,xctr,yctr,sdd,lam,pixSizeX,pixSizeY)163 qx = V _CalcQX(p,q,xctr,yctr,sdd,lam,pixSizeX,pixSizeY)164 qy = V _CalcQY(p,q,xctr,yctr,sdd,lam,pixSizeX,pixSizeY)165 qz = V _CalcQZ(p,q,xctr,yctr,sdd,lam,pixSizeX,pixSizeY)165 qTot = VC_CalcQval(p,q,xctr,yctr,sdd,lam,pixSizeX,pixSizeY) 166 qx = VC_CalcQX(p,q,xctr,yctr,sdd,lam,pixSizeX,pixSizeY) 167 qy = VC_CalcQY(p,q,xctr,yctr,sdd,lam,pixSizeX,pixSizeY) 168 qz = VC_CalcQZ(p,q,xctr,yctr,sdd,lam,pixSizeX,pixSizeY) 166 169 167 170 return(0) … … 183 186 //returned magnitude of Q is in 1/Angstroms 184 187 // 185 Function V _CalcQval(xaxval,yaxval,xctr,yctr,sdd,lam,pixSizeX,pixSizeY)188 Function VC_CalcQval(xaxval,yaxval,xctr,yctr,sdd,lam,pixSizeX,pixSizeY) 186 189 Variable xaxval,yaxval,xctr,yctr,sdd,lam,pixSizeX,pixSizeY 187 190 … … 210 213 // now properly accounts for qz 211 214 // 212 Function V _CalcQX(xaxval,yaxval,xctr,yctr,sdd,lam,pixSizeX,pixSizeY)215 Function VC_CalcQX(xaxval,yaxval,xctr,yctr,sdd,lam,pixSizeX,pixSizeY) 213 216 Variable xaxval,yaxval,xctr,yctr,sdd,lam,pixSizeX,pixSizeY 214 217 215 218 Variable qx,qval,phi,dx,dy,dist,two_theta 216 219 217 qval = V _CalcQval(xaxval,yaxval,xctr,yctr,sdd,lam,pixSizeX,pixSizeY)220 qval = VC_CalcQval(xaxval,yaxval,xctr,yctr,sdd,lam,pixSizeX,pixSizeY) 218 221 219 222 sdd *=100 //convert to cm … … 240 243 // now properly accounts for qz 241 244 // 242 Function V _CalcQY(xaxval,yaxval,xctr,yctr,sdd,lam,pixSizeX,pixSizeY)245 Function VC_CalcQY(xaxval,yaxval,xctr,yctr,sdd,lam,pixSizeX,pixSizeY) 243 246 Variable xaxval,yaxval,xctr,yctr,sdd,lam,pixSizeX,pixSizeY 244 247 245 248 Variable dy,qval,dx,phi,qy,dist,two_theta 246 249 247 qval = V _CalcQval(xaxval,yaxval,xctr,yctr,sdd,lam,pixSizeX,pixSizeY)250 qval = VC_CalcQval(xaxval,yaxval,xctr,yctr,sdd,lam,pixSizeX,pixSizeY) 248 251 249 252 sdd *=100 //convert to cm … … 269 272 // not actually used, but here for completeness if anyone asks 270 273 // 271 Function V _CalcQZ(xaxval,yaxval,xctr,yctr,sdd,lam,pixSizeX,pixSizeY)274 Function VC_CalcQZ(xaxval,yaxval,xctr,yctr,sdd,lam,pixSizeX,pixSizeY) 272 275 Variable xaxval,yaxval,xctr,yctr,sdd,lam,pixSizeX,pixSizeY 273 276 274 277 Variable dy,qval,dx,phi,qz,dist,two_theta 275 278 276 qval = V _CalcQval(xaxval,yaxval,xctr,yctr,sdd,lam,pixSizeX,pixSizeY)279 qval = VC_CalcQval(xaxval,yaxval,xctr,yctr,sdd,lam,pixSizeX,pixSizeY) 277 280 278 281 sdd *=100 //convert to cm … … 328 331 end 329 332 330 Function V _SphereForm(scale,radius,delrho,bkg,x)333 Function VC_SphereForm(scale,radius,delrho,bkg,x) 331 334 Variable scale,radius,delrho,bkg 332 335 Variable x … … 369 372 End 370 373 371 Function V _Debye(scale,rg,bkg,x)374 Function VC_Debye(scale,rg,bkg,x) 372 375 Variable scale,rg,bkg 373 376 Variable x … … 394 397 // make/O/D coef_ECEmp = {2.2e-8,3.346,0.0065,9.0,0.016} 395 398 // 396 Function V _EC_Empirical(aa,mm,scale,rg,bkg,x)399 Function VC_EC_Empirical(aa,mm,scale,rg,bkg,x) 397 400 Variable aa,mm,scale,rg,bkg 398 401 Variable x … … 427 430 // blocked beam 428 431 // 429 Function V _BlockedBeam(bkg,x)432 Function VC_BlockedBeam(bkg,x) 430 433 Variable bkg 431 434 Variable x … … 446 449 // 447 450 // 448 Function V _BroadPeak(aa,nn,cc,LL,Qzero,mm,bgd,x)451 Function VC_BroadPeak(aa,nn,cc,LL,Qzero,mm,bgd,x) 449 452 Variable aa,nn,cc,LL,Qzero,mm,bgd 450 453 Variable x … … 471 474 End 472 475 473 474 475 Function SetDeltaQ(folderStr,type) 476 String folderStr,type 477 478 WAVE inten = $("root:Packages:NIST:VSANS:VCALC:" + folderStr + ":det_"+type) // 2D detector data 476 // 477 // updated to new folder structure Feb 2016 478 // folderStr = RAW,SAM, VCALC or other 479 // detStr is the panel identifer "ML", etc. 480 // 481 Function SetDeltaQ(folderStr,detStr) 482 String folderStr,detStr 483 484 Variable isVCALC 485 if(cmpstr(folderStr,"VCALC") == 0) 486 isVCALC = 1 487 endif 488 489 String folderPath = "root:Packages:NIST:VSANS:"+folderStr 490 String instPath = ":entry:entry:instrument:detector_" 491 492 if(isVCALC) 493 WAVE inten = $(folderPath+instPath+detStr+":det_"+detStr) // 2D detector data 494 else 495 Wave inten = V_getDetectorDataW(folderStr,detStr) 496 endif 497 498 Wave qx = $(folderPath+instPath+detStr+":qx_"+detStr) 499 Wave qy = $(folderPath+instPath+detStr+":qy_"+detStr) 479 500 480 501 Variable xDim,yDim,delQ … … 484 505 485 506 if(xDim<yDim) 486 WAVE qx = $("root:Packages:NIST:VSANS:VCALC:" + folderStr + ":qx_"+type)487 507 delQ = abs(qx[0][0] - qx[1][0])/2 488 508 else 489 WAVE qy = $("root:Packages:NIST:VSANS:VCALC:" + folderStr + ":qy_"+type)490 509 delQ = abs(qy[0][1] - qy[0][0])/2 491 510 endif 492 511 493 512 // set the global 494 Variable/G $( "root:Packages:NIST:VSANS:VCALC:" + "gDelQ_"+type) = delQ513 Variable/G $(folderPath+instPath+detStr+":gDelQ_"+detStr) = delQ 495 514 // Print "SET delQ = ",delQ," for ",type 496 515 497 return( 0)516 return(delQ) 498 517 end 499 518 500 519 501 520 //TODO -- need a switch here to dispatch to the averaging type 502 Proc V _BinQxQy_to_1D(folderStr,type)521 Proc VC_BinQxQy_to_1D(folderStr,type) 503 522 String folderStr 504 523 String type … … 507 526 508 527 509 V _fDoBinning_QxQy2D(folderStr, type)528 VC_fDoBinning_QxQy2D(folderStr, type) 510 529 511 530 512 531 /// this is for a tall, narrow slit mode 513 // V_fBinDetector_byRows(folderStr,type) 514 515 End 516 517 518 Proc V_Graph_1D_detType(folderStr,type) 532 // VC_fBinDetector_byRows(folderStr,type) 533 534 End 535 536 537 // folderStr is RAW, VCALC, SAM, etc. 538 // type is "B", "FL" for single binning, "FLR", or "MLRTB" or similar if multiple panels are combined 539 // 540 Proc VC_Graph_1D_detType(folderStr,type) 519 541 String folderStr,type 520 542 521 SetDataFolder root:Packages:NIST:VSANS:VCALC543 SetDataFolder $("root:Packages:NIST:VSANS:"+folderStr) 522 544 523 545 Display $("iBin_qxqy"+"_"+type) vs $("qBin_qxqy"+"_"+type) … … 551 573 // TODO "iErr" is not always defined correctly since it doesn't really apply here for data that is not 2D simulation 552 574 // 553 Function V_fDoBinning_QxQy2D(folderStr,type) 575 // 576 // updated Feb2016 to take new folder structure 577 // TODO 578 // -- VERIFY 579 // -- figure out what the best location is to put the averaged data? currently @ top level of WORK folder 580 // but this is a lousy choice. 581 // 582 Function VC_fDoBinning_QxQy2D(folderStr,type) 554 583 String folderStr,type 555 584 … … 558 587 Variable ii,jj 559 588 Variable qVal,nq,var,avesq,aveisq 560 Variable binIndex,val 561 562 563 SetDataFolder root:Packages:NIST:VSANS:VCALC 589 Variable binIndex,val,isVCALC=0 590 591 String folderPath = "root:Packages:NIST:VSANS:"+folderStr 592 String instPath = ":entry:entry:instrument:detector_" 593 String detStr 594 595 if(cmpstr(folderStr,"VCALC") == 0) 596 isVCALC = 1 597 endif 564 598 565 599 // now switch on the type to determine which waves to declare and create … … 570 604 case "FL": // execute if case matches expression 571 605 case "FR": 572 NVAR delQ = $("root:Packages:NIST:VSANS:VCALC:" + "gDelQ_FL") 573 WAVE inten = $("root:Packages:NIST:VSANS:VCALC:" + "Front" + ":det_"+type) // 2D detector data 574 WAVE/Z iErr = $("iErr_"+type) // 2D errors -- may not exist, especially for simulation 575 Wave qTotal = $("root:Packages:NIST:VSANS:VCALC:" + "Front" +":qTot_"+type) // 2D q-values 606 detStr = type 607 if(isVCALC) 608 WAVE inten = $(folderPath+instPath+detStr+":det_"+detStr) 609 WAVE/Z iErr = $("iErr_"+detStr) // 2D errors -- may not exist, especially for simulation 610 else 611 Wave inten = V_getDetectorDataW(folderStr,detStr) 612 Wave iErr = V_getDetectorDataErrW(folderStr,detStr) 613 endif 614 NVAR delQ = $(folderPath+instPath+detStr+":gDelQ_"+detStr) 615 Wave qTotal = $(folderPath+instPath+detStr+":qTot_"+detStr) // 2D q-values 576 616 nSets = 1 577 617 break … … 579 619 case "FT": 580 620 case "FB": 581 NVAR delQ = $("root:Packages:NIST:VSANS:VCALC:" + "gDelQ_FT") 582 WAVE inten = $("root:Packages:NIST:VSANS:VCALC:" + "Front" + ":det_"+type) // 2D detector data 583 WAVE/Z iErr = $("iErr_"+type) // 2D errors -- may not exist, especially for simulation 584 Wave qTotal = $("root:Packages:NIST:VSANS:VCALC:" + "Front" +":qTot_"+type) // 2D q-values 621 detStr = type 622 if(isVCALC) 623 WAVE inten = $(folderPath+instPath+detStr+":det_"+detStr) 624 WAVE/Z iErr = $("iErr_"+detStr) // 2D errors -- may not exist, especially for simulation 625 else 626 Wave inten = V_getDetectorDataW(folderStr,detStr) 627 Wave iErr = V_getDetectorDataErrW(folderStr,detStr) 628 endif 629 NVAR delQ = $(folderPath+instPath+detStr+":gDelQ_"+detStr) 630 Wave qTotal = $(folderPath+instPath+detStr+":qTot_"+detStr) // 2D q-values 585 631 nSets = 1 586 632 break 587 633 588 634 case "ML": 589 case "MR": 590 NVAR delQ = $("root:Packages:NIST:VSANS:VCALC:" + "gDelQ_ML") 591 WAVE inten = $("root:Packages:NIST:VSANS:VCALC:" + "Middle" + ":det_"+type) // 2D detector data 592 WAVE/Z iErr = $("iErr_"+type) // 2D errors -- may not exist, especially for simulation 593 Wave qTotal = $("root:Packages:NIST:VSANS:VCALC:" + "Middle" +":qTot_"+type) // 2D q-values 635 case "MR": 636 detStr = type 637 if(isVCALC) 638 WAVE inten = $(folderPath+instPath+detStr+":det_"+detStr) 639 WAVE/Z iErr = $("iErr_"+detStr) // 2D errors -- may not exist, especially for simulation 640 else 641 Wave inten = V_getDetectorDataW(folderStr,detStr) 642 Wave iErr = V_getDetectorDataErrW(folderStr,detStr) 643 endif 644 //TODO: 645 // -- decide on the proper deltaQ for binning. either nominal value for LR, or one 646 // determined specifically for that panel (currently using one tube width as deltaQ) 647 // -- this is repeated multiple times in this switch 648 NVAR delQ = $(folderPath+instPath+detStr+":gDelQ_"+detStr) 649 // NVAR delQ = $(folderPath+instPath+"ML"+":gDelQ_ML") 650 Wave qTotal = $(folderPath+instPath+detStr+":qTot_"+detStr) // 2D q-values 594 651 nSets = 1 595 652 break 596 653 597 654 case "MT": 598 case "MB": 599 NVAR delQ = $("root:Packages:NIST:VSANS:VCALC:" + "gDelQ_MT") 600 WAVE inten = $("root:Packages:NIST:VSANS:VCALC:" + "Middle" + ":det_"+type) // 2D detector data 601 WAVE/Z iErr = $("iErr_"+type) // 2D errors -- may not exist, especially for simulation 602 Wave qTotal = $("root:Packages:NIST:VSANS:VCALC:" + "Middle" +":qTot_"+type) // 2D q-values 655 case "MB": 656 detStr = type 657 if(isVCALC) 658 WAVE inten = $(folderPath+instPath+detStr+":det_"+detStr) 659 WAVE/Z iErr = $("iErr_"+detStr) // 2D errors -- may not exist, especially for simulation 660 else 661 Wave inten = V_getDetectorDataW(folderStr,detStr) 662 Wave iErr = V_getDetectorDataErrW(folderStr,detStr) 663 endif 664 NVAR delQ = $(folderPath+instPath+detStr+":gDelQ_"+detStr) 665 Wave qTotal = $(folderPath+instPath+detStr+":qTot_"+detStr) // 2D q-values 603 666 nSets = 1 604 667 break 605 668 606 case "B": 607 NVAR delQ = $("root:Packages:NIST:VSANS:VCALC:" + "gDelQ_B") 608 WAVE inten = $("root:Packages:NIST:VSANS:VCALC:" + "Back" + ":det_"+type) // 2D detector data 609 WAVE/Z iErr = $("iErr_"+type) // 2D errors -- may not exist, especially for simulation 610 Wave qTotal = $("root:Packages:NIST:VSANS:VCALC:" + "Back" +":qTot_"+type) // 2D q-values 669 case "B": 670 detStr = type 671 if(isVCALC) 672 WAVE inten = $(folderPath+instPath+detStr+":det_"+detStr) 673 WAVE/Z iErr = $("iErr_"+detStr) // 2D errors -- may not exist, especially for simulation 674 else 675 Wave inten = V_getDetectorDataW(folderStr,detStr) 676 Wave iErr = V_getDetectorDataErrW(folderStr,detStr) 677 endif 678 NVAR delQ = $(folderPath+instPath+detStr+":gDelQ_B") 679 Wave qTotal = $(folderPath+instPath+detStr+":qTot_"+detStr) // 2D q-values 611 680 nSets = 1 612 681 break 613 682 614 683 case "FLR": 615 NVAR delQ = $("root:Packages:NIST:VSANS:VCALC:" + "gDelQ_FL") 616 WAVE inten = $("root:Packages:NIST:VSANS:VCALC:" + "Front" + ":det_"+"FL") // 2D detector data 617 WAVE/Z iErr = $("iErr_"+"FL") // 2D errors -- may not exist, especially for simulation 618 Wave qTotal = $("root:Packages:NIST:VSANS:VCALC:" + "Front" +":qTot_"+"FL") // 2D q-values 619 WAVE inten2 = $("root:Packages:NIST:VSANS:VCALC:" + "Front" + ":det_"+"FR") // 2D detector data 620 WAVE/Z iErr2 = $("iErr_"+"FR") // 2D errors -- may not exist, especially for simulation 621 Wave qTotal2 = $("root:Packages:NIST:VSANS:VCALC:" + "Front" +":qTot_"+"FR") // 2D q-values 684 // detStr has multiple values now, so unfortuntely, I'm hard-wiring things... 685 // TODO 686 // -- see if I can un-hard-wire some of this below when more than one panel is combined 687 if(isVCALC) 688 WAVE inten = $(folderPath+instPath+"FL"+":det_"+"FL") 689 WAVE/Z iErr = $("iErr_"+"FL") // 2D errors -- may not exist, especially for simulation 690 WAVE inten2 = $(folderPath+instPath+"FR"+":det_"+"FR") 691 WAVE/Z iErr2 = $("iErr_"+"FR") // 2D errors -- may not exist, especially for simulation 692 else 693 Wave inten = V_getDetectorDataW(folderStr,"FL") 694 Wave iErr = V_getDetectorDataErrW(folderStr,"FL") 695 Wave inten2 = V_getDetectorDataW(folderStr,"FR") 696 Wave iErr2 = V_getDetectorDataErrW(folderStr,"FR") 697 endif 698 NVAR delQ = $(folderPath+instPath+"FL"+":gDelQ_FL") 699 700 Wave qTotal = $(folderPath+instPath+"FL"+":qTot_"+"FL") // 2D q-values 701 Wave qTotal2 = $(folderPath+instPath+"FR"+":qTot_"+"FR") // 2D q-values 702 622 703 nSets = 2 623 704 break 624 705 625 706 case "FTB": 626 NVAR delQ = $("root:Packages:NIST:VSANS:VCALC:" + "gDelQ_FT") 627 WAVE inten = $("root:Packages:NIST:VSANS:VCALC:" + "Front" + ":det_"+"FT") // 2D detector data 628 WAVE/Z iErr = $("iErr_"+"FT") // 2D errors -- may not exist, especially for simulation 629 Wave qTotal = $("root:Packages:NIST:VSANS:VCALC:" + "Front" +":qTot_"+"FT") // 2D q-values 630 WAVE inten2 = $("root:Packages:NIST:VSANS:VCALC:" + "Front" + ":det_"+"FB") // 2D detector data 631 WAVE/Z iErr2 = $("iErr_"+"FB") // 2D errors -- may not exist, especially for simulation 632 Wave qTotal2 = $("root:Packages:NIST:VSANS:VCALC:" + "Front" +":qTot_"+"FB") // 2D q-values 707 if(isVCALC) 708 WAVE inten = $(folderPath+instPath+"FT"+":det_"+"FT") 709 WAVE/Z iErr = $("iErr_"+"FT") // 2D errors -- may not exist, especially for simulation 710 WAVE inten2 = $(folderPath+instPath+"FB"+":det_"+"FB") 711 WAVE/Z iErr2 = $("iErr_"+"FB") // 2D errors -- may not exist, especially for simulation 712 else 713 Wave inten = V_getDetectorDataW(folderStr,"FT") 714 Wave iErr = V_getDetectorDataErrW(folderStr,"FT") 715 Wave inten2 = V_getDetectorDataW(folderStr,"FB") 716 Wave iErr2 = V_getDetectorDataErrW(folderStr,"FB") 717 endif 718 NVAR delQ = $(folderPath+instPath+"FT"+":gDelQ_FT") 719 720 Wave qTotal = $(folderPath+instPath+"FT"+":qTot_"+"FT") // 2D q-values 721 Wave qTotal2 = $(folderPath+instPath+"FB"+":qTot_"+"FB") // 2D q-values 722 633 723 nSets = 2 634 724 break 635 725 636 726 case "FLRTB": 637 NVAR delQ = $("root:Packages:NIST:VSANS:VCALC:" + "gDelQ_FL") 638 WAVE inten = $("root:Packages:NIST:VSANS:VCALC:" + "Front" + ":det_"+"FL") // 2D detector data 639 WAVE/Z iErr = $("iErr_"+"FL") // 2D errors -- may not exist, especially for simulation 640 Wave qTotal = $("root:Packages:NIST:VSANS:VCALC:" + "Front" +":qTot_"+"FL") // 2D q-values 641 WAVE inten2 = $("root:Packages:NIST:VSANS:VCALC:" + "Front" + ":det_"+"FR") // 2D detector data 642 WAVE/Z iErr2 = $("iErr_"+"FR") // 2D errors -- may not exist, especially for simulation 643 Wave qTotal2 = $("root:Packages:NIST:VSANS:VCALC:" + "Front" +":qTot_"+"FR") // 2D q-values 644 WAVE inten3 = $("root:Packages:NIST:VSANS:VCALC:" + "Front" + ":det_"+"FT") // 2D detector data 645 WAVE/Z iErr3 = $("iErr_"+"FT") // 2D errors -- may not exist, especially for simulation 646 Wave qTotal3 = $("root:Packages:NIST:VSANS:VCALC:" + "Front" +":qTot_"+"FT") // 2D q-values 647 WAVE inten4 = $("root:Packages:NIST:VSANS:VCALC:" + "Front" + ":det_"+"FB") // 2D detector data 648 WAVE/Z iErr4 = $("iErr_"+"FB") // 2D errors -- may not exist, especially for simulation 649 Wave qTotal4 = $("root:Packages:NIST:VSANS:VCALC:" + "Front" +":qTot_"+"FB") // 2D q-values 727 if(isVCALC) 728 WAVE inten = $(folderPath+instPath+"FL"+":det_"+"FL") 729 WAVE/Z iErr = $("iErr_"+"FL") // 2D errors -- may not exist, especially for simulation 730 WAVE inten2 = $(folderPath+instPath+"FR"+":det_"+"FR") 731 WAVE/Z iErr2 = $("iErr_"+"FR") // 2D errors -- may not exist, especially for simulation 732 WAVE inten3 = $(folderPath+instPath+"FT"+":det_"+"FT") 733 WAVE/Z iErr3 = $("iErr_"+"FT") // 2D errors -- may not exist, especially for simulation 734 WAVE inten4 = $(folderPath+instPath+"FB"+":det_"+"FB") 735 WAVE/Z iErr4 = $("iErr_"+"FB") // 2D errors -- may not exist, especially for simulation 736 else 737 Wave inten = V_getDetectorDataW(folderStr,"FL") 738 Wave iErr = V_getDetectorDataErrW(folderStr,"FL") 739 Wave inten2 = V_getDetectorDataW(folderStr,"FR") 740 Wave iErr2 = V_getDetectorDataErrW(folderStr,"FR") 741 Wave inten3 = V_getDetectorDataW(folderStr,"FT") 742 Wave iErr3 = V_getDetectorDataErrW(folderStr,"FT") 743 Wave inten4 = V_getDetectorDataW(folderStr,"FB") 744 Wave iErr4 = V_getDetectorDataErrW(folderStr,"FB") 745 endif 746 NVAR delQ = $(folderPath+instPath+"FL"+":gDelQ_FL") 747 748 Wave qTotal = $(folderPath+instPath+"FL"+":qTot_"+"FL") // 2D q-values 749 Wave qTotal2 = $(folderPath+instPath+"FR"+":qTot_"+"FR") // 2D q-values 750 Wave qTotal3 = $(folderPath+instPath+"FT"+":qTot_"+"FT") // 2D q-values 751 Wave qTotal4 = $(folderPath+instPath+"FB"+":qTot_"+"FB") // 2D q-values 752 650 753 nSets = 4 651 754 break 652 755 653 654 756 case "MLR": 655 NVAR delQ = $("root:Packages:NIST:VSANS:VCALC:" + "gDelQ_ML") 656 WAVE inten = $("root:Packages:NIST:VSANS:VCALC:" + "Middle" + ":det_"+"ML") // 2D detector data 657 WAVE/Z iErr = $("iErr_"+"ML") // 2D errors -- may not exist, especially for simulation 658 Wave qTotal = $("root:Packages:NIST:VSANS:VCALC:" + "Middle" +":qTot_"+"ML") // 2D q-values 659 WAVE inten2 = $("root:Packages:NIST:VSANS:VCALC:" + "Middle" + ":det_"+"MR") // 2D detector data 660 WAVE/Z iErr2 = $("iErr_"+"MR") // 2D errors -- may not exist, especially for simulation 661 Wave qTotal2 = $("root:Packages:NIST:VSANS:VCALC:" + "Middle" +":qTot_"+"MR") // 2D q-values 757 if(isVCALC) 758 WAVE inten = $(folderPath+instPath+"ML"+":det_"+"ML") 759 WAVE/Z iErr = $("iErr_"+"ML") // 2D errors -- may not exist, especially for simulation 760 WAVE inten2 = $(folderPath+instPath+"MR"+":det_"+"MR") 761 WAVE/Z iErr2 = $("iErr_"+"MR") // 2D errors -- may not exist, especially for simulation 762 else 763 Wave inten = V_getDetectorDataW(folderStr,"ML") 764 Wave iErr = V_getDetectorDataErrW(folderStr,"ML") 765 Wave inten2 = V_getDetectorDataW(folderStr,"MR") 766 Wave iErr2 = V_getDetectorDataErrW(folderStr,"MR") 767 endif 768 NVAR delQ = $(folderPath+instPath+"ML"+":gDelQ_ML") 769 770 Wave qTotal = $(folderPath+instPath+"ML"+":qTot_"+"ML") // 2D q-values 771 Wave qTotal2 = $(folderPath+instPath+"MR"+":qTot_"+"MR") // 2D q-values 772 662 773 nSets = 2 663 774 break 664 775 665 776 case "MTB": 666 NVAR delQ = $("root:Packages:NIST:VSANS:VCALC:" + "gDelQ_MT") 667 WAVE inten = $("root:Packages:NIST:VSANS:VCALC:" + "Middle" + ":det_"+"MT") // 2D detector data 668 WAVE/Z iErr = $("iErr_"+"MT") // 2D errors -- may not exist, especially for simulation 669 Wave qTotal = $("root:Packages:NIST:VSANS:VCALC:" + "Middle" +":qTot_"+"MT") // 2D q-values 670 WAVE inten2 = $("root:Packages:NIST:VSANS:VCALC:" + "Middle" + ":det_"+"MB") // 2D detector data 671 WAVE/Z iErr2 = $("iErr_"+"MB") // 2D errors -- may not exist, especially for simulation 672 Wave qTotal2 = $("root:Packages:NIST:VSANS:VCALC:" + "Middle" +":qTot_"+"MB") // 2D q-values 777 if(isVCALC) 778 WAVE inten = $(folderPath+instPath+"MT"+":det_"+"MT") 779 WAVE/Z iErr = $("iErr_"+"MT") // 2D errors -- may not exist, especially for simulation 780 WAVE inten2 = $(folderPath+instPath+"MB"+":det_"+"MB") 781 WAVE/Z iErr2 = $("iErr_"+"MB") // 2D errors -- may not exist, especially for simulation 782 else 783 Wave inten = V_getDetectorDataW(folderStr,"MT") 784 Wave iErr = V_getDetectorDataErrW(folderStr,"MT") 785 Wave inten2 = V_getDetectorDataW(folderStr,"MB") 786 Wave iErr2 = V_getDetectorDataErrW(folderStr,"MB") 787 endif 788 NVAR delQ = $(folderPath+instPath+"MT"+":gDelQ_MT") 789 790 Wave qTotal = $(folderPath+instPath+"MT"+":qTot_"+"MT") // 2D q-values 791 Wave qTotal2 = $(folderPath+instPath+"MB"+":qTot_"+"MB") // 2D q-values 792 673 793 nSets = 2 674 794 break 675 795 676 796 case "MLRTB": 677 NVAR delQ = $("root:Packages:NIST:VSANS:VCALC:" + "gDelQ_ML") 678 WAVE inten = $("root:Packages:NIST:VSANS:VCALC:" + "Middle" + ":det_"+"ML") // 2D detector data 679 WAVE/Z iErr = $("iErr_"+"ML") // 2D errors -- may not exist, especially for simulation 680 Wave qTotal = $("root:Packages:NIST:VSANS:VCALC:" + "Middle" +":qTot_"+"ML") // 2D q-values 681 WAVE inten2 = $("root:Packages:NIST:VSANS:VCALC:" + "Middle" + ":det_"+"MR") // 2D detector data 682 WAVE/Z iErr2 = $("iErr_"+"MR") // 2D errors -- may not exist, especially for simulation 683 Wave qTotal2 = $("root:Packages:NIST:VSANS:VCALC:" + "Middle" +":qTot_"+"MR") // 2D q-values 684 WAVE inten3 = $("root:Packages:NIST:VSANS:VCALC:" + "Middle" + ":det_"+"MT") // 2D detector data 685 WAVE/Z iErr3 = $("iErr_"+"MT") // 2D errors -- may not exist, especially for simulation 686 Wave qTotal3 = $("root:Packages:NIST:VSANS:VCALC:" + "Middle" +":qTot_"+"MT") // 2D q-values 687 WAVE inten4 = $("root:Packages:NIST:VSANS:VCALC:" + "Middle" + ":det_"+"MB") // 2D detector data 688 WAVE/Z iErr4 = $("iErr_"+"MB") // 2D errors -- may not exist, especially for simulation 689 Wave qTotal4 = $("root:Packages:NIST:VSANS:VCALC:" + "Middle" +":qTot_"+"MB") // 2D q-values 797 if(isVCALC) 798 WAVE inten = $(folderPath+instPath+"ML"+":det_"+"ML") 799 WAVE/Z iErr = $("iErr_"+"ML") // 2D errors -- may not exist, especially for simulation 800 WAVE inten2 = $(folderPath+instPath+"MR"+":det_"+"MR") 801 WAVE/Z iErr2 = $("iErr_"+"MR") // 2D errors -- may not exist, especially for simulation 802 WAVE inten3 = $(folderPath+instPath+"MT"+":det_"+"MT") 803 WAVE/Z iErr3 = $("iErr_"+"MT") // 2D errors -- may not exist, especially for simulation 804 WAVE inten4 = $(folderPath+instPath+"MB"+":det_"+"MB") 805 WAVE/Z iErr4 = $("iErr_"+"MB") // 2D errors -- may not exist, especially for simulation 806 else 807 Wave inten = V_getDetectorDataW(folderStr,"ML") 808 Wave iErr = V_getDetectorDataErrW(folderStr,"ML") 809 Wave inten2 = V_getDetectorDataW(folderStr,"MR") 810 Wave iErr2 = V_getDetectorDataErrW(folderStr,"MR") 811 Wave inten3 = V_getDetectorDataW(folderStr,"MT") 812 Wave iErr3 = V_getDetectorDataErrW(folderStr,"MT") 813 Wave inten4 = V_getDetectorDataW(folderStr,"MB") 814 Wave iErr4 = V_getDetectorDataErrW(folderStr,"MB") 815 endif 816 NVAR delQ = $(folderPath+instPath+"ML"+":gDelQ_ML") 817 818 Wave qTotal = $(folderPath+instPath+"ML"+":qTot_"+"ML") // 2D q-values 819 Wave qTotal2 = $(folderPath+instPath+"MR"+":qTot_"+"MR") // 2D q-values 820 Wave qTotal3 = $(folderPath+instPath+"MT"+":qTot_"+"MT") // 2D q-values 821 Wave qTotal4 = $(folderPath+instPath+"MB"+":qTot_"+"MB") // 2D q-values 822 690 823 nSets = 4 691 824 break … … 699 832 700 833 if(nSets == 0) 834 SetDataFolder root: 701 835 return(0) 702 836 endif … … 736 870 //******TODO****** -- where to put the averaged data -- right now, folderStr is forced to "" 737 871 // SetDataFolder $("root:"+folderStr) //should already be here, but make sure... 738 Make/O/D/N=(nq) $( "root:Packages:NIST:VSANS:VCALC:"+folderStr+"iBin_qxqy"+"_"+type)739 Make/O/D/N=(nq) $( "root:Packages:NIST:VSANS:VCALC:"+folderStr+"qBin_qxqy"+"_"+type)740 Make/O/D/N=(nq) $( "root:Packages:NIST:VSANS:VCALC:"+folderStr+"nBin_qxqy"+"_"+type)741 Make/O/D/N=(nq) $( "root:Packages:NIST:VSANS:VCALC:"+folderStr+"iBin2_qxqy"+"_"+type)742 Make/O/D/N=(nq) $( "root:Packages:NIST:VSANS:VCALC:"+folderStr+"eBin_qxqy"+"_"+type)743 Make/O/D/N=(nq) $( "root:Packages:NIST:VSANS:VCALC:"+folderStr+"eBin2D_qxqy"+"_"+type)744 745 Wave iBin_qxqy = $( "root:Packages:NIST:VSANS:VCALC:"+folderStr+"iBin_qxqy_"+type)746 Wave qBin_qxqy = $( "root:Packages:NIST:VSANS:VCALC:"+folderStr+"qBin_qxqy"+"_"+type)747 Wave nBin_qxqy = $( "root:Packages:NIST:VSANS:VCALC:"+folderStr+"nBin_qxqy"+"_"+type)748 Wave iBin2_qxqy = $( "root:Packages:NIST:VSANS:VCALC:"+folderStr+"iBin2_qxqy"+"_"+type)749 Wave eBin_qxqy = $( "root:Packages:NIST:VSANS:VCALC:"+folderStr+"eBin_qxqy"+"_"+type)750 Wave eBin2D_qxqy = $( "root:Packages:NIST:VSANS:VCALC:"+folderStr+"eBin2D_qxqy"+"_"+type)872 Make/O/D/N=(nq) $(folderPath+":"+"iBin_qxqy"+"_"+type) 873 Make/O/D/N=(nq) $(folderPath+":"+"qBin_qxqy"+"_"+type) 874 Make/O/D/N=(nq) $(folderPath+":"+"nBin_qxqy"+"_"+type) 875 Make/O/D/N=(nq) $(folderPath+":"+"iBin2_qxqy"+"_"+type) 876 Make/O/D/N=(nq) $(folderPath+":"+"eBin_qxqy"+"_"+type) 877 Make/O/D/N=(nq) $(folderPath+":"+"eBin2D_qxqy"+"_"+type) 878 879 Wave iBin_qxqy = $(folderPath+":"+"iBin_qxqy_"+type) 880 Wave qBin_qxqy = $(folderPath+":"+"qBin_qxqy"+"_"+type) 881 Wave nBin_qxqy = $(folderPath+":"+"nBin_qxqy"+"_"+type) 882 Wave iBin2_qxqy = $(folderPath+":"+"iBin2_qxqy"+"_"+type) 883 Wave eBin_qxqy = $(folderPath+":"+"eBin_qxqy"+"_"+type) 884 Wave eBin2D_qxqy = $(folderPath+":"+"eBin2D_qxqy"+"_"+type) 751 885 752 886 … … 818 952 endif 819 953 820 // add in set 3 and 4 (set 1 and 2 already done)954 // add in set 3 and 4 (set 1 and 2 already done) 821 955 if(nSets == 4) 822 956 xDim=DimSize(inten3,0) -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/VC_UtilityProcedures.ipf
r963 r982 216 216 default: 217 217 Print "Detector type mismatch in V_getPixSizeX(type)" 218 setDataFolder root: 218 219 return(NaN) 219 220 endswitch … … 263 264 default: 264 265 Print "Detector type mismatch in V_getPixSizeY(type)" 266 SetDataFolder root: 265 267 return(NaN) 266 268 endswitch … … 311 313 default: 312 314 Print "Detector type mismatch in VCALC_get_nPix_X(type)" 315 SetDataFolder root: 313 316 return(NaN) 314 317 endswitch … … 358 361 default: 359 362 Print "Detector type mismatch in VCALC_get_nPix_Y(type)" 363 SetDataFolder root: 360 364 return(NaN) 361 365 endswitch 362 366 363 setDataFolder root:367 SetDataFolder root: 364 368 365 369 return(nPix) … … 379 383 case "FL": 380 384 case "FR": 385 SetDataFolder root: 381 386 return(0) 382 387 break //already zero, do nothing … … 388 393 case "ML": 389 394 case "MR": 395 SetDataFolder root: 390 396 return(0) 391 397 break //already zero, do nothing … … 396 402 397 403 case "B": 404 SetDataFolder root: 398 405 return(0) 399 406 break //already zero, do nothing -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/VC_VCALCPanel_MockUp.ipf
r979 r982 21 21 22 22 //initialize space = folders, parameters, instrument constants, etc. 23 V _Initialize_Space()23 VC_Initialize_Space() 24 24 25 25 //open the panel … … 46 46 // sva.dval = 0.3 47 47 48 V _BDet_SDD_SetVarProc(sva)49 V _MDet_SDD_SetVarProc(sva)50 V _FDet_SDD_SetVarProc(sva)48 VC_BDet_SDD_SetVarProc(sva) 49 VC_MDet_SDD_SetVarProc(sva) 50 VC_FDet_SDD_SetVarProc(sva) 51 51 52 52 return(0) … … 72 72 PopupMenu popup_a,mode=1,popvalue="Low Q",value= root:Packages:NIST:VSANS:VCALC:gPresetPopStr 73 73 74 PopupMenu popup_b,pos={690,310},size={142,20},title="Binning type",proc=V _RebinIQ_PopProc74 PopupMenu popup_b,pos={690,310},size={142,20},title="Binning type",proc=VC_RebinIQ_PopProc 75 75 PopupMenu popup_b,mode=1,popvalue="One",value= root:Packages:NIST:VSANS:VCALC:gBinTypeStr 76 76 … … 145 145 Slider VCALCCtrl_0a,pos={223,324},size={200,45},limits={0,10,1},value= 1,vert= 0 146 146 SetVariable VCALCCtrl_0b,pos={25,294},size={120,15},title="wavelength" 147 SetVariable VCALCCtrl_0b,limits={4,20,1},value=_NUM:8,proc=V _Lambda_SetVarProc147 SetVariable VCALCCtrl_0b,limits={4,20,1},value=_NUM:8,proc=VC_Lambda_SetVarProc 148 148 PopupMenu VCALCCtrl_0c,pos={26,257},size={150,20},title="monochromator" 149 149 PopupMenu VCALCCtrl_0c,mode=1,popvalue="Velocity Selector",value= root:Packages:NIST:VSANS:VCALC:gMonochromatorType … … 166 166 167 167 // tab(2) - Front detector panels, initially not visible 168 SetVariable VCALCCtrl_2a,pos={30,260},size={150,15},title="L/R Separation (mm)",proc=V _FDet_LR_SetVarProc168 SetVariable VCALCCtrl_2a,pos={30,260},size={150,15},title="L/R Separation (mm)",proc=VC_FDet_LR_SetVarProc 169 169 SetVariable VCALCCtrl_2a,limits={0,400,1},disable=1,value=_NUM:100 170 SetVariable VCALCCtrl_2b,pos={30,290},size={150,15},title="T/B Separation (mm)",proc=V _FDet_LR_SetVarProc170 SetVariable VCALCCtrl_2b,pos={30,290},size={150,15},title="T/B Separation (mm)",proc=VC_FDet_LR_SetVarProc 171 171 SetVariable VCALCCtrl_2b,limits={0,400,1},disable=1,value=_NUM:100 172 172 SetVariable VCALCCtrl_2c,pos={205,290},size={150,15},title="Lateral Offset (mm)" 173 173 SetVariable VCALCCtrl_2c,limits={0,200,0.1},disable=1,value=_NUM:0 174 SetVariable VCALCCtrl_2d,pos={205,260},size={230,15},title="Sample to Detector Distance (m)",proc=V _FDet_SDD_SetVarProc174 SetVariable VCALCCtrl_2d,pos={205,260},size={230,15},title="Sample to Detector Distance (m)",proc=VC_FDet_SDD_SetVarProc 175 175 SetVariable VCALCCtrl_2d,limits={1,8,0.1},disable=1 ,value=_NUM:1.5 176 176 177 177 178 178 // tab(3) - Middle detector panels, initially not visible 179 SetVariable VCALCCtrl_3a,pos={30,260},size={150,15},title="L/R Separation (mm)",proc=V _MDet_LR_SetVarProc179 SetVariable VCALCCtrl_3a,pos={30,260},size={150,15},title="L/R Separation (mm)",proc=VC_MDet_LR_SetVarProc 180 180 SetVariable VCALCCtrl_3a,limits={0,400,1},disable=1,value=_NUM:120 181 SetVariable VCALCCtrl_3b,pos={30,290},size={150,15},title="T/B Separation (mm)",proc=V _MDet_LR_SetVarProc181 SetVariable VCALCCtrl_3b,pos={30,290},size={150,15},title="T/B Separation (mm)",proc=VC_MDet_LR_SetVarProc 182 182 SetVariable VCALCCtrl_3b,limits={0,400,1},disable=1,value=_NUM:120 183 183 SetVariable VCALCCtrl_3c,pos={205,290},size={150,15},title="Lateral Offset (mm)" 184 184 SetVariable VCALCCtrl_3c,limits={0,200,0.1},disable=1,value=_NUM:0 185 SetVariable VCALCCtrl_3d,pos={205,260},size={230,15},title="Sample to Detector Distance (m)",proc=V _MDet_SDD_SetVarProc185 SetVariable VCALCCtrl_3d,pos={205,260},size={230,15},title="Sample to Detector Distance (m)",proc=VC_MDet_SDD_SetVarProc 186 186 SetVariable VCALCCtrl_3d,limits={8,20,0.1},disable=1,value=_NUM:10 187 187 … … 189 189 SetVariable VCALCCtrl_4a,pos={188,290},size={150,15},title="Lateral Offset (mm)" 190 190 SetVariable VCALCCtrl_4a,limits={0,200,0.1},disable=1,value=_NUM:0 191 SetVariable VCALCCtrl_4b,pos={188,260},size={230,15},title="Sample to Detector Distance (m)",proc=V _BDet_SDD_SetVarProc191 SetVariable VCALCCtrl_4b,pos={188,260},size={230,15},title="Sample to Detector Distance (m)",proc=VC_BDet_SDD_SetVarProc 192 192 SetVariable VCALCCtrl_4b,limits={20,25,0.1},disable=1,value=_NUM:22 193 193 PopupMenu VCALCCtrl_4c,pos={40,260},size={180,20},title="Detector type",disable=1 … … 196 196 // tab(5) - Simulation setup 197 197 SetVariable VCALCCtrl_5a,pos={40,290},size={200,15},title="Neutrons on Sample (imon)" 198 SetVariable VCALCCtrl_5a,limits={1e7,1e15,1e7},disable=1,value=_NUM:1e10,proc=V _SimImon_SetVarProc198 SetVariable VCALCCtrl_5a,limits={1e7,1e15,1e7},disable=1,value=_NUM:1e10,proc=VC_SimImon_SetVarProc 199 199 PopupMenu VCALCCtrl_5b,pos={40,260},size={180,20},title="Model Function",disable=1 200 PopupMenu VCALCCtrl_5b,mode=1,popvalue="Debye",value= root:Packages:NIST:VSANS:VCALC:gModelFunctionType,proc=V _SimModelFunc_PopProc200 PopupMenu VCALCCtrl_5b,mode=1,popvalue="Debye",value= root:Packages:NIST:VSANS:VCALC:gModelFunctionType,proc=VC_SimModelFunc_PopProc 201 201 202 202 End … … 297 297 // recalculate the detectors with a preset model function 298 298 // 299 Function V _SimModelFunc_PopProc(ctrlName,popNum,popStr) : PopupMenuControl299 Function VC_SimModelFunc_PopProc(ctrlName,popNum,popStr) : PopupMenuControl 300 300 String ctrlName 301 301 Variable popNum // which item is currently selected (1-based) … … 312 312 // just rebin 313 313 // 314 Function V _RebinIQ_PopProc(ctrlName,popNum,popStr) : PopupMenuControl314 Function VC_RebinIQ_PopProc(ctrlName,popNum,popStr) : PopupMenuControl 315 315 String ctrlName 316 316 Variable popNum // which item is currently selected (1-based) … … 339 339 // setVar for the wavelength 340 340 // 341 Function V _Lambda_SetVarProc(sva) : SetVariableControl341 Function VC_Lambda_SetVarProc(sva) : SetVariableControl 342 342 STRUCT WMSetVariableAction &sva 343 343 … … 367 367 // setVar for the simulation monitor count 368 368 // 369 Function V _SimImon_SetVarProc(sva) : SetVariableControl369 Function VC_SimImon_SetVarProc(sva) : SetVariableControl 370 370 STRUCT WMSetVariableAction &sva 371 371 … … 439 439 // of the intensity and a redraw of the banks 440 440 // 441 Function V _FDet_SDD_SetVarProc(sva) : SetVariableControl441 Function VC_FDet_SDD_SetVarProc(sva) : SetVariableControl 442 442 STRUCT WMSetVariableAction &sva 443 443 … … 476 476 // of the intensity and a redraw of the banks 477 477 // 478 Function V _MDet_SDD_SetVarProc(sva) : SetVariableControl478 Function VC_MDet_SDD_SetVarProc(sva) : SetVariableControl 479 479 STRUCT WMSetVariableAction &sva 480 480 … … 513 513 // of the intensity and a redraw of the banks 514 514 // 515 Function V _BDet_SDD_SetVarProc(sva) : SetVariableControl515 Function VC_BDet_SDD_SetVarProc(sva) : SetVariableControl 516 516 STRUCT WMSetVariableAction &sva 517 517 … … 550 550 // of the intensity and a redraw of the banks 551 551 // 552 Function V _FDet_LR_SetVarProc(sva) : SetVariableControl552 Function VC_FDet_LR_SetVarProc(sva) : SetVariableControl 553 553 STRUCT WMSetVariableAction &sva 554 554 … … 588 588 // of the intensity and a redraw of the banks 589 589 // 590 Function V _MDet_LR_SetVarProc(sva) : SetVariableControl590 Function VC_MDet_LR_SetVarProc(sva) : SetVariableControl 591 591 STRUCT WMSetVariableAction &sva 592 592 … … 633 633 // -- parameters and constants need to be defined in their own space 634 634 // 635 // 636 Proc V_Initialize_Space() 635 // FEB 2016 -- changed the data folder space to mimic the HDF folder structure 636 // so that the averaging routines could be re-used (along with everything else) 637 // -- painful, but better in the long run 638 // 639 // -- I have not re-named the detector arrays to all be "data" since that is very difficult to 640 // deal with on images. Added a global "gVCALC_Active" as a crude workaround as needed. Turn it 641 // on when needed and then immediately off 642 // 643 Proc VC_Initialize_Space() 637 644 // 638 645 NewDataFolder/O root:Packages … … 640 647 NewDataFolder/O root:Packages:NIST:VSANS 641 648 NewDataFolder/O root:Packages:NIST:VSANS:VCALC 642 NewDataFolder/O root:Packages:NIST:VSANS:VCALC:Front 643 NewDataFolder/O root:Packages:NIST:VSANS:VCALC:Middle 644 NewDataFolder/O root:Packages:NIST:VSANS:VCALC:Back 649 NewDataFolder/O root:Packages:NIST:VSANS:VCALC:entry 650 NewDataFolder/O root:Packages:NIST:VSANS:VCALC:entry:entry 651 NewDataFolder/O root:Packages:NIST:VSANS:VCALC:entry:entry:instrument 652 NewDataFolder/O root:Packages:NIST:VSANS:VCALC:entry:entry:instrument:detector_B 653 NewDataFolder/O root:Packages:NIST:VSANS:VCALC:entry:entry:instrument:detector_MB 654 NewDataFolder/O root:Packages:NIST:VSANS:VCALC:entry:entry:instrument:detector_MT 655 NewDataFolder/O root:Packages:NIST:VSANS:VCALC:entry:entry:instrument:detector_ML 656 NewDataFolder/O root:Packages:NIST:VSANS:VCALC:entry:entry:instrument:detector_MR 657 NewDataFolder/O root:Packages:NIST:VSANS:VCALC:entry:entry:instrument:detector_FB 658 NewDataFolder/O root:Packages:NIST:VSANS:VCALC:entry:entry:instrument:detector_FT 659 NewDataFolder/O root:Packages:NIST:VSANS:VCALC:entry:entry:instrument:detector_FL 660 NewDataFolder/O root:Packages:NIST:VSANS:VCALC:entry:entry:instrument:detector_FR 661 662 // NewDataFolder/O root:Packages:NIST:VSANS:VCALC:Front 663 // NewDataFolder/O root:Packages:NIST:VSANS:VCALC:Middle 664 // NewDataFolder/O root:Packages:NIST:VSANS:VCALC:Back 665 645 666 NewDataFolder/O root:Packages:NIST:VSANS:RawVSANS 646 667 668 Variable/G root:Packages:NIST:VSANS:VCALC:gVCALC_Active = 1 647 669 648 670 SetDataFolder root:Packages:NIST:VSANS:VCALC … … 729 751 // TODO: the detector dimensions need to be properly defined here... 730 752 // FRONT 731 SetDataFolder root:Packages:NIST:VSANS:VCALC:Front 732 733 Make/O/D/N=(::gFront_L_nPix_X,::gFront_L_nPix_Y) det_FL 734 Make/O/D/N=(::gFront_R_nPix_X,::gFront_R_nPix_Y) det_FR 735 Make/O/D/N=(::gFront_T_nPix_X,::gFront_T_nPix_Y) det_FT 736 Make/O/D/N=(::gFront_B_nPix_X,::gFront_B_nPix_Y) det_FB 753 // SetDataFolder root:Packages:NIST:VSANS:VCALC:Front 754 755 SetDataFolder root:Packages:NIST:VSANS:VCALC:entry:entry:instrument:detector_FL 756 Make/O/D/N=(root:Packages:NIST:VSANS:VCALC:gFront_L_nPix_X,root:Packages:NIST:VSANS:VCALC:gFront_L_nPix_Y) det_FL 737 757 Duplicate/O det_FL qTot_FL,qx_FL,qy_FL,qz_FL 758 759 SetDataFolder root:Packages:NIST:VSANS:VCALC:entry:entry:instrument:detector_FR 760 Make/O/D/N=(root:Packages:NIST:VSANS:VCALC:gFront_R_nPix_X,root:Packages:NIST:VSANS:VCALC:gFront_R_nPix_Y) det_FR 738 761 Duplicate/O det_FR qTot_FR,qx_FR,qy_FR,qz_FR 762 763 SetDataFolder root:Packages:NIST:VSANS:VCALC:entry:entry:instrument:detector_FT 764 Make/O/D/N=(root:Packages:NIST:VSANS:VCALC:gFront_T_nPix_X,root:Packages:NIST:VSANS:VCALC:gFront_T_nPix_Y) det_FT 739 765 Duplicate/O det_FT qTot_FT,qx_FT,qy_FT,qz_FT 766 767 SetDataFolder root:Packages:NIST:VSANS:VCALC:entry:entry:instrument:detector_FB 768 Make/O/D/N=(root:Packages:NIST:VSANS:VCALC:gFront_B_nPix_X,root:Packages:NIST:VSANS:VCALC:gFront_B_nPix_Y) det_FB 740 769 Duplicate/O det_FB qTot_FB,qx_FB,qy_FB,qz_FB 770 741 771 742 772 //MIDDLE 743 773 // TODO: the detector dimensions need to be properly defined here... 744 SetDataFolder root:Packages:NIST:VSANS:VCALC:Middle 745 746 Make/O/D/N=(::gMiddle_L_nPix_X,::gMiddle_L_nPix_Y) det_ML 747 Make/O/D/N=(::gMiddle_R_nPix_X,::gMiddle_R_nPix_Y) det_MR 748 Make/O/D/N=(::gMiddle_T_nPix_X,::gMiddle_T_nPix_Y) det_MT 749 Make/O/D/N=(::gMiddle_B_nPix_X,::gMiddle_B_nPix_Y) det_MB 774 // SetDataFolder root:Packages:NIST:VSANS:VCALC:Middle 775 776 SetDataFolder root:Packages:NIST:VSANS:VCALC:entry:entry:instrument:detector_ML 777 Make/O/D/N=(root:Packages:NIST:VSANS:VCALC:gMiddle_L_nPix_X,root:Packages:NIST:VSANS:VCALC:gMiddle_L_nPix_Y) det_ML 750 778 Duplicate/O det_ML qTot_ML,qx_ML,qy_ML,qz_ML 779 780 SetDataFolder root:Packages:NIST:VSANS:VCALC:entry:entry:instrument:detector_MR 781 Make/O/D/N=(root:Packages:NIST:VSANS:VCALC:gMiddle_R_nPix_X,root:Packages:NIST:VSANS:VCALC:gMiddle_R_nPix_Y) det_MR 751 782 Duplicate/O det_MR qTot_MR,qx_MR,qy_MR,qz_MR 783 784 SetDataFolder root:Packages:NIST:VSANS:VCALC:entry:entry:instrument:detector_MT 785 Make/O/D/N=(root:Packages:NIST:VSANS:VCALC:gMiddle_T_nPix_X,root:Packages:NIST:VSANS:VCALC:gMiddle_T_nPix_Y) det_MT 752 786 Duplicate/O det_MT qTot_MT,qx_MT,qy_MT,qz_MT 787 788 SetDataFolder root:Packages:NIST:VSANS:VCALC:entry:entry:instrument:detector_MB 789 Make/O/D/N=(root:Packages:NIST:VSANS:VCALC:gMiddle_B_nPix_X,root:Packages:NIST:VSANS:VCALC:gMiddle_B_nPix_Y) det_MB 753 790 Duplicate/O det_MB qTot_MB,qx_MB,qy_MB,qz_MB 754 791 755 792 // BACK 756 793 // TODO: the detector dimensions need to be properly defined here... 757 SetDataFolder root:Packages:NIST:VSANS:VCALC:Back 758 759 Make/O/D/N=(::gBack_nPix_X,::gBack_nPix_Y) det_B 794 // SetDataFolder root:Packages:NIST:VSANS:VCALC:Back 795 796 SetDataFolder root:Packages:NIST:VSANS:VCALC:entry:entry:instrument:detector_B 797 Make/O/D/N=(root:Packages:NIST:VSANS:VCALC:gBack_nPix_X,root:Packages:NIST:VSANS:VCALC:gBack_nPix_Y) det_B 760 798 Duplicate/O det_B qTot_B,qx_B,qy_B,qz_B 761 799 -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/VSANS_Includes.ipf
r979 r982 51 51 #include "V_Test_RAW_Panel" // rename this later when it's done 52 52 #include "V_Utilities_General" // 53 #include "V_DataPlotting" -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_BroadPeak_Pix_2D.ipf
r975 r982 32 32 Prompt yDim "Enter Y dimension: " 33 33 34 Make/O/D coef_PeakPix2D = {10, 3, 10, 0.3, 10, 2, 0.1, 8, 4, 100, 100}34 Make/O/D coef_PeakPix2D = {10, 3, 10, 0.3, 10, 2, 0.1, 8, 8, 100, 100} 35 35 // Make/O/D tmp_Pix2D = {10, 3, 10, 0.3, 10, 2, 0.1} //without the pixel ctrs 36 36 make/o/t parameters_PeakPix2D = {"Porod Scale", "Porod Exponent","Lorentzian Scale","Lor Screening Length","Peak position","Lorentzian Exponent","Bgd [1/cm]", "xPix size (mm)","yPix size (mm)", "xCtr (pixels)", "yCtr (pixels)"} -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_DetectorCorrections.ipf
r981 r982 92 92 // -- do I want this to return a wave? 93 93 // -- do I need to write a separate function that returns the distance wave for later calculations? 94 // -- do I want to make the distance array 2D to keep the x and y dims together? Calculate them all right now?94 // -- do I want to make the distance array 3D to keep the x and y dims together? Calculate them all right now? 95 95 // -- what else do I need to pass to the function? (fname=folder? detStr?) 96 96 // 97 97 // 98 98 // 99 Function NonLinearCorrection(dataW,data_errW,coefW) 100 Wave dataW,data_errW,coefW 101 99 Function NonLinearCorrection(dataW,coefW,tube_width,detStr,destPath) 100 Wave dataW,coefW 101 Variable tube_width 102 String detStr,destPath 103 104 102 105 // do I count on the orientation as an input, or do I just figure it out on my own? 103 106 String orientation … … 112 115 113 116 // make a wave of the same dimensions, in the same data folder for the distance 114 // ?? or a 2D wave? 117 // ?? or a 3D wave? 118 Make/O/D/N=(dimX,dimY) $(destPath + ":entry:entry:instrument:detector_"+detStr+":data_realDistX") 119 Make/O/D/N=(dimX,dimY) $(destPath + ":entry:entry:instrument:detector_"+detStr+":data_realDistY") 120 Wave data_realDistX = $(destPath + ":entry:entry:instrument:detector_"+detStr+":data_realDistX") 121 Wave data_realDistY = $(destPath + ":entry:entry:instrument:detector_"+detStr+":data_realDistY") 115 122 116 123 // then per tube, do the quadratic calculation to get the real space distance along the tube … … 119 126 if(cmpstr(orientation,"vertical")==0) 120 127 // this is data dimensioned as (Ntubes,Npix) 121 122 128 data_realDistY[][] = coefW[0][p] + coefW[1][p]*q + coefW[2][p]*q*q 129 130 data_realDistX[][] = tube_width*p 131 123 132 elseif(cmpstr(orientation,"horizontal")==0) 124 133 // this is data (horizontal) dimensioned as (Npix,Ntubes) 125 126 134 data_realDistX[][] = coefW[0][q] + coefW[1][q]*p + coefW[2][q]*p*p 135 136 data_realDistY[][] = tube_width*q 137 127 138 else 128 139 DoAlert 0,"Orientation not correctly passed in NonLinearCorrection(). No correction done." … … 165 176 // -- only for the tube, not the Back det 166 177 167 DoAlert 0, "re-do this and do a better job of filling the fake data"178 DoAlert 0, "re-do this and do a better job of filling the fake calibration data" 168 179 169 180 fMakeFakeCalibrationWaves() … … 200 211 // this is vertical tube data dimensioned as (Ntubes,Npix) 201 212 pixSize = 8 //V_getDet_y_pixel_size(fname,detStr) 213 202 214 elseif(cmpstr(orientation,"horizontal")==0) 203 215 // this is data (horizontal) dimensioned as (Npix,Ntubes) 204 216 pixSize = 4 //V_getDet_x_pixel_size(fname,detStr) 217 205 218 else 206 219 DoAlert 0,"Orientation not correctly passed in NonLinearCorrection(). No correction done." 207 220 endif 208 221 209 calib[0][] = - 64222 calib[0][] = -(128/2)*pixSize //approx (n/2)*pixSixe 210 223 calib[1][] = pixSize 211 224 calib[2][] = 2e-4 … … 215 228 return(0) 216 229 End 230 231 232 233 Function V_Detector_CalcQVals(fname,detStr,destPath) 234 String fname,detStr,destPath 235 236 String orientation 237 Variable xCtr,yCtr,lambda,sdd 238 239 // get all of the geometry information 240 orientation = V_getDet_tubeOrientation(fname,detStr) 241 sdd = V_getDet_distance(fname,detStr) 242 xCtr = V_getDet_beam_center_x(fname,detStr) 243 yCtr = V_getDet_beam_center_y(fname,detStr) 244 lambda = V_getWavelength(fname) 245 Wave data_realDistX = $(destPath + ":entry:entry:instrument:detector_"+detStr+":data_realDistX") 246 Wave data_realDistY = $(destPath + ":entry:entry:instrument:detector_"+detStr+":data_realDistY") 247 248 // make the new waves 249 Duplicate/O data_realDistX $(destPath + ":entry:entry:instrument:detector_"+detStr+":qTot_"+detStr) 250 Duplicate/O data_realDistX $(destPath + ":entry:entry:instrument:detector_"+detStr+":qx_"+detStr) 251 Duplicate/O data_realDistX $(destPath + ":entry:entry:instrument:detector_"+detStr+":qy_"+detStr) 252 Duplicate/O data_realDistX $(destPath + ":entry:entry:instrument:detector_"+detStr+":qz_"+detStr) 253 Wave qTot = $(destPath + ":entry:entry:instrument:detector_"+detStr+":qTot_"+detStr) 254 Wave qx = $(destPath + ":entry:entry:instrument:detector_"+detStr+":qx_"+detStr) 255 Wave qy = $(destPath + ":entry:entry:instrument:detector_"+detStr+":qy_"+detStr) 256 Wave qz = $(destPath + ":entry:entry:instrument:detector_"+detStr+":qz_"+detStr) 257 258 // calculate all of the q-values 259 qTot = V_CalcQval(p,q,xCtr,yCtr,sdd,lambda,data_realDistX,data_realDistY) 260 qx = V_CalcQX(p,q,xCtr,yCtr,sdd,lambda,data_realDistX,data_realDistY) 261 qy = V_CalcQY(p,q,xCtr,yCtr,sdd,lambda,data_realDistX,data_realDistY) 262 qz = V_CalcQZ(p,q,xCtr,yCtr,sdd,lambda,data_realDistX,data_realDistY) 263 264 265 return(0) 266 End 267 268 269 //function to calculate the overall q-value, given all of the necesary trig inputs 270 // 271 // TODO: 272 // -- verify the calculation (accuracy - in all input conditions) 273 // -- verify the units of everything here, it's currently all jumbled an wrong... 274 // -- the input data_realDistX and Y are essentially lookup tables of the real space distance corresponding 275 // to each pixel 276 // 277 //sdd is in meters 278 //wavelength is in Angstroms 279 // 280 //returned magnitude of Q is in 1/Angstroms 281 // 282 Function V_CalcQval(xaxval,yaxval,xctr,yctr,sdd,lam,distX,distY) 283 Variable xaxval,yaxval,xctr,yctr,sdd,lam 284 Wave distX,distY 285 286 Variable dx,dy,qval,two_theta,dist 287 288 sdd *=100 //convert to cm 289 dx = (distX[xaxval][yaxval] - xctr) //delta x in cm 290 dy = (distY[xaxval][yaxval] - yctr) //delta y in cm 291 dist = sqrt(dx^2 + dy^2) 292 293 two_theta = atan(dist/sdd) 294 295 qval = 4*Pi/lam*sin(two_theta/2) 296 297 return qval 298 End 299 300 //calculates just the q-value in the x-direction on the detector 301 // TODO: 302 // -- verify the calculation (accuracy - in all input conditions) 303 // -- verify the units of everything here, it's currently all jumbled an wrong... 304 // -- the input data_realDistX and Y are essentially lookup tables of the real space distance corresponding 305 // to each pixel 306 // 307 // 308 // this properly accounts for qz 309 // 310 Function V_CalcQX(xaxval,yaxval,xctr,yctr,sdd,lam,distX,distY) 311 Variable xaxval,yaxval,xctr,yctr,sdd,lam 312 Wave distX,distY 313 314 Variable qx,qval,phi,dx,dy,dist,two_theta 315 316 qval = V_CalcQval(xaxval,yaxval,xctr,yctr,sdd,lam,distX,distY) 317 318 sdd *=100 //convert to cm 319 dx = (distX[xaxval][yaxval] - xctr) //delta x in cm 320 dy = (distY[xaxval][yaxval] - yctr) //delta y in cm 321 phi = V_FindPhi(dx,dy) 322 323 //get scattering angle to project onto flat detector => Qr = qval*cos(theta) 324 dist = sqrt(dx^2 + dy^2) 325 two_theta = atan(dist/sdd) 326 327 qx = qval*cos(two_theta/2)*cos(phi) 328 329 return qx 330 End 331 332 //calculates just the q-value in the y-direction on the detector 333 // TODO: 334 // -- verify the calculation (accuracy - in all input conditions) 335 // -- verify the units of everything here, it's currently all jumbled an wrong... 336 // -- the input data_realDistX and Y are essentially lookup tables of the real space distance corresponding 337 // to each pixel 338 // 339 // 340 // this properly accounts for qz 341 // 342 Function V_CalcQY(xaxval,yaxval,xctr,yctr,sdd,lam,distX,distY) 343 Variable xaxval,yaxval,xctr,yctr,sdd,lam 344 Wave distX,distY 345 346 Variable qy,qval,phi,dx,dy,dist,two_theta 347 348 qval = V_CalcQval(xaxval,yaxval,xctr,yctr,sdd,lam,distX,distY) 349 350 sdd *=100 //convert to cm 351 dx = (distX[xaxval][yaxval] - xctr) //delta x in cm 352 dy = (distY[xaxval][yaxval] - yctr) //delta y in cm 353 phi = V_FindPhi(dx,dy) 354 355 //get scattering angle to project onto flat detector => Qr = qval*cos(theta) 356 dist = sqrt(dx^2 + dy^2) 357 two_theta = atan(dist/sdd) 358 359 qy = qval*cos(two_theta/2)*sin(phi) 360 361 return qy 362 End 363 364 //calculates just the q-value in the z-direction on the detector 365 // TODO: 366 // -- verify the calculation (accuracy - in all input conditions) 367 // -- verify the units of everything here, it's currently all jumbled an wrong... 368 // -- the input data_realDistX and Y are essentially lookup tables of the real space distance corresponding 369 // to each pixel 370 // 371 // not actually used for anything, but here for completeness if anyone asks 372 // 373 // this properly accounts for qz 374 // 375 Function V_CalcQZ(xaxval,yaxval,xctr,yctr,sdd,lam,distX,distY) 376 Variable xaxval,yaxval,xctr,yctr,sdd,lam 377 Wave distX,distY 378 379 Variable qz,qval,phi,dx,dy,dist,two_theta 380 381 qval = V_CalcQval(xaxval,yaxval,xctr,yctr,sdd,lam,distX,distY) 382 383 sdd *=100 //convert to cm 384 dx = (distX[xaxval][yaxval] - xctr) //delta x in cm 385 dy = (distY[xaxval][yaxval] - yctr) //delta y in cm 386 387 //get scattering angle to project onto flat detector => Qr = qval*cos(theta) 388 dist = sqrt(dx^2 + dy^2) 389 two_theta = atan(dist/sdd) 390 391 qz = qval*sin(two_theta/2) 392 393 return qz 394 End 395 217 396 218 397 -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_HDF5_RW_Utils.ipf
r981 r982 40 40 // 41 41 // TODO: -- is there an extra "entry" heading? Am I adding this by mistake by setting base_name="entry" for RAW data? 42 // 42 // -- as dumb as it is -- do I just leave it now, or break everything. ont the plus side, removing the extra entry 43 // layer may catch a lot of the hard-wired junk that is present... 43 44 Function V_LoadHDF5Data(file,folder) 44 45 String file,folder 45 46 46 String base_name 47 String base_name,detStr 48 String destPath 49 Variable ii 50 47 51 SetDataFolder $("root:Packages:NIST:VSANS:"+folder) 48 // SetDataFolder root: 52 destPath = "root:Packages:NIST:VSANS:"+folder 53 49 54 if(cmpstr(folder,"RAW")==0) 50 55 base_name="entry" 56 // base_name="RAW" // this acts as a flag to remove the duplicate "entry" level 51 57 else 52 base_name="entry" //TODO -- remove this / change behavior in V_LoadHDF5_NoAtt() 58 // null will use the file name as the top level (above entry) 59 base_name="" //TODO -- remove this / change behavior in V_LoadHDF5_NoAtt() 53 60 endif 54 61 … … 57 64 // if RAW data, then generate the errors and linear data copy 58 65 // do this 9x 66 // then do any "massaging" needed to redimension, fake values, etc. 67 // 59 68 string tmpStr = "root:Packages:NIST:VSANS:RAW:entry:entry:instrument:" 69 60 70 if(cmpstr(folder,"RAW")==0) 61 V_MakeDataError(tmpStr+"detector_B") 62 V_MakeDataError(tmpStr+"detector_MB") 63 V_MakeDataError(tmpStr+"detector_MT") 64 V_MakeDataError(tmpStr+"detector_ML") 65 V_MakeDataError(tmpStr+"detector_MR") 66 V_MakeDataError(tmpStr+"detector_FB") 67 V_MakeDataError(tmpStr+"detector_FT") 68 V_MakeDataError(tmpStr+"detector_FL") 69 V_MakeDataError(tmpStr+"detector_FR") 70 71 // TODO -- once I get "real" data, get rid of this call to force the data to be proper dimensions. 71 72 // TODO -- once I get "real" data, get rid of this call to force the data to be proper dimensions. 72 73 V_RedimFakeData() 73 // 74 // TODO -- for the "real" data, may need a step in here to convert integer detector data to DP, or I'll 75 // get really odd results from the calculations, and may not even notice. 76 77 // TODO 78 // -- get rid of these fake calibration waves as "real" ones are filled in 74 75 // makes data error and linear copy -- DP waves if V_RedimFakeData() called above 76 for(ii=0;ii<ItemsInList(ksDetectorListAll);ii+=1) 77 detStr = StringFromList(ii, ksDetectorListAll, ";") 78 V_MakeDataError(tmpStr+"detector_"+detStr) 79 endfor 80 81 82 // TODO -- for the "real" data, may need a step in here to convert integer detector data to DP, or I'll 83 // get really odd results from the calculations, and may not even notice. 84 // !!!! Where do I actually do this? - this is currently done in Raw_to_work() 85 // -- is is better to do here, right as the data is loaded? 86 // TODO -- some of this is done in V_RedimFakeData() above - which will disappear once I get real data 87 88 89 // TODO 90 // -- get rid of these fake calibration waves as "real" ones are filled in by NICE 79 91 Execute "MakeFakeCalibrationWaves()" 80 // fMakeFakeCalibrationWaves() //skips the alert 81 92 // fMakeFakeCalibrationWaves() //skips the alert 93 94 95 // TODO -- do I want to calculate the nonlinear x/y arrays and the q-values here? 96 // -- otherwise the mouse-over doesn't calculate the correct Q_values 97 // the display currently is not shifted or altered at all to account for the non-linearity 98 // or for display in q-values -- so why bother with this? 99 NVAR gDoNonLinearCor = root:Packages:NIST:VSANS:Globals:gDoNonLinearCor 100 // generate a distance matrix for each of the detectors 101 if (gDoNonLinearCor == 1) 102 Print "Calculating Non-linear correction at RAW load time"// for "+ detStr 103 for(ii=0;ii<ItemsInList(ksDetectorListNoB);ii+=1) 104 detStr = StringFromList(ii, ksDetectorListNoB, ";") 105 Wave w = V_getDetectorDataW(folder,detStr) 106 // Wave w_err = V_getDetectorDataErrW(fname,detStr) 107 Wave w_calib = V_getDetTube_spatialCalib(folder,detStr) 108 Variable tube_width = V_getDet_tubeWidth(folder,detStr) 109 NonLinearCorrection(w,w_calib,tube_width,detStr,destPath) 82 110 83 /// END FAKE DATA CORRECTIONS 84 111 // (2.5) Calculate the q-values 112 // calculating q-values can't be done unless the non-linear corrections are calculated 113 // so go ahead and put it in this loop. 114 // TODO : 115 // -- make sure that everything is present before the calculation 116 // -- beam center must be properly defined in terms of real distance 117 // -- distances/zero location/ etc. must be clearly documented for each detector 118 // ** this assumes that NonLinearCorrection() has been run to generate data_RealDistX and Y 119 // ** this routine Makes the waves QTot, qx, qy, qz in each detector folder. 120 // 121 V_Detector_CalcQVals(folder,detStr,destPath) 122 123 endfor 124 else 125 Print "Non-linear correction not done" 126 endif 127 128 129 /// END FAKE DATA CORRECTIONS 130 85 131 endif 86 132 … … 90 136 91 137 // 92 // TODO -- this is all FAKED since all the data arrays are (1,128,128)93 // I'm intentionally using the wrong number of pixels so I'm more likely to go back and get rid of this later.138 // TODO -- this is all FAKED since all the data arrays are written to hdf as (1,128,128) 139 // -- try to fill in the bits from VCALC, if it exists (or force it) 94 140 // 95 141 // the SetScale parts may be useful later. … … 97 143 Function V_RedimFakeData() 98 144 99 SetDataFolder root:Packages:NIST:VSANS:RAW:entry:entry:instrument:detector_B 100 Wave det_B=data 101 Redimension/N=(320,320)/E=1 det_B 102 det_B = p+q+2 103 104 Variable ctr=20,npix=128 105 SetDataFolder root:Packages:NIST:VSANS:RAW:entry:entry:instrument:detector_MT 106 Wave det_MT=data 107 Redimension/N=(npix,48)/E=1 det_MT 108 SetScale/I x -npix/2,npix/2,"",det_MT 109 SetScale/I y ctr,ctr+48,"",det_MT 110 // det_mt[][20] = 50 111 det_MT *= 10 145 // check for fake data in VCALC folder... 146 wave/Z tmpw=$"root:Packages:NIST:VSANS:VCALC:entry:entry:instrument:detector_B:det_B" 147 if(WaveExists(tmpw) == 0) 148 Execute "VCALC_Panel()" 149 endif 150 151 SetDataFolder root:Packages:NIST:VSANS:RAW:entry:entry:instrument:detector_B 152 Wave det_B=data 153 Redimension/N=(320,320)/E=1 det_B 154 Redimension/D det_B 155 // det_B = p+q+2 156 wave tmpw=$"root:Packages:NIST:VSANS:VCALC:entry:entry:instrument:detector_B:det_B" 157 det_B=tmpw 158 det_B += 2 159 160 Variable ctr=20,npix=128 161 SetDataFolder root:Packages:NIST:VSANS:RAW:entry:entry:instrument:detector_MT 162 Wave det_MT=data 163 Redimension/N=(npix,48)/E=1 det_MT 164 Redimension/D det_MT 165 SetScale/I x -npix/2,npix/2,"",det_MT 166 SetScale/I y ctr,ctr+48,"",det_MT 167 // det_MT *= 10 168 // det_MT += 2 169 wave tmpw=$"root:Packages:NIST:VSANS:VCALC:entry:entry:instrument:detector_MT:det_MT" 170 det_MT=tmpw 112 171 det_MT += 2 113 114 SetDataFolder root:Packages:NIST:VSANS:RAW:entry:entry:instrument:detector_MB 115 Wave det_MB=data 116 Redimension/N=(npix,48)/E=1 det_MB 117 SetScale/I x -npix/2,npix/2,"",det_MB 118 SetScale/I y -ctr,-ctr-48,"",det_MB 119 det_MB *= 5 172 173 SetDataFolder root:Packages:NIST:VSANS:RAW:entry:entry:instrument:detector_MB 174 Wave det_MB=data 175 Redimension/N=(npix,48)/E=1 det_MB 176 Redimension/D det_MB 177 SetScale/I x -npix/2,npix/2,"",det_MB 178 SetScale/I y -ctr-48,-ctr,"",det_MB 179 // det_MB *= 5 180 // det_MB += 2 181 wave tmpw=$"root:Packages:NIST:VSANS:VCALC:entry:entry:instrument:detector_MB:det_MB" 182 det_MB=tmpw 120 183 det_MB += 2 121 122 ctr=30 123 SetDataFolder root:Packages:NIST:VSANS:RAW:entry:entry:instrument:detector_ML 124 Wave det_ML=data 125 Redimension/N=(48,npix)/E=1 det_ML 126 SetScale/I x -ctr-48,-ctr,"",det_ML 127 SetScale/I y -npix/2,npix/2,"",det_ML 128 det_ML *= 2 184 185 ctr=30 186 SetDataFolder root:Packages:NIST:VSANS:RAW:entry:entry:instrument:detector_ML 187 Wave det_ML=data 188 Redimension/N=(48,npix)/E=1 det_ML 189 Redimension/D det_ML 190 SetScale/I x -ctr-48,-ctr,"",det_ML 191 SetScale/I y -npix/2,npix/2,"",det_ML 192 // det_ML *= 2 193 // det_ML += 2 194 wave tmpw=$"root:Packages:NIST:VSANS:VCALC:entry:entry:instrument:detector_ML:det_ML" 195 det_ML=tmpw 129 196 det_ML += 2 130 131 SetDataFolder root:Packages:NIST:VSANS:RAW:entry:entry:instrument:detector_MR 132 Wave det_MR=data 133 Redimension/N=(48,npix)/E=1 det_MR 134 SetScale/I x ctr,ctr+48,"",det_MR 135 SetScale/I y -npix/2,npix/2,"",det_MR 136 det_MR +=2 137 138 ctr=30 139 SetDataFolder root:Packages:NIST:VSANS:RAW:entry:entry:instrument:detector_FT 140 Wave det_FT=data 141 Redimension/N=(npix,48)/E=1 det_FT 142 SetScale/I x -npix/2,npix/2,"",det_FT 143 SetScale/I y ctr,ctr+48,"",det_FT 144 145 SetDataFolder root:Packages:NIST:VSANS:RAW:entry:entry:instrument:detector_FB 146 Wave det_FB=data 147 Redimension/N=(npix,48)/E=1 det_FB 148 SetScale/I x -npix/2,npix/2,"",det_FB 149 SetScale/I y -ctr,-ctr-48,"",det_FB 150 151 SetDataFolder root:Packages:NIST:VSANS:RAW:entry:entry:instrument:detector_FL 152 Wave det_FL=data 153 Redimension/N=(48,npix)/E=1 det_FL 154 SetScale/I x -ctr-48,-ctr,"",det_FL 155 SetScale/I y -npix/2,npix/2,"",det_FL 156 157 SetDataFolder root:Packages:NIST:VSANS:RAW:entry:entry:instrument:detector_FR 158 Wave det_FR=data 159 Redimension/N=(48,npix)/E=1 det_FR 160 SetScale/I x ctr,ctr+48,"",det_FR 161 SetScale/I y -npix/2,npix/2,"",det_FR 162 197 198 SetDataFolder root:Packages:NIST:VSANS:RAW:entry:entry:instrument:detector_MR 199 Wave det_MR=data 200 Redimension/N=(48,npix)/E=1 det_MR 201 Redimension/D det_MR 202 SetScale/I x ctr,ctr+48,"",det_MR 203 SetScale/I y -npix/2,npix/2,"",det_MR 204 // det_MR +=2 205 wave tmpw=$"root:Packages:NIST:VSANS:VCALC:entry:entry:instrument:detector_MR:det_MR" 206 det_MR=tmpw 207 det_MR += 2 208 209 ctr=30 210 SetDataFolder root:Packages:NIST:VSANS:RAW:entry:entry:instrument:detector_FT 211 Wave det_FT=data 212 Redimension/N=(npix,48)/E=1 det_FT 213 Redimension/D det_FT 214 SetScale/I x -npix/2,npix/2,"",det_FT 215 SetScale/I y ctr,ctr+48,"",det_FT 216 wave tmpw=$"root:Packages:NIST:VSANS:VCALC:entry:entry:instrument:detector_FT:det_FT" 217 det_FT=tmpw 218 219 SetDataFolder root:Packages:NIST:VSANS:RAW:entry:entry:instrument:detector_FB 220 Wave det_FB=data 221 Redimension/N=(npix,48)/E=1 det_FB 222 Redimension/D det_FB 223 SetScale/I x -npix/2,npix/2,"",det_FB 224 SetScale/I y -ctr-48,-ctr,"",det_FB 225 wave tmpw=$"root:Packages:NIST:VSANS:VCALC:entry:entry:instrument:detector_FB:det_FB" 226 det_FB=tmpw 227 228 SetDataFolder root:Packages:NIST:VSANS:RAW:entry:entry:instrument:detector_FL 229 Wave det_FL=data 230 Redimension/N=(48,npix)/E=1 det_FL 231 Redimension/D det_FL 232 SetScale/I x -ctr-48,-ctr,"",det_FL 233 SetScale/I y -npix/2,npix/2,"",det_FL 234 wave tmpw=$"root:Packages:NIST:VSANS:VCALC:entry:entry:instrument:detector_FL:det_FL" 235 det_FL=tmpw 236 237 SetDataFolder root:Packages:NIST:VSANS:RAW:entry:entry:instrument:detector_FR 238 Wave det_FR=data 239 Redimension/N=(48,npix)/E=1 det_FR 240 Redimension/D det_FR 241 SetScale/I x ctr,ctr+48,"",det_FR 242 SetScale/I y -npix/2,npix/2,"",det_FR 243 wave tmpw=$"root:Packages:NIST:VSANS:VCALC:entry:entry:instrument:detector_FR:det_FR" 244 det_FR=tmpw 245 163 246 // get rid of zeros 164 det_FL += 2 165 det_FR += 2 166 det_FT += 2 167 det_FB += 2 247 det_FL += 2 248 det_FR += 2 249 det_FT += 2 250 det_FB += 2 251 252 V_RescaleToBeamCenter("RAW","MB",64,55) 253 V_RescaleToBeamCenter("RAW","MT",64,-8.7) 254 V_RescaleToBeamCenter("RAW","MR",-8.1,64) 255 V_RescaleToBeamCenter("RAW","ML",55,64) 256 V_RescaleToBeamCenter("RAW","FL",55,64) 257 V_RescaleToBeamCenter("RAW","FR",-8.1,64) 258 V_RescaleToBeamCenter("RAW","FT",64,-8.7) 259 V_RescaleToBeamCenter("RAW","FB",64,55) 260 261 168 262 169 263 return(0) … … 217 311 if(cmpstr(base_name,"") == 0) 218 312 base_name = StringFromList(0,FileName,".") 313 endif 314 if(cmpstr(base_name,"RAW") == 0) 315 base_name = "" 219 316 endif 220 317 //base_name = "entry" -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_MainPanel.ipf
r981 r982 55 55 56 56 Variable err= V_LoadHDF5Data("","RAW") // load the data into RawVSANS storage folder (why am I doing this?) 57 Print "Load err = "+num2str(err)57 // Print "Load err = "+num2str(err) 58 58 if(!err) 59 59 String hdfDF = root:file_name // last file loaded, may not be the safest way to pass -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Menu.ipf
r977 r982 16 16 "-" 17 17 "Main Control Panel",DoWindow/F Main_VSANS_Panel 18 "Data Display", UpdateDisplayInformation("")18 "Data Display",DoWindow/F VSANS_Data 19 19 "VCALC",VCALC_Panel() 20 20 "-" -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Test_RAW_Panel.ipf
r981 r982 91 91 PauseUpdate; Silent 1 // building window... 92 92 NewPanel /W=(37,45,1038,719) /N=VSANS_Data 93 ShowTools/A93 // ShowTools/A 94 94 ModifyPanel cbRGB=(65535,60076,49151) 95 95 … … 222 222 case 3: //mouse down 223 223 // Print "mouse down" 224 // 225 // TODO (Way in the future -- I could make the small graphs into "buttons" by responding to a "mouse up" (not down) 226 // that hits in one of the small graph areas, and treat that as a click on that tab 227 // 224 228 break 225 229 … … 335 339 pixSizeX = V_getDet_x_pixel_size(gCurDispType,detStr)/10 // written mm? need cm 336 340 pixSizeY = V_getDet_y_pixel_size(gCurDispType,detStr)/10 // written mm? need cm 337 338 gQQ = V_CalcQval(xaxval+1,yaxval+1,xctr,yctr,sdd,lam,pixSizeX,pixSizeY) 339 gQX = V_CalcQX(xaxval+1,yaxval+1,xctr,yctr,sdd,lam,pixSizeX,pixSizeY) 340 gQY = V_CalcQY(xaxval+1,yaxval+1,xctr,yctr,sdd,lam,pixSizeX,pixSizeY) 341 // 342 // TODO: these q-values ignore the non-linear corrections!!! 343 // -- What can I do about this? 344 gQQ = VC_CalcQval(xaxval+1,yaxval+1,xctr,yctr,sdd,lam,pixSizeX,pixSizeY) 345 gQX = VC_CalcQX(xaxval+1,yaxval+1,xctr,yctr,sdd,lam,pixSizeX,pixSizeY) 346 gQY = VC_CalcQY(xaxval+1,yaxval+1,xctr,yctr,sdd,lam,pixSizeX,pixSizeY) 341 347 342 348 ii = -1 //look no further, set ii to bad value to exit the for loop … … 381 387 382 388 SVAR dataType = root:Packages:NIST:VSANS:Globals:gCurDispType 389 // make sure log scaling is correct 390 NVAR state = root:Packages:NIST:VSANS:Globals:gIsLogScale 391 383 392 384 393 //************ … … 411 420 MoveSubWindow/W=VSANS_Data#det_panelsM fnum=(320,70,430,160) 412 421 MoveSubWindow/W=VSANS_Data#det_panelsF fnum=(200,70,310,160) 422 423 ModifyImage/W=VSANS_Data#det_panelsB ''#0 log=State 424 425 // make the plot square 426 ModifyGraph/W=VSANS_Data#det_panelsB width={Aspect,1} 413 427 414 428 SetActiveSubWindow VSANS_Data#det_panelsB … … 450 464 MoveSubWindow/W=VSANS_Data#det_panelsB fnum=(440,70,550,160) 451 465 MoveSubWindow/W=VSANS_Data#det_panelsF fnum=(200,70,310,160) 452 466 467 ModifyImage/W=VSANS_Data#det_panelsM ''#0 log=State 468 ModifyImage/W=VSANS_Data#det_panelsM ''#1 log=State 469 ModifyImage/W=VSANS_Data#det_panelsM ''#2 log=State 470 ModifyImage/W=VSANS_Data#det_panelsM ''#3 log=State 471 472 // make the plot square 473 ModifyGraph/W=VSANS_Data#det_panelsM width={Aspect,1} 474 453 475 SetActiveSubWindow VSANS_Data#det_panelsM 454 476 SetDataFolder root: … … 490 512 MoveSubWindow/W=VSANS_Data#det_panelsM fnum=(320,70,430,160) 491 513 514 ModifyImage/W=VSANS_Data#det_panelsF ''#0 log=State 515 ModifyImage/W=VSANS_Data#det_panelsF ''#1 log=State 516 ModifyImage/W=VSANS_Data#det_panelsF ''#2 log=State 517 ModifyImage/W=VSANS_Data#det_panelsF ''#3 log=State 518 519 // make the plot square 520 ModifyGraph/W=VSANS_Data#det_panelsF width={Aspect,1} 521 492 522 SetActiveSubWindow VSANS_Data#det_panelsF 493 523 SetDataFolder root: 494 524 endif 495 525 496 // make sure log scaling is correct497 NVAR state = root:Packages:NIST:VSANS:Globals:gIsLogScale498 499 // on the front:500 ModifyImage/W=VSANS_Data#det_panelsF ''#0 log=State501 ModifyImage/W=VSANS_Data#det_panelsF ''#1 log=State502 ModifyImage/W=VSANS_Data#det_panelsF ''#2 log=State503 ModifyImage/W=VSANS_Data#det_panelsF ''#3 log=State504 //on the middle:505 ModifyImage/W=VSANS_Data#det_panelsM ''#0 log=State506 ModifyImage/W=VSANS_Data#det_panelsM ''#1 log=State507 ModifyImage/W=VSANS_Data#det_panelsM ''#2 log=State508 ModifyImage/W=VSANS_Data#det_panelsM ''#3 log=State509 // on the back:510 ModifyImage/W=VSANS_Data#det_panelsB ''#0 log=State511 ////512 513 526 514 527 break … … 630 643 case 2: // mouse up 631 644 // click code here 645 646 V_PlotData_Panel() 647 632 648 break 633 649 case -1: // control being killed … … 743 759 case 2: // mouse up 744 760 // click code here 761 V_FindBeamCenter() 745 762 break 746 763 case -1: // control being killed -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_WorkFolderUtils.ipf
r981 r982 382 382 // TODO 383 383 // -- currently only redimensioning the data and linear_data_error - What else??? 384 // 384 // -- ?? some of this is done at load time for RAW data 385 385 for(ii=0;ii<ItemsInList(ksDetectorListAll);ii+=1) 386 386 detStr = StringFromList(ii, ksDetectorListAll, ";") … … 400 400 // if not in DIV folder, load. 401 401 // if unable to load, skip correction and report error (Alert?) (Ask to Load?) 402 402 Print "Doing DIV correction"// for "+ detStr 403 403 for(ii=0;ii<ItemsInList(ksDetectorListAll);ii+=1) 404 404 detStr = StringFromList(ii, ksDetectorListAll, ";") 405 405 Wave w = V_getDetectorDataW(fname,detStr) 406 406 Wave w_err = V_getDetectorDataErrW(fname,detStr) 407 Print "Doing DIV correction for "+ detStr407 408 408 DIVCorrection(w,w_err,detStr,newType) 409 409 endfor … … 413 413 414 414 // (2) non-linear correction 415 // TODO: 416 // -- currently, the "B" detector is skipped 417 // -- document what is generated here: 418 // **in each detector folder: data_realDistX and data_realDistY (2D waves of the mm? position of the pixel) 419 // -- still not sure whether to duplicate these calculations as the RAW data is loaded. It would allow the RAW 420 // data to be properly displayed, but without all of the (complete) set of corrections 421 // * the corrected distances are calculated into arrays, but nothing is done with them yet 422 // * there is enough information now to calculate the q-arrays -other corrections modify the data 415 423 NVAR gDoNonLinearCor = root:Packages:NIST:VSANS:Globals:gDoNonLinearCor 416 424 // generate a distance matrix for each of the detectors 417 425 if (gDoNonLinearCor == 1) 418 for(ii=0;ii<ItemsInList(ksDetectorListAll);ii+=1) 419 detStr = StringFromList(ii, ksDetectorListAll, ";") 426 Print "Doing Non-linear correction"// for "+ detStr 427 for(ii=0;ii<ItemsInList(ksDetectorListNoB);ii+=1) 428 detStr = StringFromList(ii, ksDetectorListNoB, ";") 420 429 Wave w = V_getDetectorDataW(fname,detStr) 421 Wave w_err = V_getDetectorDataErrW(fname,detStr)430 // Wave w_err = V_getDetectorDataErrW(fname,detStr) 422 431 Wave w_calib = V_getDetTube_spatialCalib(fname,detStr) 423 Print "Doing Non-linear correction for "+ detStr 424 // NonLinearCorrection(fill this in) 432 Variable tube_width = V_getDet_tubeWidth(fname,detStr) 433 NonLinearCorrection(w,w_calib,tube_width,detStr,destPath) 434 435 // (2.5) Calculate the q-values 436 // calculating q-values can't be done unless the non-linear corrections are calculated 437 // so go ahead and put it in this loop. 438 // TODO : 439 // -- make sure that everything is present before the calculation 440 // -- beam center must be properly defined in terms of real distance 441 // -- distances/zero location/ etc. must be clearly documented for each detector 442 // ** this assumes that NonLinearCorrection() has been run to generate data_RealDistX and Y 443 // ** this routine Makes the waves QTot, qx, qy, qz in each detector folder. 444 // 445 V_Detector_CalcQVals(fname,detStr,destPath) 425 446 426 447 endfor … … 428 449 Print "Non-linear correction not done" 429 450 endif 430 451 431 452 // (3) solid angle correction 432 453 NVAR gDoSolidAngleCor = root:Packages:NIST:VSANS:Globals:gDoSolidAngleCor 433 454 if (gDoSolidAngleCor == 1) 455 Print "Doing Solid Angle correction"// for "+ detStr 434 456 for(ii=0;ii<ItemsInList(ksDetectorListAll);ii+=1) 435 457 detStr = StringFromList(ii, ksDetectorListAll, ";") … … 437 459 Wave w_err = V_getDetectorDataErrW(fname,detStr) 438 460 Wave w_dt = V_getDetector_deadtime(fname,detStr) 439 Print "Doing Solid Angle correction for "+ detStr440 461 // SolidAngleCorrection(fill this in) 441 462 … … 453 474 ctTime = V_getCount_time(fname) 454 475 if (gDoDeadTimeCor == 1) 476 Print "Doing DeadTime correction"// for "+ detStr 455 477 for(ii=0;ii<ItemsInList(ksDetectorListAll);ii+=1) 456 478 detStr = StringFromList(ii, ksDetectorListAll, ";") … … 458 480 Wave w_err = V_getDetectorDataErrW(fname,detStr) 459 481 Wave w_dt = V_getDetector_deadtime(fname,detStr) 460 Print "Doing DeadTime correction for "+ detStr461 482 // DeadTimeCorrectionTubes(w,w_err,w_dt,ctTime) 462 483 //deadtime corrections … … 488 509 NVAR gDoTrans = root:Packages:NIST:VSANS:Globals:gDoTransmissionCor 489 510 if (gDoTrans == 1) 511 Print "Doing Large-angle transmission correction"// for "+ detStr 490 512 for(ii=0;ii<ItemsInList(ksDetectorListAll);ii+=1) 491 513 detStr = StringFromList(ii, ksDetectorListAll, ";") … … 493 515 Wave w_err = V_getDetectorDataErrW(fname,detStr) 494 516 Wave w_dt = V_getDetector_deadtime(fname,detStr) 495 Print "Doing Large-angle transmission correction for "+ detStr496 517 // TransmissionCorrection(fill this in) 497 518 … … 505 526 // TODO -- but there are TWO monitors - so how to switch? 506 527 // TODO -- what do I really need to save? 528 Print "Doing monitor normalization"// for "+ detStr 529 507 530 defmon=1e8 //default monitor counts 508 531 for(ii=0;ii<ItemsInList(ksDetectorListAll);ii+=1) … … 511 534 Wave w_err = V_getDetectorDataErrW(fname,detStr) 512 535 Variable monCt = V_getBeamMonNormData(fname) 513 Print "Doing monitor normalization for "+ detStr514 536 // MonitorNormalization(fill this in) 515 537 //scale the data to the default montor counts
Note: See TracChangeset
for help on using the changeset viewer.