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

Last change on this file since 1022 was 1022, checked in by srkline, 6 years ago

ADDED:

included common NCNR procedures for the PlotManager?, to allow plotting of 1D data sets using a familiar interface

greatly expanded Patch functionality to include input in the multiple sections of the Nexus file, including separate panels to handle patching of waves to the file - needed for non-linear coefficients, dead time, and XY beam centers. All patch operations are expandable as more fields become necessary to patch.

removed bug of group_id being defined in /reduction and in /sample (removed R/W that referenced /reduction)

added panel to "isolate" a single detector panel, allowing the corrections to be applied/removed/recalculated as needed to directly see their effects.

linked new procedures to their appropriate action buttons

Added more data fields (label, intent, etc.) to the VCALC to Nexus data writer to get more realistic values into the fake data files for testing

Added VCALC simulation functions with EMP and BGD in anticipation of testing the CORRECT step

more little bug and documentation fixes which I can't remember, but they are all important...

File size: 56.6 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
24
25Function proto_V_get_FP2(str,str2)
26        String str,str2
27        return(0)
28end
29
30//Function/S proto_V_get_STR(str)
31//      String str
32//      return("")
33//end
34
35Macro Dump_V_getFP(fname)
36        String fname
37       
38        Test_V_get_FP("V_get*",fname)
39end
40
41Function Test_V_get_FP(str,fname)
42        String str,fname
43       
44        Variable ii,num
45        String list,item
46       
47       
48        list=FunctionList(str,";","NPARAMS:1,VALTYPE:1") //,VALTYPE:1 gives real return values, not strings
49//      Print list
50        num = ItemsInlist(list)
51       
52       
53        for(ii=0;ii<num;ii+=1)
54                item = StringFromList(ii, list , ";")
55                FUNCREF proto_V_get_FP f = $item
56                Print item ," = ", f(fname)
57        endfor
58       
59        return(0)
60end
61
62Macro Dump_V_getFP_Det(fname,detStr)
63        String fname,detStr="FL"
64       
65        Test_V_get_FP2("V_get*",fname,detStr)
66end
67
68Function Test_V_get_FP2(str,fname,detStr)
69        String str,fname,detStr
70       
71        Variable ii,num
72        String list,item
73       
74       
75        list=FunctionList(str,";","NPARAMS:2,VALTYPE:1") //,VALTYPE:1 gives real return values, not strings
76//      Print list
77        num = ItemsInlist(list)
78       
79       
80        for(ii=0;ii<num;ii+=1)
81                item = StringFromList(ii, list , ";")
82                FUNCREF proto_V_get_FP2 f = $item
83                Print item ," = ", f(fname,detStr)
84        endfor
85       
86        return(0)
87end
88
89
90Macro Dump_V_getSTR(fname)
91        String fname
92       
93        Test_V_get_STR("V_get*",fname)
94end
95
96Function Test_V_get_STR(str,fname)
97        String str,fname
98       
99        Variable ii,num
100        String list,item,strToEx
101       
102       
103        list=FunctionList(str,";","NPARAMS:1,VALTYPE:4")
104//      Print list
105        num = ItemsInlist(list)
106       
107       
108        for(ii=0;ii<num;ii+=1)
109                item = StringFromList(ii, list , ";")
110        //      FUNCREF proto_V_get_STR f = $item
111                printf "%s = ",item
112                sprintf strToEx,"Print %s(\"%s\")",item,fname
113                Execute strToEx
114//              print strToEx
115//              Print item ," = ", f(fname)
116        endfor
117       
118        return(0)
119end
120
121Macro Dump_V_getSTR_Det(fname,detStr)
122        String fname,detStr="FL"
123       
124        Test_V_get_STR2("V_get*",fname,detStr)
125end
126
127Function Test_V_get_STR2(str,fname,detStr)
128        String str,fname,detStr
129       
130        Variable ii,num
131        String list,item,strToEx
132       
133       
134        list=FunctionList(str,";","NPARAMS:2,VALTYPE:4")
135//      Print list
136        num = ItemsInlist(list)
137       
138       
139        for(ii=0;ii<num;ii+=1)
140                item = StringFromList(ii, list , ";")
141        //      FUNCREF proto_V_get_STR f = $item
142                printf "%s = ",item
143                sprintf strToEx,"Print %s(\"%s\",\"%s\")",item,fname,detStr
144                Execute strToEx
145//              print strToEx
146//              Print item ," = ", f(fname)
147        endfor
148       
149        return(0)
150end
151///////////////////////////////////////
152
153
154//////////////////////////////////////////////
155
156
157///////////////////////
158//
159// *These are the specific bits of information to retrieve (or write) to the data file
160// *These functions use the path to the file as input, and each has the specific
161//   path to the variable srting, or wave hard-coded into the access function
162// *They call the generic worker functions to get the values, either from the local copy if present,
163//   or the full file is loaded.
164//
165// *Since the path is the important bit, these are written as get/write pairs to make it easier to
166//   keep up with any changes in path
167//
168//
169// TODO -- verify the paths, and add more as needed
170// TODO -- for all of the String functions -- "num" does nothing right now -
171//         -- if it ever does, or needs to, a lot of locations will need to be corrected
172//
173
174
175//////// TOP LEVEL
176//////// TOP LEVEL
177//////// TOP LEVEL
178
179//// nexus version used for definitions
180//Function/S V_getNeXus_version(fname)
181//      String fname
182//     
183//      String path = "entry:NeXus_version"     
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 time (! this is the true counting time??)
190Function V_getCollectionTime(fname)
191        String fname
192       
193        String path = "entry:collection_time"   
194        return(V_getRealValueFromHDF5(fname,path))
195End
196
197// data directory where data files are stored (for user access, not archive)
198Function/S V_getData_directory(fname)
199        String fname
200       
201        String path = "entry:data_directory"   
202        Variable num=60
203        return(V_getStringFromHDF5(fname,path,num))
204End
205
206// Base class of Nexus definition (=NXsas)
207Function/S V_getNexusDefinition(fname)
208        String fname
209       
210        String path = "entry:definition"       
211        Variable num=60
212        return(V_getStringFromHDF5(fname,path,num))
213End
214
215// TODO -- not mine, added somewhere by Nexus writer?
216// data collection duration (may include pauses, other "dead" time)
217Function V_getDataDuration(fname)
218        String fname
219       
220        String path = "entry:duration" 
221        return(V_getRealValueFromHDF5(fname,path))
222End
223
224// TODO -- not mine, added somewhere by Nexus writer?
225// data collection end time
226Function/S V_getDataEndTime(fname)
227        String fname
228       
229        String path = "entry:end_time" 
230        Variable num=60
231        return(V_getStringFromHDF5(fname,path,num))
232End
233
234// experiment description
235Function/S V_getExperiment_description(fname)
236        String fname
237       
238        String path = "entry:experiment_description"   
239        Variable num=60
240        return(V_getStringFromHDF5(fname,path,num))
241End
242
243// experiment identifier? used only by NICE?
244Function/S V_getExperiment_identifier(fname)
245        String fname
246       
247        String path = "entry:experiment_identifier"     
248        Variable num=60
249        return(V_getStringFromHDF5(fname,path,num))
250End
251
252// name of facility = NCNR
253Function/S V_getFacility(fname)
254        String fname
255       
256        String path = "entry:facility" 
257        Variable num=60
258        return(V_getStringFromHDF5(fname,path,num))
259End
260
261// TODO - should be the file name as saved on disk, currently it's not
262Function/S V_getFile_name(fname)
263        String fname
264       
265        String path = "entry:file_name"
266        Variable num=60
267        return(V_getStringFromHDF5(fname,path,num))
268End
269               
270//
271Function/S V_getHDF_version(fname)
272        String fname
273       
274        String path = "entry:hdf_version"       
275        Variable num=60
276        return(V_getStringFromHDF5(fname,path,num))
277End
278
279// TODO -- not mine, added somewhere by Nexus writer?
280Function/S V_getProgram_name(fname)
281        String fname
282       
283        String path = "entry:program_name"     
284        Variable num=60
285        return(V_getStringFromHDF5(fname,path,num))
286End
287
288// TODO -- not mine, added somewhere by Nexus writer?
289// data collection start time
290Function/S V_getDataStartTime(fname)
291        String fname
292       
293        String path = "entry:start_time"       
294        Variable num=60
295        return(V_getStringFromHDF5(fname,path,num))
296End
297               
298// title of experiment
299Function/S V_getTitle(fname)
300        String fname
301       
302        String path = "entry:title"     
303        Variable num=60
304        return(V_getStringFromHDF5(fname,path,num))
305end
306       
307       
308               
309////////// USER
310////////// USER
311////////// USER
312
313// list of user names
314// TODO -- currently not written out to data file??
315Function/S V_getUserNames(fname)
316        String fname
317       
318        String path = "entry:user:name"
319        Variable num=60
320        return(V_getStringFromHDF5(fname,path,num))
321end
322
323
324//////// CONTROL
325//////// CONTROL
326//////// CONTROL
327
328// TODO -- for the control section, document each of the fields
329
330Function/S V_getCount_end(fname)
331        String fname
332       
333        Variable num
334        String path = "entry:control:count_end"
335        return(V_getStringFromHDF5(fname,path,num))
336end
337
338
339Function/S V_getCount_start(fname)
340        String fname
341       
342        Variable num
343        String path = "entry:control:count_start"       
344        return(V_getStringFromHDF5(fname,path,num))
345end
346
347
348Function V_getCount_time(fname)
349        String fname
350       
351        String path = "entry:control:count_time"       
352        return(V_getRealValueFromHDF5(fname,path))
353end
354
355
356Function V_getCount_time_preset(fname)
357        String fname
358       
359        String path = "entry:control:count_time_preset"
360        return(V_getRealValueFromHDF5(fname,path))
361end
362
363
364Function V_getDetector_counts(fname)
365        String fname
366       
367        String path = "entry:control:detector_counts"   
368        return(V_getRealValueFromHDF5(fname,path))
369end
370
371
372Function V_getDetector_preset(fname)
373        String fname
374       
375        String path = "entry:control:detector_preset"   
376        return(V_getRealValueFromHDF5(fname,path))
377end
378
379
380Function V_getIntegral(fname)
381        String fname
382       
383        String path = "entry:control:integral" 
384        return(V_getRealValueFromHDF5(fname,path))
385end
386
387// control mode for data acquisition, "timer"
388// TODO - what are the enumerated types for this?
389Function/S V_getControlMode(fname)
390        String fname
391       
392        String path = "entry:control:mode"     
393        Variable num=60
394        return(V_getStringFromHDF5(fname,path,num))
395End
396
397//monitor count
398// TODO - verify that this is the correct monitor
399Function V_getMonitorCount(fname)
400        String fname
401       
402        String path = "entry:control:monitor_counts"   
403        return(V_getRealValueFromHDF5(fname,path))
404end
405
406Function V_getMonitor_preset(fname)
407        String fname
408       
409        String path = "entry:control:monitor_preset"   
410        return(V_getRealValueFromHDF5(fname,path))
411end
412
413// TODO - what are the enumerated types for this?
414Function/S V_getPreset(fname)
415        String fname
416       
417        Variable num
418        String path = "entry:control:preset"   
419        return(V_getStringFromHDF5(fname,path,num))
420end
421
422
423
424
425
426//////// INSTRUMENT
427//////// INSTRUMENT
428//////// INSTRUMENT
429
430// TODO -- this does not appear to be written out
431Function/S V_getLocalContact(fname)
432        String fname
433
434        String path = "entry:instrument:local_contact"
435        Variable num=60
436        return(V_getStringFromHDF5(fname,path,num))
437End
438
439Function/S V_getInstrumentName(fname)
440        String fname
441
442        String path = "entry:instrument:name"
443        Variable num=60
444        return(V_getStringFromHDF5(fname,path,num))
445End
446
447Function/S V_getInstrumentType(fname)
448        String fname
449
450        String path = "entry:instrument:type"
451        Variable num=60
452        return(V_getStringFromHDF5(fname,path,num))
453End
454
455////// INSTRUMENT/ATTENUATOR
456// TODO - be sure of the definition of these terms
457//
458
459// transmission value for the attenuator in the beam
460// use this, but if something wrong, the tables are present
461Function V_getAttenuator_transmission(fname)
462        String fname
463       
464        String path = "entry:instrument:attenuator:attenuator_transmission"     
465        return(V_getRealValueFromHDF5(fname,path))
466end
467
468// transmission value (error) for the attenuator in the beam
469// use this, but if something wrong, the tables are present
470Function V_getAttenuator_trans_err(fname)
471        String fname
472       
473        String path = "entry:instrument:attenuator:attenuator_transmission_error"       
474        return(V_getRealValueFromHDF5(fname,path))
475end
476
477// desired thickness
478Function V_getAtten_desired_thickness(fname)
479        String fname
480       
481        String path = "entry:instrument:attenuator:desired_thickness"   
482        return(V_getRealValueFromHDF5(fname,path))
483end
484
485
486// distance from the attenuator to the sample (units??)
487Function V_getAttenDistance(fname)
488        String fname
489       
490        String path = "entry:instrument:attenuator:distance"   
491        return(V_getRealValueFromHDF5(fname,path))
492end
493
494
495
496// table of the attenuation factor error
497Function/WAVE V_getAttenIndex_error_table(fname)
498        String fname
499       
500        String path = "entry:instrument:attenuator:index_error_table"
501        WAVE w = V_getRealWaveFromHDF5(fname,path)
502       
503        return w
504end
505
506// table of the attenuation factor
507Function/WAVE V_getAttenIndex_table(fname)
508        String fname
509       
510        String path = "entry:instrument:attenuator:index_table"
511        WAVE w = V_getRealWaveFromHDF5(fname,path)
512
513        return w
514end
515
516//
517//// status "in or out"
518//Function/S V_getAttenStatus(fname)
519//      String fname
520//
521//      String path = "entry:instrument:attenuator:status"
522//      Variable num=60
523//      return(V_getStringFromHDF5(fname,path,num))
524//End
525
526//// this is equivalent to "status" - if anything is dropped in the beam
527//Function V_getAtten_number(fname)
528//      String fname
529//     
530//      String path = "entry:instrument:attenuator:num_atten_dropped"   
531//      return(V_getRealValueFromHDF5(fname,path))
532//end
533
534// thickness of the attenuator (PMMA) - units??
535Function V_getAttenThickness(fname)
536        String fname
537       
538        String path = "entry:instrument:attenuator:thickness"   
539        return(V_getRealValueFromHDF5(fname,path))
540end
541
542
543// type of material for the atteunator
544Function/S V_getAttenType(fname)
545        String fname
546
547        String path = "entry:instrument:attenuator:type"
548        Variable num=60
549        return(V_getStringFromHDF5(fname,path,num))
550End
551
552
553////// INSTRUMENT/BEAM
554// instrument/beam/analyzer (data folder)
555// this is the He3 analyzer, after the sample (but first alphabetically)
556// TODO -- document what all of the fields represent, and what are the most important to "key" on to read
557//
558Function V_getAnalyzer_depth(fname)
559        String fname
560       
561        String path = "entry:instrument:beam:analyzer:depth"   
562        return(V_getRealValueFromHDF5(fname,path))
563end
564
565Function/S V_getAnalyzer_direction(fname)
566        String fname
567
568        String path = "entry:instrument:beam:analyzer:direction"
569        Variable num=60
570        return(V_getStringFromHDF5(fname,path,num))
571End
572
573Function V_getAnalyzer_height(fname)
574        String fname
575       
576        String path = "entry:instrument:beam:analyzer:height"   
577        return(V_getRealValueFromHDF5(fname,path))
578end
579
580// ?? TODO is this equivalent to "status" -- ?? 0|1
581Function V_getAnalyzer_inBeam(fname)
582        String fname
583       
584        String path = "entry:instrument:beam:analyzer:inBeam"   
585        return(V_getRealValueFromHDF5(fname,path))
586end
587
588Function V_getAnalyzer_innerDiameter(fname)
589        String fname
590       
591        String path = "entry:instrument:beam:analyzer:innerDiameter"   
592        return(V_getRealValueFromHDF5(fname,path))
593end
594
595// one of the most important
596Function/S V_getAnalyzer_name(fname)
597        String fname
598
599        String path = "entry:instrument:beam:analyzer:name"
600        Variable num=60
601        return(V_getStringFromHDF5(fname,path,num))
602End
603
604Function V_getAnalyzer_opacityAt1Ang(fname)
605        String fname
606       
607        String path = "entry:instrument:beam:analyzer:opacityAt1Ang"   
608        return(V_getRealValueFromHDF5(fname,path))
609end
610
611Function V_getAnalyzer_opacityAt1Ang_err(fname)
612        String fname
613       
614        String path = "entry:instrument:beam:analyzer:opacityAt1AngStd"
615        return(V_getRealValueFromHDF5(fname,path))
616end
617
618Function V_getAnalyzer_outerDiameter(fname)
619        String fname
620       
621        String path = "entry:instrument:beam:analyzer:outerDiameter"   
622        return(V_getRealValueFromHDF5(fname,path))
623end
624
625Function/S V_getAnalyzer_shape(fname)
626        String fname
627
628        String path = "entry:instrument:beam:analyzer:shape"
629        Variable num=60
630        return(V_getStringFromHDF5(fname,path,num))
631End
632
633Function V_getAnalyzer_tE(fname)
634        String fname
635       
636        String path = "entry:instrument:beam:analyzer:tE"       
637        return(V_getRealValueFromHDF5(fname,path))
638end
639
640Function V_getAnalyzer_tE_err(fname)
641        String fname
642       
643        String path = "entry:instrument:beam:analyzer:tEStd"   
644        return(V_getRealValueFromHDF5(fname,path))
645end
646
647Function/S V_getAnalyzer_type(fname)
648        String fname
649
650        String path = "entry:instrument:beam:analyzer:type"
651        Variable num=60
652        return(V_getStringFromHDF5(fname,path,num))
653End
654
655
656Function V_getAnalyzer_width(fname)
657        String fname
658       
659        String path = "entry:instrument:beam:analyzer:width"   
660        return(V_getRealValueFromHDF5(fname,path))
661end
662
663
664// instrument/beam/chopper (data folder)
665Function V_getChopperAngular_opening(fname)
666        String fname
667       
668        String path = "entry:instrument:beam:chopper:angular_opening"   
669        return(V_getRealValueFromHDF5(fname,path))
670end
671
672Function V_getChopDistance_from_sample(fname)
673        String fname
674       
675        String path = "entry:instrument:beam:chopper:distance_from_sample"     
676        return(V_getRealValueFromHDF5(fname,path))
677end
678
679Function V_getChopDistance_from_source(fname)
680        String fname
681       
682        String path = "entry:instrument:beam:chopper:distance_from_source"     
683        return(V_getRealValueFromHDF5(fname,path))
684end
685
686Function V_getChopperDuty_cycle(fname)
687        String fname
688       
689        String path = "entry:instrument:beam:chopper:duty_cycle"       
690        return(V_getRealValueFromHDF5(fname,path))
691end
692
693Function V_getChopperRotation_speed(fname)
694        String fname
695       
696        String path = "entry:instrument:beam:chopper:rotation_speed"   
697        return(V_getRealValueFromHDF5(fname,path))
698end
699
700Function V_getChopperSlits(fname)
701        String fname
702       
703        String path = "entry:instrument:beam:chopper:slits"     
704        return(V_getRealValueFromHDF5(fname,path))
705end
706
707Function/S V_getChopperStatus(fname)
708        String fname
709
710        String path = "entry:instrument:beam:chopper:status"
711        Variable num=60
712        return(V_getStringFromHDF5(fname,path,num))
713End
714
715Function/S V_getChopperType(fname)
716        String fname
717
718        String path = "entry:instrument:beam:chopper:type"
719        Variable num=60
720        return(V_getStringFromHDF5(fname,path,num))
721End
722
723
724// instrument/beam/flipperPolarizer (data folder)
725// this is upstream, after the supermirror but before the sample
726
727Function/S V_getflipperPolarizer_Direction(fname)
728        String fname
729
730        String path = "entry:instrument:beam:flipperPolarizer:direction"
731        Variable num=60
732        return(V_getStringFromHDF5(fname,path,num))
733End
734
735Function V_getflipperPolarizer_inBeam(fname)
736        String fname
737       
738        String path = "entry:instrument:beam:flipperPolarizer:inBeam"   
739        return(V_getRealValueFromHDF5(fname,path))
740end
741
742Function/S V_getflipperPolarizer_Type(fname)
743        String fname
744
745        String path = "entry:instrument:beam:flipperPolarizer:type"
746        Variable num=60
747        return(V_getStringFromHDF5(fname,path,num))
748End
749
750
751
752//Function V_getFlipperDriving_current(fname)
753//      String fname
754//     
755//      String path = "entry:instrument:beam:flipper:driving_current"   
756//      return(V_getRealValueFromHDF5(fname,path))
757//end
758//
759//Function V_getFlipperFrequency(fname)
760//      String fname
761//     
762//      String path = "entry:instrument:beam:flipper:frequency"
763//      return(V_getRealValueFromHDF5(fname,path))
764//end
765//
766//Function/S V_getFlipperstatus(fname)
767//      String fname
768//
769//      String path = "entry:instrument:beam:flipper:status"
770//      Variable num=60
771//      return(V_getStringFromHDF5(fname,path,num))
772//End
773//
774//Function V_getFlipperTransmitted_power(fname)
775//      String fname
776//     
777//      String path = "entry:instrument:beam:flipper:transmitted_power"
778//      return(V_getRealValueFromHDF5(fname,path))
779//end
780//
781//Function/S V_getFlipperWaveform(fname)
782//      String fname
783//
784//      String path = "entry:instrument:beam:flipper:waveform"
785//      Variable num=60
786//      return(V_getStringFromHDF5(fname,path,num))
787//End
788
789
790
791// instrument/beam/monochromator (data folder)
792Function/S V_getMonochromatorType(fname)
793        String fname
794
795        String path = "entry:instrument:beam:monochromator:type"
796        Variable num=60
797        return(V_getStringFromHDF5(fname,path,num))
798End
799
800Function V_getWavelength(fname)
801        String fname
802       
803        String path = "entry:instrument:beam:monochromator:wavelength" 
804        return(V_getRealValueFromHDF5(fname,path))
805end
806
807Function V_getWavelength_spread(fname)
808        String fname
809       
810        String path = "entry:instrument:beam:monochromator:wavelength_spread"   
811        return(V_getRealValueFromHDF5(fname,path))
812end
813
814// instrument/beam/monochromator/crystal (data folder)
815Function V_getCrystalDistance(fname)
816        String fname
817       
818        String path = "entry:instrument:beam:monochromator:crystal:distance"   
819        return(V_getRealValueFromHDF5(fname,path))
820end
821
822Function V_getCrystalEnergy(fname)
823        String fname
824       
825        String path = "entry:instrument:beam:monochromator:crystal:energy"     
826        return(V_getRealValueFromHDF5(fname,path))
827end
828
829Function V_getCrystalHorizontal_aperture(fname)
830        String fname
831       
832        String path = "entry:instrument:beam:monochromator:crystal:horizontal_aperture"
833        return(V_getRealValueFromHDF5(fname,path))
834end
835
836Function V_getCrystalHoriz_curvature(fname)
837        String fname
838       
839        String path = "entry:instrument:beam:monochromator:crystal:horizontal_curvature"       
840        return(V_getRealValueFromHDF5(fname,path))
841end
842
843Function V_getCrystalLattice_parameter(fname)
844        String fname
845       
846        String path = "entry:instrument:beam:monochromator:crystal:lattice_parameter"   
847        return(V_getRealValueFromHDF5(fname,path))
848end
849
850Function V_getCrystalReflection(fname)
851        String fname
852       
853        String path = "entry:instrument:beam:monochromator:crystal:reflection" 
854        return(V_getRealValueFromHDF5(fname,path))
855end
856
857Function V_getCrystalRotation(fname)
858        String fname
859       
860        String path = "entry:instrument:beam:monochromator:crystal:rotation"   
861        return(V_getRealValueFromHDF5(fname,path))
862end
863
864Function/S V_getCrystalStatus(fname)
865        String fname
866
867        String path = "entry:instrument:beam:monochromator:crystal:status"
868        Variable num=60
869        return(V_getStringFromHDF5(fname,path,num))
870End
871
872Function V_getCrystalVertical_aperture(fname)
873        String fname
874       
875        String path = "entry:instrument:beam:monochromator:crystal:vertical_aperture"   
876        return(V_getRealValueFromHDF5(fname,path))
877end
878
879Function V_getCrystalVertical_curvature(fname)
880        String fname
881       
882        String path = "entry:instrument:beam:monochromator:crystal:vertical_curvature" 
883        return(V_getRealValueFromHDF5(fname,path))
884end
885
886Function V_getCrystalWavelength(fname)
887        String fname
888       
889        String path = "entry:instrument:beam:monochromator:crystal:wavelength" 
890        return(V_getRealValueFromHDF5(fname,path))
891end
892
893Function V_getCrystalWavelength_spread(fname)
894        String fname
895       
896        String path = "entry:instrument:beam:monochromator:crystal:wavelength_spread"   
897        return(V_getRealValueFromHDF5(fname,path))
898end
899
900Function V_getCrystalWavevector(fname)
901        String fname
902       
903        String path = "entry:instrument:beam:monochromator:crystal:wavevector" 
904        return(V_getRealValueFromHDF5(fname,path))
905end
906
907// instrument/beam/monochromator/velocity_selector (data folder)
908Function V_getVSDistance(fname)
909        String fname
910       
911        String path = "entry:instrument:beam:monochromator:velocity_selector:distance" 
912        return(V_getRealValueFromHDF5(fname,path))
913end
914
915Function V_getVSRotation_speed(fname)
916        String fname
917       
918        String path = "entry:instrument:beam:monochromator:velocity_selector:rotation_speed"   
919        return(V_getRealValueFromHDF5(fname,path))
920end
921
922Function/S V_getVelSelStatus(fname)
923        String fname
924
925        String path = "entry:instrument:beam:monochromator:velocity_selector:status"
926        Variable num=60
927        return(V_getStringFromHDF5(fname,path,num))
928End
929
930Function/WAVE V_getVSTable_parameters(fname)
931        String fname
932       
933        String path = "entry:instrument:beam:monochromator:velocity_selector:table_parameters" 
934        WAVE w = V_getRealWaveFromHDF5(fname,path)
935
936        return w
937end
938
939//// DONE - this does not exist for VSANS - per JGB 4/2016
940//Function V_getVS_tilt(fname)
941//      String fname
942//     
943//      String path = "entry:instrument:beam:monochromator:velocity_selector:vs_tilt"   
944//      return(V_getRealValueFromHDF5(fname,path))
945//end
946
947Function V_getVSWavelength(fname)
948        String fname
949       
950        String path = "entry:instrument:beam:monochromator:velocity_selector:wavelength"       
951        return(V_getRealValueFromHDF5(fname,path))
952end
953
954Function V_getVSWavelength_spread(fname)
955        String fname
956       
957        String path = "entry:instrument:beam:monochromator:velocity_selector:wavelength_spread"
958        return(V_getRealValueFromHDF5(fname,path))
959end
960
961// instrument/beam/monochromator/white_beam (data folder)
962Function/S V_getWhiteBeamStatus(fname)
963        String fname
964
965        String path = "entry:instrument:beam:monochromator:white_beam:status"
966        Variable num=60
967        return(V_getStringFromHDF5(fname,path,num))
968End
969
970Function V_getWhiteBeamWavelength(fname)
971        String fname
972       
973        String path = "entry:instrument:beam:monochromator:white_beam:wavelength"       
974        return(V_getRealValueFromHDF5(fname,path))
975end
976
977Function V_getWhiteBeamWavelength_spread(fname)
978        String fname
979       
980        String path = "entry:instrument:beam:monochromator:white_beam:wavelength_spread"       
981        return(V_getRealValueFromHDF5(fname,path))
982end
983
984// instrument/beam/superMirror (data folder)
985// This is the upstream polarizer. There are no other choices for polarizer on VSANS
986Function/S V_getPolarizerComposition(fname)
987        String fname
988
989        String path = "entry:instrument:beam:superMirror:composition"
990        Variable num=60
991        return(V_getStringFromHDF5(fname,path,num))
992End
993
994Function V_getPolarizerEfficiency(fname)
995        String fname
996       
997        String path = "entry:instrument:beam:superMirror:efficiency"   
998        return(V_getRealValueFromHDF5(fname,path))
999end
1000
1001Function/S V_getPolarizerState(fname)
1002        String fname
1003
1004        String path = "entry:instrument:beam:superMirror:state"
1005        Variable num=60
1006        return(V_getStringFromHDF5(fname,path,num))
1007End
1008
1009//Function/S V_getPolarizerType(fname)
1010//      String fname
1011//
1012//      String path = "entry:instrument:beam:polarizer:type"
1013//      Variable num=60
1014//      return(V_getStringFromHDF5(fname,path,num))
1015//End
1016
1017//// instrument/beam/polarizer_analyzer (data folder)
1018//Function V_getPolAnaCell_index(fname)
1019//      String fname
1020//
1021//      String path = "entry:instrument:beam:polarizer_analyzer:cell_index"
1022//      return(V_getRealValueFromHDF5(fname,path))
1023//End
1024//
1025//Function/S V_getPolAnaCell_name(fname)
1026//      String fname
1027//
1028//      String path = "entry:instrument:beam:polarizer_analyzer:cell_name"
1029//      Variable num=60
1030//      return(V_getStringFromHDF5(fname,path,num))
1031//End
1032//
1033//Function/WAVE V_getPolAnaCell_parameters(fname)
1034//      String fname
1035//
1036//      String path = "entry:instrument:beam:polarizer_analyzer:cell_parameters"
1037//      WAVE w = V_getRealWaveFromHDF5(fname,path)
1038//
1039//      return w
1040//End
1041//
1042//Function V_getPolAnaGuideFieldCur_1(fname)
1043//      String fname
1044//
1045//      String path = "entry:instrument:beam:polarizer_analyzer:guide_field_current_1"
1046//      return(V_getRealValueFromHDF5(fname,path))
1047//End
1048//
1049//Function V_getPolAnaGuideFieldCur_2(fname)
1050//      String fname
1051//
1052//      String path = "entry:instrument:beam:polarizer_analyzer:guide_field_current_2"
1053//      return(V_getRealValueFromHDF5(fname,path))
1054//End
1055//
1056//Function V_getPolAnaSolenoid_current(fname)
1057//      String fname
1058//
1059//      String path = "entry:instrument:beam:polarizer_analyzer:solenoid_current"
1060//      return(V_getRealValueFromHDF5(fname,path))
1061//End
1062//
1063//Function/S V_getPolAnaStatus(fname)
1064//      String fname
1065//
1066//      String path = "entry:instrument:beam:polarizer_analyzer:status"
1067//      Variable num=60
1068//      return(V_getStringFromHDF5(fname,path,num))
1069//End
1070
1071                                       
1072/////// INSTRUMENT/BEAM MONITORS
1073
1074//beam_monitor_low (data folder)
1075Function V_getBeamMonLowData(fname)
1076        String fname
1077
1078        String path = "entry:instrument:beam_monitor_low:data"
1079        return(V_getRealValueFromHDF5(fname,path))
1080End
1081
1082Function V_getBeamMonLowDistance(fname)
1083        String fname
1084
1085        String path = "entry:instrument:beam_monitor_low:distance"
1086        return(V_getRealValueFromHDF5(fname,path))
1087End
1088
1089Function V_getBeamMonLowEfficiency(fname)
1090        String fname
1091
1092        String path = "entry:instrument:beam_monitor_low:efficiency"
1093        return(V_getRealValueFromHDF5(fname,path))
1094End
1095
1096Function V_getBeamMonLowSaved_count(fname)
1097        String fname
1098
1099        String path = "entry:instrument:beam_monitor_low:saved_count"
1100        return(V_getRealValueFromHDF5(fname,path))
1101End
1102
1103Function/S V_getBeamMonLowType(fname)
1104        String fname
1105
1106        String path = "entry:instrument:beam_monitor_low:type"
1107        Variable num=60
1108        return(V_getStringFromHDF5(fname,path,num))
1109End
1110
1111//beam_monitor_norm (data folder)
1112Function V_getBeamMonNormData(fname)
1113        String fname
1114
1115        String path = "entry:instrument:beam_monitor_norm:data"
1116        return(V_getRealValueFromHDF5(fname,path))
1117End
1118
1119Function V_getBeamMonNormDistance(fname)
1120        String fname
1121
1122        String path = "entry:instrument:beam_monitor_norm:distance"
1123        return(V_getRealValueFromHDF5(fname,path))
1124End
1125
1126Function V_getBeamMonNormEfficiency(fname)
1127        String fname
1128
1129        String path = "entry:instrument:beam_monitor_norm:efficiency"
1130        return(V_getRealValueFromHDF5(fname,path))
1131End
1132
1133Function V_getBeamMonNormSaved_count(fname)
1134        String fname
1135
1136        String path = "entry:instrument:beam_monitor_norm:saved_count"
1137        return(V_getRealValueFromHDF5(fname,path))
1138End
1139
1140Function/S V_getBeamMonNormType(fname)
1141        String fname
1142
1143        String path = "entry:instrument:beam_monitor_norm:type"
1144        Variable num=60
1145        return(V_getStringFromHDF5(fname,path,num))
1146End
1147
1148//beam_stop C2 (data folder)
1149Function/S V_getBeamStopC2Description(fname)
1150        String fname
1151
1152        String path = "entry:instrument:beam_stop_C2:description"
1153        Variable num=60
1154        return(V_getStringFromHDF5(fname,path,num))
1155End
1156
1157Function V_getBeamStopC2Dist_to_det(fname)
1158        String fname
1159
1160        String path = "entry:instrument:beam_stop_C2:distance_to_detector"
1161        return(V_getRealValueFromHDF5(fname,path))
1162End
1163
1164//TODO -- not sure what this really means
1165Function V_getBeamStopC2num_beamstops(fname)
1166        String fname
1167
1168        String path = "entry:instrument:beam_stop_C2:num_beamstops"
1169        return(V_getRealValueFromHDF5(fname,path))
1170End
1171
1172Function V_getBeamStopC2_x_pos(fname)
1173        String fname
1174
1175        String path = "entry:instrument:beam_stop_C2:x_pos"
1176        return(V_getRealValueFromHDF5(fname,path))
1177End
1178
1179Function V_getBeamStopC2_y_pos(fname)
1180        String fname
1181
1182        String path = "entry:instrument:beam_stop_C2:y_pos"
1183        return(V_getRealValueFromHDF5(fname,path))
1184End
1185
1186// beam stop shape parameters
1187Function V_getBeamStopC2_height(fname)
1188        String fname
1189
1190        String path = "entry:instrument:beam_stop_C2:shape:height"
1191        return(V_getRealValueFromHDF5(fname,path))
1192End
1193
1194Function/S V_getBeamStopC2_shape(fname)
1195        String fname
1196
1197        Variable num=60
1198        String path = "entry:instrument:beam_stop_C2:shape:shape"
1199        return(V_getStringFromHDF5(fname,path,num))
1200End
1201
1202// == diameter if shape = CIRCLE
1203Function V_getBeamStopC2_size(fname)
1204        String fname
1205
1206        String path = "entry:instrument:beam_stop_C2:shape:size"
1207        return(V_getRealValueFromHDF5(fname,path))
1208End
1209
1210Function V_getBeamStopC2_width(fname)
1211        String fname
1212
1213        String path = "entry:instrument:beam_stop_C2:shape:width"
1214        return(V_getRealValueFromHDF5(fname,path))
1215End
1216
1217
1218
1219//beam_stop C3 (data folder)
1220Function/S V_getBeamStopC3Description(fname)
1221        String fname
1222
1223        String path = "entry:instrument:beam_stop_C3:description"
1224        Variable num=60
1225        return(V_getStringFromHDF5(fname,path,num))
1226End
1227
1228Function V_getBeamStopC3Dist_to_det(fname)
1229        String fname
1230
1231        String path = "entry:instrument:beam_stop_C3:distance_to_detector"
1232        return(V_getRealValueFromHDF5(fname,path))
1233End
1234
1235//TODO -- not sure what this really means
1236Function V_getBeamStopC3num_beamstops(fname)
1237        String fname
1238
1239        String path = "entry:instrument:beam_stop_C3:num_beamstops"
1240        return(V_getRealValueFromHDF5(fname,path))
1241End
1242
1243Function V_getBeamStopC3_x_pos(fname)
1244        String fname
1245
1246        String path = "entry:instrument:beam_stop_C3:x_pos"
1247        return(V_getRealValueFromHDF5(fname,path))
1248End
1249
1250Function V_getBeamStopC3_y_pos(fname)
1251        String fname
1252
1253        String path = "entry:instrument:beam_stop_C3:y_pos"
1254        return(V_getRealValueFromHDF5(fname,path))
1255End
1256
1257// beam stop shape parameters
1258Function V_getBeamStopC3_height(fname)
1259        String fname
1260
1261        String path = "entry:instrument:beam_stop_C3:shape:height"
1262        return(V_getRealValueFromHDF5(fname,path))
1263End
1264
1265Function/S V_getBeamStopC3_shape(fname)
1266        String fname
1267
1268        Variable num=60
1269        String path = "entry:instrument:beam_stop_C3:shape:shape"
1270        return(V_getStringFromHDF5(fname,path,num))
1271End
1272
1273// == diameter if shape = CIRCLE
1274Function V_getBeamStopC3_size(fname)
1275        String fname
1276
1277        String path = "entry:instrument:beam_stop_C3:shape:size"
1278        return(V_getRealValueFromHDF5(fname,path))
1279End
1280
1281Function V_getBeamStopC3_width(fname)
1282        String fname
1283
1284        String path = "entry:instrument:beam_stop_C3:shape:width"
1285        return(V_getRealValueFromHDF5(fname,path))
1286End
1287
1288
1289
1290
1291//// INSTRUMENT/COLLIMATOR
1292//collimator (data folder)
1293
1294// this is now defined as text, due to selections from GUI
1295Function/S V_getNumberOfGuides(fname)
1296        String fname
1297
1298        Variable num=60
1299        String path = "entry:instrument:collimator:number_guides"
1300        return(V_getStringFromHDF5(fname,path,num))
1301End
1302
1303//                              geometry (data folder)
1304//                                      shape (data folder)
1305Function/S V_getGuideShape(fname)
1306        String fname
1307
1308        String path = "entry:instrument:collimator:geometry:shape:shape"
1309        Variable num=60
1310        return(V_getStringFromHDF5(fname,path,num))
1311End
1312
1313Function V_getGuideSize(fname)
1314        String fname
1315
1316        String path = "entry:instrument:collimator:geometry:shape:size"
1317        return(V_getRealValueFromHDF5(fname,path))
1318End
1319
1320
1321//                      converging_pinholes (data folder)
1322Function/S V_getConvPinholeStatus(fname)
1323        String fname
1324
1325        String path = "entry:instrument:converging_pinholes:status"
1326        Variable num=60
1327        return(V_getStringFromHDF5(fname,path,num))
1328End
1329
1330//                      converging_slits (not used)
1331
1332////// INSTRUMENT/DETECTORS
1333//                      detector_B (data folder)
1334//
1335// only defined for the "B" detector, and may not be necessary?
1336// DONE -- write to return an ARRAY
1337Function/WAVE V_getDet_cal_x(fname,detStr)
1338        String fname,detStr
1339
1340        if(cmpstr(detStr,"B") == 0)
1341                String path = "entry:instrument:detector_"+detStr+":cal_x"
1342                WAVE w = V_getRealWaveFromHDF5(fname,path)
1343
1344                return w
1345        else
1346                return $""
1347        endif
1348End
1349
1350// only defined for the "B" detector, and may not be necessary?
1351// TODO -- write to return an ARRAY
1352Function/WAVE V_getDet_cal_y(fname,detStr)
1353        String fname,detStr
1354
1355        if(cmpstr(detStr,"B") == 0)
1356                String path = "entry:instrument:detector_"+detStr+":cal_y"
1357                WAVE w = V_getRealWaveFromHDF5(fname,path)
1358       
1359                return w
1360        else
1361                return $""
1362        endif
1363End
1364
1365//  Pixels are not square
1366// so the FHWM will be different in each direction. May need to return
1367// "dummy" value for "B" detector if pixels there are square
1368Function V_getDet_pixel_fwhm_x(fname,detStr)
1369        String fname,detStr
1370
1371        String path = "entry:instrument:detector_"+detStr+":pixel_fwhm_x"
1372
1373        return(V_getRealValueFromHDF5(fname,path))
1374End
1375
1376// Pixels are not square
1377// so the FHWM will be different in each direction. May need to return
1378// "dummy" value for "B" detector if pixels there are square
1379Function V_getDet_pixel_fwhm_y(fname,detStr)
1380        String fname,detStr
1381
1382        String path = "entry:instrument:detector_"+detStr+":pixel_fwhm_y"
1383
1384        return(V_getRealValueFromHDF5(fname,path))
1385End
1386
1387Function V_getDet_pixel_num_x(fname,detStr)
1388        String fname,detStr
1389
1390        String path = "entry:instrument:detector_"+detStr+":pixel_num_x"
1391        return(V_getRealValueFromHDF5(fname,path))
1392End
1393
1394Function V_getDet_pixel_num_y(fname,detStr)
1395        String fname,detStr
1396
1397        String path = "entry:instrument:detector_"+detStr+":pixel_num_y"
1398        return(V_getRealValueFromHDF5(fname,path))
1399End
1400
1401//// only defined for the "B" detector, and only to satisfy NXsas
1402//Function V_getDet_azimuthalAngle(fname,detStr)
1403//      String fname,detStr
1404//
1405//      if(cmpstr(detStr,"B") == 0)
1406//              String path = "entry:instrument:detector_"+detStr+":azimuthal_angle"
1407//              return(V_getRealValueFromHDF5(fname,path))
1408//      else
1409//              return(0)
1410//      endif
1411//End
1412
1413Function V_getDet_beam_center_x(fname,detStr)
1414        String fname,detStr
1415
1416        String path = "entry:instrument:detector_"+detStr+":beam_center_x"
1417        return(V_getRealValueFromHDF5(fname,path))
1418End
1419
1420Function V_getDet_beam_center_y(fname,detStr)
1421        String fname,detStr
1422
1423        String path = "entry:instrument:detector_"+detStr+":beam_center_y"
1424        return(V_getRealValueFromHDF5(fname,path))
1425End
1426
1427
1428//TODO
1429//
1430// x and y center in mm is currently not part of the Nexus definition
1431//  does it need to be?
1432// these lookups will fail if they have not been generated locally!
1433Function V_getDet_beam_center_x_mm(fname,detStr)
1434        String fname,detStr
1435
1436        String path = "entry:instrument:detector_"+detStr+":beam_center_x_mm"
1437        return(V_getRealValueFromHDF5(fname,path))
1438End
1439
1440//TODO
1441//
1442// x and y center in mm is currently not part of the Nexus definition
1443//  does it need to be?
1444// these lookups will fail if they have not been generated locally!
1445Function V_getDet_beam_center_y_mm(fname,detStr)
1446        String fname,detStr
1447
1448        String path = "entry:instrument:detector_"+detStr+":beam_center_y_mm"
1449        return(V_getRealValueFromHDF5(fname,path))
1450End
1451
1452
1453
1454Function/WAVE V_getDetectorDataW(fname,detStr)
1455        String fname,detStr
1456
1457        String path = "entry:instrument:detector_"+detStr+":data"
1458        WAVE w = V_getRealWaveFromHDF5(fname,path)
1459
1460        return w
1461End
1462
1463//
1464// TODO -- this does not exist in the raw data, but does in the processed data
1465// !!! how to handle this?? Binning routines need the error wave
1466//
1467Function/WAVE V_getDetectorDataErrW(fname,detStr)
1468        String fname,detStr
1469
1470        String path = "entry:instrument:detector_"+detStr+":linear_data_error"
1471        WAVE w = V_getRealWaveFromHDF5(fname,path)
1472
1473        return w
1474End
1475
1476// TODO -- write this function to return a WAVE with the data
1477// either as a wave reference, or as an input parameter
1478// ALSO -- the "B" deadtime will be a single value (probably)
1479//  but the tube banks will be 1D arrays of values, one per tube
1480Function/WAVE V_getDetector_deadtime(fname,detStr)
1481        String fname,detStr
1482
1483        String path = "entry:instrument:detector_"+detStr+":dead_time"
1484        if(cmpstr(detStr,"B") == 0)
1485                return $""
1486        else   
1487                WAVE w = V_getRealWaveFromHDF5(fname,path)
1488                return w
1489        endif
1490End
1491
1492// for "B" only
1493Function V_getDetector_deadtime_B(fname,detStr)
1494        String fname,detStr
1495
1496        String path = "entry:instrument:detector_"+detStr+":dead_time"
1497        if(cmpstr(detStr,"B") == 0)
1498                return(V_getRealValueFromHDF5(fname,path))
1499        else   
1500                return(0)
1501        endif
1502End
1503
1504Function/S V_getDetDescription(fname,detStr)
1505        String fname,detStr
1506
1507        String path = "entry:instrument:detector_"+detStr+":description"
1508        Variable num=60
1509        return(V_getStringFromHDF5(fname,path,num))
1510End
1511
1512Function V_getDet_NominalDistance(fname,detStr)
1513        String fname,detStr
1514
1515        String path = "entry:instrument:detector_"+detStr+":distance"
1516        return(V_getRealValueFromHDF5(fname,path))
1517End
1518
1519//this is a DERIVED distance, since the nominal sdd is for the carriage (=LR panels)
1520Function V_getDet_ActualDistance(fname,detStr)
1521        String fname,detStr
1522
1523        Variable sdd
1524        sdd = V_getDet_NominalDistance(fname,detStr)            //[cm]
1525        sdd += V_getDet_TBSetback(fname,detStr)/10              // written in [mm], convert to [cm], returns 0 for L/R/B panels
1526               
1527        return(sdd)
1528End
1529
1530//// only defined for the "B" detector, and only to satisfy NXsas
1531//Function V_getDet_equatorial_angle(fname,detStr)
1532//      String fname,detStr
1533//
1534//      if(cmpstr(detStr,"B") == 0)
1535//              String path = "entry:instrument:detector_"+detStr+":equatorial_angle"
1536//              return(V_getRealValueFromHDF5(fname,path))
1537//      else
1538//              return(0)
1539//      endif
1540//End
1541
1542Function/S V_getDetEventFileName(fname,detStr)
1543        String fname,detStr
1544
1545        String path = "entry:instrument:detector_"+detStr+":event_file_name"
1546        Variable num=60
1547        return(V_getStringFromHDF5(fname,path,num))
1548End
1549
1550Function V_getDet_IntegratedCount(fname,detStr)
1551        String fname,detStr
1552
1553        String path = "entry:instrument:detector_"+detStr+":integrated_count"
1554        return(V_getRealValueFromHDF5(fname,path))
1555End
1556
1557// only return value for B and L/R detectors. everything else returns zero
1558Function V_getDet_LateralOffset(fname,detStr)
1559        String fname,detStr
1560
1561        if(cmpstr(detStr,"FT") == 0 || cmpstr(detStr,"FB") == 0)
1562                return(0)
1563        endif
1564        if(cmpstr(detStr,"MT") == 0 || cmpstr(detStr,"MB") == 0)
1565                return(0)
1566        endif   
1567       
1568        String path = "entry:instrument:detector_"+detStr+":lateral_offset"
1569        return(V_getRealValueFromHDF5(fname,path))
1570End
1571
1572// only return values for T/B. everything else returns zero
1573Function V_getDet_VerticalOffset(fname,detStr)
1574        String fname,detStr
1575
1576        if(cmpstr(detStr,"B") == 0)
1577                return(0)
1578        endif
1579        if(cmpstr(detStr,"FR") == 0 || cmpstr(detStr,"FL") == 0)
1580                return(0)
1581        endif
1582        if(cmpstr(detStr,"MR") == 0 || cmpstr(detStr,"ML") == 0)
1583                return(0)
1584        endif   
1585       
1586        String path = "entry:instrument:detector_"+detStr+":vertical_offset"
1587        return(V_getRealValueFromHDF5(fname,path))
1588End
1589
1590// TODO - be sure this is defined correctly (with correct units!)
1591// -- only returns for T/B detectors
1592Function V_getDet_TBSetback(fname,detStr)
1593        String fname,detStr
1594
1595        if(cmpstr(detStr,"B") == 0)
1596                return(0)
1597        endif
1598        if(cmpstr(detStr,"FR") == 0 || cmpstr(detStr,"FL") == 0)
1599                return(0)
1600        endif
1601        if(cmpstr(detStr,"MR") == 0 || cmpstr(detStr,"ML") == 0)
1602                return(0)
1603        endif   
1604       
1605        String path = "entry:instrument:detector_"+detStr+":setback"
1606        return(V_getRealValueFromHDF5(fname,path))
1607       
1608       
1609End
1610
1611
1612Function/S V_getDetSettings(fname,detStr)
1613        String fname,detStr
1614
1615        String path = "entry:instrument:detector_"+detStr+":settings"
1616        Variable num=60
1617        return(V_getStringFromHDF5(fname,path,num))
1618End
1619
1620
1621Function V_getDet_x_pixel_size(fname,detStr)
1622        String fname,detStr
1623
1624        String path = "entry:instrument:detector_"+detStr+":x_pixel_size"
1625        return(V_getRealValueFromHDF5(fname,path))
1626End
1627
1628Function V_getDet_y_pixel_size(fname,detStr)
1629        String fname,detStr
1630
1631        String path = "entry:instrument:detector_"+detStr+":y_pixel_size"
1632        return(V_getRealValueFromHDF5(fname,path))
1633End
1634
1635/////////                       detector_FB (data folder) + ALL other PANEL DETECTORS
1636
1637Function V_getDet_numberOfTubes(fname,detStr)
1638        String fname,detStr
1639
1640        String path = "entry:instrument:detector_"+detStr+":number_of_tubes"
1641        if(cmpstr(detStr,"B") == 0)
1642                return(0)
1643        else
1644                return(V_getRealValueFromHDF5(fname,path))
1645        endif
1646End
1647
1648
1649// DONE -- write this function to return a WAVE with the data
1650// either as a wave reference, or as an input parameter
1651Function/WAVE V_getDetTube_spatialCalib(fname,detStr)
1652        String fname,detStr
1653
1654        String path = "entry:instrument:detector_"+detStr+":spatial_calibration"
1655        if(cmpstr(detStr,"B") == 0)
1656                return $("")    // return should be null
1657        else
1658                WAVE w = V_getRealWaveFromHDF5(fname,path)
1659                return w
1660        endif
1661End
1662
1663
1664Function/S V_getDet_tubeOrientation(fname,detStr)
1665        String fname,detStr
1666
1667        String path = "entry:instrument:detector_"+detStr+":tube_orientation"
1668        Variable num=60
1669        if(cmpstr(detStr,"B") == 0)
1670                return("")
1671        else
1672                return(V_getStringFromHDF5(fname,path,num))
1673        endif
1674End
1675
1676// TODO -- be clear on how this is defined. Units?
1677Function V_getDet_tubeWidth(fname,detStr)
1678        String fname,detStr
1679
1680        String path = "entry:instrument:detector_"+detStr+":tube_width"
1681        if(cmpstr(detStr,"B") == 0)
1682                return(0)
1683        else
1684                return(V_getRealValueFromHDF5(fname,path))
1685        endif
1686End
1687
1688//////////////////////
1689
1690// INSTRUMENT/LENSES
1691//  lenses (data folder)
1692
1693Function V_getLensCurvature(fname)
1694        String fname
1695
1696        String path = "entry:instrument:lenses:curvature"
1697        return(V_getRealValueFromHDF5(fname,path))
1698End
1699
1700Function/S V_getLensesFocusType(fname)
1701        String fname
1702
1703        String path = "entry:instrument:lenses:focus_type"
1704        Variable num=60
1705        return(V_getStringFromHDF5(fname,path,num))
1706End
1707
1708Function V_getLensDistance(fname)
1709        String fname
1710
1711        String path = "entry:instrument:lenses:lens_distance"
1712        return(V_getRealValueFromHDF5(fname,path))
1713End
1714
1715Function/S V_getLensGeometry(fname)
1716        String fname
1717
1718        String path = "entry:instrument:lenses:lens_geometry"
1719        Variable num=60
1720        return(V_getStringFromHDF5(fname,path,num))
1721End
1722
1723Function/S V_getLensMaterial(fname)
1724        String fname
1725
1726        String path = "entry:instrument:lenses:lens_material"
1727        Variable num=60
1728        return(V_getStringFromHDF5(fname,path,num))
1729End
1730
1731Function V_getNumber_of_Lenses(fname)
1732        String fname
1733
1734        String path = "entry:instrument:lenses:number_of_lenses"
1735        return(V_getRealValueFromHDF5(fname,path))
1736End
1737
1738Function V_getNumber_of_prisms(fname)
1739        String fname
1740
1741        String path = "entry:instrument:lenses:number_of_prisms"
1742        return(V_getRealValueFromHDF5(fname,path))
1743End
1744
1745Function V_getPrism_distance(fname)
1746        String fname
1747
1748        String path = "entry:instrument:lenses:prism_distance"
1749        return(V_getRealValueFromHDF5(fname,path))
1750End
1751
1752Function/S V_getPrismMaterial(fname)
1753        String fname
1754
1755        String path = "entry:instrument:lenses:prism_material"
1756        Variable num=60
1757        return(V_getStringFromHDF5(fname,path,num))
1758End
1759
1760// status of lens/prism = lens | prism | both | out
1761Function/S V_getLensPrismStatus(fname)
1762        String fname
1763
1764        String path = "entry:instrument:lenses:status"
1765        Variable num=60
1766        return(V_getStringFromHDF5(fname,path,num))
1767End
1768       
1769
1770
1771
1772///////  sample_aperture (1) (data folder)
1773// this is the INTERNAL sample aperture
1774//
1775Function/S V_getSampleAp_Description(fname)
1776        String fname
1777
1778        String path = "entry:instrument:sample_aperture:description"
1779        Variable num=60
1780        return(V_getStringFromHDF5(fname,path,num))
1781End
1782
1783Function V_getSampleAp_distance(fname)
1784        String fname
1785
1786        String path = "entry:instrument:sample_aperture:distance"
1787        return(V_getRealValueFromHDF5(fname,path))
1788End
1789
1790//      shape (data folder)
1791Function V_getSampleAp_height(fname)
1792        String fname
1793
1794        String path = "entry:instrument:sample_aperture:shape:height"
1795        return(V_getRealValueFromHDF5(fname,path))
1796End
1797
1798Function/S V_getSampleAp_shape(fname)
1799        String fname
1800
1801        String path = "entry:instrument:sample_aperture:shape:shape"
1802        Variable num=60
1803        return(V_getStringFromHDF5(fname,path,num))
1804End
1805
1806// this returns TEXT, due to GUI input, == to diameter if CIRCLE
1807Function/S V_getSampleAp_size(fname)
1808        String fname
1809
1810        String path = "entry:instrument:sample_aperture:shape:size"
1811        Variable num=60
1812        return(V_getStringFromHDF5(fname,path,num))
1813End
1814
1815Function V_getSampleAp_width(fname)
1816        String fname
1817
1818        String path = "entry:instrument:sample_aperture:shape:width"
1819        return(V_getRealValueFromHDF5(fname,path))
1820End
1821
1822
1823
1824///////  sample_aperture_2 (data folder)
1825// sample aperture (2) is the external aperture, which may or may not be present
1826
1827Function/S V_getSampleAp2_Description(fname)
1828        String fname
1829
1830        String path = "entry:instrument:sample_aperture_2:description"
1831        Variable num=60
1832        return(V_getStringFromHDF5(fname,path,num))
1833End
1834
1835Function V_getSampleAp2_distance(fname)
1836        String fname
1837
1838        String path = "entry:instrument:sample_aperture_2:distance"
1839        return(V_getRealValueFromHDF5(fname,path))
1840End
1841
1842//      shape (data folder)
1843Function V_getSampleAp2_height(fname)
1844        String fname
1845
1846        String path = "entry:instrument:sample_aperture_2:shape:height"
1847        return(V_getRealValueFromHDF5(fname,path))
1848End
1849
1850Function/S V_getSampleAp2_shape(fname)
1851        String fname
1852
1853        String path = "entry:instrument:sample_aperture_2:shape:shape"
1854        Variable num=60
1855        return(V_getStringFromHDF5(fname,path,num))
1856End
1857
1858// this returns REAL, DIFFERENT than SampleAp1
1859Function V_getSampleAp2_size(fname)
1860        String fname
1861
1862        String path = "entry:instrument:sample_aperture_2:shape:size"
1863        return(V_getRealValueFromHDF5(fname,path))
1864End
1865
1866Function V_getSampleAp2_width(fname)
1867        String fname
1868
1869        String path = "entry:instrument:sample_aperture_2:shape:width"
1870        return(V_getRealValueFromHDF5(fname,path))
1871End
1872
1873       
1874//////  sample_table (data folder)
1875// location  = "CHAMBER" or HUBER
1876Function/S V_getSampleTableLocation(fname)
1877        String fname
1878
1879        String path = "entry:instrument:sample_table:location"
1880        Variable num=60
1881        return(V_getStringFromHDF5(fname,path,num))
1882End
1883
1884// TODO - verify the meaning
1885//      offset_distance (?? for center of sample table vs. sample position)
1886Function V_getSampleTableOffset(fname)
1887        String fname
1888
1889        String path = "entry:instrument:sample_table:offset_distance"
1890        return(V_getRealValueFromHDF5(fname,path))
1891End     
1892       
1893//  source (data folder)
1894//name "NCNR"
1895Function/S V_getSourceName(fname)
1896        String fname
1897
1898        String path = "entry:instrument:source:name"
1899        Variable num=60
1900        return(V_getStringFromHDF5(fname,path,num))
1901End
1902
1903//      power -- nominal only, not connected to any real number
1904Function V_getReactorPower(fname)
1905        String fname
1906
1907        String path = "entry:instrument:source:power"
1908        return(V_getRealValueFromHDF5(fname,path))
1909End     
1910
1911//probe (wave) "neutron"
1912Function/S V_getSourceProbe(fname)
1913        String fname
1914
1915        String path = "entry:instrument:source:probe"
1916        Variable num=60
1917        return(V_getStringFromHDF5(fname,path,num))
1918End
1919
1920//type (wave) "Reactor Neutron Source"
1921Function/S V_getSourceType(fname)
1922        String fname
1923
1924        String path = "entry:instrument:source:type"
1925        Variable num=60
1926        return(V_getStringFromHDF5(fname,path,num))
1927End
1928
1929       
1930///////  source_aperture (data folder)
1931
1932Function/S V_getSourceAp_Description(fname)
1933        String fname
1934
1935        String path = "entry:instrument:source_aperture:description"
1936        Variable num=60
1937        return(V_getStringFromHDF5(fname,path,num))
1938End
1939
1940Function V_getSourceAp_distance(fname)
1941        String fname
1942
1943        String path = "entry:instrument:source_aperture:distance"
1944        return(V_getRealValueFromHDF5(fname,path))
1945End
1946
1947//      shape (data folder)
1948Function V_getSourceAp_height(fname)
1949        String fname
1950
1951        String path = "entry:instrument:source_aperture:shape:height"
1952        return(V_getRealValueFromHDF5(fname,path))
1953End
1954
1955Function/S V_getSourceAp_shape(fname)
1956        String fname
1957
1958        String path = "entry:instrument:source_aperture:shape:shape"
1959        Variable num=60
1960        return(V_getStringFromHDF5(fname,path,num))
1961End
1962
1963// this returns TEXT, due to GUI input, == to diameter if CIRCLE
1964Function/S V_getSourceAp_size(fname)
1965        String fname
1966
1967        String path = "entry:instrument:source_aperture:shape:size"
1968        Variable num=60
1969        return(V_getStringFromHDF5(fname,path,num))
1970End
1971
1972Function V_getSourceAp_width(fname)
1973        String fname
1974
1975        String path = "entry:instrument:source_aperture:shape:width"
1976        return(V_getRealValueFromHDF5(fname,path))
1977End
1978
1979
1980//////// SAMPLE
1981//////// SAMPLE
1982//////// SAMPLE
1983
1984//Sample position in changer (returned as TEXT)
1985Function/S V_getSamplePosition(fname)
1986        String fname
1987       
1988        String path = "entry:sample:changer_position"   
1989        Variable num=60
1990        return(V_getStringFromHDF5(fname,path,num))
1991end
1992
1993// sample label
1994Function/S V_getSampleDescription(fname)
1995        String fname
1996
1997        String path = "entry:sample:description"
1998        Variable num=60
1999        return(V_getStringFromHDF5(fname,path,num))
2000End
2001
2002// for a z-stage??
2003Function V_getSampleElevation(fname)
2004        String fname
2005       
2006        String path = "entry:sample:elevation" 
2007        return(V_getRealValueFromHDF5(fname,path))
2008end
2009
2010//no meaning to this...
2011Function V_getSample_equatorial_ang(fname)
2012        String fname
2013       
2014        String path = "entry:sample:equatorial_angle"   
2015        return(V_getRealValueFromHDF5(fname,path))
2016end
2017
2018// group ID !!! very important for matching up files
2019Function V_getSample_GroupID(fname)
2020        String fname
2021       
2022        String path = "entry:sample:group_id"   
2023        return(V_getRealValueFromHDF5(fname,path))
2024end
2025
2026
2027//Sample Rotation Angle
2028Function V_getSampleRotationAngle(fname)
2029        String fname
2030       
2031        String path = "entry:sample:rotation_angle"     
2032        return(V_getRealValueFromHDF5(fname,path))
2033end
2034
2035//?? this is huber/chamber??
2036// TODO -- then where is the description of 10CB, etc...
2037Function/S V_getSampleHolderDescription(fname)
2038        String fname
2039
2040        String path = "entry:sample:sample_holder_description"
2041        Variable num=60
2042        return(V_getStringFromHDF5(fname,path,num))
2043End
2044
2045//Sample Thickness
2046// TODO -- somehow, this is not set correctly in the acquisition, so NaN results
2047Function V_getSampleThickness(fname)
2048        String fname
2049       
2050        String path = "entry:sample:thickness" 
2051        return(V_getRealValueFromHDF5(fname,path))
2052end
2053
2054Function V_getSampleTranslation(fname)
2055        String fname
2056       
2057        String path = "entry:sample:translation"       
2058        return(V_getRealValueFromHDF5(fname,path))
2059end
2060
2061// sample transmission
2062Function V_getSampleTransmission(fname)
2063        String fname
2064       
2065        String path = "entry:sample:transmission"       
2066//      String path = "QKK0037737:data:Transmission"   
2067        return(V_getRealValueFromHDF5(fname,path))
2068end
2069
2070//transmission error (one sigma)
2071Function V_getSampleTransError(fname)
2072        String fname
2073       
2074        String path = "entry:sample:transmission_error"
2075        return(V_getRealValueFromHDF5(fname,path))
2076end
2077
2078
2079
2080
2081//// SAMPLE / DATA LOGS
2082// write this generic , call with the name of the environment log desired
2083//
2084// temperature_1
2085// temperature_2
2086// temperature_3
2087// temperature_4
2088// shear_field
2089// pressure
2090// magnetic_field
2091// electric_field
2092//
2093//////// (for example) electric_field (data folder)
2094
2095Function/S V_getLog_attachedTo(fname,logStr)
2096        String fname,logStr
2097
2098        String path = "entry:sample:"+logstr+":attached_to"
2099        Variable num=60
2100        return(V_getStringFromHDF5(fname,path,num))
2101End
2102
2103
2104Function/S V_getLog_measurement(fname,logStr)
2105        String fname,logStr
2106
2107        String path = "entry:sample:"+logstr+":measurement"
2108        Variable num=60
2109        return(V_getStringFromHDF5(fname,path,num))
2110End
2111
2112
2113Function/S V_getLog_Name(fname,logStr)
2114        String fname,logStr
2115
2116        String path = "entry:sample:"+logstr+":name"
2117        Variable num=60
2118        return(V_getStringFromHDF5(fname,path,num))
2119End
2120
2121// TODO -- this may not exist if it is not a "controlling" sensor, but there still may be logged data present
2122// TODO -- it may also have different names for each sensor (setpoint_1, setpoint_2, etc. which will be a big hassle)
2123Function V_getLog_setPoint(fname,logStr)
2124        String fname,logStr
2125       
2126        String path = "entry:sample:"+logstr+":setpoint_1"
2127        return(V_getRealValueFromHDF5(fname,path))
2128end
2129
2130Function/S V_getLog_startTime(fname,logStr)
2131        String fname,logStr
2132
2133        String path = "entry:sample:"+logstr+":start"
2134        Variable num=60
2135        return(V_getStringFromHDF5(fname,path,num))
2136End
2137
2138
2139// TODO -- this may only exist for electric field and magnetic field...
2140// or may be elimnated altogether
2141Function V_getLog_nomValue(fname,logStr)
2142        String fname,logStr
2143       
2144        String path = "entry:sample:"+logstr+":value"
2145        return(V_getRealValueFromHDF5(fname,path))
2146end
2147
2148////            value_log (data folder)
2149
2150Function V_getLog_avgValue(fname,logStr)
2151        String fname,logStr
2152       
2153        String path = "entry:sample:"+logstr+":value_log:average_value"
2154        return(V_getRealValueFromHDF5(fname,path))
2155end
2156
2157Function V_getLog_avgValue_err(fname,logStr)
2158        String fname,logStr
2159       
2160        String path = "entry:sample:"+logstr+":value_log:average_value_error"
2161        return(V_getRealValueFromHDF5(fname,path))
2162end
2163
2164Function V_getLog_maximumValue(fname,logStr)
2165        String fname,logStr
2166       
2167        String path = "entry:sample:"+logstr+":value_log:maximum_value"
2168        return(V_getRealValueFromHDF5(fname,path))
2169end
2170
2171Function V_getLog_medianValue(fname,logStr)
2172        String fname,logStr
2173       
2174        String path = "entry:sample:"+logstr+":value_log:median_value"
2175        return(V_getRealValueFromHDF5(fname,path))
2176end
2177
2178Function V_getLog_minimumValue(fname,logStr)
2179        String fname,logStr
2180       
2181        String path = "entry:sample:"+logstr+":value_log:minimum_value"
2182        return(V_getRealValueFromHDF5(fname,path))
2183end
2184
2185// DONE -- this needs to be a WAVE reference
2186// DONE -- verify that the field is really read in as "time0"
2187Function V_getLog_time(fname,logStr,outW)
2188        String fname,logStr
2189        Wave outW
2190       
2191        String path = "entry:sample:"+logstr+":value_log:time0"
2192        WAVE w = V_getRealWaveFromHDF5(fname,path)
2193
2194        outW = w
2195        return(0)
2196end
2197
2198// DONE -- this needs to be a WAVE reference
2199Function V_getLog_Value(fname,logStr,outW)
2200        String fname,logStr
2201        Wave outW
2202       
2203        String path = "entry:sample:"+logstr+":value_log:value"
2204        WAVE w = V_getRealWaveFromHDF5(fname,path)
2205
2206        outW = w
2207        return(0)
2208end
2209
2210
2211
2212
2213
2214
2215
2216///////// REDUCTION
2217///////// REDUCTION
2218///////// REDUCTION
2219
2220
2221Function/WAVE V_getAbsolute_Scaling(fname)
2222        String fname
2223       
2224        String path = "entry:reduction:absolute_scaling"       
2225        WAVE w = V_getRealWaveFromHDF5(fname,path)
2226       
2227        return w
2228end
2229
2230Function/S V_getBackgroundFileName(fname)
2231        String fname
2232
2233        String path = "entry:reduction:background_file_name"   
2234        Variable num=60
2235        return(V_getStringFromHDF5(fname,path,num))
2236End
2237
2238Function/WAVE V_getBoxCoordinates(fname)
2239        String fname
2240       
2241        String path = "entry:reduction:box_coordinates"
2242        WAVE w = V_getRealWaveFromHDF5(fname,path)
2243
2244        return w
2245end
2246
2247//box counts
2248Function V_getBoxCounts(fname)
2249        String fname
2250       
2251        String path = "entry:reduction:box_count"       
2252        return(V_getRealValueFromHDF5(fname,path))
2253end
2254
2255//box counts error
2256Function V_getBoxCountsError(fname)
2257        String fname
2258       
2259        String path = "entry:reduction:box_count_error"
2260        return(V_getRealValueFromHDF5(fname,path))
2261end
2262
2263Function/S V_getReductionComments(fname)
2264        String fname
2265
2266        String path = "entry:reduction:comments"       
2267        Variable num=60
2268        return(V_getStringFromHDF5(fname,path,num))
2269End
2270
2271
2272Function/S V_getEmptyBeamFileName(fname)
2273        String fname
2274
2275        String path = "entry:reduction:empty_beam_file_name"   
2276        Variable num=60
2277        return(V_getStringFromHDF5(fname,path,num))
2278End
2279
2280Function/S V_getEmptyFileName(fname)
2281        String fname
2282
2283        String path = "entry:reduction:empty_file_name"
2284        Variable num=60
2285        return(V_getStringFromHDF5(fname,path,num))
2286End
2287
2288// this is (presumably) the polarization "intent"
2289Function/S V_getReduction_polSANSPurpose(fname)
2290        String fname
2291
2292        String path = "entry:reduction:file_purpose"   
2293        Variable num=60
2294        return(V_getStringFromHDF5(fname,path,num))
2295End
2296
2297//group ID
2298// DONE
2299// x- is this duplicated?
2300// x- yes, this is a duplicated field in the /entry/sample block (and is probably more appropriate there)
2301// x- so pick a single location, rather than needing to duplicate.
2302//
2303Function V_getSample_group_ID(fname)
2304        String fname
2305
2306// do not use the entry/reduction location
2307//      String path = "entry:reduction:group_id"
2308        String path = "entry:sample:group_id"   
2309
2310        return(V_getRealValueFromHDF5(fname,path))
2311end
2312
2313Function/S V_getReduction_intent(fname)
2314        String fname
2315
2316        String path = "entry:reduction:intent" 
2317        Variable num=60
2318        return(V_getStringFromHDF5(fname,path,num))
2319End
2320
2321Function/S V_getMaskFileName(fname)
2322        String fname
2323
2324        String path = "entry:reduction:mask_file_name" 
2325        Variable num=60
2326        return(V_getStringFromHDF5(fname,path,num))
2327End
2328
2329Function/S V_getLogFileName(fname)
2330        String fname
2331
2332        String path = "entry:reduction:sans_log_file_name"     
2333        Variable num=60
2334        return(V_getStringFromHDF5(fname,path,num))
2335End
2336
2337Function/S V_getSensitivityFileName(fname)
2338        String fname
2339
2340        String path = "entry:reduction:sensitivity_file_name"   
2341        Variable num=60
2342        return(V_getStringFromHDF5(fname,path,num))
2343End
2344
2345Function/S V_getTransmissionFileName(fname)
2346        String fname
2347
2348        String path = "entry:reduction:transmission_file_name" 
2349        Variable num=60
2350        return(V_getStringFromHDF5(fname,path,num))
2351End
2352
2353//whole detector trasmission
2354Function V_getSampleTransWholeDetector(fname)
2355        String fname
2356       
2357        String path = "entry:reduction:whole_trans"     
2358        return(V_getRealValueFromHDF5(fname,path))
2359end
2360
2361//whole detector trasmission error
2362Function V_getSampleTransWholeDetErr(fname)
2363        String fname
2364       
2365        String path = "entry:reduction:whole_trans_error"       
2366        return(V_getRealValueFromHDF5(fname,path))
2367end
2368
2369       
2370
2371
2372
2373// these have all been moved elsewhere                 
2374///////                 pol_sans (data folder)
2375//
2376//Function/S V_getPolSANS_cellName(fname)
2377//      String fname
2378//
2379//      String path = "entry:reduction:pol_sans:cell_name"     
2380//      Variable num=60
2381//      return(V_getStringFromHDF5(fname,path,num))
2382//End
2383//
2384//
2385//Function/WAVE V_getPolSANS_cellParams(fname)
2386//      String fname
2387//     
2388//      String path = "entry:reduction:pol_sans:cell_parameters"       
2389//      WAVE w = V_getRealWaveFromHDF5(fname,path)
2390//
2391//      return w
2392//end
2393//
2394//Function/S V_getPolSANS_PolSANSPurpose(fname)
2395//      String fname
2396//
2397//      String path = "entry:reduction:pol_sans:pol_sans_purpose"       
2398//      Variable num=60
2399//      return(V_getStringFromHDF5(fname,path,num))
2400//End
2401
2402                               
2403//////// TOP LEVEL DATA REPRESENTATION
2404//
2405// note that here the data is (supposed to be) a link, not the actual data
2406// Igor HDf implementation cannot follow links properly, as far as I know.
2407// so ignore them here, and focus on the image that may be possible to read
2408//
2409
2410//              data_B (data folder)
2411//                      data (wave) 1           //ignore this, it's a link
2412//                      variables (wave) 320
2413//                      thumbnail (data folder)
2414
2415////data (wave) "binary"
2416//// TODO -- this will need to be completely replaced with a function that can
2417//// read the binary image data. should be possible, but I don't know the details on either end...
2418//Function/S V_getDataImage(fname,detStr)
2419//      String fname,detStr
2420//
2421//      String path = "entry:data_"+detStr+":thumbnail:data"   
2422//      Variable num=60
2423//      return(V_getStringFromHDF5(fname,path,num))
2424//End
2425//
2426//Function/S V_getDataImageDescription(fname,detStr)
2427//      String fname,detStr
2428//
2429//      String path = "entry:data_"+detStr+":thumbnail:description"     
2430//      Variable num=60
2431//      return(V_getStringFromHDF5(fname,path,num))
2432//End
2433//                                                             
2434//Function/S V_getDataImageType(fname,detStr)
2435//      String fname,detStr
2436//
2437//      String path = "entry:data_"+detStr+":thumbnail:type"   
2438//      Variable num=60
2439//      return(V_getStringFromHDF5(fname,path,num))
2440//End
2441//
2442//
2443
2444
Note: See TracBrowser for help on using the repository browser.