Changeset 970


Ignore:
Timestamp:
Nov 16, 2015 4:18:33 PM (7 years ago)
Author:
srkline
Message:

more additions and corrections to the V_get and V_write functions

creating a folder (not root) for the raw data files to be loaded

Location:
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/VC_VCALCPanel_MockUp.ipf

    r963 r970  
    643643        NewDataFolder/O root:Packages:NIST:VSANS:VCALC:Middle 
    644644        NewDataFolder/O root:Packages:NIST:VSANS:VCALC:Back 
     645        NewDataFolder/O root:Packages:NIST:VSANS:RawVSANS 
    645646         
    646647         
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_HDF5_RW_Utils.ipf

    r969 r970  
    1212// 
    1313 
    14  
    15  
    16 // thought this would be useful, but the file name (folder) is stuck in the middle... 
    17 //Strconstant ksPathPrefix = "root:(folder):entry:entry1:" 
     14// data is read into: 
     15//      NewDataFolder/O/S root:Packages:NIST:VSANS:RawVSANS 
     16// so that the data folders of the raw data won't be lying around on the top level, looking like 
     17// 1D data sets and interfering. 
     18 
     19 
     20// the base data folder path where the raw data is loaded 
     21Strconstant ksBaseDFPath = "root:Packages:NIST:VSANS:RawVSANS:" 
    1822 
    1923 
     
    2428End 
    2529 
     30// TODO -- move the initializtion of the raw data folder to be in the as-yet unwritten initialization routine for 
     31// reduction. be sure that it's duplicated in the VCALC initialization too. 
     32// 
    2633Proc V_LoadHDF5Data(file) 
    2734        String file 
    2835 
    29         SetDataFolder root:      
     36        NewDataFolder/O/S root:Packages:NIST:VSANS:RawVSANS 
     37//      SetDataFolder root: 
    3038        Variable err= V_LoadHDF5_NoAtt(file)    // reads into current folder 
    3139        SetDataFolder root: 
     
    102110        folderStr = V_RemoveDotExtension(V_GetFileNameFromPathNoSemi(fname)) 
    103111         
    104         if(Exists("root:"+folderStr+":"+path)) 
     112        if(Exists(ksBaseDFPath+folderStr+":"+path)) 
    105113                valExists=1 
    106114        endif 
     
    112120 
    113121// this should exist now - if not, I need to see the error 
    114         Wave/Z w = $("root:"+folderStr+":"+path) 
     122        Wave/Z w = $(ksBaseDFPath+folderStr+":"+path) 
    115123         
    116124        if(WaveExists(w)) 
     
    139147        folderStr = V_RemoveDotExtension(V_GetFileNameFromPathNoSemi(fname)) 
    140148         
    141         if(Exists("root:"+folderStr+":"+path)) 
     149        if(Exists(ksBaseDFPath+folderStr+":"+path)) 
    142150                valExists=1 
    143151        endif 
     
    149157 
    150158// this should exist now - if not, I need to see the error 
    151         Wave wOut = $("root:"+folderStr+":"+path) 
     159        Wave wOut = $(ksBaseDFPath+folderStr+":"+path) 
    152160         
    153161        return wOut 
     
    173181        folderStr = V_RemoveDotExtension(V_GetFileNameFromPathNoSemi(fname)) 
    174182         
    175         if(Exists("root:"+folderStr+":"+path)) 
     183        if(Exists(ksBaseDFPath+folderStr+":"+path)) 
    176184                valExists=1 
    177185        endif 
     
    183191 
    184192// this should exist now - if not, I need to see the error 
    185         Wave/T wOut = $("root:"+folderStr+":"+path) 
     193        Wave/T wOut = $(ksBaseDFPath+folderStr+":"+path) 
    186194         
    187195        return wOut 
     
    233241        folderStr = V_RemoveDotExtension(V_GetFileNameFromPathNoSemi(fname)) 
    234242         
    235         if(Exists("root:"+folderStr+":"+path)) 
     243        if(Exists(ksBaseDFPath+folderStr+":"+path)) 
    236244                valExists=1 
    237245        endif 
     
    243251 
    244252// this should exist now - if not, I need to see the error 
    245         Wave/T/Z tw = $("root:"+folderStr+":"+path) 
     253        Wave/T/Z tw = $(ksBaseDFPath+folderStr+":"+path) 
    246254         
    247255        if(WaveExists(tw)) 
     
    444452        folderStr = V_RemoveDotExtension(folderStr) 
    445453         
    446         KillDataFolder/Z $("root:"+folderStr) 
     454        KillDataFolder/Z $(ksBaseDFPath+folderStr) 
    447455        err = V_flag 
    448456         
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_HDF5_Read.ipf

    r969 r970  
    3131//end 
    3232 
     33Macro Dump_V_getFP(fname) 
     34        String fname 
     35         
     36        Test_V_get_FP("V_get*",fname) 
     37end 
     38 
    3339Function Test_V_get_FP(str,fname) 
    3440        String str,fname 
     
    5258end 
    5359 
     60Macro Dump_V_getFP_Det(fname,detStr) 
     61        String fname,detStr="FL" 
     62         
     63        Test_V_get_FP2("V_get*",fname,detStr) 
     64end 
     65 
    5466Function Test_V_get_FP2(str,fname,detStr) 
    5567        String str,fname,detStr 
     
    7183         
    7284        return(0) 
     85end 
     86 
     87 
     88Macro Dump_V_getSTR(fname) 
     89        String fname 
     90         
     91        Test_V_get_STR("V_get*",fname) 
    7392end 
    7493 
     
    96115         
    97116        return(0) 
     117end 
     118 
     119Macro Dump_V_getSTR_Det(fname,detStr) 
     120        String fname,detStr="FL" 
     121         
     122        Test_V_get_STR2("V_get*",fname,detStr) 
    98123end 
    99124 
     
    651676end 
    652677 
    653 Function V_getCrystalnx_distance(fname) 
    654         String fname 
    655          
    656         String path = "entry:instrument:beam:monochromator:crystal:nx_distance"  
     678Function V_getCrystalDistance(fname) 
     679        String fname 
     680         
     681        String path = "entry:instrument:beam:monochromator:crystal:distance"     
    657682        return(V_getRealValueFromHDF5(fname,path)) 
    658683end 
     
    716741 
    717742// instrument/beam/monochromator/velocity_selector (data folder) 
    718 Function V_getVSnx_distance(fname) 
    719         String fname 
    720          
    721         String path = "entry:instrument:beam:monochromator:velocity_selector:nx_distance"        
     743Function V_getVSDistance(fname) 
     744        String fname 
     745         
     746        String path = "entry:instrument:beam:monochromator:velocity_selector:distance"   
    722747        return(V_getRealValueFromHDF5(fname,path)) 
    723748end 
     
    906931End 
    907932 
    908 Function V_getBeamMonLownx_distance(fname) 
    909         String fname 
    910  
    911         String path = "entry:instrument:beam_monitor_low:nx_distance" 
     933Function V_getBeamMonLowDistance(fname) 
     934        String fname 
     935 
     936        String path = "entry:instrument:beam_monitor_low:distance" 
    912937        return(V_getRealValueFromHDF5(fname,path)) 
    913938End 
     
    943968End 
    944969 
    945 Function V_getBeamMonNormnx_distance(fname) 
    946         String fname 
    947  
    948         String path = "entry:instrument:beam_monitor_norm:nx_distance" 
     970Function V_getBeamMonNormDistance(fname) 
     971        String fname 
     972 
     973        String path = "entry:instrument:beam_monitor_norm:distance" 
    949974        return(V_getRealValueFromHDF5(fname,path)) 
    950975End 
     
    9811006End 
    9821007 
    983 Function V_getBeamStop_x0(fname) 
    984         String fname 
    985  
    986         String path = "entry:instrument:beam_stop:x0" 
    987         return(V_getRealValueFromHDF5(fname,path)) 
    988 End 
    989  
    990 Function V_getBeamStop_y0(fname) 
    991         String fname 
    992  
    993         String path = "entry:instrument:beam_stop:y0" 
     1008Function V_getBeamStop_x_pos(fname) 
     1009        String fname 
     1010 
     1011        String path = "entry:instrument:beam_stop:x_pos" 
     1012        return(V_getRealValueFromHDF5(fname,path)) 
     1013End 
     1014 
     1015Function V_getBeamStop_y_pos(fname) 
     1016        String fname 
     1017 
     1018        String path = "entry:instrument:beam_stop:y_pos" 
    9941019        return(V_getRealValueFromHDF5(fname,path)) 
    9951020End 
     
    10451070// only defined for the "B" detector, and may not be necessary? 
    10461071// TODO -- write to return an ARRAY 
    1047 Function V_getDet_CALX(fname,detStr,outW) 
     1072Function V_getDet_cal_x(fname,detStr,outW) 
    10481073        String fname,detStr 
    10491074        Wave outW 
    10501075 
    10511076        if(cmpstr(detStr,"B") == 0) 
    1052                 String path = "entry:instrument:detector_"+detStr+":CALX" 
     1077                String path = "entry:instrument:detector_"+detStr+":cal_x" 
    10531078                WAVE w = V_getRealWaveFromHDF5(fname,path) 
    10541079 
     
    10621087// only defined for the "B" detector, and may not be necessary? 
    10631088// TODO -- write to return an ARRAY 
    1064 Function V_getDet_CALY(fname,detStr,outW) 
     1089Function V_getDet_cal_y(fname,detStr,outW) 
    10651090        String fname,detStr 
    10661091        Wave outW 
    10671092 
    10681093        if(cmpstr(detStr,"B") == 0) 
    1069                 String path = "entry:instrument:detector_"+detStr+":CALY" 
     1094                String path = "entry:instrument:detector_"+detStr+":cal_y" 
    10701095                WAVE w = V_getRealWaveFromHDF5(fname,path) 
    10711096         
     
    10801105// so the FHWM will be different in each direction. May need to return 
    10811106// "dummy" value for "B" detector if pixels there are square 
    1082 Function V_getDet_PixelFWHM_X(fname,detStr) 
    1083         String fname,detStr 
    1084  
    1085         String path = "entry:instrument:detector_"+detStr+":PixelFWHM_X" 
     1107Function V_getDet_pixel_fwhm_x(fname,detStr) 
     1108        String fname,detStr 
     1109 
     1110        String path = "entry:instrument:detector_"+detStr+":pixel_fwhm_x" 
    10861111 
    10871112// TODO -- different behavior for "B" 
     
    10961121// so the FHWM will be different in each direction. May need to return 
    10971122// "dummy" value for "B" detector if pixels there are square 
    1098 Function V_getDet_PixelFWHM_Y(fname,detStr) 
    1099         String fname,detStr 
    1100  
    1101         String path = "entry:instrument:detector_"+detStr+":PixelFWHM_Y" 
     1123Function V_getDet_pixel_fwhm_y(fname,detStr) 
     1124        String fname,detStr 
     1125 
     1126        String path = "entry:instrument:detector_"+detStr+":pixel_fwhm_y" 
    11021127 
    11031128// TODO -- different behavior for "B" 
     
    11091134End 
    11101135 
    1111 Function V_getDet_PixelNumX(fname,detStr) 
    1112         String fname,detStr 
    1113  
    1114         String path = "entry:instrument:detector_"+detStr+":PixelNumX" 
    1115         return(V_getRealValueFromHDF5(fname,path)) 
    1116 End 
    1117  
    1118 Function V_getDet_PixelNumY(fname,detStr) 
    1119         String fname,detStr 
    1120  
    1121         String path = "entry:instrument:detector_"+detStr+":PixelNumY" 
     1136Function V_getDet_pixel_num_x(fname,detStr) 
     1137        String fname,detStr 
     1138 
     1139        String path = "entry:instrument:detector_"+detStr+":pixel_num_x" 
     1140        return(V_getRealValueFromHDF5(fname,path)) 
     1141End 
     1142 
     1143Function V_getDet_pixel_num_y(fname,detStr) 
     1144        String fname,detStr 
     1145 
     1146        String path = "entry:instrument:detector_"+detStr+":pixel_num_y" 
    11221147        return(V_getRealValueFromHDF5(fname,path)) 
    11231148End 
     
    17811806 
    17821807// TODO -- this needs to be a WAVE reference 
     1808// TODO -- verify that the field is really read in as "time0" 
    17831809Function V_getLog_time(fname,logStr,outW) 
    17841810        String fname,logStr 
    17851811        Wave outW 
    17861812         
    1787         String path = "entry:sample:"+logstr+":value_log:nx_time" 
     1813        String path = "entry:sample:"+logstr+":value_log:time0" 
    17881814        WAVE w = V_getRealWaveFromHDF5(fname,path) 
    17891815 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_HDF5_Write.ipf

    r969 r970  
    16671667end 
    16681668 
    1669 Function V_writeCrystalnx_distance(fname,val) 
    1670         String fname 
    1671         Variable val 
    1672          
    1673 //      String path = "entry:instrument:beam:monochromator:crystal:nx_distance"  
     1669Function V_writeCrystalDistance(fname,val) 
     1670        String fname 
     1671        Variable val 
     1672         
     1673//      String path = "entry:instrument:beam:monochromator:crystal:distance"     
    16741674         
    16751675        Make/O/D/N=1 wTmpWrite 
    16761676//      Make/O/R/N=1 wTmpWrite 
    16771677        String groupName = "/entry/instrument/beam/monochromator/crystal"        
    1678         String varName = "nx_distance" 
     1678        String varName = "distance" 
    16791679        wTmpWrite[0] = val 
    16801680 
     
    18931893 
    18941894// instrument/beam/monochromator/velocity_selector (data folder) 
    1895 Function V_writeVSnx_distance(fname,val) 
    1896         String fname 
    1897         Variable val 
    1898          
    1899 //      String path = "entry:instrument:beam:monochromator:velocity_selector:nx_distance"        
     1895Function V_writeVSDistance(fname,val) 
     1896        String fname 
     1897        Variable val 
     1898         
     1899//      String path = "entry:instrument:beam:monochromator:velocity_selector:distance"   
    19001900         
    19011901        Make/O/D/N=1 wTmpWrite 
    19021902//      Make/O/R/N=1 wTmpWrite 
    19031903        String groupName = "/entry/instrument/beam/monochromator/velocity_selector"      
    1904         String varName = "nx_distance" 
     1904        String varName = "distance" 
    19051905        wTmpWrite[0] = val 
    19061906 
     
    25052505End 
    25062506 
    2507 Function V_writeBeamMonLownx_distance(fname,val) 
    2508         String fname 
    2509         Variable val 
    2510  
    2511 //      String path = "entry:instrument:beam_monitor_low:nx_distance" 
     2507Function V_writeBeamMonLowDistance(fname,val) 
     2508        String fname 
     2509        Variable val 
     2510 
     2511//      String path = "entry:instrument:beam_monitor_low:distance" 
    25122512         
    25132513        Make/O/D/N=1 wTmpWrite 
    25142514//      Make/O/R/N=1 wTmpWrite 
    25152515        String groupName = "/entry/instrument/beam_monitor_low"  
    2516         String varName = "nx_distance" 
     2516        String varName = "distance" 
    25172517        wTmpWrite[0] = val 
    25182518 
     
    26312631End 
    26322632 
    2633 Function V_writeBeamMonNormnx_distance(fname,val) 
    2634         String fname 
    2635         Variable val 
    2636  
    2637 //      String path = "entry:instrument:beam_monitor_norm:nx_distance" 
     2633Function V_writeBeamMonNormDistance(fname,val) 
     2634        String fname 
     2635        Variable val 
     2636 
     2637//      String path = "entry:instrument:beam_monitor_norm:distance" 
    26382638         
    26392639        Make/O/D/N=1 wTmpWrite 
    26402640//      Make/O/R/N=1 wTmpWrite 
    26412641        String groupName = "/entry/instrument/beam_monitor_norm"         
    2642         String varName = "nx_distance" 
     2642        String varName = "distance" 
    26432643        wTmpWrite[0] = val 
    26442644 
     
    27572757End 
    27582758 
    2759 Function V_writeBeamStop_x0(fname,val) 
     2759Function V_writeBeamStop_x_pos(fname,val) 
    27602760        String fname 
    27612761        Variable val 
     
    27662766//      Make/O/R/N=1 wTmpWrite 
    27672767        String groupName = "/entry/instrument/beam_stop"         
    2768         String varName = "x0" 
    2769         wTmpWrite[0] = val 
    2770  
    2771         variable err 
    2772         err = V_WriteWaveToHDF(fname, groupName, varName, wTmpWrite) 
    2773         if(err) 
    2774                 Print "HDF write err = ",err 
    2775         endif 
    2776         // now be sure to kill the data folder to force a re-read of the data next time this file is read in 
    2777         err = V_KillNamedDataFolder(fname) 
    2778         if(err) 
    2779                 Print "DataFolder kill err = ",err 
    2780         endif 
    2781         return(err) 
    2782 End 
    2783  
    2784 Function V_writeBeamStop_y0(fname,val) 
     2768        String varName = "x_pos" 
     2769        wTmpWrite[0] = val 
     2770 
     2771        variable err 
     2772        err = V_WriteWaveToHDF(fname, groupName, varName, wTmpWrite) 
     2773        if(err) 
     2774                Print "HDF write err = ",err 
     2775        endif 
     2776        // now be sure to kill the data folder to force a re-read of the data next time this file is read in 
     2777        err = V_KillNamedDataFolder(fname) 
     2778        if(err) 
     2779                Print "DataFolder kill err = ",err 
     2780        endif 
     2781        return(err) 
     2782End 
     2783 
     2784Function V_writeBeamStop_y_pos(fname,val) 
    27852785        String fname 
    27862786        Variable val 
     
    27912791//      Make/O/R/N=1 wTmpWrite 
    27922792        String groupName = "/entry/instrument/beam_stop"         
    2793         String varName = "y0" 
     2793        String varName = "y_pos" 
    27942794        wTmpWrite[0] = val 
    27952795 
     
    29452945// only defined for the "B" detector, and may not be necessary? 
    29462946// TODO -- write to return an ARRAY 
    2947 Function V_writeDet_CALX(fname,detStr,inW) 
     2947Function V_writeDet_cal_x(fname,detStr,inW) 
    29482948        String fname,detStr 
    29492949        Wave inW 
     
    29582958        // -- May also need to check the dimension(s) before writing (don't trust the input) 
    29592959                String groupName = "/entry/instrument/detector_"+detStr  
    2960                 String varName = "CALX" 
     2960                String varName = "cal_x" 
    29612961 
    29622962                variable err 
     
    29782978// only defined for the "B" detector, and may not be necessary? 
    29792979// TODO -- write to return an ARRAY 
    2980 Function V_writeDet_CALY(fname,detStr,inW) 
     2980Function V_writeDet_cal_y(fname,detStr,inW) 
    29812981        String fname,detStr 
    29822982        Wave inW 
     
    29912991        // -- May also need to check the dimension(s) before writing (don't trust the input) 
    29922992                String groupName = "/entry/instrument/detector_"+detStr  
    2993                 String varName = "CALY" 
     2993                String varName = "cal_y" 
    29942994 
    29952995                variable err 
     
    30123012// so the FHWM will be different in each direction. May need to return 
    30133013// "dummy" value for "B" detector if pixels there are square 
    3014 Function V_writeDet_PixelFWHM_X(fname,detStr,val) 
     3014Function V_writeDet_pixel_fwhm_x(fname,detStr,val) 
    30153015        String fname,detStr 
    30163016        Variable val 
    30173017 
    3018 //      String path = "entry:instrument:detector_"+detStr+":PixelFWHM_X" 
     3018//      String path = "entry:instrument:detector_"+detStr+":pixel_fwhm_x" 
    30193019         
    30203020        Make/O/D/N=1 wTmpWrite 
    30213021//      Make/O/R/N=1 wTmpWrite 
    30223022        String groupName = "/entry/instrument/detector_"+detStr  
    3023         String varName = "PixelFWHM_X" 
     3023        String varName = "pixel_fwhm_x" 
    30243024        wTmpWrite[0] = val 
    30253025 
     
    30413041// so the FHWM will be different in each direction. May need to return 
    30423042// "dummy" value for "B" detector if pixels there are square 
    3043 Function V_writeDet_PixelFWHM_Y(fname,detStr,val) 
     3043Function V_writeDet_pixel_fwhm_y(fname,detStr,val) 
    30443044        String fname,detStr 
    30453045        Variable val 
    30463046 
    3047 //      String path = "entry:instrument:detector_"+detStr+":PixelFWHM_Y" 
     3047//      String path = "entry:instrument:detector_"+detStr+":pixel_fwhm_y" 
    30483048         
    30493049        Make/O/D/N=1 wTmpWrite 
    30503050//      Make/O/R/N=1 wTmpWrite 
    30513051        String groupName = "/entry/instrument/detector_"+detStr  
    3052         String varName = "PixelFWHM_Y" 
    3053         wTmpWrite[0] = val 
    3054  
    3055         variable err 
    3056         err = V_WriteWaveToHDF(fname, groupName, varName, wTmpWrite) 
    3057         if(err) 
    3058                 Print "HDF write err = ",err 
    3059         endif 
    3060         // now be sure to kill the data folder to force a re-read of the data next time this file is read in 
    3061         err = V_KillNamedDataFolder(fname) 
    3062         if(err) 
    3063                 Print "DataFolder kill err = ",err 
    3064         endif 
    3065         return(err) 
    3066 End 
    3067  
    3068  
    3069 Function V_writeDet_PixelNumX(fname,detStr,val) 
     3052        String varName = "pixel_fwhm_y" 
     3053        wTmpWrite[0] = val 
     3054 
     3055        variable err 
     3056        err = V_WriteWaveToHDF(fname, groupName, varName, wTmpWrite) 
     3057        if(err) 
     3058                Print "HDF write err = ",err 
     3059        endif 
     3060        // now be sure to kill the data folder to force a re-read of the data next time this file is read in 
     3061        err = V_KillNamedDataFolder(fname) 
     3062        if(err) 
     3063                Print "DataFolder kill err = ",err 
     3064        endif 
     3065        return(err) 
     3066End 
     3067 
     3068 
     3069Function V_writeDet_pixel_num_x(fname,detStr,val) 
    30703070        String fname,detStr 
    30713071        Variable val 
    30723072 
    3073 //      String path = "entry:instrument:detector_"+detStr+":PixelNumX" 
     3073//      String path = "entry:instrument:detector_"+detStr+":pixel_nnum_x" 
    30743074         
    30753075        Make/O/D/N=1 wTmpWrite 
    30763076//      Make/O/R/N=1 wTmpWrite 
    30773077        String groupName = "/entry/instrument/detector_"+detStr  
    3078         String varName = "PixelNumX" 
    3079         wTmpWrite[0] = val 
    3080  
    3081         variable err 
    3082         err = V_WriteWaveToHDF(fname, groupName, varName, wTmpWrite) 
    3083         if(err) 
    3084                 Print "HDF write err = ",err 
    3085         endif 
    3086         // now be sure to kill the data folder to force a re-read of the data next time this file is read in 
    3087         err = V_KillNamedDataFolder(fname) 
    3088         if(err) 
    3089                 Print "DataFolder kill err = ",err 
    3090         endif 
    3091         return(err) 
    3092 End 
    3093  
    3094 Function V_writeDet_PixelNumY(fname,detStr,val) 
     3078        String varName = "pixel_num_x" 
     3079        wTmpWrite[0] = val 
     3080 
     3081        variable err 
     3082        err = V_WriteWaveToHDF(fname, groupName, varName, wTmpWrite) 
     3083        if(err) 
     3084                Print "HDF write err = ",err 
     3085        endif 
     3086        // now be sure to kill the data folder to force a re-read of the data next time this file is read in 
     3087        err = V_KillNamedDataFolder(fname) 
     3088        if(err) 
     3089                Print "DataFolder kill err = ",err 
     3090        endif 
     3091        return(err) 
     3092End 
     3093 
     3094Function V_writeDet_pixel_num_y(fname,detStr,val) 
    30953095        String fname,detStr 
    30963096        Variable val 
    30973097 
    3098 //      String path = "entry:instrument:detector_"+detStr+":PixelNumY" 
     3098//      String path = "entry:instrument:detector_"+detStr+":pixel_num_y" 
    30993099         
    31003100        Make/O/D/N=1 wTmpWrite 
    31013101//      Make/O/R/N=1 wTmpWrite 
    31023102        String groupName = "/entry/instrument/detector_"+detStr  
    3103         String varName = "PixelNumY" 
     3103        String varName = "pixel_num_y" 
    31043104        wTmpWrite[0] = val 
    31053105 
     
    41474147        endif 
    41484148        return(err) 
    4149 End              
     4149End      
     4150 
     4151 
     4152///////  sample_aperture_2 (data folder) 
     4153 
     4154Function V_writeSampleAp2_Description(fname,str) 
     4155        String fname,str 
     4156 
     4157//      String path = "entry:instrument:sample_aperture_2:description" 
     4158 
     4159        Make/O/T/N=1 tmpTW 
     4160        String groupName = "/entry/instrument/sample_aperture_2" 
     4161        String varName = "description" 
     4162        tmpTW[0] = str // 
     4163 
     4164        variable err 
     4165        err = V_WriteTextWaveToHDF(fname, groupName, varName, tmpTW) 
     4166        if(err) 
     4167                Print "HDF write err = ",err 
     4168        endif 
     4169         
     4170        // now be sure to kill the data folder to force a re-read of the data next time this file is read in 
     4171        err = V_KillNamedDataFolder(fname) 
     4172        if(err) 
     4173                Print "DataFolder kill err = ",err 
     4174        endif 
     4175                 
     4176        return(err) 
     4177End 
     4178 
     4179Function V_writeSampleAp2_distance(fname,val) 
     4180        String fname 
     4181        Variable val 
     4182 
     4183//      String path = "entry:instrument:sample_aperture_2:distance" 
     4184         
     4185        Make/O/D/N=1 wTmpWrite 
     4186//      Make/O/R/N=1 wTmpWrite 
     4187        String groupName = "/entry/instrument/sample_aperture_2" 
     4188        String varName = "distance" 
     4189        wTmpWrite[0] = val 
     4190 
     4191        variable err 
     4192        err = V_WriteWaveToHDF(fname, groupName, varName, wTmpWrite) 
     4193        if(err) 
     4194                Print "HDF write err = ",err 
     4195        endif 
     4196        // now be sure to kill the data folder to force a re-read of the data next time this file is read in 
     4197        err = V_KillNamedDataFolder(fname) 
     4198        if(err) 
     4199                Print "DataFolder kill err = ",err 
     4200        endif 
     4201        return(err) 
     4202End 
     4203//      shape (data folder) 
     4204 
     4205Function V_writeSampleAp2_shape(fname,str) 
     4206        String fname,str 
     4207 
     4208//      String path = "entry:instrument:sample_aperture_2:shape:shape" 
     4209 
     4210        Make/O/T/N=1 tmpTW 
     4211        String groupName = "/entry/instrument/sample_aperture_2/shape" 
     4212        String varName = "shape" 
     4213        tmpTW[0] = str // 
     4214 
     4215        variable err 
     4216        err = V_WriteTextWaveToHDF(fname, groupName, varName, tmpTW) 
     4217        if(err) 
     4218                Print "HDF write err = ",err 
     4219        endif 
     4220         
     4221        // now be sure to kill the data folder to force a re-read of the data next time this file is read in 
     4222        err = V_KillNamedDataFolder(fname) 
     4223        if(err) 
     4224                Print "DataFolder kill err = ",err 
     4225        endif 
     4226                 
     4227        return(err) 
     4228End 
     4229 
     4230// TODO -- this needs to return a WAVE, since the shape may be circle, or rectangle 
     4231// and will need to return more than a single dimension 
     4232// TODO -- be careful of the UNITS 
     4233Function V_writeSampleAp2_size(fname,inW) 
     4234        String fname 
     4235        Wave inW 
     4236 
     4237//      String path = "entry:instrument:sample_aperture_2:shape:size" 
     4238 
     4239        Duplicate/O inW wTmpWrite        
     4240// then use redimension as needed to cast the wave to write to the specified type 
     4241// see WaveType for the proper codes  
     4242//      Redimension/T=() wTmpWrite 
     4243// -- May also need to check the dimension(s) before writing (don't trust the input) 
     4244        String groupName = "/entry/instrument/sample_aperture_2/shape"   
     4245        String varName = "size" 
     4246 
     4247        variable err 
     4248        err = V_WriteWaveToHDF(fname, groupName, varName, wTmpWrite) 
     4249        if(err) 
     4250                Print "HDF write err = ",err 
     4251        endif 
     4252        // now be sure to kill the data folder to force a re-read of the data next time this file is read in 
     4253        err = V_KillNamedDataFolder(fname) 
     4254        if(err) 
     4255                Print "DataFolder kill err = ",err 
     4256        endif 
     4257        return(err) 
     4258End      
     4259 
    41504260                 
    41514261//////  sample_table (data folder) 
     
    48404950        Wave inW 
    48414951         
    4842 //      String path = "entry:sample:"+logstr+":value_log:nx_time" 
     4952//      String path = "entry:sample:"+logstr+":value_log:time" 
    48434953 
    48444954        Duplicate/O inW wTmpWrite        
     
    48484958// -- May also need to check the dimension(s) before writing (don't trust the input) 
    48494959        String groupName = "/entry/sample/"+logStr+"/value_log"  
    4850         String varName = "nx_time" 
     4960        String varName = "time" 
    48514961 
    48524962        variable err 
Note: See TracChangeset for help on using the changeset viewer.