Ignore:
Timestamp:
Oct 16, 2009 2:24:50 PM (13 years ago)
Author:
srkline
Message:

Merging changes of NCNR_ in to the ILL_ files. This is mostly the :Packages:NIST: data folder structure that is new since Lionel made his changes.

Removed Lionel's InitializeILL file, and moved his specific changes (just some global variables) to the initialization routine in ILL_Utils, where it belongs.

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

Legend:

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

    r572 r573  
    7373        String fname 
    7474        //this function is for reading in RAW data only, so it will always put data in RAW folder 
    75         String curPath = "root:RAW" 
     75        String curPath = "root:Packages:NIST:RAW:" 
    7676        SetDataFolder curPath           //use the full path, so it will always work 
    77         Variable/G root:RAW:gIsLogScale = 0             //initial state is linear, keep this in RAW folder 
     77        Variable/G root:Packages:NIST:RAW:gIsLogScale = 0               //initial state is linear, keep this in RAW folder 
    7878         
    7979        Variable refNum,integer,realval 
    8080        String sansfname,textstr 
    8181         
    82         Make/D/O/N=23 $"root:RAW:IntegersRead" 
    83         Make/D/O/N=52 $"root:RAW:RealsRead" 
    84         Make/O/T/N=11 $"root:RAW:TextRead" 
    85          
    86         Wave intw=$"root:RAW:IntegersRead" 
    87         Wave realw=$"root:RAW:RealsRead" 
    88         Wave/T textw=$"root:RAW:TextRead" 
     82        Make/O/D/N=23 $"root:Packages:NIST:RAW:IntegersRead" 
     83        Make/O/D/N=52 $"root:Packages:NIST:RAW:RealsRead" 
     84        Make/O/T/N=11 $"root:Packages:NIST:RAW:TextRead" 
     85        Make/O/N=7 $"root:Packages:NIST:RAW:LogicalsRead" 
     86         
     87        Wave intw=$"root:Packages:NIST:RAW:IntegersRead" 
     88        Wave realw=$"root:Packages:NIST:RAW:RealsRead" 
     89        Wave/T textw=$"root:Packages:NIST:RAW:TextRead" 
     90        Wave logw=$"root:Packages:NIST:RAW:LogicalsRead" 
    8991         
    9092        // FILL IN 3 ARRAYS WITH HEADER INFORMATION FOR LATER USE 
     
    196198//main entry procedure for reading a "WORK.DIV" file 
    197199//displays a quick image of the  file, to check that it's correct 
    198 //data is deposited in root:DIV data folder 
    199 // 
    200 // local, just for testing 
     200//data is deposited in root:Packages:NIST:DIV data folder 
     201// 
     202// local, currently unused 
     203// 
    201204// 
    202205Proc ReadWork_DIV() 
     
    205208        ReadHeaderAndWork("DIV",fname)          //puts what is read in work.div 
    206209         
    207         String waveStr = "root:DIV:data" 
    208         NewImage/F/K=1/S=2 $waveStr 
    209         ModifyImage '' ctab= {*,*,YellowHot,0} 
    210          
    211         String/G root:DIV:fileList = "WORK.DIV" 
     210        String waveStr = "root:Packages:NIST:DIV:data" 
     211//      NewImage/F/K=1/S=2 $waveStr             //this is an experimental IGOR operation 
     212//      ModifyImage '' ctab= {*,*,YellowHot,0} 
     213        //Display;AppendImage $waveStr 
     214         
     215        //change the title string to WORK.DIV, rather than PLEXnnn_TST_asdfa garbage 
     216//      String/G root:Packages:NIST:DIV:fileList = "WORK.DIV" 
     217        ChangeDisplay("DIV") 
    212218         
    213219        SetDataFolder root:             //(redundant) 
     
    237243 
    238244        String cur_folder = type 
    239         String curPath = "root:"+cur_folder 
     245        String curPath = "root:Packages:NIST:"+cur_folder 
    240246        SetDataFolder curPath           //use the full path, so it will always work 
    241247         
     
    304310        String fname, destPath 
    305311        //this function is for reading in ASCII data so put data in user-specified folder 
    306         SetDataFolder "root:"+destPath 
     312        SetDataFolder "root:Packages:NIST:"+destPath 
    307313 
    308314        NVAR pixelsX = root:myGlobals:gNPixelsX 
     
    369375Function FillFakeHeader_ASC(destFolder) 
    370376        String destFolder 
    371         Make/O/N=23 $("root:"+destFolder+":IntegersRead") 
    372         Make/O/N=52 $("root:"+destFolder+":RealsRead") 
    373         Make/O/T/N=11 $("root:"+destFolder+":TextRead") 
    374          
    375         Wave intw=$("root:"+destFolder+":IntegersRead") 
    376         Wave realw=$("root:"+destFolder+":RealsRead") 
    377         Wave/T textw=$("root:"+destFolder+":TextRead") 
     377        Make/O/D/N=23 $("root:Packages:NIST:"+destFolder+":IntegersRead") 
     378        Make/O/D/N=52 $("root:Packages:NIST:"+destFolder+":RealsRead") 
     379        Make/O/T/N=11 $("root:Packages:NIST:"+destFolder+":TextRead") 
     380         
     381        Wave intw=$("root:Packages:NIST:"+destFolder+":IntegersRead") 
     382        Wave realw=$("root:Packages:NIST:"+destFolder+":RealsRead") 
     383        Wave/T textw=$("root:Packages:NIST:"+destFolder+":TextRead") 
    378384         
    379385        //Put in appropriate "fake" values 
    380386        //parse values as needed from headerLines 
    381         Wave/T hdr=$("root:"+destFolder+":hdrLines") 
     387        Wave/T hdr=$("root:Packages:NIST:"+destFolder+":hdrLines") 
    382388        Variable monCt,lam,offset,sdd,trans,thick 
    383389        Variable xCtr,yCtr,a1,a2,a1a2Dist,dlam,bsDiam 
     
    430436//      Print tempStr 
    431437//      Print junkStr 
    432         String/G $("root:"+destFolder+":fileList") = tempStr 
     438        String/G $("root:Packages:NIST:"+destFolder+":fileList") = tempStr 
    433439        textw[0] = tempStr              //filename 
    434440        textw[1] = junkStr              //run date-time 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/FACILITY_Utils.ipf

    r572 r573  
    9292        v_lambda = lambdaWidth^2/6.0 
    9393         
    94         if(usingLenses==1)                      //SRK 2007 
     94//      if(usingLenses==1)                      //SRK 2007 
     95        if(usingLenses != 0)                    //SRK 2008 allows for the possibility of different numbers of lenses in header 
    9596                v_b = 0.25*(S1*L2/L1)^2 +0.25*(2/3)*(lambdaWidth/lambda)^2*(S2*L2/lp)^2         //correction to 2nd term 
    9697        else 
     
    138139//Global values are set in the Initialize procedure 
    139140// 
     141// 
    140142// - called by CircSectAvg.ipf, RectAnnulAvg.ipf, and ProtocolAsPanel.ipf 
    141143// 
    142 // fileStr is passed as TextRead[3] and is the filename 
    143 // detStr is passed as TextRead[9] and is an identifier for the detector 
     144// fileStr is passed as TextRead[3] 
     145// detStr is passed as TextRead[9] 
     146// 
     147// *** as of Jan 2008, depricated. Now detector pixel sizes are read from the file header 
     148// rw[10] = x size (mm); rw[13] = y size (mm) 
    144149// 
    145150// depricated - pixel dimensions are read directly from the file header 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/ILL_DataReadWrite.ipf

    r572 r573  
    7373        String fname 
    7474        //this function is for reading in RAW data only, so it will always put data in RAW folder 
    75         String curPath = "root:RAW" 
     75        String curPath = "root:Packages:NIST:RAW:" 
    7676        SetDataFolder curPath           //use the full path, so it will always work 
    77         Variable/G root:RAW:gIsLogScale = 0             //initial state is linear, keep this in RAW folder 
     77        Variable/G root:Packages:NIST:RAW:gIsLogScale = 0               //initial state is linear, keep this in RAW folder 
    7878         
    7979        Variable refNum,integer,realval,ii 
    8080        String sansfname,textstr,v0 
    8181         
    82         Make/D/O/N=23 $"root:RAW:IntegersRead" 
    83         Make/D/O/N=52 $"root:RAW:RealsRead" 
    84         Make/O/T/N=11 $"root:RAW:TextRead" 
    85          
    86         Wave intw=$"root:RAW:IntegersRead" 
    87         Wave realw=$"root:RAW:RealsRead" 
    88         Wave/T textw=$"root:RAW:TextRead" 
     82        Make/O/D/N=23 $"root:Packages:NIST:RAW:IntegersRead" 
     83        Make/O/D/N=52 $"root:Packages:NIST:RAW:RealsRead" 
     84        Make/O/T/N=11 $"root:Packages:NIST:RAW:TextRead" 
     85        Make/O/N=7 $"root:Packages:NIST:RAW:LogicalsRead" 
     86         
     87        Wave intw=$"root:Packages:NIST:RAW:IntegersRead" 
     88        Wave realw=$"root:Packages:NIST:RAW:RealsRead" 
     89        Wave/T textw=$"root:Packages:NIST:RAW:TextRead" 
     90        Wave logw=$"root:Packages:NIST:RAW:LogicalsRead" 
    8991         
    9092        // FILL IN 3 ARRAYS WITH HEADER INFORMATION FOR LATER USE 
     
    204206        SetDataFolder curPath 
    205207         
    206         Make/D/O/N=(XPix,YPix) $"root:RAW:data" 
    207         WAVE data=$"root:RAW:data" 
     208        Make/D/O/N=(XPix,YPix) $"root:Packages:NIST:RAW:data" 
     209        WAVE data=$"root:Packages:NIST:RAW:data" 
    208210 
    209211        // fill the data array with the detector values 
     
    214216         
    215217        //keep a string with the filename in the RAW folder 
    216         String/G root:RAW:fileList = textw[0] 
     218        String/G root:Packages:NIST:RAW:fileList = textw[0] 
    217219         
    218220        Setdatafolder root: 
     
    235237        ReadHeaderAndWork("DIV",fname)          //puts what is read in work.div 
    236238         
    237         String waveStr = "root:DIV:data" 
     239        String waveStr = "root:Packages:NIST:DIV:data" 
    238240        NewImage/F/K=1/S=2 $waveStr 
    239241        ModifyImage '' ctab= {*,*,YellowHot,0} 
    240242         
    241         String/G root:DIV:fileList = "WORK.DIV" 
     243        String/G root:Packages:NIST:DIV:fileList = "WORK.DIV" 
    242244         
    243245        SetDataFolder root:             //(redundant) 
     
    267269 
    268270        String cur_folder = type 
    269         String curPath = "root:"+cur_folder 
     271        String curPath = "root:Packages:NIST:"+cur_folder 
    270272        SetDataFolder curPath           //use the full path, so it will always work 
    271273         
     
    299301        // fill in your reader for the header here so that intw, realw, and textW are filled in 
    300302        // ? possibly a duplication of the raw data reader 
    301         Duplicate/O $("root:raw:realsread"),$("curPath"+ ":realsread") 
    302         Duplicate/O $("root:raw:integersread"),$("curPath"+ ":integersread") 
    303         Duplicate/T $("root:raw:Textread"),$("curPath"+ ":Textread") 
     303        Duplicate/O $("root:Packages:NIST:raw:realsread"),$(curPath+ ":realsread") 
     304        Duplicate/O $("root:Packages:NIST:raw:integersread"),$(curPath+ ":integersread") 
     305        Duplicate/T $("root:Packages:NIST:raw:Textread"),$(curPath+ ":Textread") 
    304306         
    305307 
     
    309311        // fill the data array with the detector values 
    310312 
    311         duplicate/O $("root:raw:data"),$("curPath"+ ":data") 
     313        duplicate/O $("root:Packages:NIST:raw:data"),$(curPath+ ":data") 
    312314         
    313315         
     
    332334//      SVAR cur_folder=root:myGlobals:gDataDisplayType 
    333335        String cur_folder = type 
    334         String curPath = "root:"+cur_folder 
     336        String curPath = "root:Packages:NIST:"+cur_folder 
    335337        SetDataFolder curPath           //use the full path, so it will always work 
    336338         
     
    586588         GBLoadStr="GBLoadWave/O/N=tempGBwave/T={2,2}/J=2/W=1/Q" 
    587589 
    588         curPath = "root:"+cur_folder 
     590        curPath = "root:Packages:NIST:"+cur_folder 
    589591        SetDataFolder curPath           //use the full path, so it will always work 
    590592         
     
    694696        String fname, destPath 
    695697        //this function is for reading in ASCII data so put data in user-specified folder 
    696         SetDataFolder "root:"+destPath 
     698        SetDataFolder "root:Packages:NIST:"+destPath 
    697699 
    698700        NVAR pixelsX = root:myGlobals:gNPixelsX 
     
    763765Function FillFakeHeader_ASC(destFolder) 
    764766        String destFolder 
    765         Make/O/N=23 $("root:"+destFolder+":IntegersRead") 
    766         Make/O/N=52 $("root:"+destFolder+":RealsRead") 
    767         Make/O/T/N=11 $("root:"+destFolder+":TextRead") 
    768          
    769         Wave intw=$("root:"+destFolder+":IntegersRead") 
    770         Wave realw=$("root:"+destFolder+":RealsRead") 
    771         Wave/T textw=$("root:"+destFolder+":TextRead") 
     767        Make/O/D/N=23 $("root:Packages:NIST:"+destFolder+":IntegersRead") 
     768        Make/O/D/N=52 $("root:Packages:NIST:"+destFolder+":RealsRead") 
     769        Make/O/T/N=11 $("root:Packages:NIST:"+destFolder+":TextRead") 
     770         
     771        Wave intw=$("root:Packages:NIST:"+destFolder+":IntegersRead") 
     772        Wave realw=$("root:Packages:NIST:"+destFolder+":RealsRead") 
     773        Wave/T textw=$("root:Packages:NIST:"+destFolder+":TextRead") 
    772774         
    773775        //Put in appropriate "fake" values 
    774776        //parse values as needed from headerLines 
    775         Wave/T hdr=$("root:"+destFolder+":hdrLines") 
     777        Wave/T hdr=$("root:Packages:NIST:"+destFolder+":hdrLines") 
    776778        Variable monCt,lam,offset,sdd,trans,thick 
    777779        Variable xCtr,yCtr,a1,a2,a1a2Dist,dlam,bsDiam 
     
    824826//      Print tempStr 
    825827//      Print junkStr 
    826         String/G $("root:"+destFolder+":fileList") = tempStr 
     828        String/G $("root:Packages:NIST:"+destFolder+":fileList") = tempStr 
    827829        textw[0] = tempStr              //filename 
    828830        textw[1] = junkStr              //run date-time 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/ILL_Utils.ipf

    r572 r573  
    3232 
    3333        Variable/G root:myGlobals:apOff = 5.0           // (cm) distance from sample aperture to sample position 
     34 
     35        // changing behavior specific to ILL correction of data 
     36        Variable/G root:myGlobals:gDoDetectorEffCorr = 0                                //default state is ==1 
     37        Variable/G root:myGlobals:gDoDetectorEffCorrILL = 1                     //new global switch 
     38 
    3439 
    3540End 
     
    9499        v_lambda = lambdaWidth^2/6.0 
    95100         
    96         if(usingLenses==1)                      //SRK 2007 
     101//      if(usingLenses==1)                      //SRK 2007 
     102        if(usingLenses != 0)                    //SRK 2008 allows for the possibility of different numbers of lenses in header 
    97103                v_b = 0.25*(S1*L2/L1)^2 +0.25*(2/3)*(lambdaWidth/lambda)^2*(S2*L2/lp)^2         //correction to 2nd term 
    98104        else 
     
    142148// - called by CircSectAvg.ipf, RectAnnulAvg.ipf, and ProtocolAsPanel.ipf 
    143149// 
    144 // fileStr is passed as TextRead[3] and is the filename 
    145 // detStr is passed as TextRead[9] and is an identifier for the detector 
     150// fileStr is passed as TextRead[3] 
     151// detStr is passed as TextRead[9] 
     152// 
     153// *** as of Jan 2008, depricated. Now detector pixel sizes are read from the file header 
     154// rw[10] = x size (mm); rw[13] = y size (mm) 
    146155// 
    147156// depricated - pixel dimensions are read directly from the file header 
     
    963972        return("Function Empty") 
    964973End 
    965  
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/Includes_v520_ILL.ipf

    r572 r573  
    1818#include "DisplayUtils"                 version>=5.0 
    1919#include "FIT_Ops"                              version>=5.0 
    20 #include "InitializeILL"                        version>=5.0 
     20#include "Initialize"                   version>=5.0 
    2121#include "MainPanel"                    version>=5.0 
    2222#include "Marquee"                              version>=5.0 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/NCNR_DataReadWrite.ipf

    r572 r573  
    8585        String sansfname,textstr 
    8686         
    87         Make/O/N=23 $"root:Packages:NIST:RAW:IntegersRead" 
    88         Make/O/N=52 $"root:Packages:NIST:RAW:RealsRead" 
     87        Make/O/D/N=23 $"root:Packages:NIST:RAW:IntegersRead" 
     88        Make/O/D/N=52 $"root:Packages:NIST:RAW:RealsRead" 
    8989        Make/O/T/N=11 $"root:Packages:NIST:RAW:TextRead" 
    9090        Make/O/N=7 $"root:Packages:NIST:RAW:LogicalsRead" 
     
    361361        SetDataFolder curPath           //use the full path, so it will always work 
    362362         
    363         Make/O/N=16384 $"root:Packages:NIST:RAW:data" 
     363        Make/O/D/N=16384 $"root:Packages:NIST:RAW:data" 
    364364        WAVE data=$"root:Packages:NIST:RAW:data" 
    365365        SkipAndDecompressVAX(w,data) 
     
    509509        Variable/G $(curPath + ":gIsLogScale") = 0              //initial state is linear, keep this in DIV folder 
    510510         
    511         Make/O/N=23 $(curPath + ":IntegersRead") 
    512         Make/O/N=52 $(curPath + ":RealsRead") 
     511        Make/O/D/N=23 $(curPath + ":IntegersRead") 
     512        Make/O/D/N=52 $(curPath + ":RealsRead") 
    513513        Make/O/T/N=11 $(curPath + ":TextRead") 
    514514         
     
    759759        SetDataFolder curPath           //use the full path, so it will always work 
    760760         
    761         Make/O/N=16384 $(curPath + ":data") 
     761        Make/O/D/N=16384 $(curPath + ":data") 
    762762        WAVE data = $(curPath + ":data") 
    763763         
     
    918918Function FillFakeHeader_ASC(destFolder) 
    919919        String destFolder 
    920         Make/O/N=23 $("root:Packages:NIST:"+destFolder+":IntegersRead") 
    921         Make/O/N=52 $("root:Packages:NIST:"+destFolder+":RealsRead") 
     920        Make/O/D/N=23 $("root:Packages:NIST:"+destFolder+":IntegersRead") 
     921        Make/O/D/N=52 $("root:Packages:NIST:"+destFolder+":RealsRead") 
    922922        Make/O/T/N=11 $("root:Packages:NIST:"+destFolder+":TextRead") 
    923923         
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/PatchFiles.ipf

    r570 r573  
    325325        Variable ok 
    326326        ControlInfo/W=Patch_Panel PatchPopup 
    327         If(strlen(S_value)==0) 
     327        If(strlen(S_value)==0 || cmpstr(S_Value,"none")==0) 
    328328                //null selection 
    329329                Abort "no file selected in popup menu" 
Note: See TracChangeset for help on using the changeset viewer.