Ignore:
Timestamp:
Jun 10, 2011 2:03:45 PM (12 years ago)
Author:
srkline
Message:

Initial separation of facility-specific initialization from the USANS reduction procedures. This is being done to enable the KIST-USANS instrument to use the NCNR reduction scheme. KIST will duplicate the .bt5 file structure but use a different extension.

For this, files for KIST have been created for USANS-specifc, and for some SANS-specific procedures that are entangled with the XML writing and with the USANS simulator.

Corresponding changes (new U_NCNR_Utils) have been added for NCNR-specific USANS initialization.

More will need to be done to disentangle the U_CALC, but at a later date. See ticket #334.

Location:
sans/Dev/trunk/NCNR_User_Procedures/Reduction
Files:
6 added
1 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/USANS/BT5_AddFiles.ipf

    r611 r807  
    751751Proc SelectFilesToAdd(file1,file2) 
    752752        String file1,file2 
    753         Prompt file1, "First File", popup, BT5FileList("*.bt5*") 
    754         Prompt file2, "Second File", popup, BT5FileList("*.bt5*") 
     753        Prompt file1, "First File", popup, BT5FileList("") 
     754        Prompt file2, "Second File", popup, BT5FileList("") 
    755755         
    756756//      Print file1,file2 
     
    763763        String filter 
    764764         
     765        SVAR ext = root:Packages:NIST:USANS:Globals:MainPanel:gUExt 
     766        filter = "*"+ext+"*" 
    765767         
    766768        //get all the files, then trim the list 
     
    789791        String file1,file2 
    790792         
     793        SVAR ext = root:Packages:NIST:USANS:Globals:MainPanel:gUExt 
     794 
    791795        //load each file into a textWave 
    792796        Make/O/T/N=200 tw1,tw2 
     
    893897         
    894898        // write out the final file (=tw3) 
    895         filen = file1[0,strlen(file1)-5]+"_SUM.bt5" 
     899        filen = file1[0,strlen(file1)-5]+"_SUM"+ext 
    896900         
    897901        if(dialog) 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/USANS/BT5_Loader.ipf

    r765 r807  
    3131        SVAR USANSFolder = root:Packages:NIST:USANS:Globals:gUSANSFolder 
    3232         
    33         Variable num=200,err=0,refnum 
     33        Variable num=500,err=0,refnum 
    3434        Make/O/D/N=(num) $(USANSFolder+":"+type+":Angle") 
    3535        Make/O/D/N=(num) $(USANSFolder+":"+type+":DetCts") 
     
    7373        filedt = filedt[1,(ii-2)] 
    7474                 
    75         print filedt 
    76         print BT5Date2Secs(filedt) 
    77         print date2secs(2010,11,7) 
    78          
    79         if (BT5Date2Secs(filedt) < date2secs(2010,11,7)) 
    80                         MainDeadTime = 4e-5 
    81                         TransDeadTime = 1.26e-5 
    82                         //print "Old Dead Times" 
    83                         //MainDeadTime = 0 
    84                         //TransDeadTime = 0 
    85         else 
    86                         MainDeadTime = 7e-6 
    87                         TransDeadTime = 1.26e-5 
    88                         //print "New Dead Times" 
    89         endif 
     75//      print filedt 
     76//      print BT5Date2Secs(filedt) 
     77//      print date2secs(2010,11,7) 
     78         
     79        USANS_DetectorDeadtime(filedt,MainDeadTime,TransDeadTime) 
    9080         
    9181        //skip line 2 
     
    206196        Wave angle = $(USANSFolder+":"+type+":Angle") 
    207197        Variable num=numpnts(angle) 
    208         Variable deg2QConv=5.55e-5              //JGB -- 2/24/01 
     198//      Variable deg2QConv=5.55e-5              //JGB -- 2/24/01 
     199        NVAR deg2QConv=root:Packages:NIST:USANS:Globals:MainPanel:deg2QConv 
     200 
    209201         
    210202        Make/O/N=(num) $(USANSFolder+":"+type+":Qvals") 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/USANS/Main_USANS.ipf

    r765 r807  
    6464                USANS_Panel() 
    6565        Endif 
     66         
     67        DoIgorMenu "Control" "Retrieve All Windows" 
     68 
    6669End 
    6770 
     
    137140        root:Packages:NIST:USANS:BKG:bkgLevel := root:Packages:NIST:USANS:Globals:MainPanel:gBkgCts 
    138141 
    139          
    140         //INSTRUMENTAL CONSTANTS  
    141         Variable/G      root:Packages:NIST:USANS:Globals:MainPanel:gTheta_H = 3.9e-6            //Darwin FWHM   (pre- NOV 2004) 
    142         Variable/G      root:Packages:NIST:USANS:Globals:MainPanel:gTheta_V = 0.014             //Vertical divergence   (pre- NOV 2004) 
    143         //Variable/G  root:Globals:MainPanel:gDomega = 2.7e-7           //Solid angle of detector (pre- NOV 2004) 
    144         Variable/G      root:Packages:NIST:USANS:Globals:MainPanel:gDomega = 7.1e-7             //Solid angle of detector (NOV 2004) 
    145         Variable/G      root:Packages:NIST:USANS:Globals:MainPanel:gDefaultMCR= 1e6             //factor for normalization 
    146          
    147         //Variable/G  root:Globals:MainPanel:gDQv = 0.037               //divergence, in terms of Q (1/A) (pre- NOV 2004) 
    148         Variable/G      root:Packages:NIST:USANS:Globals:MainPanel:gDQv = 0.117         //divergence, in terms of Q (1/A)  (NOV 2004) 
    149         //November 2010 - deadtime corrections 
    150         //Only used in BT5_Loader.ipf and dependent on date, so defined there on each file load. 
    151  
    152         String/G root:Packages:NIST:gXMLLoader_Title="" 
     142// initializes facility specific constants to define the instrument      
     143        Init_USANS_Facility()    
    153144 
    154145        //initializes preferences. this includes XML y/n, and SANS Reduction items.  
     
    859850// reads directly from disk 
    860851// 
    861 // EXCLUDES all files that do not match "*.bt5*" (not case sensitive) 
     852// EXCLUDES all files that do not match "*.bt5*" (not case sensitive) (*.ext*) 
    862853// 
    863854// sorts the list to alphabetical order 
     
    869860         
    870861        SVAR USANSFolder = root:Packages:NIST:USANS:Globals:gUSANSFolder 
     862        SVAR ext = root:Packages:NIST:USANS:Globals:MainPanel:gUExt 
    871863 
    872864        String folderStr="" 
     
    893885        //Get the filter and determine the match string required AJJ Sept06 
    894886        if (stringmatch(FilterStr,"!")) 
    895                 filter = FilterStr+"*.bt5*" 
     887                filter = FilterStr+"*"+ext+"*" 
    896888        else 
    897                 filter = "*.bt5*" 
     889                filter = "*"+ext+"*" 
    898890        endif 
    899891         
     
    11721164         
    11731165        SVAR USANSFolder = root:Packages:NIST:USANS:Globals:gUSANSFolder         
    1174          
     1166        SVAR ext = root:Packages:NIST:USANS:Globals:MainPanel:gUExt 
     1167 
    11751168        //Prod the web update page 
    11761169        //This is a horrible kludge that doesn't really work as the  
     
    12041197        for(ii=0;ii<num;ii+=1) 
    12051198                item = StringFromList(ii, list  ,";") 
    1206                 if( stringmatch(item,"*.bt5*") )                //ONLY keep files with ".bt5" in the name (NOT case-sensitive)  
     1199                if( stringmatch(item,"*"+ext+"*") )             //ONLY keep files with ".bt5" in the name (NOT case-sensitive)  
    12071200                        newlist += item + ";" 
    12081201                endif 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/USANS/USANS_Includes_v230.ipf

    r740 r807  
    22#pragma version=2.20 
    33#pragma IgorVersion=6.1 
     4 
     5 
     6// to properly set up the template for other facility reduction templates,  
     7// function NCNR_USANS() must exist here in the Includes file. 
     8// 
     9Function NCNR_USANS() 
     10        //does nothing but define NCNR_USANS() 
     11        return(0) 
     12End 
     13 
    414 
    515//************* 
     
    919// 
    1020 
     21 
    1122#include "BT5_Loader",version >= 2.20    
    1223#include "COR_Graph",version >= 2.20                     
    1324#include "Main_USANS",version >= 2.20    
    1425#include "PlotUtilsMacro_v40",version >= 2.20 
    15 #include "NIST_XML_v40" 
     26#include "NIST_XML_v40"                                 //cansas file writer 
    1627#include "USANS_SlitSmearing_v40"        
    1728#include "WriteUSANSData",version >= 2.20        
     
    2132#include "GaussUtils_v40"                               //added Oct 2008 for unified file loading 
    2233#include "BT5_AddFiles"                                 //Oct 2009 to add raw data files 
     34#include "NCNR_Utils"                                   //needed for NIST_XML 
     35#include "U_NCNR_Utils"                                 //USANS-specific initialization 
     36 
    2337 
    2438// USANS simulation and required procedures 
     
    2943#include "NCNR_DataReadWrite" 
    3044#include "SANS_Utilities" 
    31 #include "NCNR_Utils" 
    3245#include "MultipleReduce" 
    3346#include "WriteQIS" 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/USANS/U_CALC.ipf

    r704 r807  
    17461746        NVAR ang2 = $(pathStr+"gAngHigh"+num2str(set)) 
    17471747        NVAR incr = $(pathStr+"gIncr"+num2str(set)) 
     1748        SVAR ext = root:Packages:NIST:USANS:Globals:MainPanel:gUExt 
     1749 
    17481750         
    17491751        Variable refNum,ii,wavePts,numPts,first,last,ctTime,monCt,transDet 
     
    17681770         
    17691771        // set up some of the strings needed 
    1770         fileStr=nameStr+num2str(num+set)+".bt5" 
     1772        fileStr=nameStr+num2str(num+set)+ext 
    17711773        dateStr = date() 
    17721774        ctTime = countingTime[first] 
Note: See TracChangeset for help on using the changeset viewer.