ECOdyagnostics/operations.py
def _get_missmatch(self, da, pos):
        """
        Returns the axes-name where a missmatch between the variable and a position is found.
        The axes-names are hard coded to 'X', 'Y', or 'Z'. Has to match the name given for the xgcm metric!

        :param da:  data variable
        :param pos: position where it is compared to ('T','U','V','F','W','UW','VW','FW')

        :return:    List of axes-names of missmatches
        """
        # Get dimensions, if temporal dimension cut it from dims to get spatial dims only
        dims = da.dims
        if 't' in dims:
            ind = dims.index('t')
            dims = dims[:ind] + dims[ind + 1:]

        # Get the expected dimension with corresponding number of axes
        ax_num = [len(l) for l in self.points[pos]].index(len(dims))
        expect = self.points[pos][ax_num]

        # Add physical dimensions where a missmatch is found
        missmatch = []
        for ax in range(len(expect)):
            if dims[ax] == expect[ax]:
                pass
            else:
                ax_miss = 'X' if dims[ax][0] == 'x' else \
                    'Y' if dims[ax][0] == 'y' else \
                        'Z' if dims[ax][0] == 'z' else None
                if ax_miss == None:
                    raise Exception("""Axis %s does not match to any known dimensions""" % (da.dims[ax]))
                missmatch.append(ax_miss)

        return missmatch

        Returns the axes-name where a missmatch between the variable and a position is found.
        The axes-names are hard coded to 'X', 'Y', or 'Z'. Has to match the name given for the xgcm metric!

        :param da:  data variable
        :param pos: position where it is compared to ('T','U','V','F','W','UW','VW','FW')

        :return:    List of axes-names of missmatches
        
Returns the axes-name where a missmatch between the variable and a position is found.
Returns the axes - name where a missmatch between the variable and a position is found .
def _get_missmatch(self, da, pos):
        dims = da.dims
        if 't' in dims:
            ind = dims.index('t')
            dims = dims[:ind] + dims[ind + 1:]
        ax_num = [len(l) for l in self.points[pos]].index(len(dims))
        expect = self.points[pos][ax_num]
        missmatch = []
        for ax in range(len(expect)):
            if dims[ax] == expect[ax]:
                pass
            else:
                ax_miss = 'X' if dims[ax][0] == 'x' else \
                    'Y' if dims[ax][0] == 'y' else \
                        'Z' if dims[ax][0] == 'z' else None
                if ax_miss == None:
                    raise Exception("""Axis %s does not match to any known dimensions""" % (da.dims[ax]))
                missmatch.append(ax_miss)
        return missmatch
def _get_missmatch ( self , da , pos ) : dims = da . dims if 't' in dims : ind = dims . index ( 't' ) dims = dims [ : ind ] + dims [ ind + 1 : ] ax_num = [ len ( l ) for l in self . points [ pos ] ] . index ( len ( dims ) ) expect = self . points [ pos ] [ ax_num ] missmatch = [ ] for ax in range ( len ( expect ) ) : if dims [ ax ] == expect [ ax ] : pass else : ax_miss = 'X' if dims [ ax ] [ 0 ] == 'x' else 'Y' if dims [ ax ] [ 0 ] == 'y' else 'Z' if dims [ ax ] [ 0 ] == 'z' else None if ax_miss == None : raise Exception ( """Axis %s does not match to any known dimensions""" % ( da . dims [ ax ] ) ) missmatch . append ( ax_miss ) return missmatch
Returns the axes-name where a missmatch between the variable and a position is found.
Returns the axes - name where a missmatch between the variable and a position is found .
"""
        Returns the axes-name where a missmatch between the variable and a position is found.
        The axes-names are hard coded to 'X', 'Y', or 'Z'. Has to match the name given for the xgcm metric!

        :param da:  data variable
        :param pos: position where it is compared to ('T','U','V','F','W','UW','VW','FW')

        :return:    List of axes-names of missmatches
        """ # Get dimensions, if temporal dimension cut it from dims to get spatial dims only # Get the expected dimension with corresponding number of axes # Add physical dimensions where a missmatch is found
List of axes-names of missmatches
List of axes - names of missmatches
self
da
None
pos
None