Changeset 2c1bb7b0 in sasmodels


Ignore:
Timestamp:
Jan 29, 2016 9:24:55 AM (9 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, core_shell_microgels, costrafo411, magnetic_model, release_v0.94, release_v0.95, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
299edd2
Parents:
1d4017a
Message:

fix mask broken by recent data refactoring

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/data.py

    r69ec80f r2c1bb7b0  
    9393        self.qmin = x.min() if x is not None else np.NaN 
    9494        self.qmax = x.max() if x is not None else np.NaN 
    95         self.mask = np.isnan(y) if y is not None else None 
     95        # TODO: why is 1D mask False and 2D mask True? 
     96        self.mask = (np.isnan(y) if y is not None 
     97                     else np.zeros_like(x,'b') if x is not None 
     98                     else None) 
    9699        self._xaxis, self._xunit = "x", "" 
    97100        self._yaxis, self._yunit = "y", "" 
     
    118121        self.qy_data, self.dqy_data = y, dy 
    119122        self.data, self.err_data = z, dz 
    120         self.mask = ~np.isnan(z) if z is not None else None 
     123        self.mask = (~np.isnan(z) if z is not None 
     124                     else np.ones_like(x) if x is not None 
     125                     else None) 
    121126        self.q_data = np.sqrt(x**2 + y**2) 
    122127        self.qmin = 1e-16 
Note: See TracChangeset for help on using the changeset viewer.