- Timestamp:
- Jun 6, 2017 2:19:21 PM (6 years ago)
- Location:
- sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_BeamCenter.ipf
r1041 r1043 54 54 Button button_1,pos={615,20},size={80,20},proc=V_DetFitButtonProc,title="Do Fit" 55 55 Button button_2,pos={744,20},size={80,20},proc=V_DetFitHelpButtonProc,title="Help" 56 Button button_3,pos={ 615,400},size={110,20},proc=V_WriteCtrButtonProc,title="WriteCenters"57 Button button_4,pos={ 730,400},size={110,20},proc=V_CtrTableButtonProc,title="Ctr table"56 Button button_3,pos={730,400},size={110,20},proc=V_CopyCtrButtonProc,title="Copy Centers" 57 Button button_4,pos={615,400},size={110,20},proc=V_CtrTableButtonProc,title="Ctr table" 58 58 Button button_5,pos={730,440},size={110,20},proc=V_WriteCtrTableButtonProc,title="Write table" 59 59 … … 441 441 // TODO -- currently hard-wired for coefficients from the only fit function 442 442 // 443 // only copies the center values to the local folder (then read back in by clicking "Ctr Table") 444 // 443 445 // -- will need to recalc mm center AND q-values 444 Function V_ WriteCtrButtonProc(ba) : ButtonControl446 Function V_CopyCtrButtonProc(ba) : ButtonControl 445 447 STRUCT WMButtonAction &ba 446 448 … … 459 461 V_putDet_beam_center_y(fname,detStr,coefW[10]) 460 462 461 DoAlert 0, "-- will need to recalc mm center AND q-values" 463 // DoAlert 0, "-- will need to recalc mm center AND q-values" 464 465 V_BCtrTable() //reads the values back in 462 466 463 467 break … … 717 721 Function V_BeamCtr_WriteTable() 718 722 719 DoAlert 0,"this currently only writes pix values locally, not mm, and not to files on disk" 723 Variable runNumber 724 Prompt runNumber, "enter the run number:" 725 DoPrompt "Pick file to write to",runNumber 726 If(V_flag==1) 727 return(0) 728 endif 720 729 721 730 String folder … … 728 737 Wave/T panelW = root:PanelW 729 738 730 ControlInfo popup_2 731 folder = S_Value 732 733 fname = folder 739 740 fname = V_FindFileFromRunNumber(runNumber) 741 734 742 for(ii=0;ii<ItemsInList(ksDetectorListAll);ii+=1) 735 743 // detStr = StringFromList(ii, ksDetectorListAll, ";") 736 744 detStr = panelW[ii] 737 V_ putDet_beam_center_x(fname,detStr,xCtr_pix[ii])738 V_ putDet_beam_center_y(fname,detStr,yCtr_pix[ii])745 V_writeDet_beam_center_x(fname,detStr,xCtr_pix[ii]) 746 V_writeDet_beam_center_y(fname,detStr,yCtr_pix[ii]) 739 747 740 748 // TODO -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_BroadPeak_Pix_2D.ipf
r1041 r1043 226 226 // base the scaling on the xSize 227 227 228 // *** NOTE *** 229 // "qval" here is NOT q 230 // qval is a real space distance in the units of PIXELS. Not mm, not q, PIXELS 231 // Don't put any meaning in the fitted values, it's simply a functional shape 232 228 233 ratio = (xSize/ySize)^2 229 234 if(ratio > 1) -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_DIVUtils.ipf
r1033 r1043 3 3 // 4 4 // ******** 5 // TODO -- this is only a fake DIV file. need to identify how to generate a real DIV file 6 // for the different detectors, and how to fill it into a file. ProDIV for SANS may be a good 7 // starting point, or it may be cumbersome. Not sure how it will be measured in practice 8 // on VSANS. 5 // TODO -- this is an incomplete DIV file. need to identify how to generate a real DIV file 6 // for the different detectors, and how to fill it into a file. 7 // Not sure how it will be measured in practice on VSANS. 9 8 // 10 9 // JAN 2017 … … 26 25 // the high angle issues. 27 26 // 28 // 29 27 // -- what about the T/B panels? Since a large chunk of these detectors may be obscured, 28 // the normalization will be way off -- and the "active" area will end up much larger 29 // than it should be - since the wings of the detector are mostly zero... 30 // 31 // 30 32 31 33 … … 40 42 41 43 42 43 44 45 46 //works on the data in "type" folder (expecting data to be reduced to the COR level) 47 //sums all of the data, and normalizes by the number of cells (=pixelX*pixelY) 48 // calling procedure must make sure that the folder is on linear scale FIRST 44 // Basic function: 45 // -- first, reduce the data (to the COR level?) 46 // -- next, V_NormalizeDIV() 47 // -- then Setup_VSANS_DIV_Struct() 48 // -- next, V_CopyDIVToSave() 49 // -- last, Save_VSANS_DIV_Nexus() 50 51 52 53 54 // 55 // Normalizes each panel independently 56 // Normalizes in-place, replacing whatever was there 57 // 58 // type is the work folder where the (? corrected) data is currently 59 // 60 // TODO 61 // -- data should be copied to some alternate work folder before this step 62 // 49 63 Function V_NormalizeDIV(type) 50 64 String type 51 52 WAVE data=$("root:Packages:NIST:"+type+":data") 53 WAVE data_lin=$("root:Packages:NIST:"+type+":linear_data") 54 WAVE data_err=$("root:Packages:NIST:"+type+":linear_data_error") 55 56 Variable totCts=sum(data,Inf,-Inf) //sum all of the data 57 NVAR pixelX = root:myGlobals:gNPixelsX 58 NVAR pixelY = root:myGlobals:gNPixelsY 59 60 61 data /= totCts 62 data *= pixelX*pixelY 63 64 data_lin /= totCts 65 data_lin *= pixelX*pixelY 66 67 data_err /= totCts 68 data_err *= pixelX*pixelY 69 65 66 Variable ii,totCts,pixelX,pixelY 67 String detStr 68 69 for(ii=0;ii<ItemsInList(ksDetectorListAll);ii+=1) 70 detStr = StringFromList(ii, ksDetectorListAll, ";") 71 Wave w = V_getDetectorDataW(type,detStr) 72 Wave w_err = V_getDetectorDataErrW(type,detStr) 73 pixelX = V_getDet_pixel_num_x(type,detStr) 74 pixelY = V_getDet_pixel_num_y(type,detStr) 75 76 totCts=sum(w,Inf,-Inf) //sum all of the data 77 78 w /= totCts 79 w *= pixelX*pixelY 80 81 w_err /= totCts 82 w_err *= pixelX*pixelY 83 84 endfor 85 70 86 return(0) 71 87 End 72 88 73 89 90 91 Function V_CopyDIVToSave(type) 92 String type 93 94 Variable ii,totCts,pixelX,pixelY 95 String detStr 96 String topath = "root:VSANS_DIV_file:entry:instrument:detector_" 97 String fromPath = "root:Packages:NIST:VSANS:"+type+":entry:instrument:detector_" 98 99 100 for(ii=0;ii<ItemsInList(ksDetectorListAll);ii+=1) 101 detStr = StringFromList(ii, ksDetectorListAll, ";") 102 103 Duplicate/O $(fromPath+detStr+":data") $(toPath+detStr+":data") 104 Duplicate/O $(fromPath+detStr+":linear_data_error") $(toPath+detStr+":linear_data_error") 105 106 endfor 107 108 return(0) 109 End 74 110 75 111 -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_MaskUtils.ipf
r1025 r1043 677 677 SetDataFolder root:VSANS_MASK_file:entry 678 678 Wave/T title = title 679 title = "This is a custom MASK file for VSANS "679 title = "This is a custom MASK file for VSANS: VSANS_MASK" 680 680 SetDataFolder root: 681 681 … … 730 730 731 731 NewDataFolder/O/S root:VSANS_MASK_file:entry 732 Make/O/T/N=1 title = "This is a fake MASK file for VSANS"732 Make/O/T/N=1 title = "This is a MASK file for VSANS: VSANS_MASK" 733 733 Make/O/T/N=1 start_date = "2015-02-28T08:15:30-5:00" 734 734 NewDataFolder/O/S root:VSANS_MASK_file:entry:instrument -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_MultipleReduce.ipf
r1042 r1043 87 87 Button ReduceOneButton,pos={3,98},size={180,20},proc=V_ReduceTopPopupFile,title="Reduce Top File in Popup" 88 88 Button ReduceOneButton,help={"This will reduce TOP files in the popup list, not all of the files."} 89 Button DoneButton,pos={2 80,128},size={110,20},proc=V_MRDoneButtonProc,title="Done Reducing"89 Button DoneButton,pos={290,128},size={110,20},proc=V_MRDoneButtonProc,title="Done Reducing" 90 90 Button DoneButton,help={"When done reducing files, this will close this control panel."} 91 91 Button cat_short,pos={310,72},size={90,20},proc=V_ShowCatShort_MRED,title="File Catalog" -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Protocol_Reduction.ipf
r1042 r1043 916 916 // endfor 917 917 918 String match="MASK" // this is part of the title of a VSANS MASK file 918 // String match="MASK" // this is part of the title of a VSANS MASK file 919 String match="VSANS_MASK" // this is part of the title of a VSANS MASK file 919 920 for(ii=0;ii<num;ii+=1) 920 921 item=StringFromList(ii, newList , ";") … … 1067 1068 DrawLine 3,350,301,350 1068 1069 DrawLine 3,445,301,445 1069 DrawLine 3,513,30 3,5131070 DrawLine 3,513,301,513 1070 1071 DrawLine 3,396,301,396 1071 1072 1072 1073 // 1073 Button button_help,pos={ 260,2},size={25,20},proc=V_ShowProtoHelp,title="?"1074 Button button_help,pos={300,2},size={25,20},proc=V_ShowProtoHelp,title="?" 1074 1075 Button button_help,help={"Show the help file for setting up a reduction protocol"} 1075 1076 Button button_quest,pos={20,2},size={150,20},proc=V_ProtocolQuestionnaire,title="Questions" -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Test_RAW_Panel.ipf
r1042 r1043 172 172 // Button button_tagFile,pos={720,412},size={70,20},proc=V_TagFileButtonProc,title="Tag File" 173 173 // Button button_tagFile,disable=2 174 Button button_saveIQ,pos={603,412},size={ 70,20},proc=V_SaveIQ_ButtonProc,title="Save I(Q)"175 Button button_BeamCtr,pos={603,450},size={ 70,20},proc=V_BeamCtrButtonProc,title="Beam Ctr"174 Button button_saveIQ,pos={603,412},size={120,20},proc=V_SaveIQ_ButtonProc,title="Save I(Q) as ITX" 175 Button button_BeamCtr,pos={603,450},size={110,20},proc=V_BeamCtrButtonProc,title="Beam Center" 176 176 Button button_SpreadPanels,pos={603,488},size={100,20},proc=V_SpreadPanelButtonProc,title="Spread Panels" 177 177 Button button_RestorePanels,pos={603,526},size={100,20},proc=V_RestorePanelButtonProc,title="Restore Panels"
Note: See TracChangeset
for help on using the changeset viewer.