Ignore:
Timestamp:
Oct 25, 2010 2:30:27 PM (12 years ago)
Author:
srkline
Message:

Fixed bug re-introduced by using the global ASCII code for Angstrom. Now it will use a default "A" if the global does not exist, rather than throwin up an error.

For 2D MC simulation, now if the data was scaled to ABS, the 2D data is "un-scaled" back to raw counts before saving as VAX format. A few counts may be lost here and there during the conversion, but less than 0.01% in my limited testing.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/NCNR_DataReadWrite.ipf

    r656 r757  
    19291929        WAVE rw=realsRead 
    19301930        WAVE/T textw=textRead 
    1931         WAVE data=linear_data 
     1931         
     1932        WAVE linear_data = linear_data 
     1933        Duplicate/O linear_data tmp_data 
     1934                 
     1935        NVAR/Z rawCts = root:Packages:NIST:SAS:gRawCounts 
     1936        if(cmpstr("SAS",type)==0 && !rawCts)            //simulation data, and is not RAW counts, so scale it back 
     1937 
     1938                //use kappa to get back to counts => linear_data = round(linear_data*kappa) 
     1939                String strNote = note(linear_data)  
     1940                Variable kappa = NumberByKey("KAPPA", strNote , "=", ";") 
     1941                NVAR detectorEff = root:Packages:NIST:SAS:g_detectorEff 
     1942 
     1943                tmp_data *= kappa 
     1944                tmp_data *= detectorEff 
     1945//              Print kappa, detectorEff 
     1946                Redimension/I tmp_data 
     1947        endif 
     1948         
     1949        WAVE w=tmp_data 
     1950 
    19321951         
    19331952        //check each wave 
     
    19411960                Abort "textw DNExist WriteVAXData()" 
    19421961        Endif 
    1943         If(!(WaveExists(data))) 
     1962        If(!(WaveExists(w))) 
    19441963                Abort "linear_data DNExist WriteVAXData()" 
    19451964        Endif 
     
    19711990         
    19721991        Make/O/W/N=16401 dataWRecMarkers 
    1973         AddRecordMarkers(data,dataWRecMarkers) 
     1992        AddRecordMarkers(w,dataWRecMarkers) 
    19741993         
    19751994        // need to re-compress?? maybe never a problem, but should be done for the odd case 
     
    22522271         
    22532272        // all done 
    2254         Killwaves/Z tmpFile,dataWRecMarkers 
     2273        Killwaves/Z tmpFile,dataWRecMarkers,tmp_data 
    22552274         
    22562275        Print "Saved VAX binary data as:  ",textW[0] 
Note: See TracChangeset for help on using the changeset viewer.