ECOdyagnostics/operations.py
def nan_mask(self, da):
        """
        Create a mask of a data variable with nan where the data is 0 and 1 everywhere else.
        """
        da_one = da * 0 + 1
        da_one = da_one.where(da != 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 nan where the data is 0 and 1 everywhere else.
        
Create a mask of a data variable with nan where the data is 0 and 1 everywhere else.
Create a mask of a data variable with nan where the data is 0 and 1 everywhere else .
def nan_mask(self, da):
        da_one = da * 0 + 1
        da_one = da_one.where(da != 0)
        mask = xr.DataArray(da_one.values, coords={dim: da[dim].values for dim in da.dims}, dims=da.dims)
        return mask
def nan_mask ( self , da ) : da_one = da * 0 + 1 da_one = da_one . where ( da != 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 nan where the data is 0 and 1 everywhere else.
Create a mask of a data variable with nan where the data is 0 and 1 everywhere else .
"""
        Create a mask of a data variable with nan where the data is 0 and 1 everywhere else.
        """
self
da