- Timestamp:
- Jun 30, 2017 12:28:55 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_EventModeProcessing.ipf
r1047 r1050 49 49 50 50 51 // TODO 52 // x- these dimensions are hard-wired (OK) 51 // 52 // x- these dimensions are hard-wired (OK for now, will need to be additional definitions for Back detector) 53 // 54 // XBINS is for an individual panel 55 // NTUBES is the total number of tubes = (4)(48)=192 53 56 // 54 57 Constant XBINS=48 … … 63 66 64 67 68 // Initialization of the VSANS event mode panel 65 69 Proc V_Show_Event_Panel() 66 70 DoWindow/F VSANS_EventModePanel … … 71 75 End 72 76 73 // TODO:77 // 74 78 // x- need an index table with the tube <-> panel correspondence 75 79 // NO, per Phil, the tube numbering is sequential: … … 127 131 128 132 129 // for decimation 130 Variable/G root:Packages:NIST:VSANS:Event:gEventFileTooLarge = 150 // 150 MB considered too large133 // for decimation (not used for VSANS - may be added back in the future 134 Variable/G root:Packages:NIST:VSANS:Event:gEventFileTooLarge = 1500 // 1500 MB considered too large 131 135 Variable/G root:Packages:NIST:VSANS:Event:gDecimation = 100 132 136 Variable/G root:Packages:NIST:VSANS:Event:gEvent_t_longest_decimated = 0 133 137 134 // for large file splitting 138 // for large file splitting (unused) 135 139 String/G root:Packages:NIST:VSANS:Event:gSplitFileList = "" // a list of the file names as split 136 140 137 // for editing 141 // for editing (unused) 138 142 Variable/G root:Packages:NIST:VSANS:Event:gStepTolerance = 5 // 5 = # of standard deviations from mean. See PutCursorsAtStep() 139 143 … … 142 146 143 147 144 148 // 149 // the main panel for VSANS Event mode 150 // -- a duplicate of the SANS panel, with the functions I'm not using disabled. 151 // could be added back in the future 152 // 145 153 Proc VSANS_EventModePanel() 146 154 PauseUpdate; Silent 1 // building window... … … 191 199 Button button1,pos={389,103},size={120,20},fSize=12,proc=V_ProcessEventLog_Button,title="Bin Event Data" 192 200 193 201 // NEW FOR VSANS 194 202 Button button21,pos={580,70},size={120,20},proc=V_SplitToPanels_Button,title="Split to Panels" 195 203 Button button22,pos={580,90},size={120,20},proc=V_GraphPanels_Button,title="Show Panels" … … 240 248 EndMacro 241 249 242 250 // 251 // takes the data that is loaded and binned as a fake 252 // (192 x 128) panel to the four LRTB panels, each with 48 tubes 253 // 243 254 Function V_SplitToPanels_Button(ba) : ButtonControl 244 255 STRUCT WMButtonAction &ba … … 257 268 End 258 269 270 271 // 272 // after splitting the data into the 4 panels, draws a simple graph to display the panels 273 // 259 274 Function V_GraphPanels_Button(ba) : ButtonControl 260 275 STRUCT WMButtonAction &ba … … 272 287 return 0 273 288 End 289 274 290 275 291 // mode selector … … 477 493 end 478 494 495 // 479 496 // for oscillatory mode 497 // 498 // Allocate the space for the data as if it was a single 192 x 128 pixel array. 499 // The (4) 48-tube panels will be split out later. this means that as defined, 500 // XBINS is for an individual panel 501 // NTUBES is the total number of tubes = (4)(48)=192 480 502 // 481 503 Function V_Osc_ProcessEventLog(ctrlName) … … 615 637 // - since I don't know if I've sorted or un-sorted. Osc mode always forces a re-sort and a re-index 616 638 // 639 // 640 // Allocate the space for the data as if it was a single 192 x 128 pixel array. 641 // The (4) 48-tube panels will be split out later. this means that as defined, 642 // XBINS is for an individual panel 643 // NTUBES is the total number of tubes = (4)(48)=192 644 // 617 645 Function V_Stream_ProcessEventLog(ctrlName) 618 646 String ctrlName … … 803 831 return(0) 804 832 End 833 805 834 806 835 // TODO … … 877 906 878 907 879 // TODO:880 // 908 // 909 // -- The "file too large" check has currently been set to 1.5 GB 881 910 // 882 911 // … … 887 916 Variable err=0 888 917 Variable fileref,totBytes 889 NVAR fileTooLarge = root:Packages:NIST:VSANS:Event:gEventFileTooLarge //limit load to 150 MB918 NVAR fileTooLarge = root:Packages:NIST:VSANS:Event:gEventFileTooLarge //limit load to 1500MB 890 919 891 920 SVAR filename = root:Packages:NIST:VSANS:Event:gEvent_logfile … … 910 939 endif 911 940 912 // TODO - decide if I want (or need) to keep this 941 // keep this , but set to 1.5 GB 942 // since I'm now in 64-bit space 913 943 /// Abort if the files are too large 914 //Open/R fileref as fileName915 //FStatus fileref916 //Close fileref917 // 918 //totBytes = V_logEOF/1e6 //in MB919 //if(totBytes > fileTooLarge)920 //sprintf abortStr,"File is %g MB, larger than the limit of %g MB. Split and Decimate.",totBytes,fileTooLarge921 //Abort abortStr922 //endif923 // 924 // Print "TotalBytes= ",totBytes944 Open/R fileref as fileName 945 FStatus fileref 946 Close fileref 947 // 948 totBytes = V_logEOF/1e6 //in MB 949 if(totBytes > fileTooLarge) 950 sprintf abortStr,"File is %g MB, larger than the limit of %g MB. Split and Decimate.",totBytes,fileTooLarge 951 Abort abortStr 952 endif 953 // 954 Print "TotalBytes (MB) = ",totBytes 925 955 926 956 … … 936 966 // assign to the proper panels 937 967 938 // TODO:939 // x- (YES - this is MUCH faster) whatif I do the JointHistogram first, then break out the blocks of the940 // 3D sliced data into the individual panels. Then the sort operation c ouldbe skipped,941 // since it wouldimplicitly be done during the histogram operation968 // 969 // x- (YES - this is MUCH faster) if I do the JointHistogram first, then break out the blocks of the 970 // 3D sliced data into the individual panels. Then the sort operation can be skipped, 971 // since it is implicitly be done during the histogram operation 942 972 // x- go back and redimension as needed to get the 128 x 192 histogram to work 943 973 // x- MatrixOp or a wave assignemt should be able to break up the 3D … … 947 977 Duplicate/O eventTime timePt 948 978 949 // TODO:979 // 950 980 // x- for processing, initially treat all of the tubes along x, and 128 pixels along y 951 981 // panels can be transposed later as needed to get the orientation correct … … 962 992 //s_toc() 963 993 964 965 994 // 966 995 // switch the "active" panel to the selected group (1-4) (5 concatenates them all together) … … 969 998 // and redimension them to be sure that they are double precision 970 999 // 971 1000 // 972 1001 // V_SwitchTubeGroup(1) 973 974 // 1002 // 1003 // 1004 975 1005 //tic() 976 1006 Wave timePt=timePt … … 981 1011 982 1012 NVAR gResol = root:Packages:NIST:VSANS:Event:gResol //timeStep in clock frequency (Hz) 1013 Printf "Time Step = 1/Frequency (ns) = %g\r",(1/gResol)*1e9 1014 983 1015 ///// 984 1016 // now do a little processing of the times based on the type of data … … 1004 1036 // MODE_TISANE 1005 1037 1038 1006 1039 // MODE_TOF 1007 1040 if(mode == MODE_TOF) // TOF mode - don't adjust the times, we get periodic t0 to reset t=0 … … 1028 1061 // -- MUCH faster to count the number of lines to remove, then delete (N) 1029 1062 // rather then delete them one-by-one in the do-loop 1063 // 1030 1064 Function V_CleanupTimes(xLoc,yLoc,timePt) 1031 1065 Wave xLoc,yLoc,timePt … … 1076 1110 1077 1111 1078 // TODO(DONE)1112 // (DONE) 1079 1113 // this "fails" for data sets that have 3 or 4 slices, as the ModifyImage command 1080 1114 // interprets the data as being RGB - and so does nothing. … … 1137 1171 // for 64-bit values: 1138 1172 // http://calc.penjee.com 1173 // 1174 // 1139 1175 // 1140 1176 // K0 = 536870912
Note: See TracChangeset
for help on using the changeset viewer.