Ignore:
Timestamp:
May 27, 2016 4:42:06 PM (7 years ago)
Author:
srkline
Message:

read/write for lateral + vertical offset of detectors, eliminating some extra unused fields.

more additions to the mask editor to give some basic functionality (add/del tubes, save mask)

File:
1 edited

Legend:

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

    r994 r1000  
    39083908End 
    39093909 
     3910// this is only written for B and L/R detectors 
    39103911Function V_writeDet_LateralOffset(fname,detStr,val) 
    39113912        String fname,detStr 
     
    39133914 
    39143915//      String path = "entry:instrument:detector_"+detStr+":lateral_offset" 
    3915          
     3916 
     3917        if(cmpstr(detStr,"FT") == 0 || cmpstr(detStr,"FB") == 0) 
     3918                return(0) 
     3919        endif 
     3920        if(cmpstr(detStr,"MT") == 0 || cmpstr(detStr,"MB") == 0) 
     3921                return(0) 
     3922        endif    
     3923                 
    39163924        Make/O/D/N=1 wTmpWrite 
    39173925//      Make/O/R/N=1 wTmpWrite 
    39183926        String groupName = "/entry/instrument/detector_"+detStr  
    39193927        String varName = "lateral_offset" 
     3928        wTmpWrite[0] = val 
     3929 
     3930        variable err 
     3931        err = V_WriteWaveToHDF(fname, groupName, varName, wTmpWrite) 
     3932        if(err) 
     3933                Print "HDF write err = ",err 
     3934        endif 
     3935        // now be sure to kill the data folder to force a re-read of the data next time this file is read in 
     3936//      err = V_KillNamedDataFolder(fname) 
     3937//      if(err) 
     3938//              Print "DataFolder kill err = ",err 
     3939//      endif 
     3940        return(err) 
     3941End 
     3942 
     3943 
     3944// this is only written for T/B detectors 
     3945Function V_writeDet_VerticalOffset(fname,detStr,val) 
     3946        String fname,detStr 
     3947        Variable val 
     3948 
     3949//      String path = "entry:instrument:detector_"+detStr+":vertical_offset" 
     3950 
     3951        if(cmpstr(detStr,"B") == 0) 
     3952                return(0) 
     3953        endif 
     3954        if(cmpstr(detStr,"FR") == 0 || cmpstr(detStr,"FL") == 0) 
     3955                return(0) 
     3956        endif 
     3957        if(cmpstr(detStr,"MR") == 0 || cmpstr(detStr,"ML") == 0) 
     3958                return(0) 
     3959        endif    
     3960                 
     3961        Make/O/D/N=1 wTmpWrite 
     3962//      Make/O/R/N=1 wTmpWrite 
     3963        String groupName = "/entry/instrument/detector_"+detStr  
     3964        String varName = "vertical_offset" 
    39203965        wTmpWrite[0] = val 
    39213966 
     
    39724017 
    39734018 
    3974          
    3975  
    3976 //Function V_writeDet_VerticalOffset(fname,detStr,val) 
    3977 //      String fname,detStr 
    3978 //      Variable val 
    3979 // 
    3980 ////    String path = "entry:instrument:detector_"+detStr+":vertical_offset" 
    3981 //       
    3982 //      Make/O/D/N=1 wTmpWrite 
    3983 ////    Make/O/R/N=1 wTmpWrite 
    3984 //      String groupName = "/entry/instrument/detector_"+detStr  
    3985 //      String varName = "vertical_offset" 
    3986 //      wTmpWrite[0] = val 
    3987 // 
    3988 //      variable err 
    3989 //      err = V_WriteWaveToHDF(fname, groupName, varName, wTmpWrite) 
    3990 //      if(err) 
    3991 //              Print "HDF write err = ",err 
    3992 //      endif 
    3993 //      // now be sure to kill the data folder to force a re-read of the data next time this file is read in 
    3994 ////    err = V_KillNamedDataFolder(fname) 
    3995 ////    if(err) 
    3996 ////            Print "DataFolder kill err = ",err 
    3997 ////    endif 
    3998 //      return(err) 
    3999 //End 
    40004019 
    40014020//// only defined for the "B" detector, and only to satisfy NXsas 
     
    41104129//End 
    41114130 
    4112 Function V_writeDetType(fname,detStr,str) 
    4113         String fname,detStr,str 
    4114  
    4115 //      String path = "entry:instrument:detector_"+detStr+":type" 
    4116  
    4117         Make/O/T/N=1 tmpTW 
    4118         String groupName = "/entry/instrument/detector_"+detStr //       
    4119         String varName = "type" 
    4120         tmpTW[0] = str // 
    4121  
    4122         variable err 
    4123         err = V_WriteTextWaveToHDF(fname, groupName, varName, tmpTW) 
    4124         if(err) 
    4125                 Print "HDF write err = ",err 
    4126         endif 
    4127          
    4128         // now be sure to kill the data folder to force a re-read of the data next time this file is read in 
    4129 //      err = V_KillNamedDataFolder(fname) 
    4130 //      if(err) 
    4131 //              Print "DataFolder kill err = ",err 
    4132 //      endif 
    4133                  
    4134         return(err) 
    4135 End 
     4131//Function V_writeDetType(fname,detStr,str) 
     4132//      String fname,detStr,str 
     4133// 
     4134////    String path = "entry:instrument:detector_"+detStr+":type" 
     4135// 
     4136//      Make/O/T/N=1 tmpTW 
     4137//      String groupName = "/entry/instrument/detector_"+detStr //       
     4138//      String varName = "type" 
     4139//      tmpTW[0] = str // 
     4140// 
     4141//      variable err 
     4142//      err = V_WriteTextWaveToHDF(fname, groupName, varName, tmpTW) 
     4143//      if(err) 
     4144//              Print "HDF write err = ",err 
     4145//      endif 
     4146//       
     4147//      // now be sure to kill the data folder to force a re-read of the data next time this file is read in 
     4148////    err = V_KillNamedDataFolder(fname) 
     4149////    if(err) 
     4150////            Print "DataFolder kill err = ",err 
     4151////    endif 
     4152//               
     4153//      return(err) 
     4154//End 
    41364155 
    41374156Function V_writeDet_x_pixel_size(fname,detStr,val) 
     
    42174236End 
    42184237 
    4219 // TODO -- be clear on how this is defined. Separation as defined from what point? Units? 
    4220 Function V_writeDetPanelSeparation(fname,detStr,val) 
    4221         String fname,detStr 
    4222         Variable val 
    4223  
    4224 //      String path = "entry:instrument:detector_"+detStr+":separation" 
    4225         if(cmpstr(detStr,"B") == 0) 
    4226                 return(0) 
    4227         else 
    4228          
    4229                 Make/O/D/N=1 wTmpWrite 
    4230         //      Make/O/R/N=1 wTmpWrite 
    4231                 String groupName = "/entry/instrument/detector_"+detStr  
    4232                 String varName = "separation" 
    4233                 wTmpWrite[0] = val 
    4234  
    4235                 variable err 
    4236                 err = V_WriteWaveToHDF(fname, groupName, varName, wTmpWrite) 
    4237                 if(err) 
    4238                         Print "HDF write err = ",err 
    4239                 endif 
    4240                 // now be sure to kill the data folder to force a re-read of the data next time this file is read in 
    4241 //              err = V_KillNamedDataFolder(fname) 
     4238// deleted from definition 
     4239//Function V_writeDetPanelSeparation(fname,detStr,val) 
     4240//      String fname,detStr 
     4241//      Variable val 
     4242// 
     4243////    String path = "entry:instrument:detector_"+detStr+":separation" 
     4244//      if(cmpstr(detStr,"B") == 0) 
     4245//              return(0) 
     4246//      else 
     4247//       
     4248//              Make/O/D/N=1 wTmpWrite 
     4249//      //      Make/O/R/N=1 wTmpWrite 
     4250//              String groupName = "/entry/instrument/detector_"+detStr  
     4251//              String varName = "separation" 
     4252//              wTmpWrite[0] = val 
     4253// 
     4254//              variable err 
     4255//              err = V_WriteWaveToHDF(fname, groupName, varName, wTmpWrite) 
    42424256//              if(err) 
    4243 //                      Print "DataFolder kill err = ",err 
     4257//                      Print "HDF write err = ",err 
    42444258//              endif 
    4245                 return(err) 
    4246         endif 
    4247 End 
     4259//              // now be sure to kill the data folder to force a re-read of the data next time this file is read in 
     4260////            err = V_KillNamedDataFolder(fname) 
     4261////            if(err) 
     4262////                    Print "DataFolder kill err = ",err 
     4263////            endif 
     4264//              return(err) 
     4265//      endif 
     4266//End 
    42484267 
    42494268// TODO -- write this function to return a WAVE with the data 
Note: See TracChangeset for help on using the changeset viewer.