Ignore:
Timestamp:
Sep 23, 2009 12:56:57 PM (13 years ago)
Author:
srkline
Message:

Added UCALC window to list of windows is package loader

Box Sum (from the marquee) asks for normalized (SAM) or RAW data

SASCALC uses real beamstop size rather than projected sizewhen doing simulation

Fake1DDataFolder() in MultiScatter_MonteCarlo ipf bug fixed where a bogus beamstop diameter (not 1"-4") would cause oddities in the resolution wave, and an (obviously) incorrect smearing of the simulation.

Fixed range 7 defaults in UCALC panel.

Location:
sans/Dev/trunk/NCNR_User_Procedures
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • sans/Dev/trunk/NCNR_User_Procedures/Common/NCNR_Package_Loader.ipf

    r542 r558  
    197197        SVAR gMenuStr3b = root:Packages:NCNRItemStr3b 
    198198         
    199         String USANS_WinList = "USANS_Panel;COR_Graph;RawDataWin;Desmear_Graph;USANS_Slope;" 
     199        String USANS_WinList = "USANS_Panel;COR_Graph;RawDataWin;Desmear_Graph;USANS_Slope;UCALC;" 
    200200         
    201201        strswitch(itemStr)      // string switch 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/Marquee.ipf

    r482 r558  
    302302// output is dumped to the command window 
    303303// 
    304 Function DoBoxSum(fileStr,x1,x2,y1,y2) 
     304Function DoBoxSum(fileStr,x1,x2,y1,y2,type) 
    305305        String fileStr 
    306306        Variable x1,x2,y1,y2 
     307        String type 
    307308         
    308309        //parse the list of file numbers 
     
    332333//              String/G root:myGlobals:gDataDisplayType="RAW" 
    333334//              fRawWindowHook() 
    334                 err = Raw_to_work("SAM") 
    335                 String/G root:myGlobals:gDataDisplayType="SAM"   
     335                if(cmpstr(type,"SAM")==0) 
     336                        err = Raw_to_work("SAM") 
     337                endif 
     338                String/G root:myGlobals:gDataDisplayType=type 
    336339                fRawWindowHook() 
    337                 cts=SumCountsInBox(x1,x2,y1,y2,"SAM") 
     340                cts=SumCountsInBox(x1,x2,y1,y2,type) 
    338341                BoxCounts[ii]=cts 
    339342                Print item+" counts = ",cts 
     
    384387         
    385388        String fileStr="",msgStr="Enter a comma-delimited list of run numbers, use dashes for ranges" 
     389        String type="RAW" 
    386390        Prompt fileStr,msgStr 
    387         DoPrompt "Pick the file range",fileStr 
     391        Prompt type,"RAW or Normalized (SAM)",popup,"RAW;SAM;" 
     392        DoPrompt "Pick the file range",fileStr,type 
    388393        Print "fileStr = ",fileStr 
    389394        printf "(x1,x2) (y1,y2) = (%d,%d) (%d,%d)\r",x1,x2,y1,y2 
    390395         
    391         DoBoxSum(fileStr,x1,x2,y1,y2) 
     396        DoBoxSum(fileStr,x1,x2,y1,y2,type) 
    392397         
    393398        return(0) 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/MultScatter_MonteCarlo_2D.ipf

    r551 r558  
    982982// data, to appear as if it was loaded from a real data file. 
    983983// 
    984 // currently only works with SANS data, but can later be expanded to generate fake USANS data sets 
    985 // ---- use FakeUSANSDataFolder() instead---- 
     984// ---- use FakeUSANSDataFolder() if you want to fake a 1D USANS data set ---- 
    986985// 
    987986Function        Fake1DDataFolder(qval,aveint,sigave,sigmaQ,qbar,fSubs,dataFolder) 
     
    1000999        Duplicate/O aveint, $(baseStr+"_i") 
    10011000        Duplicate/O sigave, $(baseStr+"_s") 
    1002 //      Duplicate/O sigmaQ, $(baseStr+"sq") 
    1003 //      Duplicate/O qbar, $(baseStr+"qb") 
    1004 //      Duplicate/O fSubS, $(baseStr+"fs") 
    1005  
    1006         // need to switch based on SANS/USANS 
    1007         if (isSANSResolution(sigave[0]))                //checks to see if the first point of the wave is <0] 
    1008                 // make a resolution matrix for SANS data 
    1009                 Variable np=numpnts(qval) 
    1010                 Make/D/O/N=(np,4) $(baseStr+"_res") 
    1011                 Wave res=$(baseStr+"_res") 
    1012                  
    1013                 res[][0] = sigmaQ[p]            //sigQ 
    1014                 res[][1] = qBar[p]              //qBar 
    1015                 res[][2] = fSubS[p]             //fShad 
    1016                 res[][3] = qval[p]              //Qvalues 
    1017                  
    1018                 // keep a copy of everything in SAS too... the smearing wrapper function looks for  
    1019                 // data in folders based on waves it is passed - an I lose control of that 
    1020                 Duplicate/O res, $("root:Packages:NIST:SAS:"+baseStr+"_res") 
    1021                 Duplicate/O qval,  $("root:Packages:NIST:SAS:"+baseStr+"_q") 
    1022                 Duplicate/O aveint,  $("root:Packages:NIST:SAS:"+baseStr+"_i") 
    1023                 Duplicate/O sigave,  $("root:Packages:NIST:SAS:"+baseStr+"_s") 
    1024         else 
    1025                 //the data is USANS data 
    1026                 // nothing done here yet 
    1027 //              dQv = -$w3[0] 
    1028                  
    1029 //              USANS_CalcWeights(baseStr,dQv) 
    1030                  
    1031         endif 
    1032  
     1001 
     1002 
     1003        // make a resolution matrix for SANS data 
     1004        Variable np=numpnts(qval) 
     1005        Make/D/O/N=(np,4) $(baseStr+"_res") 
     1006        Wave res=$(baseStr+"_res") 
     1007         
     1008        res[][0] = sigmaQ[p]            //sigQ 
     1009        res[][1] = qBar[p]              //qBar 
     1010        res[][2] = fSubS[p]             //fShad 
     1011        res[][3] = qval[p]              //Qvalues 
     1012         
     1013        // keep a copy of everything in SAS too... the smearing wrapper function looks for  
     1014        // data in folders based on waves it is passed - an I lose control of that 
     1015        Duplicate/O res, $("root:Packages:NIST:SAS:"+baseStr+"_res") 
     1016        Duplicate/O qval,  $("root:Packages:NIST:SAS:"+baseStr+"_q") 
     1017        Duplicate/O aveint,  $("root:Packages:NIST:SAS:"+baseStr+"_i") 
     1018        Duplicate/O sigave,  $("root:Packages:NIST:SAS:"+baseStr+"_s") 
     1019         
    10331020        //clean up               
    10341021        SetDataFolder root: 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/SASCALC.ipf

    r551 r558  
    13691369 
    13701370        Variable L2 = reals[18] 
    1371 //      Variable BS = reals[21]         //this the diameter is stored in mm 
    1372         Variable BS = beamstopDiamProjection(1) * 10            //calculated projection in cm *10 = mm 
     1371        Variable BS = reals[21]         //this the diameter is stored in mm 
     1372//  SRK - why was I using the projected diameter of the beam stop?? I added a step at the beginning of every recalculation 
     1373// of the intensity to get the right beamstop diameter into RealsRead... 
     1374//      Variable BS = beamstopDiamProjection(1) * 10            //calculated projection in cm *10 = mm 
    13731375        Variable S1 = reals[23] 
    13741376        Variable S2 = reals[24] 
     
    15741576        QBar = (4.0*Pi/lambda)*sin(0.5*atan(rm/L2)) 
    15751577        SigmaQ = QBar*sqrt(v_r/rmd^2 +v_lambda) 
    1576  
     1578         
    15771579        results = "success" 
    15781580        Return results 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/USANS/U_CALC.ipf

    r551 r558  
    1515// 
    1616// - more presets 
     17// 
     18// - NEED -  
     19// - printable output that makes sense to an instrument scientist at least 
     20//   for instrument setup 
     21// 
     22// - make sure that the # points <-> increment relation meshes with ICP 
    1723 
    1824// 
     
    108114        Variable/G gNumPts7 = 10 
    109115        Variable/G gCtTime7 = 0 
    110         Variable/G gIncr7 = 5    
     116        Variable/G gIncr7 = 3000         
    111117         
    112118        // results, setup values 
Note: See TracChangeset for help on using the changeset viewer.