Ignore:
Timestamp:
Jul 22, 2009 5:04:51 PM (13 years ago)
Author:
srkline
Message:

Changed T-Wide calculation to be normalized to the monitor counts, hopefully to avoid oddities of MCR fluctuations.

Also handle the case where data greater than 2 degrees is not present. in this case, a warning is presented, and the last 4 points are used, whatever the angles are.

Location:
sans/Dev/trunk/NCNR_User_Procedures/Reduction/USANS
Files:
2 edited

Legend:

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

    r404 r540  
    190190// error value of 1 is returned and wavenote not updated if level is not found 
    191191//  
     192// now normalizes to the monitor counts 
    192193// 
    193194Function FindTWideCts(type) 
     
    196197        SVAR USANSFolder = root:Packages:NIST:USANS:Globals:gUSANSFolder 
    197198         
    198         Variable levNotFound,levPt,Cts,num,ii 
     199        Variable levNotFound,levPt,Cts,num,ii,sumMonCts 
     200         
    199201        Wave angle = $(USANSFolder+":"+type+":Angle") 
    200202        Wave detCts = $(USANSFolder+":"+type+":DetCts") 
    201203        Wave TransCts = $(USANSFolder+":"+type+":TransCts") 
     204        Wave monCts = $(USANSFolder+":"+type+":MonCts") 
     205         
     206        num=numpnts(TransCts) 
     207 
     208 
    202209        FindLevel/Q/P angle,2           //use angles greater than 2 deg 
    203210        levNotFound=V_Flag              //V_Flag==1 if no pk found 
     211         
    204212        if(levNotFound) 
    205                 return(1) 
     213                //post a warning, and use just the last 4 points... 
     214                DoAlert 0,"You don't have "+type+" data past 2 degrees - so Twide may not be reliable" 
     215                levPt = num-4 
     216        else 
     217                levPt = trunc(V_LevelX)         // in points, force to integer 
    206218        endif 
    207         levPt = trunc(V_LevelX)         // in points, force to integer 
    208219         
    209220        //average the trans cts from levPt to the end of the dataset 
    210         num=numpnts(TransCts) 
    211221        Cts=0 
     222        sumMonCts=0 
     223         
    212224        for(ii=levPt;ii<num;ii+=1) 
    213225                Cts += transCts[ii] 
     226                sumMonCts += monCts[ii] 
    214227        endfor 
     228        // get the average over that number of data points 
     229        sumMonCts /= (num-levPt-1) 
    215230        Cts /= (num-levPt-1) 
    216231         
     232//      Print "cts = ",cts 
     233//      Print "sumMoncts = ",sumMoncts 
     234         
     235        //normalize to the average monitor counts 
     236        Cts /= sumMonCts 
     237         
     238//      Print "normalized counts = ",cts 
     239 
     240 
    217241        //update the note 
    218242        Wave DetCts = $(USANSFolder+":"+type+":DetCts") 
     
    222246        Note/K DetCts 
    223247        Note detCts,str 
    224          
     248 
    225249        return(0) 
    226250End 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/USANS/Main_USANS.ipf

    r496 r540  
    141141        DrawText 140,357,"Raw Data Header" 
    142142        SetDrawEnv fstyle= 1 
    143         DrawText 293,55,"Current Data" 
     143//      DrawText 293,55,"Current Data" 
    144144        ListBox fileLB,pos={5,55},size={110,230},proc=FileListBoxProc 
    145145        ListBox fileLB,listWave=root:Packages:NIST:USANS:Globals:MainPanel:fileWave 
     
    185185        SetVariable FilterSetVar,pos={8,289},size={106,18},title="Filter",fSize=12 
    186186        SetVariable FilterSetVar,value= root:Packages:NIST:USANS:Globals:MainPanel:FilterStr 
    187         CheckBox UseCurrentData,pos={298,290},size={10,10},proc=UseCurrentDataProc,title="Enable Current Data" 
    188         CheckBox UseCurrentData,value=0 
     187//      CheckBox UseCurrentData,pos={298,290},size={10,10},proc=UseCurrentDataProc,title="Enable Current Data" 
     188//      CheckBox UseCurrentData,value=0 
    189189        Button USANSFeedback,pos={220,6},size={100,20},proc=U_OpenTracTicketPage,title="Feedback" 
    190190         
     
    339339        curPathStr = S_Path 
    340340         
    341         print fpath 
     341//      print fpath 
    342342         
    343343        if(cmpstr("",listW[0])==0) 
     
    424424        Variable ctTime 
    425425        ctTime = NumberByKey("TIMEPT",noteStr,":",";") 
    426         print ctTime 
     426//      print ctTime 
    427427        //normalize by counting time 
    428428        Wave detCts = $(USANSFolder+":"+Type+":DetCts") 
Note: See TracChangeset for help on using the changeset viewer.