Changeset 1045


Ignore:
Timestamp:
Jun 9, 2017 2:33:53 PM (5 years ago)
Author:
srkline
Message:

add a truncated version of the SANS event mode panel. The loader has been altered to load my best guess of the VSANS data file. The histogramming works, and this will be needed initially at VSANS for TOF calibration.

The binning to the 4 detector panels will be much different than for SANS, decimation, editing, etc. are hopefully not necessary for VSANS, and I do not have an XOP. So there is a lot to change here to get ready for VSANS, but it compiles.

Location:
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS
Files:
1 added
3 edited

Legend:

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

    r1041 r1045  
    9696#include "V_MultipleReduce" 
    9797#include "V_VSANS_Event_Testing" 
     98#include "V_EventModeProcessing" 
     99 
     100 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_MainPanel.ipf

    r1042 r1045  
    292292        String ctrlName 
    293293         
    294         if(exists("Show_Event_Panel")==0) 
     294        if(exists("V_Show_Event_Panel")==0) 
    295295                // procedure file was not loaded 
    296296                DoAlert 0,"Only test procedures exist. See V_VSANS_Event_Testing.ipf" 
    297297        else 
    298                 Show_Event_Panel() 
     298                V_Show_Event_Panel() 
    299299        endif 
    300300         
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_VSANS_Event_Testing.ipf

    r1042 r1045  
    3939// big of an issue. 
    4040// 
    41 // -- don't see the struct idea working out. only in read c-code if needed 
     41// -- don't see the struct idea working out. only in real c-code if needed 
    4242// 
    4343// -- need to add detector binning to the decoding, to place the counts within the correct panels 
     
    170170End 
    171171 
    172 / 
     172// 
    173173// tested up to num=1e8 successfully 
    174174// 
     
    353353        GBLoadWave/B/T={192,192}/W=1/S=22 fname 
    354354         
     355        Duplicate/O $(StringFromList(0,S_waveNames)) V_Events 
     356        KillWaves/Z $(StringFromList(0,S_waveNames)) 
    355357s_toc()  
    356358         
    357359        return(0) 
    358360End 
     361 
     362// 
     363// tested up to num=1e8 successfully 
     364// 
     365Function V_MakeFakeEventWave_TOF() 
     366 
     367        Variable num,ii,jj,delayTime,numRepeat,std 
     368 
     369 
     370        num = 1000 
     371        numRepeat = 100 
     372         
     373        delayTime = 30          //microseconds 
     374        std = 5                                 //std deviation, microseconds 
     375         
     376//      // /l=64 bit, /U=unsigned 
     377        Make/O/L/U/N=(num*numRepeat) eventWave 
     378        eventWave = 0 
     379         
     380        Make/O/D/N=(num) arrival 
     381         
     382        // for each 64-bit value: 
     383        // byte 1: tube index [0,191] 
     384        // byte 2: pixel value [0,127] 
     385        // bytes 3-8 (= 6 bytes): time stamp in resolution unit 
     386         
     387        uint64 i64_num,b1,b2,b3,b4,b5,b6,b7,b8 
     388        uint64 i64_ticks,i64_start 
     389         
     390//      i64_start = ticks 
     391        i64_ticks = 0 
     392        for(jj=0;jj<numRepeat;jj+=1) 
     393                arrival = delayTime + gnoise(std) 
     394                sort arrival,arrival 
     395                arrival *= 1000         //milliseconds now 
     396         
     397                for(ii=0;ii<num;ii+=1) 
     398        //              sleep/T/C=-1 1                  // 6 ticks, approx 0.1 s (without the delay, the loop is too fast) 
     399                        b1 = trunc(abs(enoise(192)))            //since truncated, need 192 as highest random to give 191 after trunc 
     400                        b2 = trunc(abs(enoise(128)))            // same here, to get results [0,127] 
     401                         
     402                        i64_ticks = trunc(arrival[ii]) 
     403                         
     404                        b2 = b2 << 48 
     405                        b1 = b1 << 56 
     406                 
     407                        i64_num = b1+b2+i64_ticks 
     408                        eventWave[jj*num+ii] = i64_num 
     409                endfor 
     410                 
     411        endfor 
     412 
     413        return(0) 
     414End 
Note: See TracChangeset for help on using the changeset viewer.