Ignore:
Timestamp:
Apr 11, 2007 1:44:21 PM (16 years ago)
Author:
srkline
Message:

more tweaks and comments in the NCNR_*.ipf files

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  
    5858//fname is the full path:name;vers required to open the file 
    5959//VAX record markers are skipped as needed 
    60 //the data as read in is in compressed I*2 format, and is decompressed 
     60//VAX data as read in is in compressed I*2 format, and is decompressed 
    6161//immediately after being read in. The final root:RAW:data wave is the real 
    6262//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) 
    7076// 
    7177Function ReadHeaderAndData(fname) 
     
    983989//--so start is actually the "end byte" of the previous value 
    984990// 
     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// 
    985996//this procedure takes care of all file open/close pairs needed 
    986997// 
     
    9991010        FSetPos refnum,start 
    10001011        FBinWrite/B=3/F=4 refnum,value4         //write out as little endian 
    1001          
    10021012        //move to the end of the file 
    10031013        FStatus refnum 
    1004         FSetPos refnum,V_logEOF 
    1005         //Print "Wrote end of header to " + num2str(V_filePOS) 
    1006          
     1014        FSetPos refnum,V_logEOF  
    10071015        Close refnum 
    10081016         
     
    10121020        FSetPos refnum,start 
    10131021        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       
    10191024        Close refnum 
     1025         
    10201026/////// 
    10211027        Open/A/T="????TEXT" refnum as path 
     
    10241030        FBinWrite/B=2/F=2 refnum,int2   //re-write as big endian 
    10251031        FBinWrite/B=2/F=2 refnum,int1 
    1026          
    10271032        //move to the end of the file 
    10281033        FStatus refnum 
    10291034        FSetPos refnum,V_logEOF 
    1030         //Print "Wrote end of header to " + num2str(V_filePOS) 
    1031          
    10321035        Close refnum            //at this point, it is as the VAX would have written it.  
    10331036         
     
    12271230//rewrite a text field back to the header 
    12281231// fname is the full path:name 
    1229 // str is the CORRECT length - it will all be written - pad before sending 
     1232// str is the CORRECT length - it will all be written - pad or trim before passing 
    12301233// start is the start byte 
    12311234Function WriteTextToHeader(fname,str,start) 
     
    12401243        FStatus refnum 
    12411244        FSetPos refnum,V_logEOF 
    1242         //Print "Wrote end of header to " + num2str(V_filePOS) 
    12431245        Close refnum 
    12441246                 
     
    12731275        FStatus refnum 
    12741276        FSetPos refnum,V_logEOF 
    1275         //Print "Wrote end of header to " + num2str(V_filePOS) 
    12761277        Close refnum 
    12771278                 
  • sans/SANSReduction/branches/kline_29MAR07/Put in User Procedures/SANS_Reduction_v5.00/NCNR_Utils.ipf

    r82 r83  
    4545        // - when it is, remove the global and write an accessor AND make a place for  
    4646        // it in the RealsRead  
    47         Variable/G root:myGlobals:apOff = 5.0                           // (cm) distance from sample aperture to sample position 
     47        Variable/G root:myGlobals:apOff = 10.0                          // (cm) distance from sample aperture to sample position 
    4848 
    4949End 
Note: See TracChangeset for help on using the changeset viewer.