Changeset 1088


Ignore:
Timestamp:
Feb 26, 2018 3:31:01 PM (4 years ago)
Author:
srkline
Message:

corrected bad logic in reduction when reducing to 2D. Nothing was wrong, just a meaningless error dialog was presented.

updated the beamstop sizes in SASCALC for the NGB-10m SANS instrument. Now the 4 beamstops are 1", 1.5", 2" and 3".

Location:
sans/Dev/trunk/NCNR_User_Procedures/Reduction
Files:
2 edited

Legend:

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

    r940 r1088  
    23262326// all of this is bypassed if the lenses are in 
    23272327// 
     2328// returns beam diameter in [cm] 
     2329// 
    23282330Function beamDiameter(direction) 
    23292331        String direction 
     
    23712373 
    23722374//on NG3 and NG7, allowable sizes are 1,2,3,4" diameter 
     2375// 
     2376// at the NGB-10m instrument, allowable sizes are 1, 1.5, 2, 3 (inches) ( SRK 2018) 
     2377// 
    23732378//will return values larger than 4.0*2.54 if a larger beam is needed 
    23742379// 
     
    23782383        NVAR yesLens = root:Packages:NIST:SAS:gUsingLenses 
    23792384        Variable bm=0 
    2380         Variable bs=0.0 
     2385        Variable bs=0.0,pass=0 
     2386  
     2387        SVAR selInstr = root:Packages:NIST:SAS:gInstStr         // "NG3","NG7","NGB" 
    23812388    
    23822389        if(yesLens) 
     
    23862393                bm = beamDiameter("maximum") 
    23872394                do 
    2388                 bs += 1 
     2395                        if(cmpstr(selInstr,"NGB") == 0) 
     2396                                pass +=1 
     2397                                if(pass == 1) 
     2398                                        bs = 1 
     2399                                endif 
     2400                                if(pass == 2) 
     2401                                        bs = 1.5 
     2402                                endif 
     2403                                if(pass == 3) 
     2404                                        bs = 2 
     2405                                endif 
     2406                                if(pass == 4) 
     2407                                        bs = 3 
     2408                                endif 
     2409                                if(pass > 4) 
     2410                                        bs += 1 
     2411                                endif 
     2412                                                                 
     2413                        else 
     2414                        bs += 1                 // always add 1" at a time to the beam stop (NG3B-30m and NG7) 
     2415                endif 
     2416                 
    23892417           while ( (bs*2.54 < bm) || (bs > 30.0))                       //30 = ridiculous limit to avoid inf loop 
    23902418        endif 
     
    23942422        rw[21] = bs*25.4                //store the BS diameter in mm 
    23952423         
    2396     return (bs*2.54)            //return diameter in cm, not inches for txt 
     2424   return (bs*2.54)             //return diameter in cm, not inches for txt 
    23972425End 
    23982426 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Protocol_Reduction.ipf

    r1084 r1088  
     1#pragma TextEncoding = "MacRoman" 
    12#pragma rtGlobals=1             // Use modern global access method. 
    23#pragma version=5.0 
    3 #pragma IgorVersion=6.1 
     4#pragma IgorVersion=7 
    45 
    56//************************ 
     
    23372338// 
    23382339 
     2340// 
     2341// (DONE) 
     2342// -x this generates a "Bin Type Not Found" error if reducing only to a 2D level (like for DIV) 
     2343//              because binTypeStr is null 
    23392344        String binTypeStr = StringByKey("BINTYPE",prot[5],"=",";") 
    23402345        // plotting is not really necessary, and the graph may not be open - so skip for now? 
    23412346        Variable binType 
    2342         binType = V_BinTypeStr2Num(binTypeStr) 
    2343         if(binType == 0) 
    2344                         Abort "Binning mode not found in V_QBinAllPanels() "// when no case matches 
     2347        // only get the binning type if user asks for averaging 
     2348        If(cmpstr(av_type,"none") != 0) 
     2349                binType = V_BinTypeStr2Num(binTypeStr) 
     2350                if(binType == 0) 
     2351                                Abort "Binning mode not found in V_QBinAllPanels() "// when no case matches 
     2352                endif 
    23452353        endif 
    2346  
    23472354 
    23482355// 
     
    24032410// -- BAD logic here, skipping the normal graph if annular is chosen. Go back and see how I do this 
    24042411// in SANS for a better and more foolproof way to do this 
     2412// x- don't draw the graph if "none" is the average type! 
    24052413        // 
    2406         if(cmpstr(av_type,"Annular") != 0) 
     2414        if(cmpstr(av_type,"Annular") != 0 && (cmpstr(av_type,"none") != 0) ) 
    24072415                V_PlotData_Panel()              //this brings the plot window to the front, or draws it (ONLY) 
    24082416                V_Update1D_Graph(activeType,binType)            //update the graph, data was already binned 
Note: See TracChangeset for help on using the changeset viewer.