- Timestamp:
- Apr 6, 2018 9:06:40 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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
Note: See TracChangeset
for help on using the changeset viewer.