ECOdyagnostics/operations.py
def _get_dims(self, da):
        """
        Returns the spatial position of the data variable of data vector.
        Note: Output does not include 't'-dimension

        :param da:  data variable or vector as xarray.Dataarray or List(xarray.Dataarray, ...)

        :return:    position of data variable or vector
        """

        # If da is a list (vector), return a list with the dimension tuple for every direction.
        if type(da) == list:
            pos = []
            for i in range(len(da)):
                dims = da[i].dims
                # Remove temporal dimension if present
                if 't' in dims:
                    ind = dims.index('t')
                    dims = dims[:ind] + dims[ind + 1:]
                pos.append(dims)
        else:
            dims = da.dims
            if 't' in dims:
                ind = dims.index('t')
                dims = dims[:ind] + dims[ind + 1:]
            pos = dims

        return pos

        Returns the spatial position of the data variable of data vector.
        Note: Output does not include 't'-dimension

        :param da:  data variable or vector as xarray.Dataarray or List(xarray.Dataarray, ...)

        :return:    position of data variable or vector
        
Returns the spatial position of the data variable of data vector.
Note: Output does not include 't'-dimension
Returns the spatial position of the data variable of data vector . Note : Output does not include ' t ' - dimension
def _get_dims(self, da):
        if type(da) == list:
            pos = []
            for i in range(len(da)):
                dims = da[i].dims
                if 't' in dims:
                    ind = dims.index('t')
                    dims = dims[:ind] + dims[ind + 1:]
                pos.append(dims)
        else:
            dims = da.dims
            if 't' in dims:
                ind = dims.index('t')
                dims = dims[:ind] + dims[ind + 1:]
            pos = dims
        return pos
def _get_dims ( self , da ) : if type ( da ) == list : pos = [ ] for i in range ( len ( da ) ) : dims = da [ i ] . dims if 't' in dims : ind = dims . index ( 't' ) dims = dims [ : ind ] + dims [ ind + 1 : ] pos . append ( dims ) else : dims = da . dims if 't' in dims : ind = dims . index ( 't' ) dims = dims [ : ind ] + dims [ ind + 1 : ] pos = dims return pos
Returns the spatial position of the data variable of data vector.
Returns the spatial position of the data variable of data vector .
"""
        Returns the spatial position of the data variable of data vector.
        Note: Output does not include 't'-dimension

        :param da:  data variable or vector as xarray.Dataarray or List(xarray.Dataarray, ...)

        :return:    position of data variable or vector
        """ # If da is a list (vector), return a list with the dimension tuple for every direction. # Remove temporal dimension if present
position of data variable or vector
position of data variable or vector
self
da
data variable or vector as xarray.Dataarray or List(xarray.Dataarray, ...)
data variable or vector as xarray . Dataarray or List ( xarray . Dataarray ... )