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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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         
Note: See TracChangeset for help on using the changeset viewer.