source: sans/Dev/trunk/NCNR_User_Procedures/Reduction/USANS/NCNR_USANS_Utils.ipf @ 1124

Last change on this file since 1124 was 1124, checked in by srkline, 4 years ago

changes to read in new USANS Raw data structure, based on the file creation date.

Some additional changes to sector averaging and viewing the "avg" masks on the detector panels. still not quite complete.

File size: 2.9 KB
Line 
1#pragma rtGlobals=1             // Use modern global access method.
2#pragma version=2.20
3#pragma IgorVersion=6.1
4
5// utilities and constants that are specific to the NCNR USANS
6
7//facility-specific constants
8Function Init_USANS_Facility()
9
10        //INSTRUMENTAL CONSTANTS
11        Variable/G      root:Packages:NIST:USANS:Globals:MainPanel:gTheta_H = 3.9e-6            //Darwin FWHM   (pre- NOV 2004)
12        Variable/G      root:Packages:NIST:USANS:Globals:MainPanel:gTheta_V = 0.014             //Vertical divergence   (pre- NOV 2004)
13        //Variable/G  root:Globals:MainPanel:gDomega = 2.7e-7           //Solid angle of detector (pre- NOV 2004)
14        Variable/G      root:Packages:NIST:USANS:Globals:MainPanel:gDomega = 7.1e-7             //Solid angle of detector (NOV 2004)
15        Variable/G      root:Packages:NIST:USANS:Globals:MainPanel:gDefaultMCR= 1e6             //factor for normalization
16       
17        //Variable/G  root:Globals:MainPanel:gDQv = 0.037               //divergence, in terms of Q (1/A) (pre- NOV 2004)
18        Variable/G      root:Packages:NIST:USANS:Globals:MainPanel:gDQv = 0.117         //divergence, in terms of Q (1/A)  (NOV 2004)
19
20        String/G root:Packages:NIST:gXMLLoader_Title=""
21       
22        //November 2010 - deadtime corrections -- see USANS_DetectorDeadtime() below
23        //Only used in BT5_Loader.ipf and dependent on date, so defined there on each file load.
24       
25       
26        // to convert from angle (in degrees) to Q (in 1/Angstrom)
27        Variable/G root:Packages:NIST:USANS:Globals:MainPanel:deg2QConv=5.55e-5         //JGB -- 2/24/01
28       
29        // extension string for the raw data files
30        // -- not that the extension as specified here starts with "."
31        String/G        root:Packages:NIST:USANS:Globals:MainPanel:gUExt = ".bt5"
32       
33        // on Feb 7 2019 @ 11:00 AM, the order of the columns in the raw BT5 data file was swapped to
34        // put the 5 detectors in positions 2-6, moving the transmission detector from postion 4 to positon 7
35        // this was the only change made to the data file (done in expectation of NICE being ready soon)
36        // --to switch between the two different read routines, key on the time of data collection in the data file
37        //
38        Variable/G root:Packages:NIST:USANS:Globals:MainPanel:gFileSwitchSecs=date2secs(2019,2,7)+3600*11               // the seconds of the switch
39       
40        return(0)
41end
42
43
44// returns the detector dead time for the main detectors, and the transmission detector
45//
46// NCNR values switch based on a date when hardware was swapped out. other facilities can ignore the date
47//
48// also, if dead time is not known, zero can be returned to inactivate the dead time correction
49//
50//
51//Discovered significant deadtime on detectors in Oct 2010
52//JGB and AJJ changed pre-amps during shutdown Oct 27 - Nov 7 2010
53//Need different deadtime before and after 8th November 2010
54//
55Function USANS_DetectorDeadtime(filedt,MainDeadTime,TransDeadTime)
56        String filedt
57        Variable &MainDeadTime,&TransDeadTime
58       
59        if (BT5Date2Secs(filedt) < date2secs(2010,11,7))
60                        MainDeadTime = 4e-5
61                        TransDeadTime = 1.26e-5
62                        //print "Old Dead Times"
63                        //MainDeadTime = 0
64                        //TransDeadTime = 0
65        else
66                        MainDeadTime = 7e-6
67                        TransDeadTime = 1.26e-5
68                        //print "New Dead Times"
69        endif
70       
71        return(0)
72end
Note: See TracBrowser for help on using the repository browser.