Ignore:
Timestamp:
Jun 6, 2011 5:01:07 PM (12 years ago)
Author:
srkline
Message:

More additions of input panels for polarization parameters.

FlipperPanel?.ipf contains the routines to calculate polarization of the supermirror and of the flipper.

Location:
sans/Dev/trunk/NCNR_User_Procedures/Reduction/Polarization
Files:
1 added
2 edited

Legend:

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

    r802 r803  
    6161 
    6262 
    63 Macro calc_muP(mu, runT_he, runT_out, runT_bk) 
     63Proc calc_muP(mu, runT_he, runT_out, runT_bk) 
    6464        Variable mu=3.108, runT_he, runT_out, runT_bk 
    6565 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/Polarization/PolarizationPanels.ipf

    r802 r803  
    1515// TODO: 
    1616// Need a way to output the results - like in a report format 
    17 // cell 
     17// cell (panel 1) 
    1818// static params 
    1919// fit gamma params 
    2020// graph 
    2121// 
    22 // and also a separate report 
     22// and also a separate report (panel 2) 
    2323// flipper/sm @ conditions 
    2424// --- the report could be as simple as a screen snapshot of the panel? 
     
    282282// TODO:  
    283283//                      - parsing routines 
    284 //                      - write the restlts to a waveNote 
     284//                      - write the results to a waveNote 
    285285//                      --- where to store the intermediate results of trans values? 
    286286//                              make a wave behind the scenes to 
     
    341341        PauseUpdate; Silent 1           // building window... 
    342342        NewPanel /W=(759,44,1572,713)/N=DecayPanel/K=1 as "Cell Decay Parameters" 
    343         ModifyPanel cbRGB=(51152,65535,60441) 
    344         Button button_3,pos={505,16},size={35,20},proc=DecayHelpParButtonProc,title="?" 
     343        ModifyPanel cbRGB=(32768,54615,65535) 
     344//      Button button_3,pos={505,16},size={35,20},proc=DecayHelpParButtonProc,title="?" 
    345345        PopupMenu popup_0,pos={32,18},size={49,20},title="Cell",proc=DecayPanelPopMenuProc 
    346346        PopupMenu popup_0,mode=1,value= #"D_CellNameList()" 
     
    350350        GroupBox group_0,pos={550,399},size={230,149},title="FIT RESULTS",fSize=10 
    351351        GroupBox group_0,fStyle=1 
    352         SetVariable valdisp_3,pos={560,428},size={200,13},title="muPo of 3He" 
    353         SetVariable valdisp_3,fStyle=1,limits={0,0,0},barmisc={0,1000} 
    354         SetVariable valdisp_3,value= root:Packages:NIST:Polarization:Cells:gMuPo 
    355         SetVariable valdisp_1,pos={560,460},size={200,13},title="Po of 3He" 
    356         SetVariable valdisp_1,fStyle=1,limits={0,0,0},barmisc={0,1000} 
    357         SetVariable valdisp_1,value= root:Packages:NIST:Polarization:Cells:gPo 
    358         SetVariable valdisp_2,pos={560,518},size={200,13},title="Gamma (h)",fStyle=1 
    359         SetVariable valdisp_2,limits={0,0,0},barmisc={0,1000} 
    360         SetVariable valdisp_2,value= root:Packages:NIST:Polarization:Cells:gGamma 
    361         SetVariable setvar_0,pos={560,488},size={200,15},title="T0",fStyle=1 
    362         SetVariable setvar_0,limits={0,0,0},value= root:Packages:NIST:Polarization:Cells:gT0 
     352        SetVariable setvar_0,pos={560,428},size={200,13},title="muPo of 3He" 
     353        SetVariable setvar_0,fStyle=1,limits={0,0,0},barmisc={0,1000} 
     354        SetVariable setvar_0,value= root:Packages:NIST:Polarization:Cells:gMuPo 
     355        SetVariable setvar_1,pos={560,460},size={200,13},title="Po of 3He" 
     356        SetVariable setvar_1,fStyle=1,limits={0,0,0},barmisc={0,1000} 
     357        SetVariable setvar_1,value= root:Packages:NIST:Polarization:Cells:gPo 
     358        SetVariable setvar_2,pos={560,518},size={200,13},title="Gamma (h)",fStyle=1 
     359        SetVariable setvar_2,limits={0,0,0},barmisc={0,1000} 
     360        SetVariable setvar_2,value= root:Packages:NIST:Polarization:Cells:gGamma 
     361        SetVariable setvar_3,pos={560,488},size={200,15},title="T0",fStyle=1 
     362        SetVariable setvar_3,limits={0,0,0},value= root:Packages:NIST:Polarization:Cells:gT0 
    363363         
    364364 
     
    415415                                // if not, make it, and the space for the results of the calculation 
    416416                                MakeDecayResultWaves(popStr) 
    417                                 WAVE decay = $("Decay_"+popStr) 
     417                                WAVE decay = $("root:Packages:NIST:Polarization:Cells:Decay_"+popStr) 
    418418                        endif                    
    419419                        // append matrix, clearing the old one first 
     
    682682// calculate PCell and its error 
    683683// 
    684 // error calculation is not done yet, returns zero 
     684//  
    685685Function Calc_PCell(muPo,err_muPo,err_PCell) 
    686686        Variable muPo,err_muPo,&err_PCell 
     
    746746        // the error is a big mess to calculate, since it's messy argument inside acosh 
    747747        arg = (cr1 - cr3)/(cr2 - cr3) * (1/(Te*exp(-mu))) 
     748        tmp2 =  (1/sqrt(arg+1)/sqrt(arg-1))^2                                   // derivative of acosh(arg) (squared) 
     749         
    748750        // calculate the error of the argument first, then the error of acosh(arg) 
    749751        // there are 5 partial derivatives 
    750         arg_err = ( arg/(cr1 - cr3) * err_cr1 )^2               //CR in 
    751         arg_err += ( arg/(cr2 - cr3) * err_cr2 )^2      //CR out 
    752         arg_err += ((-arg/(cr1 - cr3) +  arg/(cr2 - cr3) )* err_cr3 )^2//CR bkg  
    753         arg_err += ( -arg/Te * err_Te )^2                                       //Te 
    754         arg_err += ( arg * err_mu )^2                                           //mu  (probably the dominant relative error) 
    755          
    756         arg_err = sqrt(arg_err) 
    757          
    758         // then the acosh term 
    759         err_muPo = ( 1/sqrt(arg+1)/sqrt(arg-1) * arg_err )^2 
    760         err_muPo = sqrt(err_muPo) 
     752        arg_err = tmp2 * ( arg/(cr1 - cr3) * err_cr1 )^2                //CR in 
     753        arg_err += tmp2 * ( arg/(cr2 - cr3) * err_cr2 )^2       //CR out 
     754        arg_err += tmp2 * ((-arg/(cr1 - cr3) +  arg/(cr2 - cr3) )* err_cr3 )^2//CR bkg  
     755        arg_err += tmp2 * ( -arg/Te * err_Te )^2                                        //Te 
     756        arg_err += tmp2 * ( arg * err_mu )^2                                            //mu  (probably the dominant relative error) 
     757         
     758        err_muPo = sqrt(arg_err) 
    761759         
    762760         
     
    11931191         
    11941192        if( (sdd1 != sdd2) || (sdd2 != sdd3) || (sdd1 != sdd3) ) 
    1195                 DoAlert 0,"Files are not all at the same detector distance" 
     1193                DoAlert 0,"Files in row "+num2str(selRow)+" are not all at the same detector distance" 
    11961194                err = 1 
    11971195        endif 
    11981196         
    11991197        if( (atten1 != atten2) || (atten2 != atten3) || (atten1 != atten3) ) 
    1200                 DoAlert 0,"Files are not all collected with the same attenuation. Just so you know." 
     1198                DoAlert 0,"Files in row "+num2str(selRow)+" are not all collected with the same attenuation. Just so you know." 
    12011199                err = 0 
    12021200        endif 
Note: See TracChangeset for help on using the changeset viewer.