ECOdyagnostics/operations.py
def zero_mask(self, da):
        """
        Create a mask of a data variable with 0 where the data is 0 or nan and 1 everywhere else.
        """
        da_one = da * 0 + 1
        da_one = da_one.where(np.isfinite(da), other=0)
        da_one = da_one.where(da != 0, other=0)
        mask = xr.DataArray(da_one.values, coords={dim: da[dim].values for dim in da.dims}, dims=da.dims)
        return mask

        Create a mask of a data variable with 0 where the data is 0 or nan and 1 everywhere else.
        
Create a mask of a data variable with 0 where the data is 0 or nan and 1 everywhere else.
Create a mask of a data variable with 0 where the data is 0 or nan and 1 everywhere else .
def zero_mask(self, da):
        da_one = da * 0 + 1
        da_one = da_one.where(np.isfinite(da), other=0)
        da_one = da_one.where(da != 0, other=0)
        mask = xr.DataArray(da_one.values, coords={dim: da[dim].values for dim in da.dims}, dims=da.dims)
        return mask
def zero_mask ( self , da ) : da_one = da * 0 + 1 da_one = da_one . where ( np . isfinite ( da ) , other = 0 ) da_one = da_one . where ( da != 0 , other = 0 ) mask = xr . DataArray ( da_one . values , coords = { dim : da [ dim ] . values for dim in da . dims } , dims = da . dims ) return mask
Create a mask of a data variable with 0 where the data is 0 or nan and 1 everywhere else.
Create a mask of a data variable with 0 where the data is 0 or nan and 1 everywhere else .
"""
        Create a mask of a data variable with 0 where the data is 0 or nan and 1 everywhere else.
        """
self
da