Changeset 8f12385 in sasview


Ignore:
Timestamp:
Mar 29, 2011 4:57:49 PM (13 years ago)
Author:
Jae Cho <jhjcho@…>
Branches:
master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
ddeeb02
Parents:
21969a4a
Message:

included mask in masked circular average in 2D

File:
1 edited

Legend:

Unmodified
Added
Removed
  • DataLoader/manipulations.py

    r729bcf6 r8f12385  
    418418        self.bin_width = bin_width 
    419419 
    420     def __call__(self, data2D): 
     420    def __call__(self, data2D, ismask=False): 
    421421        """ 
    422422        Perform circular averaging on the data 
     
    431431        qx_data = data2D.qx_data[numpy.isfinite(data2D.data)] 
    432432        err_data = data2D.err_data[numpy.isfinite(data2D.data)] 
     433        mask_data = data2D.mask[numpy.isfinite(data2D.data)] 
    433434         
    434435        dq_data = None 
     
    489490        y_counts = numpy.zeros(nbins) 
    490491 
    491         for npt in range(len(data)):           
     492        for npt in range(len(data)):    
     493             
     494            if ismask and not mask_data[npt]: 
     495                continue    
     496             
    492497            frac = 0 
    493498             
     
    540545        x    = x / y_counts 
    541546        idx = (numpy.isfinite(y)) & (numpy.isfinite(x))  
     547         
    542548        if err_x != None: 
    543549            d_x = err_x[idx] / y_counts[idx] 
Note: See TracChangeset for help on using the changeset viewer.