Ignore:
Timestamp:
Feb 10, 2011 1:29:02 PM (12 years ago)
Author:
srkline
Message:

Added patch to use the correct detector dead time based on whether VAX or ICE hardware was used. The switch is done based on the day of data acquisition using dates supplied by Jeff and Cedric for the date past which the VAX hardware was not used.

25-FEB-2010 for NG7
23-JUL-2009 for NG3

Any data collected after these dates will use the measured dead time with ICE hardware.

Location:
sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/Marquee.ipf

    r779 r788  
    581581// 
    582582// 
     583// The histogram could potentially be done with the Igor ImageLineProfile operation 
     584// but this seems to be just as efficient to do. 
     585// 
    583586Function DoHistogramPair(xin,yin) 
    584587        Variable xin,yin 
     
    597600        AvgCountsY=0 
    598601         
    599         //set position wave 
     602        //set position wave, in detector coordinates 
    600603        positionX=p+pt1 
    601604        positionY=p+pt1 
    602         //convert the position to Detector coordinates 
    603         positionX += 1 
    604         positionY += 1 
    605605         
    606606        //do the vertical, then the horizontal 
     
    642642        GetMarquee/K            //to keep from drawing the marquee on the new histo graph 
    643643        //draw the graph, or just bring to the front with the new data 
     644        Variable step = 30 
    644645        DoWindow/F HistoPair 
    645646        if(V_Flag != 1) 
    646647                Draw_HistoPair() 
    647         endif 
    648          
    649          
    650         //could draw the width lines on the graph using the normal drawing routines 
    651         // -- but can't draw horizontal and vertical on at the same time. MasterAngleDraw clears 
    652         // between drawing. Also, the lines are drawn though the beam center of the data file as 
    653         // loaded. Not good for beamstop alignment, since the beam center may not have been measured yet 
    654 //      SVAR tempStr = root:myGlobals:Drawing:gDrawInfoStr 
    655 //      String newStr = ReplaceNumberByKey("WIDTH", tempStr, xWidth, "=", ";") 
    656 //      newStr = ReplaceNumberByKey("PHI", newStr, 0, "=", ";") 
    657 //      String/G root:myGlobals:Drawing:gDrawInfoStr = newStr 
    658 //      //redraw the angles 
    659 //      MasterAngleDraw() 
     648        else 
     649                SetAxis bottom (xin-step),(xin+step) 
     650                SetAxis bottomY (yin-step),(yin+step) 
     651        endif 
    660652                 
    661653        // so use a pair of cursors instead (how do I easily get rid of them?) - a "done" button 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/NCNR_Utils.ipf

    r750 r788  
    3737        Variable/G root:myGlobals:DeadtimeNG5_ILL = 3.0e-6 
    3838        Variable/G root:myGlobals:DeadtimeNG7_ILL = 3.0e-6 
    39         Variable/G root:myGlobals:DeadtimeNG3_ORNL = 3.4e-6 
    40         Variable/G root:myGlobals:DeadtimeNG5_ORNL = 0.6e-6             //as of 9 MAY 2002 
    41         Variable/G root:myGlobals:DeadtimeNG7_ORNL = 3.4e-6 
     39        Variable/G root:myGlobals:DeadtimeNG3_ORNL_VAX = 3.4e-6         //pre - 23-JUL-2009 used VAX 
     40        Variable/G root:myGlobals:DeadtimeNG3_ORNL_ICE = 1.5e-6         //post - 23-JUL-2009 used ICE 
     41        Variable/G root:myGlobals:DeadtimeNG5_ORNL = 0.6e-6                     //as of 9 MAY 2002 
     42        Variable/G root:myGlobals:DeadtimeNG7_ORNL_VAX = 3.4e-6         //pre 25-FEB-2010 used VAX 
     43        Variable/G root:myGlobals:DeadtimeNG7_ORNL_ICE = 2.3e-6         //post 25-FEB-2010 used ICE 
    4244        Variable/G root:myGlobals:DeadtimeDefault = 3.4e-6 
    4345         
     
    354356// fileStr is passed as TextRead[3] 
    355357// detStr is passed as TextRead[9] 
    356 // 
    357 Function DetectorDeadtime(fileStr,detStr) 
    358         String fileStr,detStr 
     358// dateAndTimeStr is passed as TextRead[1] 
     359//      --- if no date/time string is passed, ICE values are the default 
     360// 
     361// Due to the switch from VAX -> ICE, there were some hardware changes that led to 
     362// a change in the effective detector dead time. The dead time was re-measured by J. Barker 
     363// as follows: 
     364//      Instrument                              Date measured                           deadtime constant 
     365//      NG3                                                     DECEMBER 2009                           1.5 microseconds 
     366//      NG7                                                     APRIL2010                                       2.3 microseconds 
     367// 
     368// The day of the switch to ICE on NG7 was 25-FEB-2010 (per J. Krzywon)  
     369// The day of the switch to ICE on NG3 was 23-JUL-2009 (per C. Gagnon) 
     370// 
     371// so any data after these dates is to use the new dead time constant. The switch is made on the 
     372// data collection date. 
     373// 
     374// 
     375Function DetectorDeadtime(fileStr,detStr,[dateAndTimeStr]) 
     376        String fileStr,detStr,dateAndTimeStr 
    359377         
    360378        Variable deadtime 
     
    364382        NVAR DeadtimeNG5_ILL = root:myGlobals:DeadtimeNG5_ILL 
    365383        NVAR DeadtimeNG7_ILL = root:myGlobals:DeadtimeNG7_ILL 
    366         NVAR DeadtimeNG3_ORNL = root:myGlobals:DeadtimeNG3_ORNL 
     384        NVAR DeadtimeNG3_ORNL_VAX = root:myGlobals:DeadtimeNG3_ORNL_VAX 
     385        NVAR DeadtimeNG3_ORNL_ICE = root:myGlobals:DeadtimeNG3_ORNL_ICE 
    367386        NVAR DeadtimeNG5_ORNL = root:myGlobals:DeadtimeNG5_ORNL 
    368         NVAR DeadtimeNG7_ORNL = root:myGlobals:DeadtimeNG7_ORNL 
     387        NVAR DeadtimeNG7_ORNL_VAX = root:myGlobals:DeadtimeNG7_ORNL_VAX 
     388        NVAR DeadtimeNG7_ORNL_ICE = root:myGlobals:DeadtimeNG7_ORNL_ICE 
    369389        NVAR DeadtimeDefault = root:myGlobals:DeadtimeDefault 
     390         
     391        // if no date string is passed, default to the ICE values 
     392        if(strlen(dateAndTimeStr)==0) 
     393                dateAndTimeStr = "01-JAN-2011"          //dummy date to force to ICE values 
     394        endif 
     395         
     396         
     397        Variable NG3_to_ICE = ConvertVAXDay2secs("23-JUL-2009") 
     398        Variable NG7_to_ICE = ConvertVAXDay2secs("25-FEB-2010") 
     399        Variable fileTime = ConvertVAXDay2secs(dateAndTimeStr) 
     400 
    370401         
    371402        strswitch(instr) 
     
    374405                                deadtime= DeadtimeNG3_ILL 
    375406                        else 
    376                                 deadtime = DeadtimeNG3_ORNL     //detector is ordella-type 
     407                                if(fileTime > NG3_to_ICE) 
     408                                        deadtime = DeadtimeNG3_ORNL_ICE //detector is ordella-type, using ICE hardware 
     409                                else 
     410                                        deadtime = DeadtimeNG3_ORNL_VAX //detector is ordella-type 
     411                                endif 
    377412                        endif 
    378413                        break 
     
    388423                                deadtime= DeadtimeNG7_ILL 
    389424                        else 
    390                                 deadtime = DeadtimeNG7_ORNL     //detector is ordella-type 
     425                                if(fileTime > NG7_to_ICE) 
     426                                        deadtime = DeadtimeNG7_ORNL_ICE //detector is ordella-type, using ICE hardware 
     427                                else 
     428                                        deadtime = DeadtimeNG7_ORNL_VAX //detector is ordella-type 
     429                                endif 
    391430                        endif 
    392431                        break 
     
    398437        return(deadtime) 
    399438End 
     439 
     440// converts ONLY DD-MON-YYYY portion of the data collection time 
     441// to a number of seconds from midnight on 1/1/1904, as Igor likes to do 
     442// 
     443// dateAndTime is the full string of "dd-mon-yyyy hh:mm:ss" as returned by the function 
     444// getFileCreationDate(file) 
     445// 
     446Function ConvertVAXDay2secs(dateAndTime) 
     447        string dateAndTime 
     448         
     449        Variable day,yr,mon,time_secs 
     450        string monStr 
     451 
     452        sscanf dateandtime,"%d-%3s-%4d",day,monStr,yr 
     453        mon = monStr2num(monStr) 
     454//      print yr,mon,day 
     455        time_secs = date2secs(yr,mon,day) 
     456 
     457        return(time_secs) 
     458end 
     459 
     460// takes a month string and returns the corresponding number 
     461// 
     462Function monStr2num(monStr) 
     463        String monStr 
     464         
     465        String list=";JAN;FEB;MAR;APR;MAY;JUN;JUL;AUG;SEP;OCT;NOV;DEC;" 
     466        return(WhichListItem(monStr, list ,";")) 
     467end 
     468 
    400469 
    401470//make a three character string of the run number 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/WorkFileUtils.ipf

    r670 r788  
    136136         
    137137        //deadtime corrections to raw data 
    138         deadTime = DetectorDeadtime(raw_text[3],raw_text[9])            //pick the correct detector deadtime 
     138        deadTime = DetectorDeadtime(raw_text[3],raw_text[9],dateAndTimeStr=raw_text[1])         //pick the correct detector deadtime, switch on date too 
    139139        itim = raw_ints[2] 
    140140        cntrate = sum(raw_data,-inf,inf)/itim           //080802 use data sum, rather than scaler value 
     
    308308        itim = integersread[2] 
    309309        cntrate = sum(data,-inf,inf)/itim               //use sum of detector counts rather than scaler value 
    310         deadtime = DetectorDeadtime(textread[3],textread[9])    //pick the correct deadtime 
     310        deadtime = DetectorDeadtime(textread[3],textread[9],dateAndTimeStr=textRead[1]) //pick the correct deadtime 
    311311        dscale = 1/(1-deadTime*cntrate) 
    312312         
Note: See TracChangeset for help on using the changeset viewer.