Ignore:
Timestamp:
Mar 28, 2019 11:12:06 AM (4 years ago)
Author:
srkline
Message:

1) speed improvement (2x + faster) in recalculation of VCALC configuration by using multithreading where possible.

2) Important bug fix for USANS to account for data collected in q-values, where each point is collected for a different lenght of time. This change had unintended consequences for normalization and dead time corrections.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/USANS/BT5_Loader.ipf

    r1133 r1137  
    3737        Make/O/D/N=(num) $(USANSFolder+":"+type+":MonCts") 
    3838        Make/O/D/N=(num) $(USANSFolder+":"+type+":TransCts") 
     39        Make/O/D/N=(num) $(USANSFolder+":"+type+":CtTime") 
    3940        Wave Angle = $(USANSFolder+":"+type+":Angle") 
    4041        Wave DetCts = $(USANSFolder+":"+type+":DetCts") 
     
    4243        Wave MonCts = $(USANSFolder+":"+type+":MonCts") 
    4344        Wave TransCts = $(USANSFolder+":"+type+":TransCts") 
     45        Wave CtTime = $(USANSFolder+":"+type+":CtTime") 
    4446         
    4547        Open/R refNum as fname          //if fname is "", a dialog will be presented 
     
    8587         
    8688        Variable useNewDataFormat 
    87  
     89        NVAR    gRawUSANSisQvalues = root:Packages:NIST:gRawUSANSisQvalues 
     90         
     91         
    8892// test by date 
    8993        Variable thisFileSecs 
     
    98102         
    99103        USANS_DetectorDeadtime(filedt,MainDeadTime,TransDeadTime) 
     104         
     105//      Print "Overriding Transmission DeadTime, set to 1e-9 s" 
     106//      TransDeadTime = 1e-9 
     107//      MainDeadTime = 1e-9 
     108         
    100109         
    101110        //skip line 2 
     
    119128                        break                                                   // Hit blank line. End of data in the file. 
    120129                endif 
     130                //1st line of pair 
    121131                sscanf buffer,"%g%g%g%g%g",v1,v2,v3,v4,v5               // 5 values here now 
    122132                angle[numlinesloaded] = v1              //[0] is the ANGLE 
     133                if(gRawUSANSisQvalues==1) 
     134                        // in this mode, each data point is collected for a different time 
     135                        countTime = v2 * 60             // convert MIN to seconds 
     136                endif 
     137                 
    123138                 
    124139                FReadLine refNum,buffer //assume a 2nd line is there, w/16 values 
     
    152167                endif 
    153168                 
     169                CtTime[numlinesloaded] = countTime 
     170                 
    154171                numlinesloaded += 1             //2 lines in file read, one "real" line of data 
    155172        while(1) 
     
    158175        //Print "numlines = ",numlinesloaded 
    159176        //trim the waves to the correct number of points 
    160         Redimension/N=(numlinesloaded) Angle,MonCts,DetCts,TransCts,ErrDetCts 
     177        Redimension/N=(numlinesloaded) Angle,MonCts,DetCts,TransCts,ErrDetCts,CtTime 
    161178         
    162179        //remove LF from end of filelabel 
Note: See TracChangeset for help on using the changeset viewer.