1 | #pragma rtGlobals=1 // Use modern global access method. |
---|
2 | |
---|
3 | |
---|
4 | // |
---|
5 | // |
---|
6 | // |
---|
7 | // |
---|
8 | // AUG 2015 ************** |
---|
9 | //////////// |
---|
10 | // this needs to be connected to the "new" Nexus file |
---|
11 | // remove the VSANS references, match to SASCALC, write proper documentation, etc. |
---|
12 | /////////// |
---|
13 | |
---|
14 | |
---|
15 | |
---|
16 | |
---|
17 | // |
---|
18 | // this is a test of the "new" SANS file structure that is supposed to be |
---|
19 | // NeXus compliant. It doesn't have the NICE logs, but has everything that I |
---|
20 | // can think of here. |
---|
21 | // |
---|
22 | |
---|
23 | /// |
---|
24 | // for the simulator, routines to be able to write out a proper Nexus file |
---|
25 | // based on a template |
---|
26 | //// |
---|
27 | |
---|
28 | |
---|
29 | |
---|
30 | // overwrites the dummy values as needed with SASCALC information |
---|
31 | // |
---|
32 | // TODO |
---|
33 | // issues here with the potential for Nexus to have data as INTEGER |
---|
34 | // where I'd rather have the data here in Igor be DP, so there are no |
---|
35 | // conversion/assignment issues |
---|
36 | // |
---|
37 | // simuation data from VCALC = DP, but I need to assign to an Integer wave... |
---|
38 | // - sometimes this works, sometimes not... |
---|
39 | // may need to Redimension/I |
---|
40 | // |
---|
41 | /// break this up into several smaller procedures as this is a VERY lengthy task to do |
---|
42 | |
---|
43 | // TODO |
---|
44 | // set the "accessible" copies of the data (these are really to be links in the file!) |
---|
45 | |
---|
46 | |
---|
47 | |
---|
48 | // |
---|
49 | // A "template" VSANS Nexus file has been loaded and is then filled in with |
---|
50 | // the simulation results. Some of teh file, will therefor be garbage, but the |
---|
51 | // overall structure and attributes should be correct. |
---|
52 | // |
---|
53 | // Hopefully this will make the maintenance and testing of the file structure easier... |
---|
54 | // AUG 2015 |
---|
55 | // |
---|
56 | /////////////////////////// |
---|
57 | // |
---|
58 | // these are all of the VCALC changes to the simulated files. ADD to these as needed, making these changes to the |
---|
59 | // folder structure after the "default" values have been re-filled in the waves (to make sure something is really there) |
---|
60 | // |
---|
61 | //////////////////////// |
---|
62 | |
---|
63 | // TODO: |
---|
64 | // -- Need to write all of the "accessors" to r/w all of the simulated bits to the data file... lots to do |
---|
65 | // -- THIS DOES NOT MATCH THE CURRENT NICE_GENERATED FILE !!!! |
---|
66 | // |
---|
67 | |
---|
68 | |
---|
69 | |
---|
70 | // |
---|
71 | // this is NOT linked in any way with SASCALC, and I have no idea |
---|
72 | // of how to ever keep this in sync if the Nexus tree changes... |
---|
73 | // |
---|
74 | Proc H_Fill_SANS_Template_wSim() |
---|
75 | |
---|
76 | SetDataFolder root:SANS_file |
---|
77 | file_name = "SANSTest.h5" |
---|
78 | file_time = "2015-02-28T08:15:30-5:00" |
---|
79 | facility = "NCNR" |
---|
80 | NeXus_version = "Nexus 0.0" |
---|
81 | hdf_version = "hdf5.x" |
---|
82 | file_history = "history log" |
---|
83 | SetDataFolder root:SANS_file:entry1 |
---|
84 | title = "title of entry1" |
---|
85 | experiment_identifier = 684636 |
---|
86 | experiment_description = "description of expt" |
---|
87 | entry_identifier = "S22-33" |
---|
88 | definition = "NXsas" |
---|
89 | start_time = "2015-02-28T08:15:30-5:00" |
---|
90 | end_time = "2015-02-28T08:15:30-5:00" |
---|
91 | duration = 300 |
---|
92 | collection_time = 300 |
---|
93 | run_cycle = "S22-23" |
---|
94 | data_directory = "[NG7SANS41]" |
---|
95 | program_name = "runPoint={stuff}" |
---|
96 | SetDataFolder root:SANS_file:entry1:user |
---|
97 | name = "Dr. Pi" |
---|
98 | role = "evil scientist" |
---|
99 | affiliation = "NIST" |
---|
100 | address = "100 Bureau Drive" |
---|
101 | telephoneNumber = "301-999-9999" |
---|
102 | faxNumber = "301-999-9999" |
---|
103 | email = "sans@nist" |
---|
104 | facility_user_id = 6937596 |
---|
105 | SetDataFolder root:SANS_file:entry1:control |
---|
106 | mode = "timer" |
---|
107 | preset = 555 |
---|
108 | integral = 555 |
---|
109 | monitor_counts = 666 |
---|
110 | monitor_preset = 1e8 |
---|
111 | detector_counts = 100111222 |
---|
112 | detector_preset = 1e5 |
---|
113 | // type = "monitor type" |
---|
114 | // efficiency = 0.01 |
---|
115 | // sampled_fraction = 1 |
---|
116 | count_start = 1 |
---|
117 | count_end = 1 |
---|
118 | count_time = 1 |
---|
119 | count_time_preset = 1 |
---|
120 | // SetDataFolder root:SANS_file:entry1:program_name |
---|
121 | // data = "program data" |
---|
122 | // description = "acquisition" |
---|
123 | // file_name = "NICE" |
---|
124 | // type = "client" |
---|
125 | SetDataFolder root:SANS_file:entry1:sample |
---|
126 | description = "My Sample" |
---|
127 | group_id = 12345 |
---|
128 | // chemical_formula = "C8H10N4O2" |
---|
129 | SetDataFolder root:SANS_file:entry1:sample:temperature_1 |
---|
130 | name = "Sample temperature" |
---|
131 | attached_to = "block" |
---|
132 | measurement = "temperature" |
---|
133 | SetDataFolder root:SANS_file:entry1:sample:temperature_1:value_log |
---|
134 | start = "2015-02-28T08:15:30-5:00" |
---|
135 | nx_time = p |
---|
136 | value = 2*p |
---|
137 | SetDataFolder root:SANS_file:entry1:sample:temperature_2 |
---|
138 | name = "Sample temperature" |
---|
139 | attached_to = "block" |
---|
140 | measurement = "temperature" |
---|
141 | SetDataFolder root:SANS_file:entry1:sample:temperature_2:value_log |
---|
142 | start = "2015-02-28T08:15:30-5:00" |
---|
143 | nx_time = p |
---|
144 | value = 3*p |
---|
145 | SetDataFolder root:SANS_file:entry1:sample:electric_field |
---|
146 | name = "electric meter" |
---|
147 | attached_to = "sample" |
---|
148 | measurement = "voltage" |
---|
149 | SetDataFolder root:SANS_file:entry1:sample:electric_field:value_log |
---|
150 | start = "2015-02-28T08:15:30-5:00" |
---|
151 | nx_time = 2*p |
---|
152 | value = sin(p/10) |
---|
153 | SetDataFolder root:SANS_file:entry1:sample:shear_field |
---|
154 | name = "rheometer" |
---|
155 | attached_to = "sample" |
---|
156 | measurement = "stress" |
---|
157 | SetDataFolder root:SANS_file:entry1:sample:shear_field:value_log |
---|
158 | start = "2015-02-28T08:15:30-5:00" |
---|
159 | nx_time = p |
---|
160 | value = cos(p/5) |
---|
161 | SetDataFolder root:SANS_file:entry1:sample:pressure |
---|
162 | name = "Sample pressure" |
---|
163 | attached_to = "pressure cell" |
---|
164 | measurement = "pressure" |
---|
165 | SetDataFolder root:SANS_file:entry1:sample:pressure:value_log |
---|
166 | start = "2015-02-28T08:15:30-5:00" |
---|
167 | nx_time = p |
---|
168 | value = p/2 |
---|
169 | SetDataFolder root:SANS_file:entry1:sample:magnetic_field |
---|
170 | name = "magnetic field (direction)" |
---|
171 | attached_to = "cryostat" |
---|
172 | measurement = "magnetic field" |
---|
173 | SetDataFolder root:SANS_file:entry1:sample:magnetic_field:value_log |
---|
174 | start = "2015-02-28T08:15:30-5:00" |
---|
175 | nx_time = p |
---|
176 | value = 10*p |
---|
177 | SetDataFolder root:SANS_file:entry1:sample |
---|
178 | changer_position = 5 |
---|
179 | sample_holder_description = "10CB" |
---|
180 | // mass = 0.3 |
---|
181 | // density = 1.02 |
---|
182 | // molecular_weight = 194.19 |
---|
183 | // description = "My Sample" |
---|
184 | // preparation_date = "2015-02-28T08:15:30-5:00" |
---|
185 | // volume_fraction = 0.2 |
---|
186 | // scattering_length_density = 6.35e-6 |
---|
187 | thickness = 0.1 |
---|
188 | rotation_angle = 30 |
---|
189 | transmission = 0.888 |
---|
190 | transmission_error = 0.011 |
---|
191 | // xs_incoh = 5.5 |
---|
192 | // xs_coh = 22.2 |
---|
193 | // xs_absorb = 3.1 |
---|
194 | SetDataFolder root:SANS_file:entry1:instrument |
---|
195 | // location = "NCNR" |
---|
196 | name = "NGB30mSANS" |
---|
197 | type = "30 m SANS" |
---|
198 | local_contact = "Steve Kline" |
---|
199 | SetDataFolder root:SANS_file:entry1:instrument:source |
---|
200 | name = "NCNR" |
---|
201 | type = "Reactor Neutron Source" |
---|
202 | probe = "neutron" |
---|
203 | power = 20 |
---|
204 | SetDataFolder root:SANS_file:entry1:instrument:beam_monitor |
---|
205 | data = 1234567 |
---|
206 | type = "monitor" |
---|
207 | efficiency = 0.01 |
---|
208 | nx_distance = 16 |
---|
209 | saved_count = 1e8 |
---|
210 | SetDataFolder root:SANS_file:entry1:instrument:monochromator |
---|
211 | wavelength = 6 |
---|
212 | wavelength_spread = 0.15 |
---|
213 | type = "VS" |
---|
214 | SetDataFolder root:SANS_file:entry1:instrument:monochromator:velocity_selector |
---|
215 | rotation_speed = 5100 |
---|
216 | wavelength = 6 |
---|
217 | wavelength_spread = 0.15 |
---|
218 | vs_tilt = 3 |
---|
219 | nx_distance = 18.8 |
---|
220 | //table |
---|
221 | SetDataFolder root:SANS_file:entry1:instrument:polarizer |
---|
222 | type = "supermirror" |
---|
223 | composition = "multilayer" |
---|
224 | efficiency = 0.95 |
---|
225 | status = "in" |
---|
226 | SetDataFolder root:SANS_file:entry1:instrument:flipper |
---|
227 | status = "on" |
---|
228 | driving_current = 42 |
---|
229 | waveform = "sine" |
---|
230 | frequency = 400 |
---|
231 | transmitted_power = 0.99 |
---|
232 | SetDataFolder root:SANS_file:entry1:instrument:polarizer_analyzer |
---|
233 | status = "down" |
---|
234 | guide_field_current_1 = 33 |
---|
235 | guide_field_current_2 = 32 |
---|
236 | solenoid_current = 21 |
---|
237 | cell_index = 1 |
---|
238 | cell_names = {"Burgundy","Olaf","Jim","Bob","Joe"} |
---|
239 | cell_parameters = 1 |
---|
240 | SetDataFolder root:SANS_file:entry1:instrument:chopper |
---|
241 | type = "single" |
---|
242 | status = "in" |
---|
243 | rotation_speed = 12000 |
---|
244 | distance_from_source = 400 |
---|
245 | distance_from_sample = 1500 |
---|
246 | slits = 2 |
---|
247 | angular_opening = 15 |
---|
248 | duty_cycle = 0.25 |
---|
249 | SetDataFolder root:SANS_file:entry1:instrument:attenuator |
---|
250 | nx_distance = 1500 |
---|
251 | type = "PMMA" |
---|
252 | thickness = 0 |
---|
253 | attenuator_transmission = 1 |
---|
254 | status = "in" |
---|
255 | atten_number = 0 |
---|
256 | index = 1 |
---|
257 | SetDataFolder root:SANS_file:entry1:instrument:source_aperture |
---|
258 | // material = "Gd" |
---|
259 | description = "source aperture" |
---|
260 | diameter = 1.27 |
---|
261 | nx_distance = 13.0 |
---|
262 | SetDataFolder root:SANS_file:entry1:instrument:source_aperture:shape |
---|
263 | size = 1.27 |
---|
264 | SetDataFolder root:SANS_file:entry1:instrument:sample_aperture |
---|
265 | // material = "Gd" |
---|
266 | description = "sample aperture" |
---|
267 | diameter = 1.27 |
---|
268 | nx_distance = 10 |
---|
269 | SetDataFolder root:SANS_file:entry1:instrument:sample_aperture:shape |
---|
270 | size = 1.27 |
---|
271 | SetDataFolder root:SANS_file:entry1:instrument:collimator |
---|
272 | SetDataFolder root:SANS_file:entry1:instrument:collimator:geometry |
---|
273 | SetDataFolder root:SANS_file:entry1:instrument:collimator:geometry:shape |
---|
274 | shape = "box" |
---|
275 | size = 11 |
---|
276 | nx_NumGuides = 1 |
---|
277 | SetDataFolder root:SANS_file:entry1:instrument:lenses |
---|
278 | status = "in" |
---|
279 | lens_geometry = "concave_lens" |
---|
280 | focus_type = "point" |
---|
281 | number_of_lenses = 28 |
---|
282 | number_of_prisms = 7 |
---|
283 | curvature = 1 |
---|
284 | lens_distance = 123 |
---|
285 | prism_distance = 123 |
---|
286 | lens_material = "MgF2" |
---|
287 | prism_material = "MgF2" |
---|
288 | SetDataFolder root:SANS_file:entry1:instrument:sample_table |
---|
289 | location = "chamber" |
---|
290 | offset_distance = 0 |
---|
291 | SetDataFolder root:SANS_file:entry1:instrument:beam_stop |
---|
292 | description = "circular" |
---|
293 | nx_distance = 12.5 |
---|
294 | size = 7.62 |
---|
295 | status = "out" |
---|
296 | xPos = 66.4 |
---|
297 | yPos = 64.4 |
---|
298 | x_motor_position = 0.15 |
---|
299 | y_motor_position = 0.55 |
---|
300 | SetDataFolder root:SANS_file:entry1:instrument:detector |
---|
301 | data = trunc(abs(gnoise(p+q))) |
---|
302 | // data_error = 0.01*abs(gnoise(p+q)) |
---|
303 | nx_distance = 13.1 |
---|
304 | description = "Ordela 2660N" |
---|
305 | settings = "just right" |
---|
306 | dead_time = 5e-6 |
---|
307 | x_pixel_size = 5.08 |
---|
308 | y_pixel_size = 5.08 |
---|
309 | beam_center_x = 65.55 |
---|
310 | beam_center_y = 62.33 |
---|
311 | type = "Ordela" |
---|
312 | // flatfield_applied = 0 |
---|
313 | // countrate_correction_applied = 0 |
---|
314 | pixel_mask = 0 |
---|
315 | integrated_count = 100111222 |
---|
316 | lateral_offset = 20 |
---|
317 | PixelNumX = 128 |
---|
318 | PixelNumY = 128 |
---|
319 | PixelFWHM = 0.5 |
---|
320 | //calibration_method |
---|
321 | CALX = {0.5,0.5,10000} |
---|
322 | CALY = {0.5,0.5,10000} |
---|
323 | size = 65 |
---|
324 | event_file_name ="something.hst" |
---|
325 | SetDataFolder root:SANS_file:entry1:data |
---|
326 | data = trunc(abs(gnoise(p+q))) |
---|
327 | // error = 0.01*abs(gnoise(p+q)) |
---|
328 | variables = {128,128} |
---|
329 | data_image = p |
---|
330 | SetDataFolder root:SANS_file:entry1:reduction |
---|
331 | intent = "SCATTER" |
---|
332 | transmission_file_name = "SANSFile_TRN.h5" |
---|
333 | empty_beam_file_name = "SANSFile_EB.h5" |
---|
334 | background_file_name = "SANSFile_BKG.h5" |
---|
335 | empty_file_name = "SANSFile_EMP.h5" |
---|
336 | sensitivity_file_name = "SANSFile_DIV.h5" |
---|
337 | mask_file_name = "SANSFile_MASK.h5" |
---|
338 | sans_log_file_name = "SANSFile_log.txt" |
---|
339 | whole_trans = 0.888 |
---|
340 | whole_trans_error = 0.008 |
---|
341 | box_count = 23232 |
---|
342 | box_count_error = 22 |
---|
343 | box_coordinates = {50,80,45,75} |
---|
344 | comments = "extra data comments" |
---|
345 | absolute_scaling = {1,1,1e5,1} |
---|
346 | SetDataFolder root:SANS_file:entry1:reduction:pol_sans |
---|
347 | pol_sans_purpose = "name from the list" |
---|
348 | cell_name = "Burgundy" |
---|
349 | cell_parameters = {1,2,3,4,5} |
---|
350 | |
---|
351 | SetDataFolder root:SANS_file:DAS_Logs |
---|
352 | //...multiple entries and levels... to add |
---|
353 | |
---|
354 | |
---|
355 | SetDataFolder root: |
---|
356 | |
---|
357 | End |
---|
358 | |
---|
359 | |
---|
360 | |
---|