source: sans/Dev/trunk/NCNR_User_Procedures/Reduction/USANS/U_NCNR_Utils.ipf @ 807

Last change on this file since 807 was 807, checked in by srkline, 12 years ago

Initial separation of facility-specific initialization from the USANS reduction procedures. This is being done to enable the KIST-USANS instrument to use the NCNR reduction scheme. KIST will duplicate the .bt5 file structure but use a different extension.

For this, files for KIST have been created for USANS-specifc, and for some SANS-specific procedures that are entangled with the XML writing and with the USANS simulator.

Corresponding changes (new U_NCNR_Utils) have been added for NCNR-specific USANS initialization.

More will need to be done to disentangle the U_CALC, but at a later date. See ticket #334.

File size: 2.4 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       
34       
35        return(0)
36end
37
38
39// returns the detector dead time for the main detectors, and the transmission detector
40//
41// NCNR values switch based on a date when hardware was swapped out. other facilities can ignore the date
42//
43// also, if dead time is not known, zero can be returned to inactivate the dead time correction
44//
45//
46//Discovered significant deadtime on detectors in Oct 2010
47//JGB and AJJ changed pre-amps during shutdown Oct 27 - Nov 7 2010
48//Need different deadtime before and after 8th November 2010
49//
50Function USANS_DetectorDeadtime(filedt,MainDeadTime,TransDeadTime)
51        String filedt
52        Variable &MainDeadTime,&TransDeadTime
53       
54        if (BT5Date2Secs(filedt) < date2secs(2010,11,7))
55                        MainDeadTime = 4e-5
56                        TransDeadTime = 1.26e-5
57                        //print "Old Dead Times"
58                        //MainDeadTime = 0
59                        //TransDeadTime = 0
60        else
61                        MainDeadTime = 7e-6
62                        TransDeadTime = 1.26e-5
63                        //print "New Dead Times"
64        endif
65       
66        return(0)
67end
Note: See TracBrowser for help on using the repository browser.