ECOdyagnostics/operations.py
def curl(self, x, axes=None, **kwargs):
        """
        Compute the curl of a vector.

        If axes are not specified, by default the gradient is taken along 'X', 'Y' and 'Z'.
        """
        if len(x) != 3:
            raise Exception("Vector is not 3dimensional, please provide axes to compute the gradient")

        if axes is None:
            axes = ['X', 'Y', 'Z']
        elif len(axes) != 3:
            raise Exception("Input for axes is not 3 dimensional, please provide the appropriate axis order.")

        y = [0] * 3
        y[0] = self.derivative(x[2], axes[1], **kwargs) - self.derivative(x[1], axes[2], **kwargs)
        y[1] = self.derivative(x[0], axes[2], **kwargs) - self.derivative(x[2], axes[0], **kwargs)
        y[2] = self.derivative(x[1], axes[0], **kwargs) - self.derivative(x[0], axes[1], **kwargs)

        return y

        Compute the curl of a vector.

        If axes are not specified, by default the gradient is taken along 'X', 'Y' and 'Z'.
        
Compute the curl of a vector.
Compute the curl of a vector .
def curl(self, x, axes=None, **kwargs):
        if len(x) != 3:
            raise Exception("Vector is not 3dimensional, please provide axes to compute the gradient")
        if axes is None:
            axes = ['X', 'Y', 'Z']
        elif len(axes) != 3:
            raise Exception("Input for axes is not 3 dimensional, please provide the appropriate axis order.")
        y = [0] * 3
        y[0] = self.derivative(x[2], axes[1], **kwargs) - self.derivative(x[1], axes[2], **kwargs)
        y[1] = self.derivative(x[0], axes[2], **kwargs) - self.derivative(x[2], axes[0], **kwargs)
        y[2] = self.derivative(x[1], axes[0], **kwargs) - self.derivative(x[0], axes[1], **kwargs)
        return y
def curl ( self , x , axes = None , ** kwargs ) : if len ( x ) != 3 : raise Exception ( "Vector is not 3dimensional, please provide axes to compute the gradient" ) if axes is None : axes = [ 'X' , 'Y' , 'Z' ] elif len ( axes ) != 3 : raise Exception ( "Input for axes is not 3 dimensional, please provide the appropriate axis order." ) y = [ 0 ] * 3 y [ 0 ] = self . derivative ( x [ 2 ] , axes [ 1 ] , ** kwargs ) - self . derivative ( x [ 1 ] , axes [ 2 ] , ** kwargs ) y [ 1 ] = self . derivative ( x [ 0 ] , axes [ 2 ] , ** kwargs ) - self . derivative ( x [ 2 ] , axes [ 0 ] , ** kwargs ) y [ 2 ] = self . derivative ( x [ 1 ] , axes [ 0 ] , ** kwargs ) - self . derivative ( x [ 0 ] , axes [ 1 ] , ** kwargs ) return y
Compute the curl of a vector.
Compute the curl of a vector .
"""
        Compute the curl of a vector.

        If axes are not specified, by default the gradient is taken along 'X', 'Y' and 'Z'.
        """
self
x
axes