ECOdyagnostics/operations.py
def interp(self, da, axis, **kwargs):
        """
        Interpolation function based on the xgcm interpolation.
        Can be performed for up to three axes.

        :param da:      data variable to interpolate
        :param axis:    axis or List(axes) along which to interpolate, computed by given order
        :param kwargs:  additional keyword arguments for xgcm.interp

        :return:        interpolated data variable along given axis
        """
        # Merge kwargs
        kwargs = dict(self.boundary, **kwargs)
        if self.discretization == 'standard':
            if axis is None:
                da_int = self.grid.interp(da, )
            elif len(axis) == 1:
                da_int = self.grid.interp(da, axis=axis[0], **kwargs)
            elif len(axis) == 2:
                da_int = self.grid.interp(self.grid.interp(da, axis=axis[0], **kwargs),
                                          axis=axis[1], **kwargs)
            elif len(axis) == 3:
                da_int = self.grid.interp(self.grid.interp(self.grid.interp(da,
                                                                            axis=axis[0], **kwargs),
                                                           axis=axis[1], **kwargs),
                                          axis=axis[2], **kwargs)

            else:
                raise Exception("Unknown operation for axis: %s" % (axis))

        return da_int

        Interpolation function based on the xgcm interpolation.
        Can be performed for up to three axes.

        :param da:      data variable to interpolate
        :param axis:    axis or List(axes) along which to interpolate, computed by given order
        :param kwargs:  additional keyword arguments for xgcm.interp

        :return:        interpolated data variable along given axis
        
Interpolation function based on the xgcm interpolation.
Can be performed for up to three axes.
Interpolation function based on the xgcm interpolation . Can be performed for up to three axes .
def interp(self, da, axis, **kwargs):
        kwargs = dict(self.boundary, **kwargs)
        if self.discretization == 'standard':
            if axis is None:
                da_int = self.grid.interp(da, )
            elif len(axis) == 1:
                da_int = self.grid.interp(da, axis=axis[0], **kwargs)
            elif len(axis) == 2:
                da_int = self.grid.interp(self.grid.interp(da, axis=axis[0], **kwargs),
                                          axis=axis[1], **kwargs)
            elif len(axis) == 3:
                da_int = self.grid.interp(self.grid.interp(self.grid.interp(da,
                                                                            axis=axis[0], **kwargs),
                                                           axis=axis[1], **kwargs),
                                          axis=axis[2], **kwargs)
            else:
                raise Exception("Unknown operation for axis: %s" % (axis))
        return da_int
def interp ( self , da , axis , ** kwargs ) : kwargs = dict ( self . boundary , ** kwargs ) if self . discretization == 'standard' : if axis is None : da_int = self . grid . interp ( da , ) elif len ( axis ) == 1 : da_int = self . grid . interp ( da , axis = axis [ 0 ] , ** kwargs ) elif len ( axis ) == 2 : da_int = self . grid . interp ( self . grid . interp ( da , axis = axis [ 0 ] , ** kwargs ) , axis = axis [ 1 ] , ** kwargs ) elif len ( axis ) == 3 : da_int = self . grid . interp ( self . grid . interp ( self . grid . interp ( da , axis = axis [ 0 ] , ** kwargs ) , axis = axis [ 1 ] , ** kwargs ) , axis = axis [ 2 ] , ** kwargs ) else : raise Exception ( "Unknown operation for axis: %s" % ( axis ) ) return da_int
Interpolation function based on the xgcm interpolation.
Interpolation function based on the xgcm interpolation .
"""
        Interpolation function based on the xgcm interpolation.
        Can be performed for up to three axes.

        :param da:      data variable to interpolate
        :param axis:    axis or List(axes) along which to interpolate, computed by given order
        :param kwargs:  additional keyword arguments for xgcm.interp

        :return:        interpolated data variable along given axis
        """ # Merge kwargs
interpolated data variable along given axis
interpolated data variable along given axis
self
da
data variable to interpolate
data variable to interpolate
axis
axis or List(axes) along which to interpolate, computed by given order
axis or List ( axes ) along which to interpolate computed by given order
kwargs
additional keyword arguments for xgcm.interp
additional keyword arguments for xgcm . interp