Changeset 226


Ignore:
Timestamp:
Dec 5, 2007 7:31:18 PM (15 years ago)
Author:
ajj
Message:

Prettified the RAW Data graph and added a display of mean monitor counts to help spot problems.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sans/USANSReduction/trunk/Put in User Procedures Folder/USANS Procedures v2.20/Main_USANS.ipf

    r51 r226  
    109109Window USANS_Panel() : Panel 
    110110        PauseUpdate; Silent 1           // building window... 
    111         NewPanel /W=(501,44,915,493)/K=1 as "USANS_Panel" 
     111        NewPanel /W=(600,44,1015,493)/K=1 as "USANS_Panel" 
    112112        SetDrawLayer UserBack 
    113113        SetDrawEnv fstyle= 1 
     
    177177        String fldrSav= GetDataFolder(1) 
    178178        SetDataFolder root:RAW: 
    179         String textStr=note(DetCts) 
    180         textStr=StringForRawGraph(textStr) 
    181         Display /W=(501,416,892,666) /K=1 DetCts vs Angle as "Raw Data" 
     179        //String textStr = StringForRawGraph() 
     180        //textStr=StringByKey("FILE",textStr,":",";")+" MONRATE:"+num2str(mean(MonCts)/NumberByKey("TIMEPT",textStr,":",";")) 
     181        Display /W=(600,525,1015,850)/L=left1/B=bottom1 /K=1 DetCts vs Angle as "Raw Data" 
     182        ModifyGraph margin(top)=50 
     183        //Display /W=(600,525,1015,850) /K=1 DetCts vs Angle as "Raw Data" 
    182184        DoWindow/C RawDataWin 
    183         AppendToGraph/L=left2 TransCts vs Angle 
    184         AppendToGraph/L=left3 MonCts vs Angle 
    185         ModifyGraph mode=4 
    186         ModifyGraph marker=19 
     185        //AppendToGraph/L=left1 /B=bottom1 DetCts vs Angle 
     186        AppendToGraph/L=left2/B=bottom1 TransCts vs Angle 
     187        AppendToGraph/L=left3/B=bottom1 MonCts vs Angle 
     188        SetAxis/A/N=2 left1 
     189        SetAxis/A/N=2 left2 
     190        SetAxis/A/N=2 left3 
     191        ModifyGraph mode=4, marker=19 
    187192        ModifyGraph rgb(TransCts)=(1,4,52428),rgb(MonCts)=(1,39321,19939) 
    188         ModifyGraph msize=1 
    189         ModifyGraph grid=1 
    190         ModifyGraph mirror=2 
    191         ModifyGraph standoff(left)=0,standoff(bottom)=0,standoff(left2)=0 
    192         ModifyGraph lblPos(left)=55 
    193         ModifyGraph tickUnit(left)=1 
    194         ModifyGraph freePos(left2)=0 
    195         ModifyGraph freePos(left3)=0 
    196         ModifyGraph axisEnab(left)={0,0.5} 
    197         ModifyGraph axisEnab(left2)={0.55,0.75} 
    198         ModifyGraph axisEnab(left3)={0.8,1} 
     193        ModifyGraph msize=1,grid=1,mirror=2,standoff=1,lblPos=50,tickUnit=1,notation=1,freePos={0.1,kwFraction} 
     194        ModifyGraph nticks(left2)=2 
     195        ModifyGraph nticks(left3)=2 
     196        ModifyGraph mirror(bottom1)=0 
     197        ModifyGraph axisEnab(left1)={0.1,0.5},gridEnab(left1)={0.1,1} 
     198        ModifyGraph axisEnab(left2)={0.57,0.77},gridEnab(left2)={0.1,1} 
     199        ModifyGraph axisEnab(left3)={0.8,1},gridEnab={0.1,1} 
     200        ModifyGraph axisEnab(bottom1)={0.1,1},gridEnab(bottom1)={0.1,1} 
    199201        ErrorBars DetCts Y,wave=(ErrDetCts,ErrDetCts) 
    200         Legend/N=text0/J/X=0.5/Y=57 "\\s(DetCts) DetCts\r\\s(TransCts) TransCts\r\\s(MonCts) MonCts" 
    201         TextBox/N=text1/A=RC/X=0.50/Y=-2 textStr 
    202         Label bottom "Angle (degrees)" 
    203         Label left "Counts" 
     202        TextBox/F=0/E=2/A=MB/Y=2/N=text1 "Angle" 
     203        TextBox/F=0/O=90/E=2/A=LC/X=2/N=text2 "Counts" 
     204        //TextBox/N=text1/A=RC/X=0.50/Y=-2 textStr 
     205        //Label bottom1 "Angle (degrees)" 
     206        Label left1 " " 
     207        Label left2 " " 
     208        Label left3 " " 
     209        TitleForRawGraph() 
    204210        SetDataFolder fldrSav 
    205211End 
     
    560566        else 
    561567                //just update the textbox 
    562                 WAVE detCts=$"root:RAW:detCts" 
    563                 String textStr=note(detCts) 
    564                 textStr=StringForRawGraph(textStr) 
    565                 TextBox/W=RawDataWin/C/N=text1/A=RC/X=0.50/Y=-2 textStr 
     568                //String textStr=StringForRawGraph() 
     569                //TextBox/W=RawDataWin/C/N=text1/A=RC/X=0.50/Y=-2 textStr 
     570                //TextBox/W=RawDataWin/C/E=2/A=MT/X=0/Y=0/N=text0 textStr 
     571                TitleForRawGraph() 
    566572        Endif 
    567573        //bring the panel back to the front 
     
    898904//and return a string that is to be used for the textbox in the graph of raw data 
    899905// 
    900 Function/S StringForRawGraph(Str) 
    901         String str              //the wave note 
    902          
    903         String retStr="",item="" 
    904         Variable ii,num=ItemsInList(Str,";") 
    905         for(ii=0;ii<num;ii+=1) 
    906                 item = StringFromList(ii, str  ,";") 
    907                 if( stringmatch(item,"*FILE*") ) 
    908                         retStr += item + ";" 
    909                 endif 
    910                 if( stringmatch(item,"*TIME*") ) 
    911                         retStr += item + ";" 
    912                 endif 
    913         endfor 
    914         Return(retStr) 
     906Function TitleForRawGraph() 
     907 
     908        WAVE detCts=$"root:RAW:detCts" 
     909        WAVE monCts = $"root:RAW:monCts" 
     910        String str=note(detCts) 
     911         
     912        String retStr="\\JC" 
     913        retStr += StringByKey("FILE",str,":",";")+"\r" 
     914        retStr += "Count Time: "+StringByKey("TIMEPT",str,":",";") 
     915        retStr += " \tMonitor Rate: "+num2str(mean(monCts)/NumberByKey("TIMEPT",str,":",";"))+"\r" 
     916        retStr += "\\s(DetCts) DetCts \\s(TransCts) TransCts \\s(MonCts) MonCts" 
     917         
     918        TextBox/W=RawDataWin/C/E=2/A=MT/X=5/Y=0/N=text0 retStr 
    915919End 
    916920 
Note: See TracChangeset for help on using the changeset viewer.