Ignore:
Timestamp:
Oct 27, 2009 2:07:14 PM (13 years ago)
Author:
srkline
Message:

Added a calculation of the total fraction of multiple coherent scattering. This value is now displayed on the 1D sim panel and on the UCALC panel. If the total fraction of multiple coherent scattering (relative to the fraction coherently scattered) is greater than 0.10, then the field turns red as a warning.

Changed the numbering and suffix scheme for saving simulated VAX raw data files.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/USANS/U_CALC.ipf

    r577 r583  
    134134        Variable/G g_1DFracScatt= 0     // ?? 
    135135        Variable/G g_1DEstTrans = 0     // ? can I calculate this? 
     136        Variable/G g_MultScattFraction = 0 
     137 
    136138 
    137139// not on panel yet 
     
    311313         
    312314        GroupBox group0,pos={5,1},size={493,177},title="Instrument Setup" 
    313         GroupBox group1,pos={5,183},size={240,147},title="Sample Setup" 
    314         GroupBox group2,pos={5,343},size={259,147},title="Results" 
     315        GroupBox group1,pos={5,183},size={240,110},title="Sample Setup" 
     316        GroupBox group2,pos={5,310},size={240,170},title="Results" 
    315317         
    316318        PopupMenu popup0,pos={17,19},size={165,20},title="Sample Aperture Diam (in)" 
     
    455457         
    456458// a box for the results 
    457         SetVariable totalTime,pos={left+20,370},size={150,15},title="Count time (h:m)",value= gTotTimeStr 
    458         ValDisplay valdisp0_2,pos={left+20,395},size={220,13},title="Fraction of beam scattered" 
    459         ValDisplay valdisp0_2,limits={0,0,0},barmisc={0,1000},value= root:Packages:NIST:USANS:Globals:U_Sim:g_1DFracScatt 
    460         ValDisplay valdisp0_2,disable=1 
    461         ValDisplay valdisp0_3,pos={left+20,420},size={220,13},title="Estimated transmission" 
    462         ValDisplay valdisp0_3,limits={0,0,0},barmisc={0,1000},value=root:Packages:NIST:USANS:Globals:U_Sim:g_1DEstTrans 
    463         ValDisplay valdisp0_3,disable=1 
    464         Button button1,pos={left+20,400},size={150,20},proc=U_SavePanelProc,title="Save PNG" 
    465         Button button2,pos={left+20,430},size={150,20},proc=U_ConfigTextProc,title="Config Text" 
    466         Button button3,pos={left+20,460},size={150,20},proc=U_SaveButtonProc,title="Save Simulated Data" 
     459        SetVariable totalTime,pos={left+20,335},size={150,15},title="Count time (h:m)",value= gTotTimeStr 
     460        SetVariable totalTime,limits={-inf,inf,0},noedit=1 
     461        SetVariable valdisp0_2,pos={left+20,365},size={190,15},title="Multiple Coherent Scattering" 
     462        SetVariable valdisp0_2,limits={-inf,inf,0},noedit=1,value=g_MultScattFraction 
     463//      ValDisplay valdisp0_3,pos={left+20,420},size={220,13},title="Estimated transmission" 
     464//      ValDisplay valdisp0_3,limits={0,0,0},barmisc={0,1000},value=root:Packages:NIST:USANS:Globals:U_Sim:g_1DEstTrans 
     465//      ValDisplay valdisp0_3,disable=1 
     466        Button button1,pos={left+20,390},size={150,20},proc=U_SavePanelProc,title="Save PNG" 
     467        Button button2,pos={left+20,420},size={150,20},proc=U_ConfigTextProc,title="Config Text" 
     468        Button button3,pos={left+20,450},size={150,20},proc=U_SaveButtonProc,title="Save Simulated Data" 
    467469 
    468470// help, done buttons 
     
    906908//                      sprintf abortStr,"sig_sas = %g. Please check that the model coefficients have a zero background, or the low q is well-behaved.",sig_sas 
    907909//              endif 
     910                // calculate the multiple scattering fraction for display (10/2009) 
     911                NVAR mScat = root:Packages:NIST:USANS:Globals:U_Sim:g_MultScattFraction 
     912                Variable nMax=10,tau 
     913                mScat=0 
     914                tau = thick*sig_sas 
     915                // this sums the normalized scattering P', so the result is the fraction of multiply coherently scattered 
     916                // neutrons out of those that were scattered 
     917                for(ii=2;ii<nMax;ii+=1) 
     918                        mScat += tau^(ii)/factorial(ii) 
     919        //              print tau^(ii)/factorial(ii) 
     920                endfor 
    908921                estTrans = exp(-1*thick*sig_sas)                //thickness and sigma both in units of cm 
     922                mscat *= (estTrans)/(1-estTrans) 
     923                 
     924                if(mScat > 0.1) 
     925                        SetVariable valdisp0_2 win=UCALC,labelBack=(65535,32768,32768) 
     926                else 
     927                        SetVariable valdisp0_2 win=UCALC,labelBack=0 
     928                endif 
     929 
     930 
    909931                Print "Sig_sas = ",sig_sas 
    910932                 
Note: See TracChangeset for help on using the changeset viewer.