1 | #pragma rtGlobals=3 // Use modern global access method and strict wave access. |
---|
2 | |
---|
3 | |
---|
4 | //////////// READ (GET) FUNCTIONS //////////////////// |
---|
5 | |
---|
6 | |
---|
7 | ////////////////////////////////////////////// |
---|
8 | ////////////////////////////////// |
---|
9 | // for TESTING of the get functions - to quickly access and se if there are errors |
---|
10 | // |
---|
11 | // -- not sure how to test the string functions -- can't seem to get a FUNCREF to a string function |
---|
12 | // to work -- maybe it's not alllowed? |
---|
13 | // |
---|
14 | // -- also, now I have get_functions that take a detStr input with the detector information, so that the |
---|
15 | // functions didn't need to be repeated |
---|
16 | // |
---|
17 | // -- Not sure how to test the "write" functions. writing the wrong data type to the wrong data field will be a disaster |
---|
18 | // Writing odd, dummy values will also be a mess - no way to know if I'm doing anything correctly |
---|
19 | // |
---|
20 | Function proto_V_get_FP(str) |
---|
21 | String str |
---|
22 | return(0) |
---|
23 | end |
---|
24 | Function proto_V_get_FP2(str,str2) |
---|
25 | String str,str2 |
---|
26 | return(0) |
---|
27 | end |
---|
28 | //Function/S proto_V_get_STR(str) |
---|
29 | // String str |
---|
30 | // return("") |
---|
31 | //end |
---|
32 | |
---|
33 | Function Test_V_get_FP(str,fname) |
---|
34 | String str,fname |
---|
35 | |
---|
36 | Variable ii,num |
---|
37 | String list,item |
---|
38 | |
---|
39 | |
---|
40 | list=FunctionList(str,";","NPARAMS:1,VALTYPE:1") //,VALTYPE:1 gives real return values, not strings |
---|
41 | // Print list |
---|
42 | num = ItemsInlist(list) |
---|
43 | |
---|
44 | |
---|
45 | for(ii=0;ii<num;ii+=1) |
---|
46 | item = StringFromList(ii, list , ";") |
---|
47 | FUNCREF proto_V_get_FP f = $item |
---|
48 | Print item ," = ", f(fname) |
---|
49 | endfor |
---|
50 | |
---|
51 | return(0) |
---|
52 | end |
---|
53 | |
---|
54 | Function Test_V_get_FP2(str,fname,detStr) |
---|
55 | String str,fname,detStr |
---|
56 | |
---|
57 | Variable ii,num |
---|
58 | String list,item |
---|
59 | |
---|
60 | |
---|
61 | list=FunctionList(str,";","NPARAMS:2,VALTYPE:1") //,VALTYPE:1 gives real return values, not strings |
---|
62 | // Print list |
---|
63 | num = ItemsInlist(list) |
---|
64 | |
---|
65 | |
---|
66 | for(ii=0;ii<num;ii+=1) |
---|
67 | item = StringFromList(ii, list , ";") |
---|
68 | FUNCREF proto_V_get_FP2 f = $item |
---|
69 | Print item ," = ", f(fname,detStr) |
---|
70 | endfor |
---|
71 | |
---|
72 | return(0) |
---|
73 | end |
---|
74 | |
---|
75 | Function Test_V_get_STR(str,fname) |
---|
76 | String str,fname |
---|
77 | |
---|
78 | Variable ii,num |
---|
79 | String list,item,strToEx |
---|
80 | |
---|
81 | |
---|
82 | list=FunctionList(str,";","NPARAMS:1,VALTYPE:4") |
---|
83 | // Print list |
---|
84 | num = ItemsInlist(list) |
---|
85 | |
---|
86 | |
---|
87 | for(ii=0;ii<num;ii+=1) |
---|
88 | item = StringFromList(ii, list , ";") |
---|
89 | // FUNCREF proto_V_get_STR f = $item |
---|
90 | printf "%s = ",item |
---|
91 | sprintf strToEx,"Print %s(\"%s\")",item,fname |
---|
92 | Execute strToEx |
---|
93 | // print strToEx |
---|
94 | // Print item ," = ", f(fname) |
---|
95 | endfor |
---|
96 | |
---|
97 | return(0) |
---|
98 | end |
---|
99 | |
---|
100 | Function Test_V_get_STR2(str,fname,detStr) |
---|
101 | String str,fname,detStr |
---|
102 | |
---|
103 | Variable ii,num |
---|
104 | String list,item,strToEx |
---|
105 | |
---|
106 | |
---|
107 | list=FunctionList(str,";","NPARAMS:2,VALTYPE:4") |
---|
108 | // Print list |
---|
109 | num = ItemsInlist(list) |
---|
110 | |
---|
111 | |
---|
112 | for(ii=0;ii<num;ii+=1) |
---|
113 | item = StringFromList(ii, list , ";") |
---|
114 | // FUNCREF proto_V_get_STR f = $item |
---|
115 | printf "%s = ",item |
---|
116 | sprintf strToEx,"Print %s(\"%s\",\"%s\")",item,fname,detStr |
---|
117 | Execute strToEx |
---|
118 | // print strToEx |
---|
119 | // Print item ," = ", f(fname) |
---|
120 | endfor |
---|
121 | |
---|
122 | return(0) |
---|
123 | end |
---|
124 | /////////////////////////////////////// |
---|
125 | |
---|
126 | |
---|
127 | ////////////////////////////////////////////// |
---|
128 | |
---|
129 | |
---|
130 | /////////////////////// |
---|
131 | // |
---|
132 | // *These are the specific bits of information to retrieve (or write) to the data file |
---|
133 | // *These functions use the path to the file as input, and each has the specific |
---|
134 | // path to the variable srting, or wave hard-coded into the access function |
---|
135 | // *They call the generic worker functions to get the values, either from the local copy if present, |
---|
136 | // or the full file is loaded. |
---|
137 | // |
---|
138 | // *Since the path is the important bit, these are written as get/write pairs to make it easier to |
---|
139 | // keep up with any changes in path |
---|
140 | // |
---|
141 | // |
---|
142 | // TODO -- verify the paths, and add more as needed |
---|
143 | // TODO -- for all of the String functions -- "num" does nothing right now - |
---|
144 | // -- if it ever does, or needs to, a lot of locations will need to be corrected |
---|
145 | // |
---|
146 | |
---|
147 | |
---|
148 | //////// TOP LEVEL |
---|
149 | //////// TOP LEVEL |
---|
150 | //////// TOP LEVEL |
---|
151 | |
---|
152 | // nexus version used for definitions |
---|
153 | Function/S V_getNeXus_version(fname) |
---|
154 | String fname |
---|
155 | |
---|
156 | String path = "entry:NeXus_version" |
---|
157 | Variable num=60 |
---|
158 | return(V_getStringFromHDF5(fname,path,num)) |
---|
159 | End |
---|
160 | |
---|
161 | // TODO -- not mine, added somewhere by Nexus writer? |
---|
162 | // data collection time (! this is the true counting time??) |
---|
163 | Function V_getCollectionTime(fname) |
---|
164 | String fname |
---|
165 | |
---|
166 | String path = "entry:collection_time" |
---|
167 | return(V_getRealValueFromHDF5(fname,path)) |
---|
168 | End |
---|
169 | |
---|
170 | // data directory where data files are stored (for user access, not archive) |
---|
171 | Function/S V_getData_directory(fname) |
---|
172 | String fname |
---|
173 | |
---|
174 | String path = "entry:data_directory" |
---|
175 | Variable num=60 |
---|
176 | return(V_getStringFromHDF5(fname,path,num)) |
---|
177 | End |
---|
178 | |
---|
179 | // Base class of Nexus definition (=NXsas) |
---|
180 | Function/S V_getNexusDefinition(fname) |
---|
181 | String fname |
---|
182 | |
---|
183 | String path = "entry:definition" |
---|
184 | Variable num=60 |
---|
185 | return(V_getStringFromHDF5(fname,path,num)) |
---|
186 | End |
---|
187 | |
---|
188 | // TODO -- not mine, added somewhere by Nexus writer? |
---|
189 | // data collection duration (may include pauses, other "dead" time) |
---|
190 | Function V_getDataDuration(fname) |
---|
191 | String fname |
---|
192 | |
---|
193 | String path = "entry:duration" |
---|
194 | return(V_getRealValueFromHDF5(fname,path)) |
---|
195 | End |
---|
196 | |
---|
197 | // TODO -- not mine, added somewhere by Nexus writer? |
---|
198 | // data collection end time |
---|
199 | Function/S V_getDataEndTime(fname) |
---|
200 | String fname |
---|
201 | |
---|
202 | String path = "entry:end_time" |
---|
203 | Variable num=60 |
---|
204 | return(V_getStringFromHDF5(fname,path,num)) |
---|
205 | End |
---|
206 | |
---|
207 | // experiment description |
---|
208 | Function/S V_getExperiment_description(fname) |
---|
209 | String fname |
---|
210 | |
---|
211 | String path = "entry:experiment_description" |
---|
212 | Variable num=60 |
---|
213 | return(V_getStringFromHDF5(fname,path,num)) |
---|
214 | End |
---|
215 | |
---|
216 | // experiment identifier? used only by NICE? |
---|
217 | Function/S V_getExperiment_identifier(fname) |
---|
218 | String fname |
---|
219 | |
---|
220 | String path = "entry:experiment_identifier" |
---|
221 | Variable num=60 |
---|
222 | return(V_getStringFromHDF5(fname,path,num)) |
---|
223 | End |
---|
224 | |
---|
225 | // name of facility = NCNR |
---|
226 | Function/S V_getFacility(fname) |
---|
227 | String fname |
---|
228 | |
---|
229 | String path = "entry:facility" |
---|
230 | Variable num=60 |
---|
231 | return(V_getStringFromHDF5(fname,path,num)) |
---|
232 | End |
---|
233 | |
---|
234 | // file write time (what is this?? |
---|
235 | // TODO - figure out if this is supposed to be an integer or text (ISO) |
---|
236 | Function V_getFileWriteTime(fname) |
---|
237 | String fname |
---|
238 | |
---|
239 | String path = "entry:file_time" |
---|
240 | return(V_getRealValueFromHDF5(fname,path)) |
---|
241 | End |
---|
242 | |
---|
243 | // |
---|
244 | Function/S V_getHDF_version(fname) |
---|
245 | String fname |
---|
246 | |
---|
247 | String path = "entry:hdf_version" |
---|
248 | Variable num=60 |
---|
249 | return(V_getStringFromHDF5(fname,path,num)) |
---|
250 | End |
---|
251 | |
---|
252 | // TODO -- not mine, added somewhere by Nexus writer? |
---|
253 | Function/S V_getProgram_name(fname) |
---|
254 | String fname |
---|
255 | |
---|
256 | String path = "entry:program_name" |
---|
257 | Variable num=60 |
---|
258 | return(V_getStringFromHDF5(fname,path,num)) |
---|
259 | End |
---|
260 | |
---|
261 | // TODO -- not mine, added somewhere by Nexus writer? |
---|
262 | // data collection start time |
---|
263 | Function/S V_getDataStartTime(fname) |
---|
264 | String fname |
---|
265 | |
---|
266 | String path = "entry:start_time" |
---|
267 | Variable num=60 |
---|
268 | return(V_getStringFromHDF5(fname,path,num)) |
---|
269 | End |
---|
270 | |
---|
271 | // title of experiment |
---|
272 | Function/S V_getTitle(fname) |
---|
273 | String fname |
---|
274 | |
---|
275 | String path = "entry:title" |
---|
276 | Variable num=60 |
---|
277 | return(V_getStringFromHDF5(fname,path,num)) |
---|
278 | end |
---|
279 | |
---|
280 | |
---|
281 | |
---|
282 | ////////// USER |
---|
283 | ////////// USER |
---|
284 | ////////// USER |
---|
285 | |
---|
286 | // list of user names |
---|
287 | // TODO -- currently not written out to data file?? |
---|
288 | Function/S V_getUserNames(fname) |
---|
289 | String fname |
---|
290 | |
---|
291 | String path = "entry:user:name" |
---|
292 | Variable num=60 |
---|
293 | return(V_getStringFromHDF5(fname,path,num)) |
---|
294 | end |
---|
295 | |
---|
296 | |
---|
297 | //////// CONTROL |
---|
298 | //////// CONTROL |
---|
299 | //////// CONTROL |
---|
300 | |
---|
301 | // TODO -- for the control section, document each of the fields |
---|
302 | |
---|
303 | Function V_getCount_end(fname) |
---|
304 | String fname |
---|
305 | |
---|
306 | String path = "entry:control:count_end" |
---|
307 | return(V_getRealValueFromHDF5(fname,path)) |
---|
308 | end |
---|
309 | |
---|
310 | |
---|
311 | Function V_getCount_start(fname) |
---|
312 | String fname |
---|
313 | |
---|
314 | String path = "entry:control:count_start" |
---|
315 | return(V_getRealValueFromHDF5(fname,path)) |
---|
316 | end |
---|
317 | |
---|
318 | |
---|
319 | Function V_getCount_time(fname) |
---|
320 | String fname |
---|
321 | |
---|
322 | String path = "entry:control:count_time" |
---|
323 | return(V_getRealValueFromHDF5(fname,path)) |
---|
324 | end |
---|
325 | |
---|
326 | |
---|
327 | Function V_getCount_time_preset(fname) |
---|
328 | String fname |
---|
329 | |
---|
330 | String path = "entry:control:count_time_preset" |
---|
331 | return(V_getRealValueFromHDF5(fname,path)) |
---|
332 | end |
---|
333 | |
---|
334 | |
---|
335 | Function V_getDetector_counts(fname) |
---|
336 | String fname |
---|
337 | |
---|
338 | String path = "entry:control:detector_counts" |
---|
339 | return(V_getRealValueFromHDF5(fname,path)) |
---|
340 | end |
---|
341 | |
---|
342 | |
---|
343 | Function V_getDetector_preset(fname) |
---|
344 | String fname |
---|
345 | |
---|
346 | String path = "entry:control:detector_preset" |
---|
347 | return(V_getRealValueFromHDF5(fname,path)) |
---|
348 | end |
---|
349 | |
---|
350 | |
---|
351 | Function V_getIntegral(fname) |
---|
352 | String fname |
---|
353 | |
---|
354 | String path = "entry:control:integral" |
---|
355 | return(V_getRealValueFromHDF5(fname,path)) |
---|
356 | end |
---|
357 | |
---|
358 | // control mode for data acquisition, "timer" |
---|
359 | Function/S V_getControlMode(fname) |
---|
360 | String fname |
---|
361 | |
---|
362 | String path = "entry:control:mode" |
---|
363 | Variable num=60 |
---|
364 | return(V_getStringFromHDF5(fname,path,num)) |
---|
365 | End |
---|
366 | |
---|
367 | //monitor count |
---|
368 | Function V_getMonitorCount(fname) |
---|
369 | String fname |
---|
370 | |
---|
371 | String path = "entry:control:monitor_counts" |
---|
372 | return(V_getRealValueFromHDF5(fname,path)) |
---|
373 | end |
---|
374 | |
---|
375 | Function V_getMonitor_preset(fname) |
---|
376 | String fname |
---|
377 | |
---|
378 | String path = "entry:control:monitor_preset" |
---|
379 | return(V_getRealValueFromHDF5(fname,path)) |
---|
380 | end |
---|
381 | |
---|
382 | Function V_getPreset(fname) |
---|
383 | String fname |
---|
384 | |
---|
385 | String path = "entry:control:preset" |
---|
386 | return(V_getRealValueFromHDF5(fname,path)) |
---|
387 | end |
---|
388 | |
---|
389 | |
---|
390 | |
---|
391 | |
---|
392 | |
---|
393 | //////// INSTRUMENT |
---|
394 | //////// INSTRUMENT |
---|
395 | //////// INSTRUMENT |
---|
396 | |
---|
397 | Function/S V_getLocalContact(fname) |
---|
398 | String fname |
---|
399 | |
---|
400 | String path = "entry:instrument:local_contact" |
---|
401 | Variable num=60 |
---|
402 | return(V_getStringFromHDF5(fname,path,num)) |
---|
403 | End |
---|
404 | |
---|
405 | Function/S V_getInstrumentName(fname) |
---|
406 | String fname |
---|
407 | |
---|
408 | String path = "entry:instrument:name" |
---|
409 | Variable num=60 |
---|
410 | return(V_getStringFromHDF5(fname,path,num)) |
---|
411 | End |
---|
412 | |
---|
413 | Function/S V_getInstrumentType(fname) |
---|
414 | String fname |
---|
415 | |
---|
416 | String path = "entry:instrument:type" |
---|
417 | Variable num=60 |
---|
418 | return(V_getStringFromHDF5(fname,path,num)) |
---|
419 | End |
---|
420 | |
---|
421 | ////// INSTRUMENT/ATTENUATOR |
---|
422 | // TODO |
---|
423 | // attenuator number -- for VSANS I think I want this to be some "binary" representation |
---|
424 | // of 4 plates in/out - so this may be an integer-> binary, or a text string (4 char) |
---|
425 | Function V_getAtten_number(fname) |
---|
426 | String fname |
---|
427 | |
---|
428 | String path = "entry:instrument:attenuator:atten_number" |
---|
429 | return(V_getRealValueFromHDF5(fname,path)) |
---|
430 | end |
---|
431 | |
---|
432 | |
---|
433 | // transmission value for the attenuator in the beam |
---|
434 | // use this, but if something wrong, the tables are present |
---|
435 | Function V_getAttenuator_transmission(fname) |
---|
436 | String fname |
---|
437 | |
---|
438 | String path = "entry:instrument:attenuator:attenuator_transmission" |
---|
439 | return(V_getRealValueFromHDF5(fname,path)) |
---|
440 | end |
---|
441 | |
---|
442 | |
---|
443 | // distance from the attenuator to the sample (units??) |
---|
444 | Function V_getAttenDistance(fname) |
---|
445 | String fname |
---|
446 | |
---|
447 | String path = "entry:instrument:attenuator:distance" |
---|
448 | return(V_getRealValueFromHDF5(fname,path)) |
---|
449 | end |
---|
450 | |
---|
451 | |
---|
452 | // attenuator index, to use in the lookup table of transmission values |
---|
453 | Function V_getAttenIndex(fname) |
---|
454 | String fname |
---|
455 | |
---|
456 | String path = "entry:instrument:attenuator:index" |
---|
457 | return(V_getRealValueFromHDF5(fname,path)) |
---|
458 | end |
---|
459 | |
---|
460 | |
---|
461 | // table of the attenuation factor |
---|
462 | Function V_getAttenIndex_table(fname,outW) |
---|
463 | String fname |
---|
464 | Wave outW |
---|
465 | |
---|
466 | String path = "entry:instrument:attenuator:index_table" |
---|
467 | WAVE w = V_getRealWaveFromHDF5(fname,path) |
---|
468 | |
---|
469 | outW = w |
---|
470 | return(0) |
---|
471 | end |
---|
472 | |
---|
473 | |
---|
474 | // status "in or out" |
---|
475 | Function/S V_getAttenStatus(fname) |
---|
476 | String fname |
---|
477 | |
---|
478 | String path = "entry:instrument:attenuator:status" |
---|
479 | Variable num=60 |
---|
480 | return(V_getStringFromHDF5(fname,path,num)) |
---|
481 | End |
---|
482 | |
---|
483 | // thickness of the attenuator (PMMA) - units?? |
---|
484 | Function V_getAttenThickness(fname) |
---|
485 | String fname |
---|
486 | |
---|
487 | String path = "entry:instrument:attenuator:thickness" |
---|
488 | return(V_getRealValueFromHDF5(fname,path)) |
---|
489 | end |
---|
490 | |
---|
491 | |
---|
492 | // type of material for the atteunator |
---|
493 | Function/S V_getAttenType(fname) |
---|
494 | String fname |
---|
495 | |
---|
496 | String path = "entry:instrument:attenuator:type" |
---|
497 | Variable num=60 |
---|
498 | return(V_getStringFromHDF5(fname,path,num)) |
---|
499 | End |
---|
500 | |
---|
501 | |
---|
502 | ////// INSTRUMENT/BEAM |
---|
503 | // instrument/beam/chopper (data folder) |
---|
504 | Function V_getChopperAngular_opening(fname) |
---|
505 | String fname |
---|
506 | |
---|
507 | String path = "entry:instrument:beam:chopper:angular_opening" |
---|
508 | return(V_getRealValueFromHDF5(fname,path)) |
---|
509 | end |
---|
510 | |
---|
511 | Function V_getChopDistance_from_sample(fname) |
---|
512 | String fname |
---|
513 | |
---|
514 | String path = "entry:instrument:beam:chopper:distance_from_sample" |
---|
515 | return(V_getRealValueFromHDF5(fname,path)) |
---|
516 | end |
---|
517 | |
---|
518 | Function V_getChopDistance_from_source(fname) |
---|
519 | String fname |
---|
520 | |
---|
521 | String path = "entry:instrument:beam:chopper:distance_from_source" |
---|
522 | return(V_getRealValueFromHDF5(fname,path)) |
---|
523 | end |
---|
524 | |
---|
525 | Function V_getChopperDuty_cycle(fname) |
---|
526 | String fname |
---|
527 | |
---|
528 | String path = "entry:instrument:beam:chopper:duty_cycle" |
---|
529 | return(V_getRealValueFromHDF5(fname,path)) |
---|
530 | end |
---|
531 | |
---|
532 | Function V_getChopperRotation_speed(fname) |
---|
533 | String fname |
---|
534 | |
---|
535 | String path = "entry:instrument:beam:chopper:rotation_speed" |
---|
536 | return(V_getRealValueFromHDF5(fname,path)) |
---|
537 | end |
---|
538 | |
---|
539 | Function V_getChopperSlits(fname) |
---|
540 | String fname |
---|
541 | |
---|
542 | String path = "entry:instrument:beam:chopper:slits" |
---|
543 | return(V_getRealValueFromHDF5(fname,path)) |
---|
544 | end |
---|
545 | |
---|
546 | Function/S V_getChopperstatus(fname) |
---|
547 | String fname |
---|
548 | |
---|
549 | String path = "entry:instrument:beam:chopper:status" |
---|
550 | Variable num=60 |
---|
551 | return(V_getStringFromHDF5(fname,path,num)) |
---|
552 | End |
---|
553 | |
---|
554 | Function/S V_getChoppertype(fname) |
---|
555 | String fname |
---|
556 | |
---|
557 | String path = "entry:instrument:beam:chopper:type" |
---|
558 | Variable num=60 |
---|
559 | return(V_getStringFromHDF5(fname,path,num)) |
---|
560 | End |
---|
561 | |
---|
562 | |
---|
563 | // instrument/beam/flipper (data folder) |
---|
564 | Function V_getFlipperDriving_current(fname) |
---|
565 | String fname |
---|
566 | |
---|
567 | String path = "entry:instrument:beam:flipper:driving_current" |
---|
568 | return(V_getRealValueFromHDF5(fname,path)) |
---|
569 | end |
---|
570 | |
---|
571 | Function V_getFlipperFrequency(fname) |
---|
572 | String fname |
---|
573 | |
---|
574 | String path = "entry:instrument:beam:flipper:frequency" |
---|
575 | return(V_getRealValueFromHDF5(fname,path)) |
---|
576 | end |
---|
577 | |
---|
578 | Function/S V_getFlipperstatus(fname) |
---|
579 | String fname |
---|
580 | |
---|
581 | String path = "entry:instrument:beam:flipper:status" |
---|
582 | Variable num=60 |
---|
583 | return(V_getStringFromHDF5(fname,path,num)) |
---|
584 | End |
---|
585 | |
---|
586 | Function V_getFlipperTransmitted_power(fname) |
---|
587 | String fname |
---|
588 | |
---|
589 | String path = "entry:instrument:beam:flipper:transmitted_power" |
---|
590 | return(V_getRealValueFromHDF5(fname,path)) |
---|
591 | end |
---|
592 | |
---|
593 | Function/S V_getFlipperWaveform(fname) |
---|
594 | String fname |
---|
595 | |
---|
596 | String path = "entry:instrument:beam:flipper:waveform" |
---|
597 | Variable num=60 |
---|
598 | return(V_getStringFromHDF5(fname,path,num)) |
---|
599 | End |
---|
600 | |
---|
601 | // instrument/beam/monochromator (data folder) |
---|
602 | Function/S V_getMonochromatorType(fname) |
---|
603 | String fname |
---|
604 | |
---|
605 | String path = "entry:instrument:beam:monochromator:type" |
---|
606 | Variable num=60 |
---|
607 | return(V_getStringFromHDF5(fname,path,num)) |
---|
608 | End |
---|
609 | |
---|
610 | Function V_getWavelength(fname) |
---|
611 | String fname |
---|
612 | |
---|
613 | String path = "entry:instrument:beam:monochromator:wavelength" |
---|
614 | return(V_getRealValueFromHDF5(fname,path)) |
---|
615 | end |
---|
616 | |
---|
617 | Function V_getWavelength_spread(fname) |
---|
618 | String fname |
---|
619 | |
---|
620 | String path = "entry:instrument:beam:monochromator:wavelength_spread" |
---|
621 | return(V_getRealValueFromHDF5(fname,path)) |
---|
622 | end |
---|
623 | |
---|
624 | // instrument/beam/monochromator/crystal (data folder) |
---|
625 | Function V_getCrystalEnergy(fname) |
---|
626 | String fname |
---|
627 | |
---|
628 | String path = "entry:instrument:beam:monochromator:crystal:energy" |
---|
629 | return(V_getRealValueFromHDF5(fname,path)) |
---|
630 | end |
---|
631 | |
---|
632 | Function V_getCrystalHorizontal_aperture(fname) |
---|
633 | String fname |
---|
634 | |
---|
635 | String path = "entry:instrument:beam:monochromator:crystal:horizontal_aperture" |
---|
636 | return(V_getRealValueFromHDF5(fname,path)) |
---|
637 | end |
---|
638 | |
---|
639 | Function V_getCrystalHoriz_curvature(fname) |
---|
640 | String fname |
---|
641 | |
---|
642 | String path = "entry:instrument:beam:monochromator:crystal:horizontal_curvature" |
---|
643 | return(V_getRealValueFromHDF5(fname,path)) |
---|
644 | end |
---|
645 | |
---|
646 | Function V_getCrystalLattice_parameter(fname) |
---|
647 | String fname |
---|
648 | |
---|
649 | String path = "entry:instrument:beam:monochromator:crystal:lattice_parameter" |
---|
650 | return(V_getRealValueFromHDF5(fname,path)) |
---|
651 | end |
---|
652 | |
---|
653 | Function V_getCrystalnx_distance(fname) |
---|
654 | String fname |
---|
655 | |
---|
656 | String path = "entry:instrument:beam:monochromator:crystal:nx_distance" |
---|
657 | return(V_getRealValueFromHDF5(fname,path)) |
---|
658 | end |
---|
659 | |
---|
660 | Function V_getCrystalReflection(fname) |
---|
661 | String fname |
---|
662 | |
---|
663 | String path = "entry:instrument:beam:monochromator:crystal:reflection" |
---|
664 | return(V_getRealValueFromHDF5(fname,path)) |
---|
665 | end |
---|
666 | |
---|
667 | Function V_getCrystalRotation(fname) |
---|
668 | String fname |
---|
669 | |
---|
670 | String path = "entry:instrument:beam:monochromator:crystal:rotation" |
---|
671 | return(V_getRealValueFromHDF5(fname,path)) |
---|
672 | end |
---|
673 | |
---|
674 | Function/S V_getCrystalStatus(fname) |
---|
675 | String fname |
---|
676 | |
---|
677 | String path = "entry:instrument:beam:monochromator:crystal:status" |
---|
678 | Variable num=60 |
---|
679 | return(V_getStringFromHDF5(fname,path,num)) |
---|
680 | End |
---|
681 | |
---|
682 | Function V_getCrystalVertical_aperture(fname) |
---|
683 | String fname |
---|
684 | |
---|
685 | String path = "entry:instrument:beam:monochromator:crystal:vertical_aperture" |
---|
686 | return(V_getRealValueFromHDF5(fname,path)) |
---|
687 | end |
---|
688 | |
---|
689 | Function V_getCrystalVertical_curvature(fname) |
---|
690 | String fname |
---|
691 | |
---|
692 | String path = "entry:instrument:beam:monochromator:crystal:vertical_curvature" |
---|
693 | return(V_getRealValueFromHDF5(fname,path)) |
---|
694 | end |
---|
695 | |
---|
696 | Function V_getCrystalWavelength(fname) |
---|
697 | String fname |
---|
698 | |
---|
699 | String path = "entry:instrument:beam:monochromator:crystal:wavelength" |
---|
700 | return(V_getRealValueFromHDF5(fname,path)) |
---|
701 | end |
---|
702 | |
---|
703 | Function V_getCrystalWavelength_spread(fname) |
---|
704 | String fname |
---|
705 | |
---|
706 | String path = "entry:instrument:beam:monochromator:crystal:wavelength_spread" |
---|
707 | return(V_getRealValueFromHDF5(fname,path)) |
---|
708 | end |
---|
709 | |
---|
710 | Function V_getCrystalWavevector(fname) |
---|
711 | String fname |
---|
712 | |
---|
713 | String path = "entry:instrument:beam:monochromator:crystal:wavevector" |
---|
714 | return(V_getRealValueFromHDF5(fname,path)) |
---|
715 | end |
---|
716 | |
---|
717 | // instrument/beam/monochromator/velocity_selector (data folder) |
---|
718 | Function V_getVSnx_distance(fname) |
---|
719 | String fname |
---|
720 | |
---|
721 | String path = "entry:instrument:beam:monochromator:velocity_selector:nx_distance" |
---|
722 | return(V_getRealValueFromHDF5(fname,path)) |
---|
723 | end |
---|
724 | |
---|
725 | Function V_getVSRotation_speed(fname) |
---|
726 | String fname |
---|
727 | |
---|
728 | String path = "entry:instrument:beam:monochromator:velocity_selector:rotation_speed" |
---|
729 | return(V_getRealValueFromHDF5(fname,path)) |
---|
730 | end |
---|
731 | |
---|
732 | Function/S V_getVelSelStatus(fname) |
---|
733 | String fname |
---|
734 | |
---|
735 | String path = "entry:instrument:beam:monochromator:velocity_selector:status" |
---|
736 | Variable num=60 |
---|
737 | return(V_getStringFromHDF5(fname,path,num)) |
---|
738 | End |
---|
739 | |
---|
740 | Function V_getVSTable(fname,outW) |
---|
741 | String fname |
---|
742 | Wave outW |
---|
743 | |
---|
744 | String path = "entry:instrument:beam:monochromator:velocity_selector:table" |
---|
745 | WAVE w = V_getRealWaveFromHDF5(fname,path) |
---|
746 | |
---|
747 | outW = w |
---|
748 | return(0) |
---|
749 | end |
---|
750 | |
---|
751 | Function V_getVSTable_parameters(fname) |
---|
752 | String fname |
---|
753 | |
---|
754 | String path = "entry:instrument:beam:monochromator:velocity_selector:table_parameters" |
---|
755 | return(V_getRealValueFromHDF5(fname,path)) |
---|
756 | end |
---|
757 | |
---|
758 | Function V_getVS_tilt(fname) |
---|
759 | String fname |
---|
760 | |
---|
761 | String path = "entry:instrument:beam:monochromator:velocity_selector:vs_tilt" |
---|
762 | return(V_getRealValueFromHDF5(fname,path)) |
---|
763 | end |
---|
764 | |
---|
765 | Function V_getVSWavelength(fname) |
---|
766 | String fname |
---|
767 | |
---|
768 | String path = "entry:instrument:beam:monochromator:velocity_selector:wavelength" |
---|
769 | return(V_getRealValueFromHDF5(fname,path)) |
---|
770 | end |
---|
771 | |
---|
772 | Function V_getVSWavelength_spread(fname) |
---|
773 | String fname |
---|
774 | |
---|
775 | String path = "entry:instrument:beam:monochromator:velocity_selector:wavelength_spread" |
---|
776 | return(V_getRealValueFromHDF5(fname,path)) |
---|
777 | end |
---|
778 | |
---|
779 | // instrument/beam/monochromator/white_beam (data folder) |
---|
780 | Function/S V_getWhiteBeamStatus(fname) |
---|
781 | String fname |
---|
782 | |
---|
783 | String path = "entry:instrument:beam:monochromator:white_beam:status" |
---|
784 | Variable num=60 |
---|
785 | return(V_getStringFromHDF5(fname,path,num)) |
---|
786 | End |
---|
787 | |
---|
788 | Function V_getWhiteBeamWavelength(fname) |
---|
789 | String fname |
---|
790 | |
---|
791 | String path = "entry:instrument:beam:monochromator:white_beam:wavelength" |
---|
792 | return(V_getRealValueFromHDF5(fname,path)) |
---|
793 | end |
---|
794 | |
---|
795 | Function V_getWhiteBeamWavelength_spread(fname) |
---|
796 | String fname |
---|
797 | |
---|
798 | String path = "entry:instrument:beam:monochromator:white_beam:wavelength_spread" |
---|
799 | return(V_getRealValueFromHDF5(fname,path)) |
---|
800 | end |
---|
801 | |
---|
802 | // instrument/beam/polarizer (data folder) |
---|
803 | Function/S V_getPolarizerComposition(fname) |
---|
804 | String fname |
---|
805 | |
---|
806 | String path = "entry:instrument:beam:polarizer:composition" |
---|
807 | Variable num=60 |
---|
808 | return(V_getStringFromHDF5(fname,path,num)) |
---|
809 | End |
---|
810 | |
---|
811 | Function V_getPolarizerEfficiency(fname) |
---|
812 | String fname |
---|
813 | |
---|
814 | String path = "entry:instrument:beam:polarizer:efficiency" |
---|
815 | return(V_getRealValueFromHDF5(fname,path)) |
---|
816 | end |
---|
817 | |
---|
818 | Function/S V_getPolarizerStatus(fname) |
---|
819 | String fname |
---|
820 | |
---|
821 | String path = "entry:instrument:beam:polarizer:status" |
---|
822 | Variable num=60 |
---|
823 | return(V_getStringFromHDF5(fname,path,num)) |
---|
824 | End |
---|
825 | |
---|
826 | Function/S V_getPolarizerType(fname) |
---|
827 | String fname |
---|
828 | |
---|
829 | String path = "entry:instrument:beam:polarizer:type" |
---|
830 | Variable num=60 |
---|
831 | return(V_getStringFromHDF5(fname,path,num)) |
---|
832 | End |
---|
833 | |
---|
834 | // instrument/beam/polarizer_analyzer (data folder) |
---|
835 | Function V_getPolAnaCell_index(fname) |
---|
836 | String fname |
---|
837 | |
---|
838 | String path = "entry:instrument:beam:polarizer_analyzer:cell_index" |
---|
839 | return(V_getRealValueFromHDF5(fname,path)) |
---|
840 | End |
---|
841 | |
---|
842 | Function/S V_getPolAnaCell_name(fname) |
---|
843 | String fname |
---|
844 | |
---|
845 | String path = "entry:instrument:beam:polarizer_analyzer:cell_name" |
---|
846 | Variable num=60 |
---|
847 | return(V_getStringFromHDF5(fname,path,num)) |
---|
848 | End |
---|
849 | |
---|
850 | Function V_getPolAnaCell_parameters(fname,outW) |
---|
851 | String fname |
---|
852 | Wave outW |
---|
853 | |
---|
854 | String path = "entry:instrument:beam:polarizer_analyzer:cell_parameters" |
---|
855 | WAVE w = V_getRealWaveFromHDF5(fname,path) |
---|
856 | |
---|
857 | outW = w |
---|
858 | return(0) |
---|
859 | End |
---|
860 | |
---|
861 | Function V_getPolAnaGuideFieldCur_1(fname) |
---|
862 | String fname |
---|
863 | |
---|
864 | String path = "entry:instrument:beam:polarizer_analyzer:guide_field_current_1" |
---|
865 | return(V_getRealValueFromHDF5(fname,path)) |
---|
866 | End |
---|
867 | |
---|
868 | Function V_getPolAnaGuideFieldCur_2(fname) |
---|
869 | String fname |
---|
870 | |
---|
871 | String path = "entry:instrument:beam:polarizer_analyzer:guide_field_current_2" |
---|
872 | return(V_getRealValueFromHDF5(fname,path)) |
---|
873 | End |
---|
874 | |
---|
875 | Function V_getPolAnaSolenoid_current(fname) |
---|
876 | String fname |
---|
877 | |
---|
878 | String path = "entry:instrument:beam:polarizer_analyzer:solenoid_current" |
---|
879 | return(V_getRealValueFromHDF5(fname,path)) |
---|
880 | End |
---|
881 | |
---|
882 | Function/S V_getPolAnaStatus(fname) |
---|
883 | String fname |
---|
884 | |
---|
885 | String path = "entry:instrument:beam:polarizer_analyzer:status" |
---|
886 | Variable num=60 |
---|
887 | return(V_getStringFromHDF5(fname,path,num)) |
---|
888 | End |
---|
889 | |
---|
890 | |
---|
891 | /////// INSTRUMENT/BEAM MONITORS |
---|
892 | |
---|
893 | //beam_monitor_low (data folder) |
---|
894 | Function V_getBeamMonLowData(fname) |
---|
895 | String fname |
---|
896 | |
---|
897 | String path = "entry:instrument:beam_monitor_low:data" |
---|
898 | return(V_getRealValueFromHDF5(fname,path)) |
---|
899 | End |
---|
900 | |
---|
901 | Function V_getBeamMonLowEfficiency(fname) |
---|
902 | String fname |
---|
903 | |
---|
904 | String path = "entry:instrument:beam_monitor_low:efficiency" |
---|
905 | return(V_getRealValueFromHDF5(fname,path)) |
---|
906 | End |
---|
907 | |
---|
908 | Function V_getBeamMonLownx_distance(fname) |
---|
909 | String fname |
---|
910 | |
---|
911 | String path = "entry:instrument:beam_monitor_low:nx_distance" |
---|
912 | return(V_getRealValueFromHDF5(fname,path)) |
---|
913 | End |
---|
914 | |
---|
915 | Function V_getBeamMonLowSaved_count(fname) |
---|
916 | String fname |
---|
917 | |
---|
918 | String path = "entry:instrument:beam_monitor_low:saved_count" |
---|
919 | return(V_getRealValueFromHDF5(fname,path)) |
---|
920 | End |
---|
921 | |
---|
922 | Function/S V_getBeamMonLowType(fname) |
---|
923 | String fname |
---|
924 | |
---|
925 | String path = "entry:instrument:beam_monitor_low:type" |
---|
926 | Variable num=60 |
---|
927 | return(V_getStringFromHDF5(fname,path,num)) |
---|
928 | End |
---|
929 | |
---|
930 | //beam_monitor_norm (data folder) |
---|
931 | Function V_getBeamMonNormData(fname) |
---|
932 | String fname |
---|
933 | |
---|
934 | String path = "entry:instrument:beam_monitor_norm:data" |
---|
935 | return(V_getRealValueFromHDF5(fname,path)) |
---|
936 | End |
---|
937 | |
---|
938 | Function V_getBeamMonNormEfficiency(fname) |
---|
939 | String fname |
---|
940 | |
---|
941 | String path = "entry:instrument:beam_monitor_norm:efficiency" |
---|
942 | return(V_getRealValueFromHDF5(fname,path)) |
---|
943 | End |
---|
944 | |
---|
945 | Function V_getBeamMonNormnx_distance(fname) |
---|
946 | String fname |
---|
947 | |
---|
948 | String path = "entry:instrument:beam_monitor_norm:nx_distance" |
---|
949 | return(V_getRealValueFromHDF5(fname,path)) |
---|
950 | End |
---|
951 | |
---|
952 | Function V_getBeamMonNormSaved_count(fname) |
---|
953 | String fname |
---|
954 | |
---|
955 | String path = "entry:instrument:beam_monitor_norm:saved_count" |
---|
956 | return(V_getRealValueFromHDF5(fname,path)) |
---|
957 | End |
---|
958 | |
---|
959 | Function/S V_getBeamMonNormType(fname) |
---|
960 | String fname |
---|
961 | |
---|
962 | String path = "entry:instrument:beam_monitor_norm:type" |
---|
963 | Variable num=60 |
---|
964 | return(V_getStringFromHDF5(fname,path,num)) |
---|
965 | End |
---|
966 | |
---|
967 | //beam_stop (data folder) |
---|
968 | Function/S V_getBeamStopDescription(fname) |
---|
969 | String fname |
---|
970 | |
---|
971 | String path = "entry:instrument:beam_stop:description" |
---|
972 | Variable num=60 |
---|
973 | return(V_getStringFromHDF5(fname,path,num)) |
---|
974 | End |
---|
975 | |
---|
976 | Function V_getBeamStopDist_to_det(fname) |
---|
977 | String fname |
---|
978 | |
---|
979 | String path = "entry:instrument:beam_stop:distance_to_detector" |
---|
980 | return(V_getRealValueFromHDF5(fname,path)) |
---|
981 | End |
---|
982 | |
---|
983 | Function V_getBeamStop_x0(fname) |
---|
984 | String fname |
---|
985 | |
---|
986 | String path = "entry:instrument:beam_stop:x0" |
---|
987 | return(V_getRealValueFromHDF5(fname,path)) |
---|
988 | End |
---|
989 | |
---|
990 | Function V_getBeamStop_y0(fname) |
---|
991 | String fname |
---|
992 | |
---|
993 | String path = "entry:instrument:beam_stop:y0" |
---|
994 | return(V_getRealValueFromHDF5(fname,path)) |
---|
995 | End |
---|
996 | |
---|
997 | //// INSTRUMENT/COLLIMATOR |
---|
998 | //collimator (data folder) |
---|
999 | Function V_getNumberOfGuides(fname) |
---|
1000 | String fname |
---|
1001 | |
---|
1002 | String path = "entry:instrument:collimator:number_guides" |
---|
1003 | return(V_getRealValueFromHDF5(fname,path)) |
---|
1004 | End |
---|
1005 | |
---|
1006 | // geometry (data folder) |
---|
1007 | // shape (data folder) |
---|
1008 | Function/S V_getGuideShape(fname) |
---|
1009 | String fname |
---|
1010 | |
---|
1011 | String path = "entry:instrument:collimator:geometry:shape:shape" |
---|
1012 | Variable num=60 |
---|
1013 | return(V_getStringFromHDF5(fname,path,num)) |
---|
1014 | End |
---|
1015 | |
---|
1016 | Function V_getGuideSize(fname) |
---|
1017 | String fname |
---|
1018 | |
---|
1019 | String path = "entry:instrument:collimator:geometry:shape:size" |
---|
1020 | return(V_getRealValueFromHDF5(fname,path)) |
---|
1021 | End |
---|
1022 | |
---|
1023 | // converging_pinholes (data folder) |
---|
1024 | Function/S V_getConvPinholeStatus(fname) |
---|
1025 | String fname |
---|
1026 | |
---|
1027 | String path = "entry:instrument:converging_pinholes:status" |
---|
1028 | Variable num=60 |
---|
1029 | return(V_getStringFromHDF5(fname,path,num)) |
---|
1030 | End |
---|
1031 | |
---|
1032 | // converging_slits (data folder) |
---|
1033 | Function/S V_getConvSlitStatus(fname) |
---|
1034 | String fname |
---|
1035 | |
---|
1036 | String path = "entry:instrument:converging_slits:status" |
---|
1037 | Variable num=60 |
---|
1038 | return(V_getStringFromHDF5(fname,path,num)) |
---|
1039 | End |
---|
1040 | |
---|
1041 | |
---|
1042 | ////// INSTRUMENT/DETECTORS |
---|
1043 | // detector_B (data folder) |
---|
1044 | // |
---|
1045 | // only defined for the "B" detector, and may not be necessary? |
---|
1046 | // TODO -- write to return an ARRAY |
---|
1047 | Function V_getDet_CALX(fname,detStr,outW) |
---|
1048 | String fname,detStr |
---|
1049 | Wave outW |
---|
1050 | |
---|
1051 | if(cmpstr(detStr,"B") == 0) |
---|
1052 | String path = "entry:instrument:detector_"+detStr+":CALX" |
---|
1053 | WAVE w = V_getRealWaveFromHDF5(fname,path) |
---|
1054 | |
---|
1055 | outW = w |
---|
1056 | return(0) |
---|
1057 | else |
---|
1058 | return(0) |
---|
1059 | endif |
---|
1060 | End |
---|
1061 | |
---|
1062 | // only defined for the "B" detector, and may not be necessary? |
---|
1063 | // TODO -- write to return an ARRAY |
---|
1064 | Function V_getDet_CALY(fname,detStr,outW) |
---|
1065 | String fname,detStr |
---|
1066 | Wave outW |
---|
1067 | |
---|
1068 | if(cmpstr(detStr,"B") == 0) |
---|
1069 | String path = "entry:instrument:detector_"+detStr+":CALY" |
---|
1070 | WAVE w = V_getRealWaveFromHDF5(fname,path) |
---|
1071 | |
---|
1072 | outW = w |
---|
1073 | return(0) |
---|
1074 | else |
---|
1075 | return(0) |
---|
1076 | endif |
---|
1077 | End |
---|
1078 | |
---|
1079 | // TODO -- write and X and Y version of this. Pixels are not square |
---|
1080 | // so the FHWM will be different in each direction. May need to return |
---|
1081 | // "dummy" value for "B" detector if pixels there are square |
---|
1082 | Function V_getDet_PixelFWHM_X(fname,detStr) |
---|
1083 | String fname,detStr |
---|
1084 | |
---|
1085 | String path = "entry:instrument:detector_"+detStr+":PixelFWHM_X" |
---|
1086 | |
---|
1087 | // TODO -- different behavior for "B" |
---|
1088 | if(cmpstr(detStr,"B") == 0) |
---|
1089 | return(V_getRealValueFromHDF5(fname,path)) |
---|
1090 | else |
---|
1091 | return(V_getRealValueFromHDF5(fname,path)) |
---|
1092 | endif |
---|
1093 | End |
---|
1094 | |
---|
1095 | // TODO -- write and X and Y version of this. Pixels are not square |
---|
1096 | // so the FHWM will be different in each direction. May need to return |
---|
1097 | // "dummy" value for "B" detector if pixels there are square |
---|
1098 | Function V_getDet_PixelFWHM_Y(fname,detStr) |
---|
1099 | String fname,detStr |
---|
1100 | |
---|
1101 | String path = "entry:instrument:detector_"+detStr+":PixelFWHM_Y" |
---|
1102 | |
---|
1103 | // TODO -- different behavior for "B" |
---|
1104 | if(cmpstr(detStr,"B") == 0) |
---|
1105 | return(V_getRealValueFromHDF5(fname,path)) |
---|
1106 | else |
---|
1107 | return(V_getRealValueFromHDF5(fname,path)) |
---|
1108 | endif |
---|
1109 | End |
---|
1110 | |
---|
1111 | Function V_getDet_PixelNumX(fname,detStr) |
---|
1112 | String fname,detStr |
---|
1113 | |
---|
1114 | String path = "entry:instrument:detector_"+detStr+":PixelNumX" |
---|
1115 | return(V_getRealValueFromHDF5(fname,path)) |
---|
1116 | End |
---|
1117 | |
---|
1118 | Function V_getDet_PixelNumY(fname,detStr) |
---|
1119 | String fname,detStr |
---|
1120 | |
---|
1121 | String path = "entry:instrument:detector_"+detStr+":PixelNumY" |
---|
1122 | return(V_getRealValueFromHDF5(fname,path)) |
---|
1123 | End |
---|
1124 | |
---|
1125 | // only defined for the "B" detector, and only to satisfy NXsas |
---|
1126 | Function V_getDet_azimuthalAngle(fname,detStr) |
---|
1127 | String fname,detStr |
---|
1128 | |
---|
1129 | if(cmpstr(detStr,"B") == 0) |
---|
1130 | String path = "entry:instrument:detector_"+detStr+":azimuthal_angle" |
---|
1131 | return(V_getRealValueFromHDF5(fname,path)) |
---|
1132 | else |
---|
1133 | return(0) |
---|
1134 | endif |
---|
1135 | End |
---|
1136 | |
---|
1137 | Function V_getDet_beam_center_x(fname,detStr) |
---|
1138 | String fname,detStr |
---|
1139 | |
---|
1140 | String path = "entry:instrument:detector_"+detStr+":beam_center_x" |
---|
1141 | return(V_getRealValueFromHDF5(fname,path)) |
---|
1142 | End |
---|
1143 | |
---|
1144 | Function V_getDet_beam_center_y(fname,detStr) |
---|
1145 | String fname,detStr |
---|
1146 | |
---|
1147 | String path = "entry:instrument:detector_"+detStr+":beam_center_y" |
---|
1148 | return(V_getRealValueFromHDF5(fname,path)) |
---|
1149 | End |
---|
1150 | |
---|
1151 | // TODO -- write this function to return a WAVE with the data |
---|
1152 | // either as a wave reference, or as an input parameter |
---|
1153 | Function V_getDetectorData(fname,detStr,outW) |
---|
1154 | String fname,detStr |
---|
1155 | Wave outW |
---|
1156 | |
---|
1157 | String path = "entry:instrument:detector_"+detStr+":data" |
---|
1158 | WAVE w = V_getRealWaveFromHDF5(fname,path) |
---|
1159 | |
---|
1160 | outW = w |
---|
1161 | return(0) |
---|
1162 | End |
---|
1163 | |
---|
1164 | |
---|
1165 | // TODO -- write this function to return a WAVE with the data |
---|
1166 | // either as a wave reference, or as an input parameter |
---|
1167 | // ALSO -- the "B" deadtime will be a single value (probably) |
---|
1168 | // but the tube banks will be 1D arrays of values, one per tube |
---|
1169 | Function V_getDetector_deadtime(fname,detStr,outW) |
---|
1170 | String fname,detStr |
---|
1171 | Wave outW |
---|
1172 | |
---|
1173 | String path = "entry:instrument:detector_"+detStr+":dead_time" |
---|
1174 | WAVE w = V_getRealWaveFromHDF5(fname,path) |
---|
1175 | |
---|
1176 | outW = w |
---|
1177 | return(0) |
---|
1178 | End |
---|
1179 | |
---|
1180 | |
---|
1181 | Function/S V_getDetDescription(fname,detStr) |
---|
1182 | String fname,detStr |
---|
1183 | |
---|
1184 | String path = "entry:instrument:detector_"+detStr+":description" |
---|
1185 | Variable num=60 |
---|
1186 | return(V_getStringFromHDF5(fname,path,num)) |
---|
1187 | End |
---|
1188 | |
---|
1189 | Function V_getDet_distance(fname,detStr) |
---|
1190 | String fname,detStr |
---|
1191 | |
---|
1192 | String path = "entry:instrument:detector_"+detStr+":distance" |
---|
1193 | return(V_getRealValueFromHDF5(fname,path)) |
---|
1194 | End |
---|
1195 | |
---|
1196 | // only defined for the "B" detector, and only to satisfy NXsas |
---|
1197 | Function V_getDet_equatorial_angle(fname,detStr) |
---|
1198 | String fname,detStr |
---|
1199 | |
---|
1200 | if(cmpstr(detStr,"B") == 0) |
---|
1201 | String path = "entry:instrument:detector_"+detStr+":equatorial_angle" |
---|
1202 | return(V_getRealValueFromHDF5(fname,path)) |
---|
1203 | else |
---|
1204 | return(0) |
---|
1205 | endif |
---|
1206 | End |
---|
1207 | |
---|
1208 | Function/S V_getDetEventFileName(fname,detStr) |
---|
1209 | String fname,detStr |
---|
1210 | |
---|
1211 | String path = "entry:instrument:detector_"+detStr+":event_file_name" |
---|
1212 | Variable num=60 |
---|
1213 | return(V_getStringFromHDF5(fname,path,num)) |
---|
1214 | End |
---|
1215 | |
---|
1216 | Function V_getDet_IntegratedCount(fname,detStr) |
---|
1217 | String fname,detStr |
---|
1218 | |
---|
1219 | String path = "entry:instrument:detector_"+detStr+":integrated_count" |
---|
1220 | return(V_getRealValueFromHDF5(fname,path)) |
---|
1221 | End |
---|
1222 | |
---|
1223 | Function V_getDet_LateralOffset(fname,detStr) |
---|
1224 | String fname,detStr |
---|
1225 | |
---|
1226 | String path = "entry:instrument:detector_"+detStr+":lateral_offset" |
---|
1227 | return(V_getRealValueFromHDF5(fname,path)) |
---|
1228 | End |
---|
1229 | |
---|
1230 | // only defined for the "B" detector, and only to satisfy NXsas |
---|
1231 | Function V_getDet_polar_angle(fname,detStr) |
---|
1232 | String fname,detStr |
---|
1233 | |
---|
1234 | if(cmpstr(detStr,"B") == 0) |
---|
1235 | String path = "entry:instrument:detector_"+detStr+":polar_angle" |
---|
1236 | return(V_getRealValueFromHDF5(fname,path)) |
---|
1237 | else |
---|
1238 | return(0) |
---|
1239 | endif |
---|
1240 | End |
---|
1241 | |
---|
1242 | // only defined for the "B" detector, and only to satisfy NXsas |
---|
1243 | Function V_getDet_rotational_angle(fname,detStr) |
---|
1244 | String fname,detStr |
---|
1245 | |
---|
1246 | if(cmpstr(detStr,"B") == 0) |
---|
1247 | String path = "entry:instrument:detector_"+detStr+":rotational_angle" |
---|
1248 | return(V_getRealValueFromHDF5(fname,path)) |
---|
1249 | else |
---|
1250 | return(0) |
---|
1251 | endif |
---|
1252 | End |
---|
1253 | |
---|
1254 | Function/S V_getDetSettings(fname,detStr) |
---|
1255 | String fname,detStr |
---|
1256 | |
---|
1257 | String path = "entry:instrument:detector_"+detStr+":settings" |
---|
1258 | Variable num=60 |
---|
1259 | return(V_getStringFromHDF5(fname,path,num)) |
---|
1260 | End |
---|
1261 | |
---|
1262 | // really has no meaning at all |
---|
1263 | Function V_getDet_size(fname,detStr) |
---|
1264 | String fname,detStr |
---|
1265 | |
---|
1266 | String path = "entry:instrument:detector_"+detStr+":size" |
---|
1267 | return(V_getRealValueFromHDF5(fname,path)) |
---|
1268 | End |
---|
1269 | |
---|
1270 | Function/S V_getDetType(fname,detStr) |
---|
1271 | String fname,detStr |
---|
1272 | |
---|
1273 | String path = "entry:instrument:detector_"+detStr+":type" |
---|
1274 | Variable num=60 |
---|
1275 | return(V_getStringFromHDF5(fname,path,num)) |
---|
1276 | End |
---|
1277 | |
---|
1278 | Function V_getDet_x_pixel_size(fname,detStr) |
---|
1279 | String fname,detStr |
---|
1280 | |
---|
1281 | String path = "entry:instrument:detector_"+detStr+":x_pixel_size" |
---|
1282 | return(V_getRealValueFromHDF5(fname,path)) |
---|
1283 | End |
---|
1284 | |
---|
1285 | Function V_getDet_y_pixel_size(fname,detStr) |
---|
1286 | String fname,detStr |
---|
1287 | |
---|
1288 | String path = "entry:instrument:detector_"+detStr+":y_pixel_size" |
---|
1289 | return(V_getRealValueFromHDF5(fname,path)) |
---|
1290 | End |
---|
1291 | |
---|
1292 | ///////// detector_FB (data folder) + ALL other PANEL DETECTORS |
---|
1293 | |
---|
1294 | Function V_getDet_numberOfTubes(fname,detStr) |
---|
1295 | String fname,detStr |
---|
1296 | |
---|
1297 | String path = "entry:instrument:detector_"+detStr+":number_of_tubes" |
---|
1298 | if(cmpstr(detStr,"B") == 0) |
---|
1299 | return(0) |
---|
1300 | else |
---|
1301 | return(V_getRealValueFromHDF5(fname,path)) |
---|
1302 | endif |
---|
1303 | End |
---|
1304 | |
---|
1305 | // TODO -- be clear on how this is defined. Separation as defined from what point? Units? |
---|
1306 | Function V_getDetPanelSeparation(fname,detStr) |
---|
1307 | String fname,detStr |
---|
1308 | |
---|
1309 | String path = "entry:instrument:detector_"+detStr+":separation" |
---|
1310 | if(cmpstr(detStr,"B") == 0) |
---|
1311 | return(0) |
---|
1312 | else |
---|
1313 | return(V_getRealValueFromHDF5(fname,path)) |
---|
1314 | endif |
---|
1315 | End |
---|
1316 | |
---|
1317 | // TODO -- write this function to return a WAVE with the data |
---|
1318 | // either as a wave reference, or as an input parameter |
---|
1319 | Function V_getDetTube_spatialCalib(fname,detStr,outW) |
---|
1320 | String fname,detStr |
---|
1321 | Wave outW |
---|
1322 | |
---|
1323 | String path = "entry:instrument:detector_"+detStr+":spatial_calibration" |
---|
1324 | if(cmpstr(detStr,"B") == 0) |
---|
1325 | return(0) |
---|
1326 | else |
---|
1327 | WAVE w = V_getRealWaveFromHDF5(fname,path) |
---|
1328 | |
---|
1329 | outW = w |
---|
1330 | return(0) |
---|
1331 | endif |
---|
1332 | End |
---|
1333 | |
---|
1334 | // TODO -- be clear on how this is defined. |
---|
1335 | Function V_getDet_tubeIndex(fname,detStr) |
---|
1336 | String fname,detStr |
---|
1337 | |
---|
1338 | String path = "entry:instrument:detector_"+detStr+":tube_index" |
---|
1339 | if(cmpstr(detStr,"B") == 0) |
---|
1340 | return(0) |
---|
1341 | else |
---|
1342 | return(V_getRealValueFromHDF5(fname,path)) |
---|
1343 | endif |
---|
1344 | End |
---|
1345 | |
---|
1346 | Function/S V_getDet_tubeOrientation(fname,detStr) |
---|
1347 | String fname,detStr |
---|
1348 | |
---|
1349 | String path = "entry:instrument:detector_"+detStr+":tube_orientation" |
---|
1350 | Variable num=60 |
---|
1351 | if(cmpstr(detStr,"B") == 0) |
---|
1352 | return("") |
---|
1353 | else |
---|
1354 | return(V_getStringFromHDF5(fname,path,num)) |
---|
1355 | endif |
---|
1356 | End |
---|
1357 | |
---|
1358 | // TODO -- be clear on how this is defined. Units? |
---|
1359 | Function V_getDet_tubeWidth(fname,detStr) |
---|
1360 | String fname,detStr |
---|
1361 | |
---|
1362 | String path = "entry:instrument:detector_"+detStr+":tube_width" |
---|
1363 | if(cmpstr(detStr,"B") == 0) |
---|
1364 | return(0) |
---|
1365 | else |
---|
1366 | return(V_getRealValueFromHDF5(fname,path)) |
---|
1367 | endif |
---|
1368 | End |
---|
1369 | |
---|
1370 | ////////////////////// |
---|
1371 | |
---|
1372 | // INSTRUMENT/LENSES /APERTURES |
---|
1373 | // lenses (data folder) |
---|
1374 | |
---|
1375 | Function V_getLensCurvature(fname) |
---|
1376 | String fname |
---|
1377 | |
---|
1378 | String path = "entry:instrument:lenses:curvature" |
---|
1379 | return(V_getRealValueFromHDF5(fname,path)) |
---|
1380 | End |
---|
1381 | |
---|
1382 | Function/S V_getLensesFocusType(fname) |
---|
1383 | String fname |
---|
1384 | |
---|
1385 | String path = "entry:instrument:lenses:focus_type" |
---|
1386 | Variable num=60 |
---|
1387 | return(V_getStringFromHDF5(fname,path,num)) |
---|
1388 | End |
---|
1389 | |
---|
1390 | Function V_getLensDistance(fname) |
---|
1391 | String fname |
---|
1392 | |
---|
1393 | String path = "entry:instrument:lenses:lens_distance" |
---|
1394 | return(V_getRealValueFromHDF5(fname,path)) |
---|
1395 | End |
---|
1396 | |
---|
1397 | Function/S V_getLensGeometry(fname) |
---|
1398 | String fname |
---|
1399 | |
---|
1400 | String path = "entry:instrument:lenses:lens_geometry" |
---|
1401 | Variable num=60 |
---|
1402 | return(V_getStringFromHDF5(fname,path,num)) |
---|
1403 | End |
---|
1404 | |
---|
1405 | Function/S V_getLensMaterial(fname) |
---|
1406 | String fname |
---|
1407 | |
---|
1408 | String path = "entry:instrument:lenses:lens_material" |
---|
1409 | Variable num=60 |
---|
1410 | return(V_getStringFromHDF5(fname,path,num)) |
---|
1411 | End |
---|
1412 | |
---|
1413 | Function V_getNumber_of_Lenses(fname) |
---|
1414 | String fname |
---|
1415 | |
---|
1416 | String path = "entry:instrument:lenses:number_of_lenses" |
---|
1417 | return(V_getRealValueFromHDF5(fname,path)) |
---|
1418 | End |
---|
1419 | |
---|
1420 | Function V_getNumber_of_prisms(fname) |
---|
1421 | String fname |
---|
1422 | |
---|
1423 | String path = "entry:instrument:lenses:number_of_prisms" |
---|
1424 | return(V_getRealValueFromHDF5(fname,path)) |
---|
1425 | End |
---|
1426 | |
---|
1427 | Function V_getPrism_distance(fname) |
---|
1428 | String fname |
---|
1429 | |
---|
1430 | String path = "entry:instrument:lenses:prism_distance" |
---|
1431 | return(V_getRealValueFromHDF5(fname,path)) |
---|
1432 | End |
---|
1433 | |
---|
1434 | Function/S V_getPrismMaterial(fname) |
---|
1435 | String fname |
---|
1436 | |
---|
1437 | String path = "entry:instrument:lenses:prism_material" |
---|
1438 | Variable num=60 |
---|
1439 | return(V_getStringFromHDF5(fname,path,num)) |
---|
1440 | End |
---|
1441 | |
---|
1442 | // status of lens/prism = lens | prism | both | out |
---|
1443 | Function/S V_getLensPrismStatus(fname) |
---|
1444 | String fname |
---|
1445 | |
---|
1446 | String path = "entry:instrument:lenses:status" |
---|
1447 | Variable num=60 |
---|
1448 | return(V_getStringFromHDF5(fname,path,num)) |
---|
1449 | End |
---|
1450 | |
---|
1451 | |
---|
1452 | /////// sample_aperture (data folder) |
---|
1453 | |
---|
1454 | Function/S V_getSampleAp_Description(fname) |
---|
1455 | String fname |
---|
1456 | |
---|
1457 | String path = "entry:instrument:sample_aperture:description" |
---|
1458 | Variable num=60 |
---|
1459 | return(V_getStringFromHDF5(fname,path,num)) |
---|
1460 | End |
---|
1461 | |
---|
1462 | Function V_getSampleAp_distance(fname) |
---|
1463 | String fname |
---|
1464 | |
---|
1465 | String path = "entry:instrument:sample_aperture:distance" |
---|
1466 | return(V_getRealValueFromHDF5(fname,path)) |
---|
1467 | End |
---|
1468 | // shape (data folder) |
---|
1469 | |
---|
1470 | Function/S V_getSampleAp_shape(fname) |
---|
1471 | String fname |
---|
1472 | |
---|
1473 | String path = "entry:instrument:sample_aperture:shape:shape" |
---|
1474 | Variable num=60 |
---|
1475 | return(V_getStringFromHDF5(fname,path,num)) |
---|
1476 | End |
---|
1477 | |
---|
1478 | // TODO -- this needs to return a WAVE, since the shape may be circle, or rectangle |
---|
1479 | // and will need to return more than a single dimension |
---|
1480 | // TODO -- be careful of the UNITS |
---|
1481 | Function V_getSampleAp_size(fname,outW) |
---|
1482 | String fname |
---|
1483 | Wave outW |
---|
1484 | |
---|
1485 | String path = "entry:instrument:sample_aperture:shape:size" |
---|
1486 | WAVE w = V_getRealWaveFromHDF5(fname,path) |
---|
1487 | |
---|
1488 | outW = w |
---|
1489 | return(0) |
---|
1490 | End |
---|
1491 | |
---|
1492 | /////// sample_aperture_2 (data folder) |
---|
1493 | |
---|
1494 | Function/S V_getSampleAp2_Description(fname) |
---|
1495 | String fname |
---|
1496 | |
---|
1497 | String path = "entry:instrument:sample_aperture_2:description" |
---|
1498 | Variable num=60 |
---|
1499 | return(V_getStringFromHDF5(fname,path,num)) |
---|
1500 | End |
---|
1501 | |
---|
1502 | Function V_getSampleAp2_distance(fname) |
---|
1503 | String fname |
---|
1504 | |
---|
1505 | String path = "entry:instrument:sample_aperture_2:distance" |
---|
1506 | return(V_getRealValueFromHDF5(fname,path)) |
---|
1507 | End |
---|
1508 | // shape (data folder) |
---|
1509 | |
---|
1510 | Function/S V_getSampleAp2_shape(fname) |
---|
1511 | String fname |
---|
1512 | |
---|
1513 | String path = "entry:instrument:sample_aperture_2:shape:shape" |
---|
1514 | Variable num=60 |
---|
1515 | return(V_getStringFromHDF5(fname,path,num)) |
---|
1516 | End |
---|
1517 | |
---|
1518 | // TODO -- this needs to return a WAVE, since the shape may be circle, or rectangle |
---|
1519 | // and will need to return more than a single dimension |
---|
1520 | // TODO -- be careful of the UNITS |
---|
1521 | Function V_getSampleAp2_size(fname,outW) |
---|
1522 | String fname |
---|
1523 | Wave outW |
---|
1524 | |
---|
1525 | String path = "entry:instrument:sample_aperture_2:shape:size" |
---|
1526 | WAVE w = V_getRealWaveFromHDF5(fname,path) |
---|
1527 | |
---|
1528 | outW = w |
---|
1529 | return(0) |
---|
1530 | End |
---|
1531 | |
---|
1532 | ////// sample_table (data folder) |
---|
1533 | // location = "CHAMBER" or HUBER |
---|
1534 | Function/S V_getSampleTableLocation(fname) |
---|
1535 | String fname |
---|
1536 | |
---|
1537 | String path = "entry:instrument:sample_table:location" |
---|
1538 | Variable num=60 |
---|
1539 | return(V_getStringFromHDF5(fname,path,num)) |
---|
1540 | End |
---|
1541 | |
---|
1542 | // TODO - verify the meaning |
---|
1543 | // offset_distance (?? for center of sample table vs. sample position) |
---|
1544 | Function V_getSampleTableOffset(fname) |
---|
1545 | String fname |
---|
1546 | |
---|
1547 | String path = "entry:instrument:sample_table:offset_distance" |
---|
1548 | return(V_getRealValueFromHDF5(fname,path)) |
---|
1549 | End |
---|
1550 | |
---|
1551 | // source (data folder) |
---|
1552 | //name "NCNR" |
---|
1553 | Function/S V_getSourceName(fname) |
---|
1554 | String fname |
---|
1555 | |
---|
1556 | String path = "entry:instrument:source:name" |
---|
1557 | Variable num=60 |
---|
1558 | return(V_getStringFromHDF5(fname,path,num)) |
---|
1559 | End |
---|
1560 | |
---|
1561 | // power -- nominal only, not connected to any real number |
---|
1562 | Function V_getReactorPower(fname) |
---|
1563 | String fname |
---|
1564 | |
---|
1565 | String path = "entry:instrument:source:power" |
---|
1566 | return(V_getRealValueFromHDF5(fname,path)) |
---|
1567 | End |
---|
1568 | |
---|
1569 | //probe (wave) "neutron" |
---|
1570 | Function/S V_getSourceProbe(fname) |
---|
1571 | String fname |
---|
1572 | |
---|
1573 | String path = "entry:instrument:source:probe" |
---|
1574 | Variable num=60 |
---|
1575 | return(V_getStringFromHDF5(fname,path,num)) |
---|
1576 | End |
---|
1577 | |
---|
1578 | //type (wave) "Reactor Neutron Source" |
---|
1579 | Function/S V_getSourceType(fname) |
---|
1580 | String fname |
---|
1581 | |
---|
1582 | String path = "entry:instrument:source:type" |
---|
1583 | Variable num=60 |
---|
1584 | return(V_getStringFromHDF5(fname,path,num)) |
---|
1585 | End |
---|
1586 | |
---|
1587 | |
---|
1588 | /////// source_aperture (data folder) |
---|
1589 | |
---|
1590 | Function/S V_getSourceAp_Description(fname) |
---|
1591 | String fname |
---|
1592 | |
---|
1593 | String path = "entry:instrument:source_aperture:description" |
---|
1594 | Variable num=60 |
---|
1595 | return(V_getStringFromHDF5(fname,path,num)) |
---|
1596 | End |
---|
1597 | |
---|
1598 | Function V_getSourceAp_distance(fname) |
---|
1599 | String fname |
---|
1600 | |
---|
1601 | String path = "entry:instrument:source_aperture:distance" |
---|
1602 | return(V_getRealValueFromHDF5(fname,path)) |
---|
1603 | End |
---|
1604 | // shape (data folder) |
---|
1605 | |
---|
1606 | Function/S V_getSourceAp_shape(fname) |
---|
1607 | String fname |
---|
1608 | |
---|
1609 | String path = "entry:instrument:source_aperture:shape:shape" |
---|
1610 | Variable num=60 |
---|
1611 | return(V_getStringFromHDF5(fname,path,num)) |
---|
1612 | End |
---|
1613 | |
---|
1614 | // TODO -- this needs to return a WAVE, since the shape may be circle, or rectangle |
---|
1615 | // and will need to return more than a single dimension |
---|
1616 | // TODO -- be careful of the UNITS |
---|
1617 | Function V_getSourceAp_size(fname,outW) |
---|
1618 | String fname |
---|
1619 | Wave outW |
---|
1620 | |
---|
1621 | String path = "entry:instrument:source_aperture:shape:size" |
---|
1622 | WAVE w = V_getRealWaveFromHDF5(fname,path) |
---|
1623 | |
---|
1624 | outW = w |
---|
1625 | return(0) |
---|
1626 | End |
---|
1627 | |
---|
1628 | |
---|
1629 | |
---|
1630 | |
---|
1631 | //////// SAMPLE |
---|
1632 | //////// SAMPLE |
---|
1633 | //////// SAMPLE |
---|
1634 | |
---|
1635 | //Sample position in changer |
---|
1636 | // TODO -- in the NexusWriter, this ends up as a STRING -- which is wrong. it needs to be FP |
---|
1637 | Function V_getSamplePosition(fname) |
---|
1638 | String fname |
---|
1639 | |
---|
1640 | String path = "entry:sample:changer_position" |
---|
1641 | return(V_getRealValueFromHDF5(fname,path)) |
---|
1642 | end |
---|
1643 | |
---|
1644 | // sample label |
---|
1645 | // TODO: value of num is currently not used |
---|
1646 | Function/S V_getSampleDescription(fname) |
---|
1647 | String fname |
---|
1648 | |
---|
1649 | String path = "entry:sample:description" |
---|
1650 | Variable num=60 |
---|
1651 | return(V_getStringFromHDF5(fname,path,num)) |
---|
1652 | End |
---|
1653 | |
---|
1654 | //no meaning to this... |
---|
1655 | Function V_getSample_equatorial_ang(fname) |
---|
1656 | String fname |
---|
1657 | |
---|
1658 | String path = "entry:sample:equatorial_angle" |
---|
1659 | return(V_getRealValueFromHDF5(fname,path)) |
---|
1660 | end |
---|
1661 | |
---|
1662 | // group ID !!! very important for matching up files |
---|
1663 | Function V_getSample_GroupID(fname) |
---|
1664 | String fname |
---|
1665 | |
---|
1666 | String path = "entry:sample:group_id" |
---|
1667 | return(V_getRealValueFromHDF5(fname,path)) |
---|
1668 | end |
---|
1669 | |
---|
1670 | |
---|
1671 | //Sample Rotation Angle |
---|
1672 | Function V_getSampleRotationAngle(fname) |
---|
1673 | String fname |
---|
1674 | |
---|
1675 | String path = "entry:sample:rotation_angle" |
---|
1676 | return(V_getRealValueFromHDF5(fname,path)) |
---|
1677 | end |
---|
1678 | |
---|
1679 | //?? this is huber/chamber?? |
---|
1680 | // TODO -- then where is the description of 10CB, etc... |
---|
1681 | Function/S V_getSampleHolderDescription(fname) |
---|
1682 | String fname |
---|
1683 | |
---|
1684 | String path = "entry:sample:sample_holder_description" |
---|
1685 | Variable num=60 |
---|
1686 | return(V_getStringFromHDF5(fname,path,num)) |
---|
1687 | End |
---|
1688 | |
---|
1689 | //Sample Thickness |
---|
1690 | // TODO -- somehow, this is not set correctly in the acquisition, so NaN results |
---|
1691 | Function V_getSampleThickness(fname) |
---|
1692 | String fname |
---|
1693 | |
---|
1694 | String path = "entry:sample:thickness" |
---|
1695 | return(V_getRealValueFromHDF5(fname,path)) |
---|
1696 | end |
---|
1697 | |
---|
1698 | // sample transmission |
---|
1699 | Function V_getSampleTransmission(fname) |
---|
1700 | String fname |
---|
1701 | |
---|
1702 | String path = "entry:sample:transmission" |
---|
1703 | // String path = "QKK0037737:data:Transmission" |
---|
1704 | return(V_getRealValueFromHDF5(fname,path)) |
---|
1705 | end |
---|
1706 | |
---|
1707 | //transmission error (one sigma) |
---|
1708 | Function V_getSampleTransError(fname) |
---|
1709 | String fname |
---|
1710 | |
---|
1711 | String path = "entry:sample:transmission_error" |
---|
1712 | return(V_getRealValueFromHDF5(fname,path)) |
---|
1713 | end |
---|
1714 | |
---|
1715 | |
---|
1716 | |
---|
1717 | |
---|
1718 | //// SAMPLE / DATA LOGS |
---|
1719 | // write this generic , call with the name of the environment log desired |
---|
1720 | // |
---|
1721 | // temperature_1 |
---|
1722 | // temperature_2 |
---|
1723 | // shear_field |
---|
1724 | // pressure |
---|
1725 | // magnetic_field |
---|
1726 | // electric_field |
---|
1727 | // |
---|
1728 | //////// (for example) electric_field (data folder) |
---|
1729 | |
---|
1730 | Function/S V_getLog_attachedTo(fname,logStr) |
---|
1731 | String fname,logStr |
---|
1732 | |
---|
1733 | String path = "entry:sample:"+logstr+":attached_to" |
---|
1734 | Variable num=60 |
---|
1735 | return(V_getStringFromHDF5(fname,path,num)) |
---|
1736 | End |
---|
1737 | |
---|
1738 | |
---|
1739 | Function/S V_getLog_measurement(fname,logStr) |
---|
1740 | String fname,logStr |
---|
1741 | |
---|
1742 | String path = "entry:sample:"+logstr+":measurement" |
---|
1743 | Variable num=60 |
---|
1744 | return(V_getStringFromHDF5(fname,path,num)) |
---|
1745 | End |
---|
1746 | |
---|
1747 | |
---|
1748 | Function/S V_getLog_Name(fname,logStr) |
---|
1749 | String fname,logStr |
---|
1750 | |
---|
1751 | String path = "entry:sample:"+logstr+":name" |
---|
1752 | Variable num=60 |
---|
1753 | return(V_getStringFromHDF5(fname,path,num)) |
---|
1754 | End |
---|
1755 | |
---|
1756 | |
---|
1757 | // TODO -- |
---|
1758 | Function V_getLog_nomValue(fname,logStr) |
---|
1759 | String fname,logStr |
---|
1760 | |
---|
1761 | String path = "entry:sample:"+logstr+":value" |
---|
1762 | return(V_getRealValueFromHDF5(fname,path)) |
---|
1763 | end |
---|
1764 | |
---|
1765 | //// value_log (data folder) |
---|
1766 | Function/S V_getLog_startTime(fname,logStr) |
---|
1767 | String fname,logStr |
---|
1768 | |
---|
1769 | String path = "entry:sample:"+logstr+":value_log:start" |
---|
1770 | Variable num=60 |
---|
1771 | return(V_getStringFromHDF5(fname,path,num)) |
---|
1772 | End |
---|
1773 | |
---|
1774 | // TODO -- |
---|
1775 | Function V_getLog_avgValue(fname,logStr) |
---|
1776 | String fname,logStr |
---|
1777 | |
---|
1778 | String path = "entry:sample:"+logstr+":value_log:average_value" |
---|
1779 | return(V_getRealValueFromHDF5(fname,path)) |
---|
1780 | end |
---|
1781 | |
---|
1782 | // TODO -- this needs to be a WAVE reference |
---|
1783 | Function V_getLog_time(fname,logStr,outW) |
---|
1784 | String fname,logStr |
---|
1785 | Wave outW |
---|
1786 | |
---|
1787 | String path = "entry:sample:"+logstr+":value_log:nx_time" |
---|
1788 | WAVE w = V_getRealWaveFromHDF5(fname,path) |
---|
1789 | |
---|
1790 | outW = w |
---|
1791 | return(0) |
---|
1792 | end |
---|
1793 | |
---|
1794 | |
---|
1795 | // TODO -- this needs to be a WAVE reference |
---|
1796 | Function V_getLog_Value(fname,logStr,outW) |
---|
1797 | String fname,logStr |
---|
1798 | Wave outW |
---|
1799 | |
---|
1800 | String path = "entry:sample:"+logstr+":value_log:value" |
---|
1801 | WAVE w = V_getRealWaveFromHDF5(fname,path) |
---|
1802 | |
---|
1803 | outW = w |
---|
1804 | return(0) |
---|
1805 | end |
---|
1806 | |
---|
1807 | |
---|
1808 | |
---|
1809 | |
---|
1810 | |
---|
1811 | |
---|
1812 | |
---|
1813 | ///////// REDUCTION |
---|
1814 | ///////// REDUCTION |
---|
1815 | ///////// REDUCTION |
---|
1816 | |
---|
1817 | |
---|
1818 | // TODO -- needs to be a WAVE |
---|
1819 | Function V_getAbsolute_Scaling(fname,outW) |
---|
1820 | String fname |
---|
1821 | Wave outW |
---|
1822 | |
---|
1823 | String path = "entry:reduction:absolute_scaling" |
---|
1824 | WAVE w = V_getRealWaveFromHDF5(fname,path) |
---|
1825 | |
---|
1826 | outW = w |
---|
1827 | return(0) |
---|
1828 | end |
---|
1829 | |
---|
1830 | // TODO -- needs to be a WAVE |
---|
1831 | Function V_getBoxCoordinates(fname,outW) |
---|
1832 | String fname |
---|
1833 | Wave outW |
---|
1834 | |
---|
1835 | String path = "entry:reduction:box_coordinates" |
---|
1836 | WAVE w = V_getRealWaveFromHDF5(fname,path) |
---|
1837 | |
---|
1838 | outW = w |
---|
1839 | return(0) |
---|
1840 | end |
---|
1841 | |
---|
1842 | //box counts |
---|
1843 | Function V_getBoxCounts(fname) |
---|
1844 | String fname |
---|
1845 | |
---|
1846 | String path = "entry:reduction:box_count" |
---|
1847 | return(V_getRealValueFromHDF5(fname,path)) |
---|
1848 | end |
---|
1849 | |
---|
1850 | //box counts error |
---|
1851 | Function V_getBoxCountsError(fname) |
---|
1852 | String fname |
---|
1853 | |
---|
1854 | String path = "entry:reduction:box_count_error" |
---|
1855 | return(V_getRealValueFromHDF5(fname,path)) |
---|
1856 | end |
---|
1857 | |
---|
1858 | Function/S V_getReductionComments(fname) |
---|
1859 | String fname |
---|
1860 | |
---|
1861 | String path = "entry:reduction:comments" |
---|
1862 | Variable num=60 |
---|
1863 | return(V_getStringFromHDF5(fname,path,num)) |
---|
1864 | End |
---|
1865 | |
---|
1866 | |
---|
1867 | Function/S V_getReductionIntent(fname) |
---|
1868 | String fname |
---|
1869 | |
---|
1870 | String path = "entry:reduction:intent" |
---|
1871 | Variable num=60 |
---|
1872 | return(V_getStringFromHDF5(fname,path,num)) |
---|
1873 | End |
---|
1874 | |
---|
1875 | |
---|
1876 | Function/S V_getLogFileName(fname) |
---|
1877 | String fname |
---|
1878 | |
---|
1879 | String path = "entry:reduction:sans_log_file_name" |
---|
1880 | Variable num=60 |
---|
1881 | return(V_getStringFromHDF5(fname,path,num)) |
---|
1882 | End |
---|
1883 | |
---|
1884 | |
---|
1885 | Function/S V_getSensitivityFileName(fname) |
---|
1886 | String fname |
---|
1887 | |
---|
1888 | String path = "entry:reduction:sensitivity_file_name" |
---|
1889 | Variable num=60 |
---|
1890 | return(V_getStringFromHDF5(fname,path,num)) |
---|
1891 | End |
---|
1892 | |
---|
1893 | Function/S V_getTransmissionFileName(fname) |
---|
1894 | String fname |
---|
1895 | |
---|
1896 | String path = "entry:reduction:transmission_file_name" |
---|
1897 | Variable num=60 |
---|
1898 | return(V_getStringFromHDF5(fname,path,num)) |
---|
1899 | End |
---|
1900 | |
---|
1901 | Function/S V_getEmptyBeamFileName(fname) |
---|
1902 | String fname |
---|
1903 | |
---|
1904 | String path = "entry:reduction:empty_beam_file_name" |
---|
1905 | Variable num=60 |
---|
1906 | return(V_getStringFromHDF5(fname,path,num)) |
---|
1907 | End |
---|
1908 | |
---|
1909 | |
---|
1910 | //whole detector trasmission |
---|
1911 | Function V_getSampleTransWholeDetector(fname) |
---|
1912 | String fname |
---|
1913 | |
---|
1914 | String path = "entry:reduction:whole_trans" |
---|
1915 | return(V_getRealValueFromHDF5(fname,path)) |
---|
1916 | end |
---|
1917 | |
---|
1918 | //whole detector trasmission error |
---|
1919 | Function V_getSampleTransWholeDetErr(fname) |
---|
1920 | String fname |
---|
1921 | |
---|
1922 | String path = "entry:reduction:whole_trans_error" |
---|
1923 | return(V_getRealValueFromHDF5(fname,path)) |
---|
1924 | end |
---|
1925 | |
---|
1926 | |
---|
1927 | ///// pol_sans (data folder) |
---|
1928 | |
---|
1929 | Function/S V_getPolSANS_cellName(fname) |
---|
1930 | String fname |
---|
1931 | |
---|
1932 | String path = "entry:reduction:pol_sans:cell_name" |
---|
1933 | Variable num=60 |
---|
1934 | return(V_getStringFromHDF5(fname,path,num)) |
---|
1935 | End |
---|
1936 | |
---|
1937 | |
---|
1938 | // TODO -- needs to be a WAVE |
---|
1939 | Function V_getPolSANS_cellParams(fname,outW) |
---|
1940 | String fname |
---|
1941 | Wave outW |
---|
1942 | |
---|
1943 | String path = "entry:reduction:pol_sans:cell_parameters" |
---|
1944 | WAVE w = V_getRealWaveFromHDF5(fname,path) |
---|
1945 | |
---|
1946 | outW = w |
---|
1947 | return(0) |
---|
1948 | end |
---|
1949 | |
---|
1950 | Function/S V_getPolSANS_PolSANSPurpose(fname) |
---|
1951 | String fname |
---|
1952 | |
---|
1953 | String path = "entry:reduction:pol_sans:pol_sans_purpose" |
---|
1954 | Variable num=60 |
---|
1955 | return(V_getStringFromHDF5(fname,path,num)) |
---|
1956 | End |
---|
1957 | |
---|
1958 | |
---|
1959 | //////// TOP LEVEL DATA REPRESENTATION |
---|
1960 | // |
---|
1961 | // note that here the data is (supposed to be) a link, not the actual data |
---|
1962 | // Igor HDf implementation cannot follow links properly, as far as I know. |
---|
1963 | // so ignore them here, and focus on the image that may be possible to read |
---|
1964 | // |
---|
1965 | |
---|
1966 | // data_B (data folder) |
---|
1967 | // data (wave) 1 //ignore this, it's a link |
---|
1968 | // variables (wave) 320 |
---|
1969 | // thumbnail (data folder) |
---|
1970 | |
---|
1971 | //data (wave) "binary" |
---|
1972 | // TODO -- this will need to be completely replaced with a function that can |
---|
1973 | // read the binary image data. should be possible, but I don't know the details on either end... |
---|
1974 | Function/S V_getDataImage(fname,detStr) |
---|
1975 | String fname,detStr |
---|
1976 | |
---|
1977 | String path = "entry:data_"+detStr+":thumbnail:data" |
---|
1978 | Variable num=60 |
---|
1979 | return(V_getStringFromHDF5(fname,path,num)) |
---|
1980 | End |
---|
1981 | |
---|
1982 | Function/S V_getDataImageDescription(fname,detStr) |
---|
1983 | String fname,detStr |
---|
1984 | |
---|
1985 | String path = "entry:data_"+detStr+":thumbnail:description" |
---|
1986 | Variable num=60 |
---|
1987 | return(V_getStringFromHDF5(fname,path,num)) |
---|
1988 | End |
---|
1989 | |
---|
1990 | Function/S V_getDataImageType(fname,detStr) |
---|
1991 | String fname,detStr |
---|
1992 | |
---|
1993 | String path = "entry:data_"+detStr+":thumbnail:type" |
---|
1994 | Variable num=60 |
---|
1995 | return(V_getStringFromHDF5(fname,path,num)) |
---|
1996 | End |
---|
1997 | |
---|
1998 | |
---|
1999 | |
---|
2000 | |
---|
2001 | |
---|
2002 | |
---|
2003 | |
---|