Ignore:
Timestamp:
Jun 30, 2017 12:28:55 PM (6 years ago)
Author:
srkline
Message:

cleaning up a lot of the TODO items from the code.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_EventModeProcessing.ipf

    r1047 r1050  
    4949 
    5050 
    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 
    5356// 
    5457Constant XBINS=48 
     
    6366 
    6467 
     68// Initialization of the VSANS event mode panel 
    6569Proc V_Show_Event_Panel() 
    6670        DoWindow/F VSANS_EventModePanel 
     
    7175End 
    7276 
    73 // TODO: 
     77//  
    7478//  x- need an index table with the tube <-> panel correspondence 
    7579//    NO, per Phil, the tube numbering is sequential: 
     
    127131 
    128132 
    129 // for decimation 
    130         Variable/G root:Packages:NIST:VSANS:Event:gEventFileTooLarge = 150              // 150 MB considered too large 
     133// 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 
    131135        Variable/G root:Packages:NIST:VSANS:Event:gDecimation = 100 
    132136        Variable/G root:Packages:NIST:VSANS:Event:gEvent_t_longest_decimated = 0 
    133137 
    134 // for large file splitting 
     138// for large file splitting (unused) 
    135139        String/G root:Packages:NIST:VSANS:Event:gSplitFileList = ""             // a list of the file names as split 
    136140         
    137 // for editing 
     141// for editing (unused) 
    138142        Variable/G root:Packages:NIST:VSANS:Event:gStepTolerance = 5            // 5 = # of standard deviations from mean. See PutCursorsAtStep() 
    139143         
     
    142146 
    143147 
    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// 
    145153Proc VSANS_EventModePanel() 
    146154        PauseUpdate; Silent 1           // building window... 
     
    191199        Button button1,pos={389,103},size={120,20},fSize=12,proc=V_ProcessEventLog_Button,title="Bin Event Data" 
    192200 
    193  
     201// NEW FOR VSANS 
    194202        Button button21,pos={580,70},size={120,20},proc=V_SplitToPanels_Button,title="Split to Panels" 
    195203        Button button22,pos={580,90},size={120,20},proc=V_GraphPanels_Button,title="Show Panels" 
     
    240248EndMacro 
    241249 
    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// 
    243254Function V_SplitToPanels_Button(ba) : ButtonControl 
    244255        STRUCT WMButtonAction &ba 
     
    257268End 
    258269 
     270 
     271// 
     272// after splitting the data into the 4 panels, draws a simple graph to display the panels 
     273// 
    259274Function V_GraphPanels_Button(ba) : ButtonControl 
    260275        STRUCT WMButtonAction &ba 
     
    272287        return 0 
    273288End 
     289 
    274290 
    275291// mode selector 
     
    477493end 
    478494 
     495// 
    479496// 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 
    480502// 
    481503Function V_Osc_ProcessEventLog(ctrlName) 
     
    615637// - since I don't know if I've sorted or un-sorted. Osc mode always forces a re-sort and a re-index 
    616638// 
     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// 
    617645Function V_Stream_ProcessEventLog(ctrlName) 
    618646        String ctrlName 
     
    803831        return(0)        
    804832End 
     833 
    805834 
    806835// TODO 
     
    877906 
    878907 
    879 // TODO: 
    880 // 
     908//  
     909// -- The "file too large" check has currently been set to 1.5 GB 
    881910// 
    882911//       
     
    887916        Variable err=0 
    888917        Variable fileref,totBytes 
    889         NVAR fileTooLarge = root:Packages:NIST:VSANS:Event:gEventFileTooLarge           //limit load to 150MB 
     918        NVAR fileTooLarge = root:Packages:NIST:VSANS:Event:gEventFileTooLarge           //limit load to 1500MB 
    890919 
    891920        SVAR filename = root:Packages:NIST:VSANS:Event:gEvent_logfile 
     
    910939        endif 
    911940 
    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 
    913943/// Abort if the files are too large 
    914 //      Open/R fileref as fileName 
    915 //              FStatus fileref 
    916 //      Close fileref 
    917 // 
    918 //      totBytes = V_logEOF/1e6         //in MB 
    919 //      if(totBytes > fileTooLarge) 
    920 //              sprintf abortStr,"File is %g MB, larger than the limit of %g MB. Split and Decimate.",totBytes,fileTooLarge 
    921 //              Abort abortStr 
    922 //      endif 
    923 //       
    924 //      Print "TotalBytes = ",totBytes 
     944        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 
    925955         
    926956 
     
    936966// assign to the proper panels 
    937967 
    938 // TODO: 
    939 // x- (YES - this is MUCH faster) what if I do the JointHistogram first, then break out the blocks of the  
    940 //  3D sliced data into the individual panels. Then the sort operation could be skipped, 
    941 //  since it would implicitly be done during the histogram operation 
     968//  
     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 
    942972// x- go back and redimension as needed to get the 128 x 192 histogram to work 
    943973// x- MatrixOp or a wave assignemt should be able to break up the 3D 
     
    947977                Duplicate/O eventTime timePt 
    948978 
    949 // TODO: 
     979//  
    950980// x- for processing, initially treat all of the tubes along x, and 128 pixels along y 
    951981//   panels can be transposed later as needed to get the orientation correct 
     
    962992//s_toc() 
    963993 
    964  
    965994// 
    966995// switch the "active" panel to the selected group (1-4) (5 concatenates them all together) 
     
    969998// and redimension them to be sure that they are double precision 
    970999// 
    971  
     1000// 
    9721001//      V_SwitchTubeGroup(1) 
    973  
    974 //       
     1002// 
     1003//       
     1004 
    9751005//tic() 
    9761006        Wave timePt=timePt 
     
    9811011         
    9821012        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         
    9831015///// 
    9841016// now do a little processing of the times based on the type of data 
     
    10041036// MODE_TISANE 
    10051037 
     1038 
    10061039// MODE_TOF 
    10071040        if(mode == MODE_TOF)            // TOF mode - don't adjust the times, we get periodic t0 to reset t=0 
     
    10281061// -- MUCH faster to count the number of lines to remove, then delete (N) 
    10291062// rather then delete them one-by-one in the do-loop 
     1063// 
    10301064Function V_CleanupTimes(xLoc,yLoc,timePt) 
    10311065        Wave xLoc,yLoc,timePt 
     
    10761110 
    10771111 
    1078 // TODO (DONE) 
     1112// (DONE) 
    10791113// this "fails" for data sets that have 3 or 4 slices, as the ModifyImage command 
    10801114// interprets the data as being RGB - and so does nothing. 
     
    11371171//  for 64-bit values: 
    11381172// http://calc.penjee.com 
     1173// 
     1174// 
    11391175// 
    11401176//              K0 = 536870912 
Note: See TracChangeset for help on using the changeset viewer.