Changeset 970
- Timestamp:
- Nov 16, 2015 4:18:33 PM (7 years ago)
- 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 643 643 NewDataFolder/O root:Packages:NIST:VSANS:VCALC:Middle 644 644 NewDataFolder/O root:Packages:NIST:VSANS:VCALC:Back 645 NewDataFolder/O root:Packages:NIST:VSANS:RawVSANS 645 646 646 647 -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_HDF5_RW_Utils.ipf
r969 r970 12 12 // 13 13 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 21 Strconstant ksBaseDFPath = "root:Packages:NIST:VSANS:RawVSANS:" 18 22 19 23 … … 24 28 End 25 29 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 // 26 33 Proc V_LoadHDF5Data(file) 27 34 String file 28 35 29 SetDataFolder root: 36 NewDataFolder/O/S root:Packages:NIST:VSANS:RawVSANS 37 // SetDataFolder root: 30 38 Variable err= V_LoadHDF5_NoAtt(file) // reads into current folder 31 39 SetDataFolder root: … … 102 110 folderStr = V_RemoveDotExtension(V_GetFileNameFromPathNoSemi(fname)) 103 111 104 if(Exists( "root:"+folderStr+":"+path))112 if(Exists(ksBaseDFPath+folderStr+":"+path)) 105 113 valExists=1 106 114 endif … … 112 120 113 121 // 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) 115 123 116 124 if(WaveExists(w)) … … 139 147 folderStr = V_RemoveDotExtension(V_GetFileNameFromPathNoSemi(fname)) 140 148 141 if(Exists( "root:"+folderStr+":"+path))149 if(Exists(ksBaseDFPath+folderStr+":"+path)) 142 150 valExists=1 143 151 endif … … 149 157 150 158 // this should exist now - if not, I need to see the error 151 Wave wOut = $( "root:"+folderStr+":"+path)159 Wave wOut = $(ksBaseDFPath+folderStr+":"+path) 152 160 153 161 return wOut … … 173 181 folderStr = V_RemoveDotExtension(V_GetFileNameFromPathNoSemi(fname)) 174 182 175 if(Exists( "root:"+folderStr+":"+path))183 if(Exists(ksBaseDFPath+folderStr+":"+path)) 176 184 valExists=1 177 185 endif … … 183 191 184 192 // 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) 186 194 187 195 return wOut … … 233 241 folderStr = V_RemoveDotExtension(V_GetFileNameFromPathNoSemi(fname)) 234 242 235 if(Exists( "root:"+folderStr+":"+path))243 if(Exists(ksBaseDFPath+folderStr+":"+path)) 236 244 valExists=1 237 245 endif … … 243 251 244 252 // 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) 246 254 247 255 if(WaveExists(tw)) … … 444 452 folderStr = V_RemoveDotExtension(folderStr) 445 453 446 KillDataFolder/Z $( "root:"+folderStr)454 KillDataFolder/Z $(ksBaseDFPath+folderStr) 447 455 err = V_flag 448 456 -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_HDF5_Read.ipf
r969 r970 31 31 //end 32 32 33 Macro Dump_V_getFP(fname) 34 String fname 35 36 Test_V_get_FP("V_get*",fname) 37 end 38 33 39 Function Test_V_get_FP(str,fname) 34 40 String str,fname … … 52 58 end 53 59 60 Macro Dump_V_getFP_Det(fname,detStr) 61 String fname,detStr="FL" 62 63 Test_V_get_FP2("V_get*",fname,detStr) 64 end 65 54 66 Function Test_V_get_FP2(str,fname,detStr) 55 67 String str,fname,detStr … … 71 83 72 84 return(0) 85 end 86 87 88 Macro Dump_V_getSTR(fname) 89 String fname 90 91 Test_V_get_STR("V_get*",fname) 73 92 end 74 93 … … 96 115 97 116 return(0) 117 end 118 119 Macro Dump_V_getSTR_Det(fname,detStr) 120 String fname,detStr="FL" 121 122 Test_V_get_STR2("V_get*",fname,detStr) 98 123 end 99 124 … … 651 676 end 652 677 653 Function V_getCrystal nx_distance(fname)654 String fname 655 656 String path = "entry:instrument:beam:monochromator:crystal: nx_distance"678 Function V_getCrystalDistance(fname) 679 String fname 680 681 String path = "entry:instrument:beam:monochromator:crystal:distance" 657 682 return(V_getRealValueFromHDF5(fname,path)) 658 683 end … … 716 741 717 742 // instrument/beam/monochromator/velocity_selector (data folder) 718 Function V_getVS nx_distance(fname)719 String fname 720 721 String path = "entry:instrument:beam:monochromator:velocity_selector: nx_distance"743 Function V_getVSDistance(fname) 744 String fname 745 746 String path = "entry:instrument:beam:monochromator:velocity_selector:distance" 722 747 return(V_getRealValueFromHDF5(fname,path)) 723 748 end … … 906 931 End 907 932 908 Function V_getBeamMonLow nx_distance(fname)909 String fname 910 911 String path = "entry:instrument:beam_monitor_low: nx_distance"933 Function V_getBeamMonLowDistance(fname) 934 String fname 935 936 String path = "entry:instrument:beam_monitor_low:distance" 912 937 return(V_getRealValueFromHDF5(fname,path)) 913 938 End … … 943 968 End 944 969 945 Function V_getBeamMonNorm nx_distance(fname)946 String fname 947 948 String path = "entry:instrument:beam_monitor_norm: nx_distance"970 Function V_getBeamMonNormDistance(fname) 971 String fname 972 973 String path = "entry:instrument:beam_monitor_norm:distance" 949 974 return(V_getRealValueFromHDF5(fname,path)) 950 975 End … … 981 1006 End 982 1007 983 Function V_getBeamStop_x 0(fname)984 String fname 985 986 String path = "entry:instrument:beam_stop:x 0"987 return(V_getRealValueFromHDF5(fname,path)) 988 End 989 990 Function V_getBeamStop_y 0(fname)991 String fname 992 993 String path = "entry:instrument:beam_stop:y 0"1008 Function V_getBeamStop_x_pos(fname) 1009 String fname 1010 1011 String path = "entry:instrument:beam_stop:x_pos" 1012 return(V_getRealValueFromHDF5(fname,path)) 1013 End 1014 1015 Function V_getBeamStop_y_pos(fname) 1016 String fname 1017 1018 String path = "entry:instrument:beam_stop:y_pos" 994 1019 return(V_getRealValueFromHDF5(fname,path)) 995 1020 End … … 1045 1070 // only defined for the "B" detector, and may not be necessary? 1046 1071 // TODO -- write to return an ARRAY 1047 Function V_getDet_ CALX(fname,detStr,outW)1072 Function V_getDet_cal_x(fname,detStr,outW) 1048 1073 String fname,detStr 1049 1074 Wave outW 1050 1075 1051 1076 if(cmpstr(detStr,"B") == 0) 1052 String path = "entry:instrument:detector_"+detStr+": CALX"1077 String path = "entry:instrument:detector_"+detStr+":cal_x" 1053 1078 WAVE w = V_getRealWaveFromHDF5(fname,path) 1054 1079 … … 1062 1087 // only defined for the "B" detector, and may not be necessary? 1063 1088 // TODO -- write to return an ARRAY 1064 Function V_getDet_ CALY(fname,detStr,outW)1089 Function V_getDet_cal_y(fname,detStr,outW) 1065 1090 String fname,detStr 1066 1091 Wave outW 1067 1092 1068 1093 if(cmpstr(detStr,"B") == 0) 1069 String path = "entry:instrument:detector_"+detStr+": CALY"1094 String path = "entry:instrument:detector_"+detStr+":cal_y" 1070 1095 WAVE w = V_getRealWaveFromHDF5(fname,path) 1071 1096 … … 1080 1105 // so the FHWM will be different in each direction. May need to return 1081 1106 // "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"1107 Function V_getDet_pixel_fwhm_x(fname,detStr) 1108 String fname,detStr 1109 1110 String path = "entry:instrument:detector_"+detStr+":pixel_fwhm_x" 1086 1111 1087 1112 // TODO -- different behavior for "B" … … 1096 1121 // so the FHWM will be different in each direction. May need to return 1097 1122 // "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"1123 Function V_getDet_pixel_fwhm_y(fname,detStr) 1124 String fname,detStr 1125 1126 String path = "entry:instrument:detector_"+detStr+":pixel_fwhm_y" 1102 1127 1103 1128 // TODO -- different behavior for "B" … … 1109 1134 End 1110 1135 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"1136 Function 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)) 1141 End 1142 1143 Function V_getDet_pixel_num_y(fname,detStr) 1144 String fname,detStr 1145 1146 String path = "entry:instrument:detector_"+detStr+":pixel_num_y" 1122 1147 return(V_getRealValueFromHDF5(fname,path)) 1123 1148 End … … 1781 1806 1782 1807 // TODO -- this needs to be a WAVE reference 1808 // TODO -- verify that the field is really read in as "time0" 1783 1809 Function V_getLog_time(fname,logStr,outW) 1784 1810 String fname,logStr 1785 1811 Wave outW 1786 1812 1787 String path = "entry:sample:"+logstr+":value_log: nx_time"1813 String path = "entry:sample:"+logstr+":value_log:time0" 1788 1814 WAVE w = V_getRealWaveFromHDF5(fname,path) 1789 1815 -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_HDF5_Write.ipf
r969 r970 1667 1667 end 1668 1668 1669 Function V_writeCrystal nx_distance(fname,val)1670 String fname 1671 Variable val 1672 1673 // String path = "entry:instrument:beam:monochromator:crystal: nx_distance"1669 Function V_writeCrystalDistance(fname,val) 1670 String fname 1671 Variable val 1672 1673 // String path = "entry:instrument:beam:monochromator:crystal:distance" 1674 1674 1675 1675 Make/O/D/N=1 wTmpWrite 1676 1676 // Make/O/R/N=1 wTmpWrite 1677 1677 String groupName = "/entry/instrument/beam/monochromator/crystal" 1678 String varName = " nx_distance"1678 String varName = "distance" 1679 1679 wTmpWrite[0] = val 1680 1680 … … 1893 1893 1894 1894 // instrument/beam/monochromator/velocity_selector (data folder) 1895 Function V_writeVS nx_distance(fname,val)1896 String fname 1897 Variable val 1898 1899 // String path = "entry:instrument:beam:monochromator:velocity_selector: nx_distance"1895 Function V_writeVSDistance(fname,val) 1896 String fname 1897 Variable val 1898 1899 // String path = "entry:instrument:beam:monochromator:velocity_selector:distance" 1900 1900 1901 1901 Make/O/D/N=1 wTmpWrite 1902 1902 // Make/O/R/N=1 wTmpWrite 1903 1903 String groupName = "/entry/instrument/beam/monochromator/velocity_selector" 1904 String varName = " nx_distance"1904 String varName = "distance" 1905 1905 wTmpWrite[0] = val 1906 1906 … … 2505 2505 End 2506 2506 2507 Function V_writeBeamMonLow nx_distance(fname,val)2508 String fname 2509 Variable val 2510 2511 // String path = "entry:instrument:beam_monitor_low: nx_distance"2507 Function V_writeBeamMonLowDistance(fname,val) 2508 String fname 2509 Variable val 2510 2511 // String path = "entry:instrument:beam_monitor_low:distance" 2512 2512 2513 2513 Make/O/D/N=1 wTmpWrite 2514 2514 // Make/O/R/N=1 wTmpWrite 2515 2515 String groupName = "/entry/instrument/beam_monitor_low" 2516 String varName = " nx_distance"2516 String varName = "distance" 2517 2517 wTmpWrite[0] = val 2518 2518 … … 2631 2631 End 2632 2632 2633 Function V_writeBeamMonNorm nx_distance(fname,val)2634 String fname 2635 Variable val 2636 2637 // String path = "entry:instrument:beam_monitor_norm: nx_distance"2633 Function V_writeBeamMonNormDistance(fname,val) 2634 String fname 2635 Variable val 2636 2637 // String path = "entry:instrument:beam_monitor_norm:distance" 2638 2638 2639 2639 Make/O/D/N=1 wTmpWrite 2640 2640 // Make/O/R/N=1 wTmpWrite 2641 2641 String groupName = "/entry/instrument/beam_monitor_norm" 2642 String varName = " nx_distance"2642 String varName = "distance" 2643 2643 wTmpWrite[0] = val 2644 2644 … … 2757 2757 End 2758 2758 2759 Function V_writeBeamStop_x 0(fname,val)2759 Function V_writeBeamStop_x_pos(fname,val) 2760 2760 String fname 2761 2761 Variable val … … 2766 2766 // Make/O/R/N=1 wTmpWrite 2767 2767 String groupName = "/entry/instrument/beam_stop" 2768 String varName = "x 0"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_y 0(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) 2782 End 2783 2784 Function V_writeBeamStop_y_pos(fname,val) 2785 2785 String fname 2786 2786 Variable val … … 2791 2791 // Make/O/R/N=1 wTmpWrite 2792 2792 String groupName = "/entry/instrument/beam_stop" 2793 String varName = "y 0"2793 String varName = "y_pos" 2794 2794 wTmpWrite[0] = val 2795 2795 … … 2945 2945 // only defined for the "B" detector, and may not be necessary? 2946 2946 // TODO -- write to return an ARRAY 2947 Function V_writeDet_ CALX(fname,detStr,inW)2947 Function V_writeDet_cal_x(fname,detStr,inW) 2948 2948 String fname,detStr 2949 2949 Wave inW … … 2958 2958 // -- May also need to check the dimension(s) before writing (don't trust the input) 2959 2959 String groupName = "/entry/instrument/detector_"+detStr 2960 String varName = " CALX"2960 String varName = "cal_x" 2961 2961 2962 2962 variable err … … 2978 2978 // only defined for the "B" detector, and may not be necessary? 2979 2979 // TODO -- write to return an ARRAY 2980 Function V_writeDet_ CALY(fname,detStr,inW)2980 Function V_writeDet_cal_y(fname,detStr,inW) 2981 2981 String fname,detStr 2982 2982 Wave inW … … 2991 2991 // -- May also need to check the dimension(s) before writing (don't trust the input) 2992 2992 String groupName = "/entry/instrument/detector_"+detStr 2993 String varName = " CALY"2993 String varName = "cal_y" 2994 2994 2995 2995 variable err … … 3012 3012 // so the FHWM will be different in each direction. May need to return 3013 3013 // "dummy" value for "B" detector if pixels there are square 3014 Function V_writeDet_ PixelFWHM_X(fname,detStr,val)3014 Function V_writeDet_pixel_fwhm_x(fname,detStr,val) 3015 3015 String fname,detStr 3016 3016 Variable val 3017 3017 3018 // String path = "entry:instrument:detector_"+detStr+": PixelFWHM_X"3018 // String path = "entry:instrument:detector_"+detStr+":pixel_fwhm_x" 3019 3019 3020 3020 Make/O/D/N=1 wTmpWrite 3021 3021 // Make/O/R/N=1 wTmpWrite 3022 3022 String groupName = "/entry/instrument/detector_"+detStr 3023 String varName = " PixelFWHM_X"3023 String varName = "pixel_fwhm_x" 3024 3024 wTmpWrite[0] = val 3025 3025 … … 3041 3041 // so the FHWM will be different in each direction. May need to return 3042 3042 // "dummy" value for "B" detector if pixels there are square 3043 Function V_writeDet_ PixelFWHM_Y(fname,detStr,val)3043 Function V_writeDet_pixel_fwhm_y(fname,detStr,val) 3044 3044 String fname,detStr 3045 3045 Variable val 3046 3046 3047 // String path = "entry:instrument:detector_"+detStr+": PixelFWHM_Y"3047 // String path = "entry:instrument:detector_"+detStr+":pixel_fwhm_y" 3048 3048 3049 3049 Make/O/D/N=1 wTmpWrite 3050 3050 // Make/O/R/N=1 wTmpWrite 3051 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) 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) 3066 End 3067 3068 3069 Function V_writeDet_pixel_num_x(fname,detStr,val) 3070 3070 String fname,detStr 3071 3071 Variable val 3072 3072 3073 // String path = "entry:instrument:detector_"+detStr+": PixelNumX"3073 // String path = "entry:instrument:detector_"+detStr+":pixel_nnum_x" 3074 3074 3075 3075 Make/O/D/N=1 wTmpWrite 3076 3076 // Make/O/R/N=1 wTmpWrite 3077 3077 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) 3092 End 3093 3094 Function V_writeDet_pixel_num_y(fname,detStr,val) 3095 3095 String fname,detStr 3096 3096 Variable val 3097 3097 3098 // String path = "entry:instrument:detector_"+detStr+": PixelNumY"3098 // String path = "entry:instrument:detector_"+detStr+":pixel_num_y" 3099 3099 3100 3100 Make/O/D/N=1 wTmpWrite 3101 3101 // Make/O/R/N=1 wTmpWrite 3102 3102 String groupName = "/entry/instrument/detector_"+detStr 3103 String varName = " PixelNumY"3103 String varName = "pixel_num_y" 3104 3104 wTmpWrite[0] = val 3105 3105 … … 4147 4147 endif 4148 4148 return(err) 4149 End 4149 End 4150 4151 4152 /////// sample_aperture_2 (data folder) 4153 4154 Function 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) 4177 End 4178 4179 Function 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) 4202 End 4203 // shape (data folder) 4204 4205 Function 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) 4228 End 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 4233 Function 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) 4258 End 4259 4150 4260 4151 4261 ////// sample_table (data folder) … … 4840 4950 Wave inW 4841 4951 4842 // String path = "entry:sample:"+logstr+":value_log: nx_time"4952 // String path = "entry:sample:"+logstr+":value_log:time" 4843 4953 4844 4954 Duplicate/O inW wTmpWrite … … 4848 4958 // -- May also need to check the dimension(s) before writing (don't trust the input) 4849 4959 String groupName = "/entry/sample/"+logStr+"/value_log" 4850 String varName = " nx_time"4960 String varName = "time" 4851 4961 4852 4962 variable err
Note: See TracChangeset
for help on using the changeset viewer.