Changeset 1219


Ignore:
Timestamp:
Oct 4, 2019 8:56:43 AM (3 years ago)
Author:
srkline
Message:

Corrections to the NGB30mSANS attenuator tables (for 3A data only).

Corrections to the sample aperture units on VSANS (change in NICE on 5/22/19).

Additions for the super white beam mode on VSANS - still in progress.

Location:
sans/Dev/trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • sans/Dev/trunk/NCNR_Igor_Procedures/NCNR_Package_Loader.ipf

    r1215 r1219  
    165165        strswitch(itemStr)      // string switch 
    166166         
    167                 case "Load NCNR SANS Reduction Macros":  
     167                case "Load NCNR SANS Reduction Macros": 
    168168                        Execute/P "INSERTINCLUDE \"Includes_v520\"" 
    169169                        Execute/P "COMPILEPROCEDURES " 
  • sans/Dev/trunk/NCNR_User_Procedures/Common/Packages/LinearizedFits/LinearizedFits_v40.ipf

    r888 r1219  
    524524        // ShortFileNameString is the currently selected data set, so make the user find the right data set 
    525525        // 
    526         Variable maxLength=25 
     526        Variable maxLength 
     527        if(IgorVersion() < 8) 
     528                maxLength = 25 
     529        else 
     530                maxLength = 40 
     531        endif 
     532         
    527533        if(strlen(partialName) > maxLength) 
    528534                // get user input, from a list of all of the data folder names 
  • sans/Dev/trunk/NCNR_User_Procedures/Common/Packages/PlotManager/PlotUtilsMacro_v40.ipf

    r1164 r1219  
    10861086// returns a shortened file name (26 characters max) so that the loader 
    10871087// won't try to create Igor objects that have names that are longer than 31 
    1088 //  
     1088// 
     1089// if Igor 8+, use longer names (within reason) 
     1090// 
    10891091Function/S ShortFileNameString(inStr) 
    10901092        String inStr 
    10911093 
    10921094        String outStr="" 
    1093         Variable maxLength=25 
     1095        Variable maxLength 
     1096         
     1097        if(IgorVersion() < 8) 
     1098                maxLength = 25 
     1099        else 
     1100                maxLength = 40 
     1101        endif 
     1102         
     1103         
    10941104        Variable nameTooLong=0 
    10951105        String/G root:Packages:NIST:gShortNameStr = inStr[0,maxLength-1] 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/NCNR_Utils.ipf

    r1217 r1219  
    14421442// new calibration done June 2007, John Barker 
    14431443// new calibration for 3A only -- September 2019, John Barker 
     1444// -- corrected values for  att #9 and att #10 27SEP2019 
    14441445// 
    14451446Proc MakeNG3AttenTable() 
     
    14761477         
    14771478         
    1478         //each wave has 10 elements, the transmission of att# at the wavelengths  
     1479        //each wave has 11 elements, the transmission of att# at the wavelengths  
    14791480        //lambda = 4,5,6,7,8,10,12,14,17,20 (4 A and 20 A are extrapolated values) 
    14801481        Make/O/N=(num) root:myGlobals:Attenuators:ng3lambda={3,4,5,6,7,8,10,12,14,17,20} 
     
    14911492        root:myGlobals:Attenuators:ng3att7 = {0.0041106,0.00170757,0.001084,0.0006469,0.0004142,0.0002607,0.0001201,7.664e-05,4.06624e-05,1.77379e-05,7.30624e-06} 
    14921493        root:myGlobals:Attenuators:ng3att8 = {0.001029,0.000320057,0.0001918,0.0001025,6.085e-05,3.681e-05,1.835e-05,6.74002e-06,3.25288e-06,1.15321e-06,3.98173e-07} 
    1493         root:myGlobals:Attenuators:ng3att9 = {0.00026462,6.27682e-05,3.69e-05,1.908e-05,1.196e-05,8.738e-06,6.996e-06,6.2901e-07,2.60221e-07,7.49748e-08,2.08029e-08} 
    1494         root:myGlobals:Attenuators:ng3att10 = {0.00015214,1.40323e-05,8.51e-06,5.161e-06,4.4e-06,4.273e-06,1.88799e-07,5.87021e-08,2.08169e-08,4.8744e-09,1.08687e-09} 
     1494        root:myGlobals:Attenuators:ng3att9 = {0.00026462,5.999e-05,3.3937e-05,1.6241e-05,8.9395e-06,5.1975e-06,2.0337e-06,5.9274e-07,2.6022e-07,7.4975e-08,2.1699e-08} 
     1495        root:myGlobals:Attenuators:ng3att10 = {6.9169e-05,1.1244e-05,6.0046e-06,2.5733e-06,1.3133e-06,7.3386e-07,2.3137e-07,5.2128e-08,2.0817e-08,4.8744e-09,1.1826e-09} 
    14951496   
    14961497  // percent errors as measured, May 2007 values 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/VSANS_Includes.ipf

    r1209 r1219  
    1818#include "NIST_XML_v40" 
    1919#include "USANS_SlitSmearing_v40" 
     20 
     21#include "V_PlotUtils2D_VSANS"                  // basic loaders for the QxQyASCII exported VSANS data 
    2022 
    2123// 
     
    129131#include "V_SWB_GaussSpheres" 
    130132#include "V_WB_Beaucage" 
     133#include "V_SWB_Beaucage" 
    131134 
    132135 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Attenuation.ipf

    r1203 r1219  
    183183        // set a fake wavelength for the interpolation or get out 
    184184        strswitch(monoType)     // string switch 
     185                case "super_white_beam":                // TODO: this is not written into NICE 
     186                        lambda = 6.2e6          //just for the interpolation 
     187                        break 
    185188                case "velocity_selector":       // execute if case matches expression 
    186189                        // use lambda as-is 
     
    246249        // set a fake wavelength for the interpolation or get out 
    247250        strswitch(monoType)     // string switch 
     251                case "super_white_beam":                // TODO: this is not written into NICE 
     252                        lambda = 6.2e6          //just for the interpolation 
     253                        break 
    248254                case "velocity_selector":       // execute if case matches expression 
    249255                        // use lambda as-is 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_HDF5_Read.ipf

    r1203 r1219  
    19821982End 
    19831983 
     1984// 
    19841985// this returns REAL, DIFFERENT than SampleAp1 
     1986// see the note above. after the hard-coded date, the values in the header 
     1987// are values appear to be in [mm]. before that date, the values are in [cm] 
     1988// 
     1989// This function returns a value in [cm] 
     1990// 
    19851991Function V_getSampleAp2_size(fname) 
    19861992        String fname 
    19871993 
    19881994        String path = "entry:instrument:sample_aperture_2:shape:size" 
    1989         return(V_getRealValueFromHDF5(fname,path)) 
     1995         
     1996        Variable val = V_Compare_ISO_Dates("2019-05-10T13:36:54.200-04:00",V_getDataStartTime(fname)) 
     1997         
     1998        if(val == 2)            // more "current" data, mm in the header 
     1999                return(V_getRealValueFromHDF5(fname,path)/10) 
     2000        else 
     2001                // "older" data, cm in the header 
     2002                return(V_getRealValueFromHDF5(fname,path)) 
     2003        endif 
     2004 
     2005//      return(V_getRealValueFromHDF5(fname,path)) 
     2006 
    19902007End 
    19912008 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Instrument_Resolution.ipf

    r1203 r1219  
    172172                S2 = VC_sampleApertureDiam()*10         // convert cm to mm 
    173173        else 
    174         // I'm trusting [cm] is in the RAW data file 
     174        // I'm trusting [cm] is in the RAW data file, or returned from the function if the date is prior to 5/22/19 
    175175                S2 = V_getSampleAp2_size(folderStr)*10          // sample ap 1 or 2? 2 = the "external", convert to [mm] 
    176176        endif 
     
    260260// narrowSlit_whiteBeam 
    261261 
     262// TODO: this is a messy way to identify the super white beam condition, and it needs to be  
     263// done in a cleaner fashion (through IdentityCollimation) once NICE catches up 
     264 
     265        String monoType = V_IdentifyMonochromatorType(folderStr) 
     266         
    262267 
    263268        if(cmpstr(collimationStr,"pinhole") == 0) 
    264                 //nothing to change      
     269                if(cmpstr(monoType,"super_white_beam")==0) 
     270                        lambdaWidth = 0 
     271                endif 
     272                //otherwise, nothing to change   
    265273        endif 
    266274 
     
    321329        //Start resolution calculation 
    322330        a2 = S1*L2/L1 + S2*(L1+L2)/L1 
    323         q_small = 2.0*Pi*(BS-a2)*(1.0-lambdaWidth)/(lambda*L2) 
     331//      q_small = 2.0*Pi*(BS-a2)*(1.0-lambdaWidth)/(lambda*L2) 
    324332        lp = 1.0/( 1.0/L1 + 1.0/L2) 
    325333 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Utilities_Comparisons.ipf

    r1203 r1219  
    428428        String typeStr="" 
    429429 
     430// TODO: if unidentified (all are OUT), then it may be super_white_beam 
     431//       
     432        typeStr = "super_white_beam" 
     433         
     434         
    430435        if(cmpstr(V_getVelSelStatus(fname),"IN") == 0) 
    431436                typeStr = "velocity_selector" 
     
    439444                typeStr = "crystal" 
    440445        endif    
     446 
     447 
    441448         
    442449        return(typeStr) 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_WhiteBeamDistribution.ipf

    r1209 r1219  
    2626// Integral = 30955 (cts*A) for middle fit 
    2727// 
     28// 
     29 
    2830 
    2931//  White Beam: 
    3032//  mean wavelength = 5.29687 
    31 //  sqrt(mean wavelength^2) = 5.40513 
     33//  3rd moment/2nd moment = 5.741 
    3234// 
    3335//  Super White Beam: 
    3436//  mean wavelength = 6.2033 
    35 //  sqrt(mean wavelength^2) = 6.56277 
    36  
     37//  3rd moment/2nd moment = 7.93267 
     38// 
    3739 
    3840 
     
    151153Proc V_WB_Stats() 
    152154 
    153         duplicate/O counts_white cts_W, intg_W 
    154         duplicate/O counts_super_white cts_SW intg_SW 
     155        duplicate/O counts_white cts_W, intg_W,intg_W3 
     156        duplicate/O counts_super_white cts_SW intg_SW,intg_SW3 
    155157 
    156158        Print "White Beam:" 
     
    158160        printf "mean wavelength = %g\r",sum(intg_W)/sum(cts_W) 
    159161        intg_W = cts_W*white_wavelength^2 
    160         printf "sqrt(mean wavelength^2) = %g\r",sqrt( sum(intg_W)/sum(cts_W) ) 
     162//      printf "sqrt(wavelength^2)/N = %g\r",sqrt( sum(intg_W)/sum(cts_W) ) 
     163        intg_W3 = cts_W*white_wavelength^3 
     164        printf "3rd moment/2nd moment = %g\r",sum(intg_W3)/sum(intg_W) 
    161165 
    162166        Print 
     
    165169        printf "mean wavelength = %g\r",sum(intg_SW)/sum(cts_SW) 
    166170        intg_SW = cts_SW*super_white_wavelength^2 
    167         printf "sqrt(mean wavelength^2) = %g\r",sqrt( sum(intg_SW)/sum(cts_SW) ) 
     171//      printf "sqrt(wavelength^2)/N = %g\r",sqrt( sum(intg_SW)/sum(cts_SW) ) 
     172        intg_SW3 = cts_SW*super_white_wavelength^3 
     173        printf "3rd moment/2nd moment = %g\r",sum(intg_SW3)/sum(intg_SW) 
    168174                 
    169175End 
Note: See TracChangeset for help on using the changeset viewer.