Ignore:
Timestamp:
Nov 13, 2015 4:03:38 PM (7 years ago)
Author:
srkline
Message:

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

File:
1 edited

Legend:

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

    r967 r969  
    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(fname,detStr) 
     3014Function V_writeDet_PixelFWHM_X(fname,detStr,val) 
    30153015        String fname,detStr 
    3016  
    3017         String path = "entry:instrument:detector_"+detStr+":PixelFWHM" 
    3018  
    3019 // TODO -- different behavior for "B" 
    3020         if(cmpstr(detStr,"B") == 0) 
    3021 //              return(V_writeRealValueFromHDF5(fname,path)) 
    3022                 return(-99999) 
    3023         else 
    3024 //              return(V_writeRealValueFromHDF5(fname,path)) 
    3025                 return(-99999) 
    3026         endif 
    3027 End 
     3016        Variable val 
     3017 
     3018//      String path = "entry:instrument:detector_"+detStr+":PixelFWHM_X" 
     3019         
     3020        Make/O/D/N=1 wTmpWrite 
     3021//      Make/O/R/N=1 wTmpWrite 
     3022        String groupName = "/entry/instrument/detector_"+detStr  
     3023        String varName = "PixelFWHM_X" 
     3024        wTmpWrite[0] = val 
     3025 
     3026        variable err 
     3027        err = V_WriteWaveToHDF(fname, groupName, varName, wTmpWrite) 
     3028        if(err) 
     3029                Print "HDF write err = ",err 
     3030        endif 
     3031        // now be sure to kill the data folder to force a re-read of the data next time this file is read in 
     3032        err = V_KillNamedDataFolder(fname) 
     3033        if(err) 
     3034                Print "DataFolder kill err = ",err 
     3035        endif 
     3036        return(err) 
     3037End 
     3038 
     3039 
     3040// TODO -- write and X and Y version of this. Pixels are not square 
     3041// so the FHWM will be different in each direction. May need to return 
     3042// "dummy" value for "B" detector if pixels there are square 
     3043Function V_writeDet_PixelFWHM_Y(fname,detStr,val) 
     3044        String fname,detStr 
     3045        Variable val 
     3046 
     3047//      String path = "entry:instrument:detector_"+detStr+":PixelFWHM_Y" 
     3048         
     3049        Make/O/D/N=1 wTmpWrite 
     3050//      Make/O/R/N=1 wTmpWrite 
     3051        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) 
     3066End 
     3067 
    30283068 
    30293069Function V_writeDet_PixelNumX(fname,detStr,val) 
     
    50705110End 
    50715111 
     5112Function V_writeTransmissionFileName(fname,str) 
     5113        String fname,str 
     5114 
     5115//      String path = "entry:reduction:transmission_file_name"   
     5116 
     5117        Make/O/T/N=1 tmpTW 
     5118        String groupName = "/entry/reduction" 
     5119        String varName = "transmission_file_name" 
     5120        tmpTW[0] = str // 
     5121 
     5122        variable err 
     5123        err = V_WriteTextWaveToHDF(fname, groupName, varName, tmpTW) 
     5124        if(err) 
     5125                Print "HDF write err = ",err 
     5126        endif 
     5127         
     5128        // now be sure to kill the data folder to force a re-read of the data next time this file is read in 
     5129        err = V_KillNamedDataFolder(fname) 
     5130        if(err) 
     5131                Print "DataFolder kill err = ",err 
     5132        endif 
     5133                 
     5134        return(err) 
     5135End 
     5136 
     5137Function V_writeEmptyBeamFileName(fname,str) 
     5138        String fname,str 
     5139 
     5140//      String path = "entry:reduction:empty_beam_file_name"     
     5141 
     5142        Make/O/T/N=1 tmpTW 
     5143        String groupName = "/entry/reduction" 
     5144        String varName = "empty_beam_file_name" 
     5145        tmpTW[0] = str // 
     5146 
     5147        variable err 
     5148        err = V_WriteTextWaveToHDF(fname, groupName, varName, tmpTW) 
     5149        if(err) 
     5150                Print "HDF write err = ",err 
     5151        endif 
     5152         
     5153        // now be sure to kill the data folder to force a re-read of the data next time this file is read in 
     5154        err = V_KillNamedDataFolder(fname) 
     5155        if(err) 
     5156                Print "DataFolder kill err = ",err 
     5157        endif 
     5158                 
     5159        return(err) 
     5160End 
     5161 
    50725162 
    50735163//whole detector transmission 
Note: See TracChangeset for help on using the changeset viewer.