- Timestamp:
- Apr 6, 2018 9:06:40 AM (5 years ago)
- Location:
- sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/VC_DetectorBinning_Q.ipf
r1082 r1093 1251 1251 // TODO (make the N along the tube length a variable, since this can be reset @ acquisition) 1252 1252 // SetDataFolder root:Packages:NIST:VSANS:VCALC:Back 1253 WAVE det_B = $(folderPath+instPath+"B"+":det_B") // this is nominally ( 150,150)1253 WAVE det_B = $(folderPath+instPath+"B"+":det_B") // this is nominally (680,1656) 1254 1254 1255 1255 //Back detector … … 1266 1266 qz_B = 0 1267 1267 1268 // TODO - these are to be set from globals, not hard-wired. N and pixelSi xze will be known (or pre-measured)1268 // TODO - these are to be set from globals, not hard-wired. N and pixelSize will be known (or pre-measured) 1269 1269 // pixel sizes are in cm 1270 1270 pixSizeX = VCALC_getPixSizeX("B") 1271 1271 pixSizeY = VCALC_getPixSizeY("B") 1272 1273 xCtr = trunc( DimSize(det_B,0)/2 ) //should be 150/2=75 1274 yCtr = trunc( DimSize(det_B,1)/2 ) //should be 150/2=75 1272 1273 if(kBCTR_CM) 1274 xCtr = trunc( DimSize(det_B,0)/2 ) *pixSizeX * 10 1275 yCtr = trunc( DimSize(det_B,1)/2 ) *pixSizeY * 10 //values in mm -- beam is nominally at 0,0 in space 1276 else 1277 xCtr = trunc( DimSize(det_B,0)/2 ) // 1278 yCtr = trunc( DimSize(det_B,1)/2 ) // 1279 endif 1280 1275 1281 //put these beam center values into the local folder 1276 1282 V_putDet_beam_center_x("VCALC","B",xCtr) -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/VC_DetectorBinning_Utils.ipf
r1092 r1093 264 264 if(cmpstr(detStr,"B") == 0) 265 265 // and for the back detector "B" 266 Make/O/D/N=3 tmpCalib 267 tmpCalib[0] = 1 268 tmpCalib[1] = 1 269 tmpcalib[2] = 10000 266 Make/O/D/N=3 tmpCalibX,tmpCalibY 267 tmpCalibX[0] = VCALC_getPixSizeX(detStr)*10 // pixel size in mm VCALC_getPixSizeX(detStr) is [cm] 268 tmpCalibX[1] = 1 269 tmpcalibX[2] = 10000 270 tmpCalibY[0] = VCALC_getPixSizeY(detStr)*10 // pixel size in mm VCALC_getPixSizeX(detStr) is [cm] 271 tmpCalibY[1] = 1 272 tmpcalibY[2] = 10000 270 273 endif 271 274 … … 273 276 Variable tube_width = 8.4 // TODO: UNITS!!! Hard-wired value in [mm] 274 277 if(cmpstr(detStr,"B") == 0) 275 V_NonLinearCorrection_B("VCALC",data,tmpCalib ,tmpCalib,detStr,destPath)278 V_NonLinearCorrection_B("VCALC",data,tmpCalibX,tmpCalibY,detStr,destPath) 276 279 else 277 280 V_NonLinearCorrection("VCALC",data,tmpCalib,tube_width,detStr,destPath) … … 353 356 endif 354 357 355 KillWaves/Z tmpCalib 358 KillWaves/Z tmpCalib,tmpCalibX,tmpCalibY 356 359 357 360 return(0) … … 1147 1150 // - so I upped nq to 600 1148 1151 1149 nq = 600 1152 if(cmpstr(type,"B") == 0) 1153 nq = 8000 1154 else 1155 nq=600 1156 endif 1150 1157 1151 1158 //******TODO****** -- where to put the averaged data -- right now, folderStr is forced to "" -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/VC_SideView.ipf
r1081 r1093 401 401 B_T_profileX = B_SDD //SDDb in [cm] 402 402 403 B_T_profileY[0] = B_ h/2 // half-height404 B_T_profileY[1] = -B_ h/2 // half-height403 B_T_profileY[0] = B_w/2 // from the top, see the width 404 B_T_profileY[1] = -B_w/2 // half-width 405 405 406 406 B_T_rayX[0] = 0 -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/VC_VCALCPanel_MockUp.ipf
r1092 r1093 182 182 // tab(3) - Middle detector panels, initially not visible 183 183 SetVariable VCALCCtrl_3a,pos={30,260},size={150,15},title="LEFT Offset (cm)",proc=VC_MDet_LR_SetVarProc 184 SetVariable VCALCCtrl_3a,limits={-20,19,0.1},disable=1,value=_NUM:- 6184 SetVariable VCALCCtrl_3a,limits={-20,19,0.1},disable=1,value=_NUM:-7 185 185 SetVariable VCALCCtrl_3aa,pos={30,290},size={150,15},title="RIGHT Offset (cm)",proc=VC_MDet_LR_SetVarProc 186 SetVariable VCALCCtrl_3aa,limits={-19,20,0.1},disable=1,value=_NUM: 6186 SetVariable VCALCCtrl_3aa,limits={-19,20,0.1},disable=1,value=_NUM:7 187 187 188 188 SetVariable VCALCCtrl_3b,pos={30,330},size={150,15},title="TOP Offset (cm)",proc=VC_MDet_LR_SetVarProc 189 SetVariable VCALCCtrl_3b,limits={0,18,0.1},disable=1,value=_NUM: 6189 SetVariable VCALCCtrl_3b,limits={0,18,0.1},disable=1,value=_NUM:14 190 190 SetVariable VCALCCtrl_3bb,pos={30,360},size={150,15},title="BOTTOM Offset (cm)",proc=VC_MDet_LR_SetVarProc 191 SetVariable VCALCCtrl_3bb,limits={-18,0,0.1},disable=1,value=_NUM:- 6191 SetVariable VCALCCtrl_3bb,limits={-18,0,0.1},disable=1,value=_NUM:-14 192 192 193 193 SetVariable VCALCCtrl_3d,pos={205,260},size={230,15},title="Sample to Detector Distance (cm)",proc=VC_MDet_SDD_SetVarProc 194 SetVariable VCALCCtrl_3d,limits={800,2000,1},disable=1,value=_NUM:1 500194 SetVariable VCALCCtrl_3d,limits={800,2000,1},disable=1,value=_NUM:1000 195 195 196 196 … … 199 199 SetVariable VCALCCtrl_4a,limits={0,20,0.1},disable=1,value=_NUM:0 200 200 SetVariable VCALCCtrl_4b,pos={188,260},size={230,15},title="Sample to Detector Distance (cm)",proc=VC_BDet_SDD_SetVarProc 201 SetVariable VCALCCtrl_4b,limits={2000,2500,1},disable=1,value=_NUM:2 000201 SetVariable VCALCCtrl_4b,limits={2000,2500,1},disable=1,value=_NUM:2200 202 202 // PopupMenu VCALCCtrl_4c,pos={40,260},size={180,20},title="Detector type",disable=1 203 203 // PopupMenu VCALCCtrl_4c,mode=1,popvalue="2D",value= root:Packages:NIST:VSANS:VCALC:gBackDetType … … 205 205 // tab(5) - Simulation setup 206 206 SetVariable VCALCCtrl_5a,pos={40,290},size={200,15},title="Neutrons on Sample (imon)" 207 SetVariable VCALCCtrl_5a,limits={1e7,1e15,1e7},disable=1,value=_NUM:1e1 0,proc=VC_SimImon_SetVarProc207 SetVariable VCALCCtrl_5a,limits={1e7,1e15,1e7},disable=1,value=_NUM:1e11,proc=VC_SimImon_SetVarProc 208 208 PopupMenu VCALCCtrl_5b,pos={40,260},size={180,20},title="Model Function",disable=1 209 209 PopupMenu VCALCCtrl_5b,mode=1,popvalue="Debye",value= root:Packages:NIST:VSANS:VCALC:gModelFunctionType,proc=VC_SimModelFunc_PopProc … … 801 801 802 802 //// BACK DETECTOR 803 Variable/G gBack_w = 15.0 //w and h for the back detector, (cm) 150 pix * 1mm/pix804 Variable/G gBack_h = 15.0805 806 Make/O/D/N=1 :entry:instrument:detector_B:x_pixel_size = 0. 1 // 1 mmresolution (units of cm here)807 Make/O/D/N=1 :entry:instrument:detector_B:y_pixel_size = 0. 1808 809 810 Make/O/D/N=1 :entry:instrument:detector_B:pixel_num_x = 150// detector pixels in x-direction811 Make/O/D/N=1 :entry:instrument:detector_B:pixel_num_y = 1 50803 Variable/G gBack_w = 22.2 //w and h for the back detector [cm] 804 Variable/G gBack_h = 50.4 805 806 Make/O/D/N=1 :entry:instrument:detector_B:x_pixel_size = 0.034 // 340 micron resolution (units of cm here) 807 Make/O/D/N=1 :entry:instrument:detector_B:y_pixel_size = 0.034 808 809 810 Make/O/D/N=1 :entry:instrument:detector_B:pixel_num_x = 680 // detector pixels in x-direction 811 Make/O/D/N=1 :entry:instrument:detector_B:pixel_num_y = 1656 812 812 813 813 814 814 // pixel beam center - HDF style 815 Make/O/D/N=1 :entry:instrument:detector_B:beam_center_x = 75// == x beam center, in pixels816 Make/O/D/N=1 :entry:instrument:detector_B:beam_center_y = 75// == y beam center, in pixels815 Make/O/D/N=1 :entry:instrument:detector_B:beam_center_x = 340 // == x beam center, in pixels 816 Make/O/D/N=1 :entry:instrument:detector_B:beam_center_y = 828 // == y beam center, in pixels 817 817 818 818 -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_DIVUtils.ipf
r1085 r1093 398 398 Make/O/T/N=1 name = "NG3_VSANS" 399 399 NewDataFolder/O/S root:VSANS_DIV_file:entry:instrument:detector_B 400 Make/O/D/N=( 150,150) data = 1401 Make/O/D/N=( 150,150) linear_data_error = 0.01400 Make/O/D/N=(680,1656) data = 1 401 Make/O/D/N=(680,1656) linear_data_error = 0.01 402 402 NewDataFolder/O/S root:VSANS_DIV_file:entry:instrument:detector_MR 403 403 Make/O/D/N=(48,128) data = 1 -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_DetectorCorrections.ipf
r1083 r1093 106 106 // 107 107 // output is wave of corrected real space distance corresponding to each pixel of the data 108 // ** its distance from the nominal beam center of (0,0) ** 108 109 // 109 110 // … … 270 271 return(0) 271 272 endif 273 274 Print "***Cal_X and Cal_Y for Back are using default values instead of file values ***" 275 276 cal_x[0] = VCALC_getPixSizeX(detStr)*10 // pixel size in mm VCALC_getPixSizeX(detStr) is [cm] 277 cal_x[1] = 1 278 cal_x[2] = 10000 279 cal_y[0] = VCALC_getPixSizeY(detStr)*10 // pixel size in mm VCALC_getPixSizeX(detStr) is [cm] 280 cal_y[1] = 1 281 cal_y[2] = 10000 282 272 283 273 284 // do I count on the orientation as an input, or do I just figure it out on my own? … … 285 296 Wave data_realDistX = $(destPath + ":entry:instrument:detector_"+detStr+":data_realDistX") 286 297 Wave data_realDistY = $(destPath + ":entry:instrument:detector_"+detStr+":data_realDistY") 287 288 298 289 299 // Wave cal_x = V_getDet_cal_x(folder,detStr) … … 471 481 end 472 482 483 // converts from [cm] beam center to pixels 484 // 485 // the value in pixels is written to the local data folder, NOT to disk (it is recalculated as needed) 486 // 487 Function V_ConvertBeamCtr_to_pixB(folder,detStr,destPath) 488 String folder,detStr,destPath 489 490 Wave data_realDistX = $(destPath + ":entry:instrument:detector_"+detStr+":data_realDistX") 491 Wave data_realDistY = $(destPath + ":entry:instrument:detector_"+detStr+":data_realDistY") 492 493 Variable dimX,dimY,xCtr,yCtr 494 dimX = DimSize(data_realDistX,0) 495 dimY = DimSize(data_realDistX,1) 496 497 xCtr = V_getDet_beam_center_x(folder,detStr) //these are in cm, *10 to get mm 498 yCtr = V_getDet_beam_center_y(folder,detStr) 499 500 Make/O/D/N=1 $(destPath + ":entry:instrument:detector_"+detStr+":beam_center_x_pix") 501 Make/O/D/N=1 $(destPath + ":entry:instrument:detector_"+detStr+":beam_center_y_pix") 502 WAVE x_pix = $(destPath + ":entry:instrument:detector_"+detStr+":beam_center_x_pix") 503 WAVE y_pix = $(destPath + ":entry:instrument:detector_"+detStr+":beam_center_y_pix") 504 505 506 // simple wave lookup 507 // can't use x_pix[0] = data_RealDistX(xCtr)[0] since the data has no x-scale and (xCtr) is interpreted 508 // as a point value 509 510 // 511 //xCtr, yCtr are in cm, *10 to get mm to compare to distance array 512 513 Make/O/D/N=(dimX) tmpTube 514 tmpTube = data_RealDistX[p][0] 515 FindLevel /P/Q tmpTube, xCtr*10 516 517 x_pix[0] = V_levelX 518 KillWaves/Z tmpTube 519 520 521 Make/O/D/N=(dimY) tmpTube 522 tmpTube = data_RealDistY[0][p] 523 FindLevel /P/Q tmpTube, yCtr*10 524 525 y_pix[0] = V_levelX 526 KillWaves/Z tmpTube 527 528 print "pixel ctr B = ",x_pix[0],y_pix[0] 529 530 return(0) 531 end 532 473 533 // 474 534 // … … 480 540 // -- not much is known about the "B" detector, so this 481 541 // all hinges on the non-linear corrections being done correctly for that detector 542 // 543 // Variable detCtrX, detCtrY 544 // // get the pixel center of the detector (not the beam center) 545 // detCtrX = trunc( DimSize(dataW,0)/2 ) // 546 // detCtrY = trunc( DimSize(dataW,1)/2 ) 482 547 // 483 548 // … … 593 658 Wave cal_y = V_getDet_cal_y("RAW","B") 594 659 595 cal_x = 1// mm, ignore the other 2 values596 cal_y = 1// mm660 cal_x = .34 // mm, ignore the other 2 values 661 cal_y = .34 // mm 597 662 return(0) 598 663 End -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_HDF5_RW_Utils.ipf
r1091 r1093 162 162 endfor 163 163 164 //"B" is separate 165 Wave w = V_getDetectorDataW(folder,"B") 166 Wave cal_x = V_getDet_cal_x(folder,"B") 167 Wave cal_y = V_getDet_cal_y(folder,"B") 168 169 V_NonLinearCorrection_B(folder,w,cal_x,cal_y,"B",destPath) 170 V_ConvertBeamCtr_to_mmB(folder,"B",destPath) 171 V_Detector_CalcQVals(folder,"B",destPath) 172 164 //"B" is handled separately 165 // 166 // TODO -- will "B" more naturally be defined initially in terms of pixel centers, then converted to [cm]? 167 // 168 detStr = "B" 169 Wave w = V_getDetectorDataW(folder,detStr) 170 Wave cal_x = V_getDet_cal_x(folder,detStr) 171 Wave cal_y = V_getDet_cal_y(folder,detStr) 172 173 V_NonLinearCorrection_B(folder,w,cal_x,cal_y,detStr,destPath) 174 175 if(kBCTR_CM) 176 177 Make/O/D/N=1 $(destPath + ":entry:instrument:detector_"+detStr+":beam_center_x_mm") 178 Make/O/D/N=1 $(destPath + ":entry:instrument:detector_"+detStr+":beam_center_y_mm") 179 WAVE x_mm = $(destPath + ":entry:instrument:detector_"+detStr+":beam_center_x_mm") 180 WAVE y_mm = $(destPath + ":entry:instrument:detector_"+detStr+":beam_center_y_mm") 181 x_mm[0] = V_getDet_beam_center_x(folder,detStr) * 10 // convert cm to mm 182 y_mm[0] = V_getDet_beam_center_y(folder,detStr) * 10 // convert cm to mm 183 184 // now I need to convert the beam center in mm to pixels 185 // and have some rational place to look for it... 186 V_ConvertBeamCtr_to_pixB(folder,detStr,destPath) 187 else 188 // beam center is in pixels, so use the old routine 189 V_ConvertBeamCtr_to_mmB(folder,detStr,destPath) 190 191 endif 192 V_Detector_CalcQVals(folder,detStr,destPath) 193 173 194 else 174 195 Print "Non-linear correction not done" -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_MaskUtils.ipf
r1075 r1093 127 127 128 128 PopupMenu popup_0,pos={20,50},size={109,20},proc=V_SetMaskPanelPopMenuProc,title="Detector Panel" 129 PopupMenu popup_0,mode=1,popvalue="F T",value= #"\"FL;FR;FT;FB;MR;ML;MT;MB;B;\""129 PopupMenu popup_0,mode=1,popvalue="FL",value= #"\"FL;FR;FT;FB;MR;ML;MT;MB;B;\"" 130 130 PopupMenu popup_2,pos={20,20},size={109,20},title="Data Source"//,proc=SetFldrPopMenuProc 131 131 PopupMenu popup_2,mode=1,popvalue="RAW",value= #"\"RAW;SAM;VCALC;\"" … … 147 147 // draw the correct images 148 148 //draw the detector panel 149 V_DrawPanelToMask("F T")149 V_DrawPanelToMask("FL") 150 150 151 151 // overlay the current mask 152 V_OverlayMask("F T",1)152 V_OverlayMask("FL",1) 153 153 154 154 EndMacro … … 558 558 break 559 559 case "B": 560 return(0) //just exit 560 width = trunc(nPix_X/3.2) // 561 height = trunc(nPix_Y/3.2) // 562 563 left = 20 564 top = 80 565 right = left+width 566 bottom = top+height 567 568 Print left,top,right,bottom 569 561 570 break 562 571 default: … … 751 760 Make/O/T/N=1 name = "NG3_VSANS" 752 761 NewDataFolder/O/S root:VSANS_MASK_file:entry:instrument:detector_B 753 Make/O/I/N=(150,150) data = 0 762 Make/O/I/N=(680,1656) data = 0 763 data[][0,5] = 1 764 data[][1650,1655] = 1 765 data[0,5][] = 1 766 data[675,679][] = 1 754 767 NewDataFolder/O/S root:VSANS_MASK_file:entry:instrument:detector_MR 755 768 Make/O/I/N=(48,128) data = 0 769 data[44,47][] = 1 770 data[][0,4] = 1 771 data[][123,127] = 1 756 772 NewDataFolder/O/S root:VSANS_MASK_file:entry:instrument:detector_ML 757 773 Make/O/I/N=(48,128) data = 0 774 data[0,3][] = 1 775 data[][0,4] = 1 776 data[][123,127] = 1 758 777 NewDataFolder/O/S root:VSANS_MASK_file:entry:instrument:detector_MT 759 778 Make/O/I/N=(128,48) data = 0 … … 770 789 NewDataFolder/O/S root:VSANS_MASK_file:entry:instrument:detector_FR 771 790 Make/O/I/N=(48,128) data = 0 791 data[44,47][] = 1 792 data[][0,4] = 1 793 data[][123,127] = 1 772 794 NewDataFolder/O/S root:VSANS_MASK_file:entry:instrument:detector_FL 773 795 Make/O/I/N=(48,128) data = 0 796 data[0,3][] = 1 797 data[][0,4] = 1 798 data[][123,127] = 1 774 799 NewDataFolder/O/S root:VSANS_MASK_file:entry:instrument:detector_FT 775 800 Make/O/I/N=(128,48) data = 0 … … 807 832 Make/O/T/N=1 name = "NG3_VSANS" 808 833 NewDataFolder/O/S root:Packages:NIST:VSANS:MSK:entry:instrument:detector_B 809 Make/O/I/N=(150,150) data = 0 834 Make/O/I/N=(680,1656) data = 0 835 data[][0,5] = 1 836 data[][1650,1655] = 1 837 data[0,5][] = 1 838 data[675,679][] = 1 810 839 NewDataFolder/O/S root:Packages:NIST:VSANS:MSK:entry:instrument:detector_MR 811 840 Make/O/I/N=(48,128) data = 0 841 // data[][0,3] = 1 842 data[44,47][] = 1 843 data[][0,4] = 1 844 data[][123,127] = 1 812 845 NewDataFolder/O/S root:Packages:NIST:VSANS:MSK:entry:instrument:detector_ML 813 846 Make/O/I/N=(48,128) data = 0 847 data[0,3][] = 1 848 // data[44,47][] = 1 849 data[][0,4] = 1 850 data[][123,127] = 1 814 851 NewDataFolder/O/S root:Packages:NIST:VSANS:MSK:entry:instrument:detector_MT 815 852 Make/O/I/N=(128,48) data = 0 … … 826 863 NewDataFolder/O/S root:Packages:NIST:VSANS:MSK:entry:instrument:detector_FR 827 864 Make/O/I/N=(48,128) data = 0 865 // data[][0,3] = 1 866 data[44,47][] = 1 867 data[][0,4] = 1 868 data[][123,127] = 1 828 869 NewDataFolder/O/S root:Packages:NIST:VSANS:MSK:entry:instrument:detector_FL 829 870 Make/O/I/N=(48,128) data = 0 871 data[0,3][] = 1 872 // data[44,47][] = 1 873 data[][0,4] = 1 874 data[][123,127] = 1 830 875 NewDataFolder/O/S root:Packages:NIST:VSANS:MSK:entry:instrument:detector_FT 831 876 Make/O/I/N=(128,48) data = 0 -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Menu.ipf
r1092 r1093 58 58 "Read Detetcor Panel Gap",V_ReadDet_Gap() 59 59 "Patch Detector Distance",V_PatchDet_Distance() 60 "Patch Back Detector Values",V_Patch_Back_Detector() 60 61 "-" 61 62 "Setup_VSANS_DIV_Struct" -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_PatchFiles.ipf
r1092 r1093 2417 2417 2418 2418 V_fReadDet_Gap(lo,hi) 2419 End 2419 2420 2420 2421 Proc V_PatchDet_Distance(lo,hi,dist_f,dist_m,dist_b) … … 2422 2423 2423 2424 V_fPatchDet_distance(lo,hi,dist_f,dist_m,dist_b) 2425 End 2426 2427 Proc V_Patch_Back_Detector(lo,hi) 2428 Variable lo,hi 2429 2430 V_fPatch_BackDetector(lo,hi) 2424 2431 End 2425 2432 … … 2742 2749 return(0) 2743 2750 End 2751 2752 2753 // 2754 // simple utility to patch all of the values associated with the back detector 2755 // 2756 // 2757 // 2758 // 2759 // 2760 // lo is the first file number 2761 // hi is the last file number (inclusive) 2762 // 2763 Function V_fPatch_BackDetector(lo,hi) 2764 Variable lo,hi 2765 2766 2767 Variable ii,jj 2768 String fname,detStr 2769 2770 detStr = "B" 2771 2772 Make/O/D/N=3 cal_x,cal_y 2773 cal_x[0] = VCALC_getPixSizeX(detStr)*10 // pixel size in mm VCALC_getPixSizeX(detStr) is [cm] 2774 cal_x[1] = 1 2775 cal_x[2] = 10000 2776 cal_y[0] = VCALC_getPixSizeY(detStr)*10 // pixel size in mm VCALC_getPixSizeX(detStr) is [cm] 2777 cal_y[1] = 1 2778 cal_y[2] = 10000 2779 2780 Make/O/I/N=(680,1656) tmpData=1 2781 2782 //loop over all files 2783 for(jj=lo;jj<=hi;jj+=1) 2784 fname = V_FindFileFromRunNumber(jj) 2785 if(strlen(fname) != 0) 2786 2787 // patch cal_x and cal_y 2788 V_writeDet_cal_x(fname,detStr,cal_x) 2789 V_writeDet_cal_y(fname,detStr,cal_y) 2790 2791 // patch n_pix_x and y 2792 V_writeDet_pixel_num_x(fname,detStr,680) 2793 V_writeDet_pixel_num_y(fname,detStr,1656) 2794 2795 // patch pixel size x and y [cm] 2796 V_writeDet_x_pixel_size(fname,detStr,0.034) 2797 V_writeDet_y_pixel_size(fname,detStr,0.034) 2798 2799 // patch dead time 2800 // TODO: enter a proper value here once it's actually measured 2801 V_writeDetector_deadtime_B(fname,detStr,1e-20) 2802 2803 // patch fwhm_x and y 2804 // TODO: verify the values once they are measured, and also the UNITS!!! [cm]??? 2805 V_writeDet_pixel_fwhm_x(fname,detStr,0.034) 2806 V_writeDet_pixel_fwhm_y(fname,detStr,0.034) 2807 2808 // patch beam center (nominal x,y) [cm] values 2809 V_writeDet_beam_center_x(fname,detStr,11) 2810 V_writeDet_beam_center_y(fname,detStr,25) 2811 2812 // fake data 2813 V_writeDetectorData(fname,detStr,tmpData) 2814 2815 2816 else 2817 printf "run number %d not found\r",jj 2818 endif 2819 endfor 2820 2821 KillWaves/Z cal_x,cal_y,tmpData 2822 return(0) 2823 End -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_RAW_Data_Panel.ipf
r1083 r1093 151 151 DrawRect 320,70,430,160 152 152 SetDrawEnv linethick= 2,dash= 1,fillpat= 0 153 DrawRect 440,70,5 50,160153 DrawRect 440,70,535,160 154 154 155 155 SetDrawEnv fsize= 18 … … 548 548 ModifyImage/W=VSANS_Data#det_panelsB ''#0 ctabAutoscale=0,lookup= LookupWave 549 549 550 // make the plot square 551 ModifyGraph/W=VSANS_Data#det_panelsB width={Aspect,1} 550 // // make the plot square 551 // ModifyGraph/W=VSANS_Data#det_panelsB width={Aspect,1} 552 // match the aspect ratio of the data 553 ModifyGraph/W=VSANS_Data#det_panelsB width={Aspect,0.41} //680/1656 = 0.41 552 554 553 555 SetActiveSubWindow VSANS_Data#det_panelsB -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Testing_Data_Procs.ipf
r1081 r1093 55 55 V_writeDet_distance(fileName,detStr,val) 56 56 57 val = VCALC_getTopBottomSDDSetback(detStr) *10 //val is in mm, as for data file57 val = VCALC_getTopBottomSDDSetback(detStr) //val is in cm, as for data file 58 58 if(val != 0) 59 59 V_writeDet_TBSetback(fileName,detStr,val) … … 86 86 if(cmpstr(detStr,"B") == 0) 87 87 //always write out the center of the detector since this is dummy data 88 V_writeDet_beam_center_x(fileName,detStr,V_getDet_beam_center_x("VCALC",detStr)) 89 V_writeDet_beam_center_y(fileName,detStr,V_getDet_beam_center_y("VCALC",detStr)) 88 V_writeDet_beam_center_x(fileName,detStr,V_getDet_beam_center_x("VCALC",detStr)/10) //write out [cm] 89 V_writeDet_beam_center_y(fileName,detStr,V_getDet_beam_center_y("VCALC",detStr)/10) 90 91 // write out the number of pixels x and y 92 // patch n_pix_x and y 93 V_writeDet_pixel_num_x(fileName,detStr,V_getDet_pixel_num_x("VCALC",detStr)) 94 V_writeDet_pixel_num_y(fileName,detStr,V_getDet_pixel_num_y("VCALC",detStr)) 90 95 endif 91 96 -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_WorkFolderUtils.ipf
r1077 r1093 593 593 594 594 //"B" is separate 595 Wave w = V_getDetectorDataW(fname,"B") 596 Wave cal_x = V_getDet_cal_x(fname,"B") 597 Wave cal_y = V_getDet_cal_y(fname,"B") 598 V_NonLinearCorrection_B(fname,w,cal_x,cal_y,"B",destPath) 599 V_ConvertBeamCtr_to_mmB(fname,"B",destPath) 600 V_Detector_CalcQVals(fname,"B",destPath) 595 detStr = "B" 596 Wave w = V_getDetectorDataW(fname,detStr) 597 Wave cal_x = V_getDet_cal_x(fname,detStr) 598 Wave cal_y = V_getDet_cal_y(fname,detStr) 599 600 V_NonLinearCorrection_B(fname,w,cal_x,cal_y,detStr,destPath) 601 602 if(kBCTR_CM) 603 604 Make/O/D/N=1 $(destPath + ":entry:instrument:detector_"+detStr+":beam_center_x_mm") 605 Make/O/D/N=1 $(destPath + ":entry:instrument:detector_"+detStr+":beam_center_y_mm") 606 WAVE x_mm = $(destPath + ":entry:instrument:detector_"+detStr+":beam_center_x_mm") 607 WAVE y_mm = $(destPath + ":entry:instrument:detector_"+detStr+":beam_center_y_mm") 608 x_mm[0] = V_getDet_beam_center_x(fname,detStr) * 10 // convert cm to mm 609 y_mm[0] = V_getDet_beam_center_y(fname,detStr) * 10 // convert cm to mm 610 611 // now I need to convert the beam center in mm to pixels 612 // and have some rational place to look for it... 613 V_ConvertBeamCtr_to_pixB(fname,detStr,destPath) 614 else 615 // beam center is in pixels, so use the old routine 616 V_ConvertBeamCtr_to_mmB(fname,detStr,destPath) 617 618 endif 619 V_Detector_CalcQVals(fname,detStr,destPath) 601 620 602 621 else
Note: See TracChangeset
for help on using the changeset viewer.