source: sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/Vx_Nexus_VSANS_Write.ipf @ 1246

Last change on this file since 1246 was 1242, checked in by srkline, 3 years ago

updating the IgorVersion? pragma to v7.0 for all files to be consistent.

File size: 7.9 KB
Line 
1#pragma rtGlobals=3             // Use modern global access method and strict wave access.
2#pragma IgorVersion = 7.00
3
4///
5// for the simulator, routines to be able to write out a proper Nexus file
6// based on a template
7////
8
9
10
11// overwrites the dummy values as needed with VCALC information
12//
13// TODO
14// issues here with the potential for Nexus to have data as INTEGER
15// where I'd rather have the data here in Igor be DP, so there are no
16// conversion/assignment issues
17//
18// simuation data from VCALC = DP, but I need to assign to an Integer wave...
19// - sometimes this works, sometimes not...
20// may need to Redimension/I
21//
22/// break this up into several smaller procedures as this is a VERY lengthy task to do
23
24        // TODO
25// set the "accessible" copies of the data (these are really to be links in the file!)
26
27
28// TODO
29// get Paul K to write out 2D data sets, rather than 3D (not appropriate for SANS or VSANS)
30//
31
32/////
33/// to get "useable" data out of the 3D wave (incorrectly written)
34//              Redimension/N=(1,320,320)       root:V_Nexus_Template:entry1:instrument:detector_B:data
35//              root:V_Nexus_Template:entry1:instrument:detector_B:data[0][][] = root:Packages:NIST:VSANS:VCALC:Back:det_B[q][r]
36//              root:V_Nexus_Template:entry1:instrument:detector_B:distance = VCALC_getSDD("B")
37
38
39
40//
41// A "template" VSANS Nexus file has been loaded and is then filled in with
42// the simulation results. Some of the file, will therefore be garbage, but the
43// overall structure and attributes should be correct.
44//
45// Hopefully this will make the maintenance and testing of the file structure easier...
46// AUG 2015
47//
48///////////////////////////
49//
50// these are all of the VCALC changes to the simulated files. ADD to these as needed, making these changes to the
51// folder structure after the "default" values have been re-filled in the waves (to make sure something is really there)
52//
53////////////////////////
54
55// TODO:
56//      -- Need to write all of the "accessors" to r/w all of the simulated bits to the data file... lots to do
57// -- THIS DOES NOT MATCH THE CURRENT NICE_GENERATED FILE !!!!
58//
59Proc H_Fill_VSANS_Template_wSim()
60
61
62        root:V_Nexus_Template:entry1:instrument:beam:monochromator:wavelength = VCALC_getWavelength()
63                               
64//                      SetDataFolder root:VSANS_file:entry1:instrument         
65//                              SetDataFolder root:VSANS_file:entry1:instrument:monochromator           
66//                                      wavelength      = VCALC_getWavelength()
67//                                      SetDataFolder root:VSANS_file:entry1:instrument:monochromator:velocity_selector         
68//                                              wavelength      = VCALC_getWavelength()
69//                                              //      table (wave)   
70//                                      SetDataFolder root:VSANS_file:entry1:instrument:monochromator:crystal           
71//                                              wavelength      = VCALC_getWavelength()
72//                                             
73//                                      SetDataFolder root:VSANS_file:entry1:instrument:monochromator:white_beam               
74//                                              wavelength      = VCALC_getWavelength()
75//                                              //      description_of_distribution
76                                       
77
78                Redimension/N=(1,150,150)       root:V_Nexus_Template:entry1:instrument:detector_B:data
79                root:V_Nexus_Template:entry1:instrument:detector_B:data[0][][] = root:Packages:NIST:VSANS:VCALC:Back:det_B[q][r]
80                root:V_Nexus_Template:entry1:instrument:detector_B:distance = VCALC_getSDD("B")
81
82//
83//                      SetDataFolder root:VSANS_file:entry1:instrument:detector_MR                     
84//                              data    = root:Packages:NIST:VSANS:VCALC:Middle:det_MR
85//                              nx_distance     = VCALC_getSDD("MR")
86//                              separation      = VCALC_getPanelSeparation("MR")
87//                              spatial_calibration[0][] = 1.072
88//                              spatial_calibration[1][] = -4.0e-5
89//                             
90//                      SetDataFolder root:VSANS_file:entry1:instrument:detector_ML             
91//                              data    = root:Packages:NIST:VSANS:VCALC:Middle:det_ML
92//                              nx_distance     = VCALC_getSDD("ML")
93//                              separation = VCALC_getPanelSeparation("ML")
94//                              spatial_calibration[0][] = 1.072
95//                              spatial_calibration[1][] = -4.0e-5
96//
97//                      SetDataFolder root:VSANS_file:entry1:instrument:detector_MT             
98//                              data    = root:Packages:NIST:VSANS:VCALC:Middle:det_MT
99//                              nx_distance     = VCALC_getSDD("MT")
100//                              sdd_offset = VCALC_getTopBottomSDDSetback("MT")
101//                              separation = VCALC_getPanelSeparation("MT")
102//                              spatial_calibration[0][] = 1.072
103//                              spatial_calibration[1][] = -4.0e-5
104//
105//                      SetDataFolder root:VSANS_file:entry1:instrument:detector_MB             
106//                              data    = root:Packages:NIST:VSANS:VCALC:Middle:det_MB
107//                              nx_distance     = VCALC_getSDD("MB")
108//                              sdd_offset = VCALC_getTopBottomSDDSetback("MB")
109//                              separation = VCALC_getPanelSeparation("MB")
110//                              spatial_calibration[0][] = 1.072
111//                              spatial_calibration[1][] = -4.0e-5
112//
113//                      SetDataFolder root:VSANS_file:entry1:instrument:detector_FR                     
114//                              data    = root:Packages:NIST:VSANS:VCALC:Front:det_FR
115//                              nx_distance     = VCALC_getSDD("FR")
116//                              separation = VCALC_getPanelSeparation("FR")
117//                              spatial_calibration[0][] = 1.072
118//                              spatial_calibration[1][] = -4.0e-5
119//
120//                      SetDataFolder root:VSANS_file:entry1:instrument:detector_FL             
121//                              data    = root:Packages:NIST:VSANS:VCALC:Front:det_FL
122//                              nx_distance     = VCALC_getSDD("FL")
123//                              separation = VCALC_getPanelSeparation("FL")
124//                              spatial_calibration[0][] = 1.072
125//                              spatial_calibration[1][] = -4.0e-5
126//
127//                      SetDataFolder root:VSANS_file:entry1:instrument:detector_FT             
128//                              data    = root:Packages:NIST:VSANS:VCALC:Front:det_FT
129//                              nx_distance     = VCALC_getSDD("FT")
130//                              sdd_offset = VCALC_getTopBottomSDDSetback("FT")
131//                              separation = VCALC_getPanelSeparation("FT")
132//                              spatial_calibration[0][] = 1.072
133//                              spatial_calibration[1][] = -4.0e-5
134//
135//                      SetDataFolder root:VSANS_file:entry1:instrument:detector_FB             
136//                              data    = root:Packages:NIST:VSANS:VCALC:Front:det_FB
137//                              nx_distance     = VCALC_getSDD("FB")
138//                              sdd_offset = VCALC_getTopBottomSDDSetback("FB")
139//                              separation = VCALC_getPanelSeparation("FB")
140//                              spatial_calibration[0][] = 1.072
141//                              spatial_calibration[1][] = -4.0e-5
142//
143//                                     
144//// SRK -set the top level copies of the data                                 
145//              SetDataFolder root:VSANS_file:entry1:data_B     
146//                      data    = root:Packages:NIST:VSANS:VCALC:Back:det_B
147//
148//              SetDataFolder root:VSANS_file:entry1:data_MR   
149//                      data    = root:Packages:NIST:VSANS:VCALC:Middle:det_MR
150//                     
151//              SetDataFolder root:VSANS_file:entry1:data_ML   
152//                      data    = root:Packages:NIST:VSANS:VCALC:Middle:det_ML
153//                     
154//              SetDataFolder root:VSANS_file:entry1:data_MT   
155//                      data    = root:Packages:NIST:VSANS:VCALC:Middle:det_MT
156//                      data    = (data ==   2147483647) ? 0 : data             //the NaN "mask" in the sim data shows up as an ugly integer
157//                     
158//              SetDataFolder root:VSANS_file:entry1:data_MB   
159//                      data    = root:Packages:NIST:VSANS:VCALC:Middle:det_MB
160//                      data    = (data ==   2147483647) ? 0 : data             //the NaN "mask" in the sim data shows up as an ugly integer
161//                     
162//              SetDataFolder root:VSANS_file:entry1:data_FR   
163//                      data    = root:Packages:NIST:VSANS:VCALC:Front:det_FR
164//                     
165//              SetDataFolder root:VSANS_file:entry1:data_FL   
166//                      data    = root:Packages:NIST:VSANS:VCALC:Front:det_FL
167//                     
168//              SetDataFolder root:VSANS_file:entry1:data_FT   
169//                      data    = root:Packages:NIST:VSANS:VCALC:Front:det_FT
170//                      data    = (data ==   2147483647) ? 0 : data             //the NaN "mask" in the sim data shows up as an ugly integer
171//                     
172//              SetDataFolder root:VSANS_file:entry1:data_FB   
173//                      data    = root:Packages:NIST:VSANS:VCALC:Front:det_FB
174//                      data    = (data ==   2147483647) ? 0 : data             //the NaN "mask" in the sim data shows up as an ugly integer
175//                     
176//                             
177////            SetDataFolder root:VSANS_file:entry1:reduction         
178////                    intent  = "SCATTER"
179////                    transmission_file_name  = "SANSFile_TRN.h5"
180////                    empty_beam_file_name    = "SANSFile_EB.h5"
181////                    background_file_name    = "SANSFile_BKG.h5"
182////                    empty_file_name = "SANSFile_EMP.h5"
183////                    sensitivity_file_name   = "SANSFile_DIV.h5"
184////                    mask_file_name  = "SANSFile_MASK.h5"
185////                    sans_log_file_name      = "SANSFile_log.txt"
186////                    whole_trans     = 0.888
187////                    whole_trans_error       = 0.008
188////                    box_count       = 23232
189////                    box_count_error = 22
190////                    box_coordinates = {50,80,45,75}
191////                    comments        = "extra data comments"
192////                    absolute_scaling        = {1,1,1e5,1}
193////                    SetDataFolder root:VSANS_file:entry1:reduction:pol_sans                 
194////                            pol_sans_purpose        = "name from the list"
195////                            cell_name       = "Burgundy"
196////                            cell_parameters = {1,2,3,4,5}
197//                                     
198
199        SetDataFolder root:
200
201End
202
203
Note: See TracBrowser for help on using the repository browser.