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.

Location:
sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS
Files:
6 edited

Legend:

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

    r749 r757  
    990990                Label bottom "Angle (deg)" 
    991991        else 
    992                 SVAR angst = root:Packages:NIST:gAngstStr 
     992                SVAR/Z angst = root:Packages:NIST:gAngstStr 
    993993                Label bottom "q ("+angst+"\\S-1\\M)" 
    994994        Endif 
     
    11791179         
    11801180        //check for proper x-scaling selection 
    1181         SVAR angst = root:Packages:NIST:gAngstStr  
     1181        SVAR/Z angst = root:Packages:NIST:gAngstStr  
    11821182        String dum 
    11831183         
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/Marquee.ipf

    r749 r757  
    264264                ModifyGraph lowTrip=1e-04 
    265265                ModifyImage data cindex=$"root:myGlobals:NIHColors" 
    266                 SVAR angst = root:Packages:NIST:gAngstStr 
     266                SVAR/Z angst = root:Packages:NIST:gAngstStr 
    267267                Label bottom "Qx ("+angst+"\\S-1\\M)" 
    268268                Label left "Qy ("+angst+"\\S-1\\M)" 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/MultScatter_MonteCarlo_2D.ipf

    r755 r757  
    11441144// currently hard-wired for SAS data folder 
    11451145// 
     1146// A later call to Write_VAXRaw_Data() will check for the simulation data, and  
     1147// convert ABS simulated data to raw counts if necessary 
     1148// 
    11461149Function SaveAsVAXButtonProc(ctrlName,[runIndex,simLabel]) 
    11471150        String ctrlName 
     
    11531156        // the easy answer is to abort, but I possibly could unscale the data and get back to integer 
    11541157        // counts. 
    1155         NVAR isRAW = root:Packages:NIST:SAS:gRawCounts 
    1156         if(! isRAW) 
    1157                 Abort "The simulation must be in RAW counts for it to be saved as RAW VAX format" 
    1158         endif 
     1158        // A later call to Write_VAXRaw_Data() will check for the simulation data, and  
     1159        // convert ABS simulated data to raw counts if necessary 
     1160//      NVAR isRAW = root:Packages:NIST:SAS:gRawCounts 
     1161//      if(!isRAW) 
     1162//              Abort "The simulation must be in RAW counts for it to be saved as RAW VAX format" 
     1163//      endif 
    11591164         
    11601165        // if default parameters were passed in, use them 
  • 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] 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/SASCALC.ipf

    r752 r757  
    16191619        NVAR instrument = instrument 
    16201620        NVAR L2diff = L2diff 
    1621         NVAR lens = root:Packages:NIST:SAS:gUsingLenses 
    1622         SVAR aStr = root:Packages:NIST:gAngstStr 
     1621   NVAR lens = root:Packages:NIST:SAS:gUsingLenses 
     1622        SVAR/Z aStr = root:Packages:NIST:gAngstStr 
    16231623         
    16241624        sprintf temp,"Source Aperture Diameter =\t\t%6.2f cm\r",sourceApertureDiam() 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/Subtract_1D.ipf

    r749 r757  
    321321        ShowInfo 
    322322        Label left "Sample, Solvent I (cm\\S-1\M)" 
    323         Label bottom "q ("+root:Packages:NIST:gAngstStr+"\\S-1\M)" 
     323         
     324        String angst = StrVarOrDefault("root:Packages:NIST:gAngstStr", "A" ) 
     325        Label bottom "q ("+angst+"\\S-1\M)" 
    324326//      Label right "Result I/cm\\S-1" 
    325327        ControlBar 40 
Note: See TracChangeset for help on using the changeset viewer.