Ignore:
Timestamp:
Jul 20, 2011 9:40:32 AM (12 years ago)
Author:
srkline
Message:

Changed 2-yukawa to have better names for the parameters, a macro to plot g(r), and to return S(q)=1000 if the calculation fails, to be more obvious.

Added a Corrlation matrix function (in Wrapper.ipf), but it's not linked anywhere yet, since I don't know yet how best to display it.

Simplified the function to list .ASC files

Added comments to the polarization panel procedures.

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

Legend:

Unmodified
Added
Removed
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/Polarization/Pol_FlipperPanel.ipf

    r817 r824  
    105105                        // the cell must already be defined 
    106106                        String condStr, cellStr 
    107                         Prompt condStr,"Condition, <12 characters" 
     107                        Prompt condStr,"Condition, <12 characters, NO UNDERSCORES" 
    108108                        Prompt cellStr,"Cell",popup,D_CellNameList() 
    109109                        DoPrompt "Add new condition",condStr, cellStr 
     
    116116                                Print "Condition String trimmed to ",condStr 
    117117                        endif 
     118                         
     119                        condStr = ReplaceString("_", condStr, "", 0, inf) 
    118120                         
    119121                        String popStr 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/Polarization/Pol_PolarizationPanels.ipf

    r817 r824  
    11#pragma rtGlobals=1             // Use modern global access method. 
    22 
     3 
     4// Polarized Beam Reduction Procedures 
     5// 
     6// 
    37// input panels to set and calculate polarization parameters necessary for the  
    48// matrix corrections to the cross sections 
    59// 
    6 // -1- Fundamental Cell Parameters -- these are constants, generally not editable. 
    7 // -2- Decay Parameters -- these are fitted values based on transmission mearurements 
    8 // -3- 
    9  
    10  
    11 // 
    12 // -- need a general way to be sure to NOT re-initialize the values if the panel is closed/reopened 
    13 // 
    14 // 
    15 // TODO: 
    16 // Need a way to output the results - like in a report format 
    17 // cell (panel 1) 
    18 // static params 
    19 // fit gamma params 
    20 // graph 
    21 // 
    22 // and also a separate report (panel 2) 
    23 // flipper/sm @ conditions 
    24 // --- the report could be as simple as a screen snapshot of the panel? 
    25  
    26  
    27 // He cell parameters. Most of these are pre-defined, so that they are supplied as a  
     10// -1- Fundamental Cell Parameters -- these are constants, generally not editable. (this file) 
     11// -2- Decay Parameters -- these are fitted values based on transmission mearurements (this file) 
     12// -3- Flipper Panel is in its own procedure (FlipperPanel.ipf) 
     13// -4- PolCor_Panel is in PolarizationCorrection.ipf 
     14 
     15// 
     16// Driven by 4 panels to get the necessary information from the users 
     17// -1- Fundamental cell parameters: root:Packages:NIST:Polarization:Cells 
     18//              - default cell parameters are loaded. More cell definitions can be added as more cells are used 
     19//              - changes are saved per experiment 
     20//              - important parameters are held in global key=value strings gCell_<name>  
     21//              - cell names and parameters are used by the 2nd panel for calculation of the Decay constant 
     22// 
     23// -2- Decay Constant Panel 
     24//              - decay constant determined for each cell. 
     25//              - popping the cell name makes 2 waves, Decay_<cellname> and DecayCalc_<cellname> 
     26//              - Decay_ is the wave presented in the table. Specified transmission run numbers are entered 
     27//                      and "Calc Sel Row" does the calculation of mu and Pcell (for all rows, actually) 
     28//              - DimLabels are used for the arrays to make the column identity more readable than simply an index 
     29//              - time=0 is taken from the first file 
     30//              - Calculations are based on the count rate of the file, corrected for monitor and attenuation 
     31//              - alerts are posted for files in any row that are not at the same attenuation or SDD 
     32//              - if "include" column is == 1, that row will be included in the fit of the decay data 
     33//              - excluded points are plotted in red 
     34//              - results of the fit are printed on the panel, and written to the wave note of the Decay_ wave  
     35//                      (not DecayCalc_) for use in the next panel 
     36//              - manual entry of all of the parameters in the wave note is allowed. 
     37// 
     38// 
     39// -3- Flipper Panel (not in this procedure - in Pol_FlipperPanel.ipf) 
     40//              - calculates the flipper and supermirror efficiencies for a given cell AND "condition" 
     41//              - start by entering a condition name and choosing a cell 
     42//              - Waves Cond_<condition>_<cell> and CondCalc_<condition>_<cell> are created 
     43//              - DimLabels are used for the arrays to make the column identity more readable than simply an index 
     44//              - enter transmission run numbers as specified in the table 
     45//              - Do Average will calculate the Psm and PsmPfl values (and errors) and average if more than 
     46//                      one row of data is present (and included) 
     47//              - results are printed on the panel, and written to the wave note of Cond_<condition>_<cell> 
     48//              - results are used in the calculation of the polarization matrix 
     49// 
     50// 
     51// -4- PolCor_Panel (not in this procedure - in Pol_PolarizationCorrection.ipf) 
     52//              - gets all of the parameters from the user to do the polariztion correction, then the "normal" SANS reduction 
     53//              - 5 files can be added together for each of the different spin states (more than this??) 
     54//              - global strings in root:Packages:NIST:Polarization:gStr_PolCor_<tab>_<flip>_<position> hold the run number 
     55//              - polarization condition is set with the popup 
     56//              - the same fields/pops are duplicated (hidden) for the SAM/EMP/BGD tabs as needed 
     57//              - on loading of the data, the 2-letter spin state is tagged onto the loaded waves (all of them) 
     58//              - displayed data is simply re-pointed to the desired data 
     59//              - on loading, the raw files are added together as ususal, normalized to monitor counts. Then each contribution  
     60//                      of the file to the polarization matrix is added (scaling each by mon/1e8) 
     61//              - loaded data and PolMatrix are stored in the ususal SAM, EMP, BGD folders. 
     62//              - Polarization correction is done with one click (one per tab). "_pc" tags are added to the resulting names, 
     63//                      and copies of all of the associated waves are again copied (wasteful), but makes switching display very easy 
     64//              - Once all of the polariztion correction is done, then the UU_pc (etc.) data can be reduced as usual (4 passes) 
     65//              - protocol is built as ususal, from this panel only (since the SAM, EMP, and BGD need to be switched, rather than loaded 
     66//              - protocols can be saved/recalled. 
     67//              - reduction will always ask for a protocol rather than using what's on the panel. 
     68//              - closing the panel will save the state (except the protocol). NOT initializing when re-opening will restore the  
     69//                      state of the entered runs and the popups of conditions. 
     70// 
     71// 
     72// 
     73// 
     74 
     75 
     76 
     77 
     78// 
     79// Panel -1- 
     80// 
     81// Fundamental He cell parameters. Most of these are pre-defined, so that they are supplied as a  
    2882// static table, only edited as parameters are refined. 
    2983// 
     
    89143 
    90144// parse strings to fill in waves 
    91  
     145// 
    92146// 
    93147Function Make_HeCell_ParamWaves() 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/WorkFileUtils.ipf

    r794 r824  
    15001500//can be lots of other junk present, but this is very fast... 
    15011501// 
     1502// -- simplified to do in a single call -- extension must be .ASC 
     1503// - so far, only used in WorkFileMath popups, which require .ASC 
     1504// 
    15021505Function/S ASC_FileList() 
    15031506 
     
    15111514                Return("") 
    15121515        Endif 
    1513          
    1514         list = IndexedFile(catpathName,-1,"????") 
    1515          
    1516         list = RemoveFromList(ListMatch(list,"*.SA1*",";"), list, ";", 0) 
    1517         list = RemoveFromList(ListMatch(list,"*.SA2*",";"), list, ";", 0) 
    1518         list = RemoveFromList(ListMatch(list,"*.SA3*",";"), list, ";", 0) 
    1519         list = RemoveFromList(ListMatch(list,".*",";"), list, ";", 0) 
    1520         list = RemoveFromList(ListMatch(list,"*.pxp",";"), list, ";", 0) 
    1521         list = RemoveFromList(ListMatch(list,"*.DIV",";"), list, ";", 0) 
    1522         list = RemoveFromList(ListMatch(list,"*.GSP",";"), list, ";", 0) 
    1523         list = RemoveFromList(ListMatch(list,"*.MASK",";"), list, ";", 0) 
    1524  
    1525         //remove VAX version numbers 
    1526         list = RemoveVersNumsFromList(List) 
     1516 
     1517        list = IndexedFile(catpathName,-1,".ASC") 
     1518 
     1519 
     1520//      list = IndexedFile(catpathName,-1,"????") 
     1521//       
     1522//      list = RemoveFromList(ListMatch(list,"*.SA1*",";"), list, ";", 0) 
     1523//      list = RemoveFromList(ListMatch(list,"*.SA2*",";"), list, ";", 0) 
     1524//      list = RemoveFromList(ListMatch(list,"*.SA3*",";"), list, ";", 0) 
     1525//      list = RemoveFromList(ListMatch(list,".*",";"), list, ";", 0) 
     1526//      list = RemoveFromList(ListMatch(list,"*.pxp",";"), list, ";", 0) 
     1527//      list = RemoveFromList(ListMatch(list,"*.DIV",";"), list, ";", 0) 
     1528//      list = RemoveFromList(ListMatch(list,"*.GSP",";"), list, ";", 0) 
     1529//      list = RemoveFromList(ListMatch(list,"*.MASK",";"), list, ";", 0) 
     1530// 
     1531//      //remove VAX version numbers 
     1532//      list = RemoveVersNumsFromList(List) 
    15271533        //sort 
    15281534        newList = SortList(List,";",0) 
Note: See TracChangeset for help on using the changeset viewer.