source: sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_HDF5_Read.ipf @ 969

Last change on this file since 969 was 969, checked in by srkline, 7 years ago

more additions to the R/W functions to access VSANS data files

File size: 45.7 KB
Line 
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//
20Function proto_V_get_FP(str)
21        String str
22        return(0)
23end
24Function proto_V_get_FP2(str,str2)
25        String str,str2
26        return(0)
27end
28//Function/S proto_V_get_STR(str)
29//      String str
30//      return("")
31//end
32
33Function 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)
52end
53
54Function 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)
73end
74
75Function 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)
98end
99
100Function 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)
123end
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
153Function/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))
159End
160
161// TODO -- not mine, added somewhere by Nexus writer?
162// data collection time (! this is the true counting time??)
163Function V_getCollectionTime(fname)
164        String fname
165       
166        String path = "entry:collection_time"   
167        return(V_getRealValueFromHDF5(fname,path))
168End
169
170// data directory where data files are stored (for user access, not archive)
171Function/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))
177End
178
179// Base class of Nexus definition (=NXsas)
180Function/S V_getNexusDefinition(fname)
181        String fname
182       
183        String path = "entry:definition"       
184        Variable num=60
185        return(V_getStringFromHDF5(fname,path,num))
186End
187
188// TODO -- not mine, added somewhere by Nexus writer?
189// data collection duration (may include pauses, other "dead" time)
190Function V_getDataDuration(fname)
191        String fname
192       
193        String path = "entry:duration" 
194        return(V_getRealValueFromHDF5(fname,path))
195End
196
197// TODO -- not mine, added somewhere by Nexus writer?
198// data collection end time
199Function/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))
205End
206
207// experiment description
208Function/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))
214End
215
216// experiment identifier? used only by NICE?
217Function/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))
223End
224
225// name of facility = NCNR
226Function/S V_getFacility(fname)
227        String fname
228       
229        String path = "entry:facility" 
230        Variable num=60
231        return(V_getStringFromHDF5(fname,path,num))
232End
233               
234// file write time (what is this??
235// TODO - figure out if this is supposed to be an integer or text (ISO)
236Function V_getFileWriteTime(fname)
237        String fname
238       
239        String path = "entry:file_time"
240        return(V_getRealValueFromHDF5(fname,path))
241End
242               
243//
244Function/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))
250End
251
252// TODO -- not mine, added somewhere by Nexus writer?
253Function/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))
259End
260
261// TODO -- not mine, added somewhere by Nexus writer?
262// data collection start time
263Function/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))
269End
270               
271// title of experiment
272Function/S V_getTitle(fname)
273        String fname
274       
275        String path = "entry:title"     
276        Variable num=60
277        return(V_getStringFromHDF5(fname,path,num))
278end
279       
280       
281               
282////////// USER
283////////// USER
284////////// USER
285
286// list of user names
287// TODO -- currently not written out to data file??
288Function/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))
294end
295
296
297//////// CONTROL
298//////// CONTROL
299//////// CONTROL
300
301// TODO -- for the control section, document each of the fields
302
303Function V_getCount_end(fname)
304        String fname
305       
306        String path = "entry:control:count_end"
307        return(V_getRealValueFromHDF5(fname,path))
308end
309
310
311Function V_getCount_start(fname)
312        String fname
313       
314        String path = "entry:control:count_start"       
315        return(V_getRealValueFromHDF5(fname,path))
316end
317
318
319Function V_getCount_time(fname)
320        String fname
321       
322        String path = "entry:control:count_time"       
323        return(V_getRealValueFromHDF5(fname,path))
324end
325
326
327Function V_getCount_time_preset(fname)
328        String fname
329       
330        String path = "entry:control:count_time_preset"
331        return(V_getRealValueFromHDF5(fname,path))
332end
333
334
335Function V_getDetector_counts(fname)
336        String fname
337       
338        String path = "entry:control:detector_counts"   
339        return(V_getRealValueFromHDF5(fname,path))
340end
341
342
343Function V_getDetector_preset(fname)
344        String fname
345       
346        String path = "entry:control:detector_preset"   
347        return(V_getRealValueFromHDF5(fname,path))
348end
349
350
351Function V_getIntegral(fname)
352        String fname
353       
354        String path = "entry:control:integral" 
355        return(V_getRealValueFromHDF5(fname,path))
356end
357
358// control mode for data acquisition, "timer"
359Function/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))
365End
366
367//monitor count
368Function V_getMonitorCount(fname)
369        String fname
370       
371        String path = "entry:control:monitor_counts"   
372        return(V_getRealValueFromHDF5(fname,path))
373end
374
375Function V_getMonitor_preset(fname)
376        String fname
377       
378        String path = "entry:control:monitor_preset"   
379        return(V_getRealValueFromHDF5(fname,path))
380end
381
382Function V_getPreset(fname)
383        String fname
384       
385        String path = "entry:control:preset"   
386        return(V_getRealValueFromHDF5(fname,path))
387end
388
389
390
391
392
393//////// INSTRUMENT
394//////// INSTRUMENT
395//////// INSTRUMENT
396
397Function/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))
403End
404
405Function/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))
411End
412
413Function/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))
419End
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)
425Function V_getAtten_number(fname)
426        String fname
427       
428        String path = "entry:instrument:attenuator:atten_number"       
429        return(V_getRealValueFromHDF5(fname,path))
430end
431
432
433// transmission value for the attenuator in the beam
434// use this, but if something wrong, the tables are present
435Function V_getAttenuator_transmission(fname)
436        String fname
437       
438        String path = "entry:instrument:attenuator:attenuator_transmission"     
439        return(V_getRealValueFromHDF5(fname,path))
440end
441
442
443// distance from the attenuator to the sample (units??)
444Function V_getAttenDistance(fname)
445        String fname
446       
447        String path = "entry:instrument:attenuator:distance"   
448        return(V_getRealValueFromHDF5(fname,path))
449end
450
451
452// attenuator index, to use in the lookup table of transmission values
453Function V_getAttenIndex(fname)
454        String fname
455       
456        String path = "entry:instrument:attenuator:index"       
457        return(V_getRealValueFromHDF5(fname,path))
458end
459
460
461// table of the attenuation factor
462Function 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)
471end
472
473
474// status "in or out"
475Function/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))
481End
482
483// thickness of the attenuator (PMMA) - units??
484Function V_getAttenThickness(fname)
485        String fname
486       
487        String path = "entry:instrument:attenuator:thickness"   
488        return(V_getRealValueFromHDF5(fname,path))
489end
490
491
492// type of material for the atteunator
493Function/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))
499End
500
501
502////// INSTRUMENT/BEAM
503// instrument/beam/chopper (data folder)
504Function V_getChopperAngular_opening(fname)
505        String fname
506       
507        String path = "entry:instrument:beam:chopper:angular_opening"   
508        return(V_getRealValueFromHDF5(fname,path))
509end
510
511Function 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))
516end
517
518Function 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))
523end
524
525Function V_getChopperDuty_cycle(fname)
526        String fname
527       
528        String path = "entry:instrument:beam:chopper:duty_cycle"       
529        return(V_getRealValueFromHDF5(fname,path))
530end
531
532Function V_getChopperRotation_speed(fname)
533        String fname
534       
535        String path = "entry:instrument:beam:chopper:rotation_speed"   
536        return(V_getRealValueFromHDF5(fname,path))
537end
538
539Function V_getChopperSlits(fname)
540        String fname
541       
542        String path = "entry:instrument:beam:chopper:slits"     
543        return(V_getRealValueFromHDF5(fname,path))
544end
545
546Function/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))
552End
553
554Function/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))
560End
561
562
563// instrument/beam/flipper (data folder)
564Function V_getFlipperDriving_current(fname)
565        String fname
566       
567        String path = "entry:instrument:beam:flipper:driving_current"   
568        return(V_getRealValueFromHDF5(fname,path))
569end
570
571Function V_getFlipperFrequency(fname)
572        String fname
573       
574        String path = "entry:instrument:beam:flipper:frequency"
575        return(V_getRealValueFromHDF5(fname,path))
576end
577
578Function/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))
584End
585
586Function V_getFlipperTransmitted_power(fname)
587        String fname
588       
589        String path = "entry:instrument:beam:flipper:transmitted_power"
590        return(V_getRealValueFromHDF5(fname,path))
591end
592
593Function/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))
599End
600
601// instrument/beam/monochromator (data folder)
602Function/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))
608End
609
610Function V_getWavelength(fname)
611        String fname
612       
613        String path = "entry:instrument:beam:monochromator:wavelength" 
614        return(V_getRealValueFromHDF5(fname,path))
615end
616
617Function V_getWavelength_spread(fname)
618        String fname
619       
620        String path = "entry:instrument:beam:monochromator:wavelength_spread"   
621        return(V_getRealValueFromHDF5(fname,path))
622end
623
624// instrument/beam/monochromator/crystal (data folder)
625Function V_getCrystalEnergy(fname)
626        String fname
627       
628        String path = "entry:instrument:beam:monochromator:crystal:energy"     
629        return(V_getRealValueFromHDF5(fname,path))
630end
631
632Function V_getCrystalHorizontal_aperture(fname)
633        String fname
634       
635        String path = "entry:instrument:beam:monochromator:crystal:horizontal_aperture"
636        return(V_getRealValueFromHDF5(fname,path))
637end
638
639Function V_getCrystalHoriz_curvature(fname)
640        String fname
641       
642        String path = "entry:instrument:beam:monochromator:crystal:horizontal_curvature"       
643        return(V_getRealValueFromHDF5(fname,path))
644end
645
646Function V_getCrystalLattice_parameter(fname)
647        String fname
648       
649        String path = "entry:instrument:beam:monochromator:crystal:lattice_parameter"   
650        return(V_getRealValueFromHDF5(fname,path))
651end
652
653Function V_getCrystalnx_distance(fname)
654        String fname
655       
656        String path = "entry:instrument:beam:monochromator:crystal:nx_distance"
657        return(V_getRealValueFromHDF5(fname,path))
658end
659
660Function V_getCrystalReflection(fname)
661        String fname
662       
663        String path = "entry:instrument:beam:monochromator:crystal:reflection" 
664        return(V_getRealValueFromHDF5(fname,path))
665end
666
667Function V_getCrystalRotation(fname)
668        String fname
669       
670        String path = "entry:instrument:beam:monochromator:crystal:rotation"   
671        return(V_getRealValueFromHDF5(fname,path))
672end
673
674Function/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))
680End
681
682Function V_getCrystalVertical_aperture(fname)
683        String fname
684       
685        String path = "entry:instrument:beam:monochromator:crystal:vertical_aperture"   
686        return(V_getRealValueFromHDF5(fname,path))
687end
688
689Function V_getCrystalVertical_curvature(fname)
690        String fname
691       
692        String path = "entry:instrument:beam:monochromator:crystal:vertical_curvature" 
693        return(V_getRealValueFromHDF5(fname,path))
694end
695
696Function V_getCrystalWavelength(fname)
697        String fname
698       
699        String path = "entry:instrument:beam:monochromator:crystal:wavelength" 
700        return(V_getRealValueFromHDF5(fname,path))
701end
702
703Function V_getCrystalWavelength_spread(fname)
704        String fname
705       
706        String path = "entry:instrument:beam:monochromator:crystal:wavelength_spread"   
707        return(V_getRealValueFromHDF5(fname,path))
708end
709
710Function V_getCrystalWavevector(fname)
711        String fname
712       
713        String path = "entry:instrument:beam:monochromator:crystal:wavevector" 
714        return(V_getRealValueFromHDF5(fname,path))
715end
716
717// instrument/beam/monochromator/velocity_selector (data folder)
718Function 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))
723end
724
725Function 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))
730end
731
732Function/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))
738End
739
740Function 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)
749end
750
751Function 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))
756end
757
758Function 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))
763end
764
765Function V_getVSWavelength(fname)
766        String fname
767       
768        String path = "entry:instrument:beam:monochromator:velocity_selector:wavelength"       
769        return(V_getRealValueFromHDF5(fname,path))
770end
771
772Function 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))
777end
778
779// instrument/beam/monochromator/white_beam (data folder)
780Function/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))
786End
787
788Function V_getWhiteBeamWavelength(fname)
789        String fname
790       
791        String path = "entry:instrument:beam:monochromator:white_beam:wavelength"       
792        return(V_getRealValueFromHDF5(fname,path))
793end
794
795Function 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))
800end
801
802// instrument/beam/polarizer (data folder)
803Function/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))
809End
810
811Function V_getPolarizerEfficiency(fname)
812        String fname
813       
814        String path = "entry:instrument:beam:polarizer:efficiency"     
815        return(V_getRealValueFromHDF5(fname,path))
816end
817
818Function/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))
824End
825
826Function/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))
832End
833
834// instrument/beam/polarizer_analyzer (data folder)
835Function V_getPolAnaCell_index(fname)
836        String fname
837
838        String path = "entry:instrument:beam:polarizer_analyzer:cell_index"
839        return(V_getRealValueFromHDF5(fname,path))
840End
841
842Function/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))
848End
849
850Function 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)
859End
860
861Function 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))
866End
867
868Function 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))
873End
874
875Function V_getPolAnaSolenoid_current(fname)
876        String fname
877
878        String path = "entry:instrument:beam:polarizer_analyzer:solenoid_current"
879        return(V_getRealValueFromHDF5(fname,path))
880End
881
882Function/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))
888End
889
890                                       
891/////// INSTRUMENT/BEAM MONITORS
892
893//beam_monitor_low (data folder)
894Function V_getBeamMonLowData(fname)
895        String fname
896
897        String path = "entry:instrument:beam_monitor_low:data"
898        return(V_getRealValueFromHDF5(fname,path))
899End
900
901Function V_getBeamMonLowEfficiency(fname)
902        String fname
903
904        String path = "entry:instrument:beam_monitor_low:efficiency"
905        return(V_getRealValueFromHDF5(fname,path))
906End
907
908Function V_getBeamMonLownx_distance(fname)
909        String fname
910
911        String path = "entry:instrument:beam_monitor_low:nx_distance"
912        return(V_getRealValueFromHDF5(fname,path))
913End
914
915Function V_getBeamMonLowSaved_count(fname)
916        String fname
917
918        String path = "entry:instrument:beam_monitor_low:saved_count"
919        return(V_getRealValueFromHDF5(fname,path))
920End
921
922Function/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))
928End
929
930//beam_monitor_norm (data folder)
931Function V_getBeamMonNormData(fname)
932        String fname
933
934        String path = "entry:instrument:beam_monitor_norm:data"
935        return(V_getRealValueFromHDF5(fname,path))
936End
937
938Function V_getBeamMonNormEfficiency(fname)
939        String fname
940
941        String path = "entry:instrument:beam_monitor_norm:efficiency"
942        return(V_getRealValueFromHDF5(fname,path))
943End
944
945Function V_getBeamMonNormnx_distance(fname)
946        String fname
947
948        String path = "entry:instrument:beam_monitor_norm:nx_distance"
949        return(V_getRealValueFromHDF5(fname,path))
950End
951
952Function V_getBeamMonNormSaved_count(fname)
953        String fname
954
955        String path = "entry:instrument:beam_monitor_norm:saved_count"
956        return(V_getRealValueFromHDF5(fname,path))
957End
958
959Function/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))
965End
966
967//beam_stop (data folder)
968Function/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))
974End
975
976Function 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))
981End
982
983Function V_getBeamStop_x0(fname)
984        String fname
985
986        String path = "entry:instrument:beam_stop:x0"
987        return(V_getRealValueFromHDF5(fname,path))
988End
989
990Function V_getBeamStop_y0(fname)
991        String fname
992
993        String path = "entry:instrument:beam_stop:y0"
994        return(V_getRealValueFromHDF5(fname,path))
995End
996
997//// INSTRUMENT/COLLIMATOR
998//collimator (data folder)
999Function V_getNumberOfGuides(fname)
1000        String fname
1001
1002        String path = "entry:instrument:collimator:number_guides"
1003        return(V_getRealValueFromHDF5(fname,path))
1004End
1005
1006//                              geometry (data folder)
1007//                                      shape (data folder)
1008Function/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))
1014End
1015
1016Function V_getGuideSize(fname)
1017        String fname
1018
1019        String path = "entry:instrument:collimator:geometry:shape:size"
1020        return(V_getRealValueFromHDF5(fname,path))
1021End
1022
1023//                      converging_pinholes (data folder)
1024Function/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))
1030End
1031
1032//                      converging_slits (data folder)
1033Function/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))
1039End
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
1047Function 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
1060End
1061
1062// only defined for the "B" detector, and may not be necessary?
1063// TODO -- write to return an ARRAY
1064Function 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
1077End
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
1082Function 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
1093End
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
1098Function 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
1109End
1110
1111Function V_getDet_PixelNumX(fname,detStr)
1112        String fname,detStr
1113
1114        String path = "entry:instrument:detector_"+detStr+":PixelNumX"
1115        return(V_getRealValueFromHDF5(fname,path))
1116End
1117
1118Function V_getDet_PixelNumY(fname,detStr)
1119        String fname,detStr
1120
1121        String path = "entry:instrument:detector_"+detStr+":PixelNumY"
1122        return(V_getRealValueFromHDF5(fname,path))
1123End
1124
1125// only defined for the "B" detector, and only to satisfy NXsas
1126Function 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
1135End
1136
1137Function 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))
1142End
1143
1144Function 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))
1149End
1150
1151// TODO -- write this function to return a WAVE with the data
1152// either as a wave reference, or as an input parameter
1153Function 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)
1162End
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
1169Function 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)
1178End
1179
1180
1181Function/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))
1187End
1188
1189Function V_getDet_distance(fname,detStr)
1190        String fname,detStr
1191
1192        String path = "entry:instrument:detector_"+detStr+":distance"
1193        return(V_getRealValueFromHDF5(fname,path))
1194End
1195
1196// only defined for the "B" detector, and only to satisfy NXsas
1197Function 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
1206End
1207
1208Function/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))
1214End
1215
1216Function 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))
1221End
1222
1223Function 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))
1228End
1229
1230// only defined for the "B" detector, and only to satisfy NXsas
1231Function 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
1240End
1241
1242// only defined for the "B" detector, and only to satisfy NXsas
1243Function 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
1252End
1253
1254Function/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))
1260End
1261
1262// really has no meaning at all
1263Function V_getDet_size(fname,detStr)
1264        String fname,detStr
1265
1266        String path = "entry:instrument:detector_"+detStr+":size"
1267        return(V_getRealValueFromHDF5(fname,path))
1268End
1269
1270Function/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))
1276End
1277
1278Function 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))
1283End
1284
1285Function 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))
1290End
1291
1292/////////                       detector_FB (data folder) + ALL other PANEL DETECTORS
1293
1294Function 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
1303End
1304
1305// TODO -- be clear on how this is defined. Separation as defined from what point? Units?
1306Function 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
1315End
1316
1317// TODO -- write this function to return a WAVE with the data
1318// either as a wave reference, or as an input parameter
1319Function 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
1332End
1333
1334// TODO -- be clear on how this is defined.
1335Function 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
1344End
1345
1346Function/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
1356End
1357
1358// TODO -- be clear on how this is defined. Units?
1359Function 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
1368End
1369
1370//////////////////////
1371
1372// INSTRUMENT/LENSES    /APERTURES
1373//  lenses (data folder)
1374
1375Function V_getLensCurvature(fname)
1376        String fname
1377
1378        String path = "entry:instrument:lenses:curvature"
1379        return(V_getRealValueFromHDF5(fname,path))
1380End
1381
1382Function/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))
1388End
1389
1390Function V_getLensDistance(fname)
1391        String fname
1392
1393        String path = "entry:instrument:lenses:lens_distance"
1394        return(V_getRealValueFromHDF5(fname,path))
1395End
1396
1397Function/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))
1403End
1404
1405Function/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))
1411End
1412
1413Function V_getNumber_of_Lenses(fname)
1414        String fname
1415
1416        String path = "entry:instrument:lenses:number_of_lenses"
1417        return(V_getRealValueFromHDF5(fname,path))
1418End
1419
1420Function V_getNumber_of_prisms(fname)
1421        String fname
1422
1423        String path = "entry:instrument:lenses:number_of_prisms"
1424        return(V_getRealValueFromHDF5(fname,path))
1425End
1426
1427Function V_getPrism_distance(fname)
1428        String fname
1429
1430        String path = "entry:instrument:lenses:prism_distance"
1431        return(V_getRealValueFromHDF5(fname,path))
1432End
1433
1434Function/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))
1440End
1441
1442// status of lens/prism = lens | prism | both | out
1443Function/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))
1449End
1450       
1451
1452///////  sample_aperture (data folder)
1453
1454Function/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))
1460End
1461
1462Function V_getSampleAp_distance(fname)
1463        String fname
1464
1465        String path = "entry:instrument:sample_aperture:distance"
1466        return(V_getRealValueFromHDF5(fname,path))
1467End
1468//      shape (data folder)
1469
1470Function/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))
1476End
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
1481Function 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)
1490End             
1491
1492///////  sample_aperture_2 (data folder)
1493
1494Function/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))
1500End
1501
1502Function V_getSampleAp2_distance(fname)
1503        String fname
1504
1505        String path = "entry:instrument:sample_aperture_2:distance"
1506        return(V_getRealValueFromHDF5(fname,path))
1507End
1508//      shape (data folder)
1509
1510Function/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))
1516End
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
1521Function 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)
1530End             
1531               
1532//////  sample_table (data folder)
1533// location  = "CHAMBER" or HUBER
1534Function/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))
1540End
1541
1542// TODO - verify the meaning
1543//      offset_distance (?? for center of sample table vs. sample position)
1544Function V_getSampleTableOffset(fname)
1545        String fname
1546
1547        String path = "entry:instrument:sample_table:offset_distance"
1548        return(V_getRealValueFromHDF5(fname,path))
1549End     
1550       
1551//  source (data folder)
1552//name "NCNR"
1553Function/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))
1559End
1560
1561//      power -- nominal only, not connected to any real number
1562Function V_getReactorPower(fname)
1563        String fname
1564
1565        String path = "entry:instrument:source:power"
1566        return(V_getRealValueFromHDF5(fname,path))
1567End     
1568
1569//probe (wave) "neutron"
1570Function/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))
1576End
1577
1578//type (wave) "Reactor Neutron Source"
1579Function/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))
1585End
1586
1587       
1588///////  source_aperture (data folder)
1589
1590Function/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))
1596End
1597
1598Function V_getSourceAp_distance(fname)
1599        String fname
1600
1601        String path = "entry:instrument:source_aperture:distance"
1602        return(V_getRealValueFromHDF5(fname,path))
1603End
1604//      shape (data folder)
1605
1606Function/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))
1612End
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
1617Function 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)
1626End             
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
1637Function V_getSamplePosition(fname)
1638        String fname
1639       
1640        String path = "entry:sample:changer_position"   
1641        return(V_getRealValueFromHDF5(fname,path))
1642end
1643
1644// sample label
1645// TODO: value of num is currently not used
1646Function/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))
1652End
1653
1654//no meaning to this...
1655Function V_getSample_equatorial_ang(fname)
1656        String fname
1657       
1658        String path = "entry:sample:equatorial_angle"   
1659        return(V_getRealValueFromHDF5(fname,path))
1660end
1661
1662// group ID !!! very important for matching up files
1663Function V_getSample_GroupID(fname)
1664        String fname
1665       
1666        String path = "entry:sample:group_id"   
1667        return(V_getRealValueFromHDF5(fname,path))
1668end
1669
1670
1671//Sample Rotation Angle
1672Function V_getSampleRotationAngle(fname)
1673        String fname
1674       
1675        String path = "entry:sample:rotation_angle"     
1676        return(V_getRealValueFromHDF5(fname,path))
1677end
1678
1679//?? this is huber/chamber??
1680// TODO -- then where is the description of 10CB, etc...
1681Function/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))
1687End
1688
1689//Sample Thickness
1690// TODO -- somehow, this is not set correctly in the acquisition, so NaN results
1691Function V_getSampleThickness(fname)
1692        String fname
1693       
1694        String path = "entry:sample:thickness" 
1695        return(V_getRealValueFromHDF5(fname,path))
1696end
1697
1698// sample transmission
1699Function 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))
1705end
1706
1707//transmission error (one sigma)
1708Function V_getSampleTransError(fname)
1709        String fname
1710       
1711        String path = "entry:sample:transmission_error"
1712        return(V_getRealValueFromHDF5(fname,path))
1713end
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
1730Function/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))
1736End
1737
1738
1739Function/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))
1745End
1746
1747
1748Function/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))
1754End
1755
1756
1757// TODO --
1758Function V_getLog_nomValue(fname,logStr)
1759        String fname,logStr
1760       
1761        String path = "entry:sample:"+logstr+":value"
1762        return(V_getRealValueFromHDF5(fname,path))
1763end
1764
1765////            value_log (data folder)
1766Function/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))
1772End
1773
1774// TODO --
1775Function 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))
1780end
1781
1782// TODO -- this needs to be a WAVE reference
1783Function 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)
1792end
1793
1794
1795// TODO -- this needs to be a WAVE reference
1796Function 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)
1805end
1806
1807
1808
1809
1810
1811
1812
1813///////// REDUCTION
1814///////// REDUCTION
1815///////// REDUCTION
1816
1817
1818// TODO -- needs to be a WAVE
1819Function 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)
1828end
1829
1830// TODO -- needs to be a WAVE
1831Function 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)
1840end
1841
1842//box counts
1843Function V_getBoxCounts(fname)
1844        String fname
1845       
1846        String path = "entry:reduction:box_count"       
1847        return(V_getRealValueFromHDF5(fname,path))
1848end
1849
1850//box counts error
1851Function V_getBoxCountsError(fname)
1852        String fname
1853       
1854        String path = "entry:reduction:box_count_error"
1855        return(V_getRealValueFromHDF5(fname,path))
1856end
1857
1858Function/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))
1864End
1865
1866
1867Function/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))
1873End
1874
1875
1876Function/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))
1882End
1883
1884
1885Function/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))
1891End
1892
1893Function/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))
1899End
1900
1901Function/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))
1907End
1908
1909
1910//whole detector trasmission
1911Function V_getSampleTransWholeDetector(fname)
1912        String fname
1913       
1914        String path = "entry:reduction:whole_trans"     
1915        return(V_getRealValueFromHDF5(fname,path))
1916end
1917
1918//whole detector trasmission error
1919Function V_getSampleTransWholeDetErr(fname)
1920        String fname
1921       
1922        String path = "entry:reduction:whole_trans_error"       
1923        return(V_getRealValueFromHDF5(fname,path))
1924end
1925
1926                       
1927/////                   pol_sans (data folder)
1928
1929Function/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))
1935End
1936
1937
1938// TODO -- needs to be a WAVE
1939Function 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)
1948end
1949
1950Function/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))
1956End
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...
1974Function/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))
1980End
1981
1982Function/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))
1988End
1989                                                               
1990Function/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))
1996End
1997
1998
1999
2000
2001
2002
2003
Note: See TracBrowser for help on using the repository browser.