Changeset 83
- Timestamp:
- Apr 11, 2007 1:44:21 PM (15 years ago)
- Location:
- sans/SANSReduction/branches/kline_29MAR07/Put in User Procedures/SANS_Reduction_v5.00
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/SANSReduction/branches/kline_29MAR07/Put in User Procedures/SANS_Reduction_v5.00/NCNR_DataReadWrite.ipf
r82 r83 58 58 //fname is the full path:name;vers required to open the file 59 59 //VAX record markers are skipped as needed 60 // thedata as read in is in compressed I*2 format, and is decompressed60 //VAX data as read in is in compressed I*2 format, and is decompressed 61 61 //immediately after being read in. The final root:RAW:data wave is the real 62 62 //neutron counts and can be directly operated on 63 //header information is put into three wave, integers,reals, and text 64 //logicals in the header are currently skipped, since they are no use in the 65 //data reduction process. 66 // 67 // detector data is loaded into an array named "data" 68 // 69 // called by multiple ipfs (when the file name is known) 63 // 64 // header information is put into three waves: integersRead, realsRead, and textRead 65 // logicals in the header are currently skipped, since they are no use in the 66 // data reduction process. 67 // 68 // The output is the three R/T/I waves that are filled at least with minimal values 69 // and the detector data loaded into an array named "data" 70 // 71 // see documentation for the expected information in each element of the R/T/I waves 72 // and the minimum set of information. These waves can be increased in length so that 73 // more information can be accessed as needed (propagating changes...) 74 // 75 // called by multiple .ipfs (when the file name is known) 70 76 // 71 77 Function ReadHeaderAndData(fname) … … 983 989 //--so start is actually the "end byte" of the previous value 984 990 // 991 // Igor cannot write VAX FP values - so to "fake it" 992 // (1) write IEEE FP, 4*desired value, little endian 993 // (2) read back as two 16-bit integers, big endian 994 // (3) write the two 16-bit integers, reversed, writing each as big endian 995 // 985 996 //this procedure takes care of all file open/close pairs needed 986 997 // … … 999 1010 FSetPos refnum,start 1000 1011 FBinWrite/B=3/F=4 refnum,value4 //write out as little endian 1001 1002 1012 //move to the end of the file 1003 1013 FStatus refnum 1004 FSetPos refnum,V_logEOF 1005 //Print "Wrote end of header to " + num2str(V_filePOS) 1006 1014 FSetPos refnum,V_logEOF 1007 1015 Close refnum 1008 1016 … … 1012 1020 FSetPos refnum,start 1013 1021 FBinRead/B=2/F=2 refnum,int1 //read as big-endian 1014 FBinRead/B=2/F=2 refnum,int2 1015 1016 //file was opened read-only 1017 //no need to move to the end of the file, just close it 1018 1022 FBinRead/B=2/F=2 refnum,int2 1023 //file was opened read-only, no need to move to the end of the file, just close it 1019 1024 Close refnum 1025 1020 1026 /////// 1021 1027 Open/A/T="????TEXT" refnum as path … … 1024 1030 FBinWrite/B=2/F=2 refnum,int2 //re-write as big endian 1025 1031 FBinWrite/B=2/F=2 refnum,int1 1026 1027 1032 //move to the end of the file 1028 1033 FStatus refnum 1029 1034 FSetPos refnum,V_logEOF 1030 //Print "Wrote end of header to " + num2str(V_filePOS)1031 1032 1035 Close refnum //at this point, it is as the VAX would have written it. 1033 1036 … … 1227 1230 //rewrite a text field back to the header 1228 1231 // fname is the full path:name 1229 // str is the CORRECT length - it will all be written - pad before sending1232 // str is the CORRECT length - it will all be written - pad or trim before passing 1230 1233 // start is the start byte 1231 1234 Function WriteTextToHeader(fname,str,start) … … 1240 1243 FStatus refnum 1241 1244 FSetPos refnum,V_logEOF 1242 //Print "Wrote end of header to " + num2str(V_filePOS)1243 1245 Close refnum 1244 1246 … … 1273 1275 FStatus refnum 1274 1276 FSetPos refnum,V_logEOF 1275 //Print "Wrote end of header to " + num2str(V_filePOS)1276 1277 Close refnum 1277 1278 -
sans/SANSReduction/branches/kline_29MAR07/Put in User Procedures/SANS_Reduction_v5.00/NCNR_Utils.ipf
r82 r83 45 45 // - when it is, remove the global and write an accessor AND make a place for 46 46 // it in the RealsRead 47 Variable/G root:myGlobals:apOff = 5.0 // (cm) distance from sample aperture to sample position47 Variable/G root:myGlobals:apOff = 10.0 // (cm) distance from sample aperture to sample position 48 48 49 49 End
Note: See TracChangeset
for help on using the changeset viewer.