类 ArrayMath


  • public class ArrayMath
    extends java.lang.Object
    作者:
    wyq
    • 字段详细资料

      • fill_value

        public static double fill_value
    • 构造器详细资料

      • ArrayMath

        public ArrayMath()
    • 方法详细资料

      • getDataType

        public static DataType getDataType​(java.lang.Object o)
        Get data type
        参数:
        o - Object
        返回:
        Data type
      • typeToNBytes

        public static short typeToNBytes​(DataType dataType)
        Return the number of bytes per element for the given typecode.
        参数:
        dataType - Data type
        返回:
        Bytes number
      • isComplex

        public static boolean isComplex​(Array a)
        Check if an array is complex data type
        参数:
        a - The array
        返回:
        Complex data type or not
      • isNumeric

        public static boolean isNumeric​(Array a)
        Check if an array is numeric array
        参数:
        a - The array
        返回:
        Numeric or not
      • broadcastCheck

        public static int broadcastCheck​(Array a,
                                         Array b)
        Broadcast check for two arrays.
        参数:
        a - Array a
        b - Array b
        返回:
        Can broadcast (1), can not broadcast (-1), same dimensions (0)
      • broadcast

        public static int[] broadcast​(Array a,
                                      Array b)
        Get broadcast shape from two arrays
        参数:
        a - Array a
        b - Array b
        返回:
        Broadcast shape
      • add

        public static Array add​(Array a,
                                Array b)
        Array add
        参数:
        a - Array a
        b - Array b
        返回:
        Added array
      • add

        public static Array add​(Array a,
                                java.lang.Number b)
        Array add
        参数:
        a - Array a
        b - Number b
        返回:
        Added array
      • add

        public static Array add​(Array a,
                                Complex b)
        Array add
        参数:
        a - Array a
        b - Complex number b
        返回:
        Added array
      • add

        public static Array add​(Array a,
                                org.python.core.PyComplex b)
        Array add
        参数:
        a - Array a
        b - Complex number b
        返回:
        Added array
      • sub

        public static Array sub​(Array a,
                                Array b)
        Array subtract
        参数:
        a - Array a
        b - Array b
        返回:
        Result array
      • sub

        public static Array sub​(Array a,
                                java.lang.Number b)
        Array subtract
        参数:
        a - Array a
        b - Number b
        返回:
        Result array
      • sub

        public static Array sub​(Array a,
                                Complex b)
        Array subtract
        参数:
        a - Array a
        b - Complex number b
        返回:
        Result array
      • sub

        public static Array sub​(Array a,
                                org.python.core.PyComplex b)
        Array subtract
        参数:
        a - Array a
        b - Complex number b
        返回:
        Result array
      • sub

        public static Array sub​(java.lang.Number b,
                                Array a)
        Array subtract
        参数:
        a - Array a
        b - Number b
        返回:
        Result array
      • sub

        public static Array sub​(Complex b,
                                Array a)
        Array subtract
        参数:
        a - Array a
        b - Complex number b
        返回:
        Result array
      • sub

        public static Array sub​(org.python.core.PyComplex b,
                                Array a)
        Array subtract
        参数:
        a - Array a
        b - Complex number b
        返回:
        Result array
      • mul

        public static Array mul​(Array a,
                                Array b)
        Array mutiply
        参数:
        a - Array a
        b - Array b
        返回:
        Result array
      • mul

        public static Array mul​(Array a,
                                java.lang.Number b)
        Array multiply
        参数:
        a - Array a
        b - Number b
        返回:
        Result array
      • mul

        public static Array mul​(Array a,
                                Complex b)
        Array multiply
        参数:
        a - Array a
        b - Complex number b
        返回:
        Result array
      • mul

        public static Array mul​(Array a,
                                org.python.core.PyComplex b)
        Array multiply
        参数:
        a - Array a
        b - Complex number b
        返回:
        Result array
      • div

        public static Array div​(Array a,
                                Array b)
        Array divide
        参数:
        a - Array a
        b - Array b
        返回:
        Result array
      • div

        public static Array div​(Array a,
                                java.lang.Number b)
        Array divide
        参数:
        a - Array a
        b - Number b
        返回:
        Result array
      • div

        public static Array div​(Array a,
                                Complex b)
        Array divide
        参数:
        a - Array a
        b - Complex number b
        返回:
        Result array
      • div

        public static Array div​(Array a,
                                org.python.core.PyComplex b)
        Array divide
        参数:
        a - Array a
        b - Complex number b
        返回:
        Result array
      • div

        public static Array div​(java.lang.Number b,
                                Array a)
        Array divide
        参数:
        a - Array a
        b - Number b
        返回:
        Result array
      • div

        public static Array div​(Complex b,
                                Array a)
        Array divide
        参数:
        a - Array a
        b - Complex number b
        返回:
        Result array
      • div

        public static Array div​(org.python.core.PyComplex b,
                                Array a)
        Array divide
        参数:
        a - Array a
        b - Complex number b
        返回:
        Result array
      • pow

        public static Array pow​(Array a,
                                java.lang.Number b)
        Array pow function
        参数:
        a - Array a
        b - Number b
        返回:
        Result array
      • pow

        public static Array pow​(Array a,
                                Complex b)
        Array pow function
        参数:
        a - Array a
        b - Complex number b
        返回:
        Result array
      • pow

        public static Array pow​(Array a,
                                org.python.core.PyComplex b)
        Array pow function
        参数:
        a - Array a
        b - Complex number b
        返回:
        Result array
      • pow

        public static Array pow​(java.lang.Number a,
                                Array b)
        Array pow function
        参数:
        a - Number a
        b - Array b
        返回:
        Result array
      • pow

        public static Array pow​(Complex b,
                                Array a)
        Array pow function
        参数:
        a - Array a
        b - Complex number b
        返回:
        Result array
      • pow

        public static Array pow​(org.python.core.PyComplex b,
                                Array a)
        Array pow function
        参数:
        a - Array a
        b - Complex number b
        返回:
        Result array
      • pow

        public static Array pow​(Array a,
                                Array b)
        Array pow function
        参数:
        a - Number a
        b - Array b
        返回:
        Result array
      • sqrt

        public static Array sqrt​(Array a)
        Sqrt function
        参数:
        a - Array a
        返回:
        Result array
      • exp

        public static Array exp​(Array a)
        Exponent function
        参数:
        a - Array a
        返回:
        Result array
      • log

        public static Array log​(Array a)
        Log function
        参数:
        a - Array a
        返回:
        Result array
      • log10

        public static Array log10​(Array a)
        Log10 function
        参数:
        a - Array a
        返回:
        Result array
      • abs

        public static Array abs​(Array a)
        Array absolute
        参数:
        a - Array a
        返回:
        Result array
      • equal

        public static Array equal​(Array a,
                                  Array b)
        Array equal
        参数:
        a - Array a
        b - Array b
        返回:
        Result array
      • equal

        public static Array equal​(Array a,
                                  java.lang.Number b)
        Array equal
        参数:
        a - Array a
        b - Number b
        返回:
        Result array
      • equal

        public static Array equal​(Array a,
                                  java.lang.String b)
        Array equal
        参数:
        a - Array a
        b - String b
        返回:
        Result array
      • lessThan

        public static Array lessThan​(Array a,
                                     Array b)
        Array less than
        参数:
        a - Array a
        b - Array b
        返回:
        Result array
      • lessThan

        public static Array lessThan​(Array a,
                                     java.lang.Number b)
        Array less than
        参数:
        a - Array a
        b - Number b
        返回:
        Result array
      • lessThanOrEqual

        public static Array lessThanOrEqual​(Array a,
                                            Array b)
        Array less than or equal
        参数:
        a - Array a
        b - Array b
        返回:
        Result array
      • lessThanOrEqual

        public static Array lessThanOrEqual​(Array a,
                                            java.lang.Number b)
        Array less than or equal
        参数:
        a - Array a
        b - Number b
        返回:
        Result array
      • greaterThan

        public static Array greaterThan​(Array a,
                                        Array b)
        Array greater than
        参数:
        a - Array a
        b - Array b
        返回:
        Result array
      • greaterThan

        public static Array greaterThan​(Array a,
                                        java.lang.Number b)
        Array greater than
        参数:
        a - Array a
        b - Number b
        返回:
        Result array
      • greaterThanOrEqual

        public static Array greaterThanOrEqual​(Array a,
                                               Array b)
        Array greater than or equal
        参数:
        a - Array a
        b - Array b
        返回:
        Result array
      • greaterThanOrEqual

        public static Array greaterThanOrEqual​(Array a,
                                               java.lang.Number b)
        Array greater than or equal
        参数:
        a - Array a
        b - Number b
        返回:
        Result array
      • notEqual

        public static Array notEqual​(Array a,
                                     Array b)
        Array not equal
        参数:
        a - Array a
        b - Array b
        返回:
        Result array
      • notEqual

        public static Array notEqual​(Array a,
                                     java.lang.Number b)
        Array not equal
        参数:
        a - Array a
        b - Number b
        返回:
        Result array
      • any

        public static boolean any​(Array a)
        Test whether any array element evaluates to True.
        参数:
        a - The array
        返回:
        Boolean
      • all

        public static boolean all​(Array a)
        Test whether all array element evaluates to True.
        参数:
        a - The array
        返回:
        Boolean
      • inValues

        public static Array inValues​(Array a,
                                     java.util.List b)
        Return the array with the value of 1 when the input array element value in the list b, otherwise set value as 0.
        参数:
        a - Array a
        b - List b
        返回:
        Result array
      • containsNaN

        public static boolean containsNaN​(Array a)
        Check if the array contains NaN value
        参数:
        a - Input array
        返回:
        Boolean
      • removeNaN

        public static Array removeNaN​(Array a)
        Remove NaN values in an array
        参数:
        a - The array
        返回:
        The array withou NaN values
      • removeNaN

        public static Array[] removeNaN​(Array... a)
        Remove NaN values in arrays
        参数:
        a - The arrays
        返回:
        The array withou NaN values
      • nonzero

        public static java.util.List<Array> nonzero​(Array a)
        Return the indices of the elements that are non-zero.
        参数:
        a - Input array
        返回:
        Indices
      • bitAnd

        public static Array bitAnd​(Array a,
                                   java.lang.Number b)
        Bit and operation
        参数:
        a - Array a
        b - Number b
        返回:
        Result array
      • bitAnd

        public static Array bitAnd​(Array a,
                                   Array b)
        Bit and operation
        参数:
        a - Array a
        b - Array b
        返回:
        Result array
      • bitOr

        public static Array bitOr​(Array a,
                                  java.lang.Number b)
        Bit or | operation
        参数:
        a - Array a
        b - Number b
        返回:
        Result array
      • bitOr

        public static Array bitOr​(Array a,
                                  Array b)
        Bit or | operation
        参数:
        a - Array a
        b - Array b
        返回:
        Result array
      • bitXor

        public static Array bitXor​(Array a,
                                   java.lang.Number b)
        Bit exclusive or ^ operation
        参数:
        a - Array a
        b - Number b
        返回:
        Result array
      • bitXor

        public static Array bitXor​(Array a,
                                   Array b)
        Bit exclusive or | operation
        参数:
        a - Array a
        b - Array b
        返回:
        Result array
      • bitInvert

        public static Array bitInvert​(Array a)
        Bit inversion ~ operation
        参数:
        a - Array a
        返回:
        Result array
      • leftShift

        public static Array leftShift​(Array a,
                                      java.lang.Number b)
        Bit left shift operation
        参数:
        a - Array a
        b - Number b
        返回:
        Result array
      • leftShift

        public static Array leftShift​(Array a,
                                      Array b)
        Bit left shift operation
        参数:
        a - Array a
        b - Array b
        返回:
        Result array
      • rightShift

        public static Array rightShift​(Array a,
                                       java.lang.Number b)
        Bit right shift operation
        参数:
        a - Array a
        b - Number b
        返回:
        Result array
      • rightShift

        public static Array rightShift​(Array a,
                                       Array b)
        Bit right shift operation
        参数:
        a - Array a
        b - Array b
        返回:
        Result array
      • trapz

        public static double trapz​(Array y,
                                   double dx)
        Integrate vector array using the composite trapezoidal rule.
        参数:
        y - Vecotr array
        dx - Spacing between all y elements
        返回:
        Definite integral as approximated by trapezoidal rule
      • trapz

        public static double trapz​(Array y,
                                   double dx,
                                   java.util.List<Range> ranges)
                            throws InvalidRangeException
        Integrate vector array using the composite trapezoidal rule.
        参数:
        y - Vecotr array
        dx - Spacing between all y elements
        ranges -
        返回:
        Definite integral as approximated by trapezoidal rule
        抛出:
        InvalidRangeException
      • trapz

        public static double trapz​(Array y,
                                   Array x)
        Integrate vector array using the composite trapezoidal rule.
        参数:
        y - Vecotr array
        x - Spacing array between all y elements
        返回:
        Definite integral as approximated by trapezoidal rule
      • trapz

        public static double trapz​(Array y,
                                   Array x,
                                   java.util.List<Range> ranges)
                            throws InvalidRangeException
        Integrate vector array using the composite trapezoidal rule.
        参数:
        y - Vecotr array
        x - Spacing array between all y elements
        ranges - Ranges
        返回:
        Definite integral as approximated by trapezoidal rule
        抛出:
        InvalidRangeException
      • sign

        public static Array sign​(Array x)
        Returns an element-wise indication of the sign of a number. The sign function returns -1 if x less than 0, 0 if x==0, 1 if x bigger than 0. nan is returned for nan inputs.
        参数:
        x - Input array
        返回:
        The sign of x array
      • dot

        public static Array dot​(Array a,
                                Array b)
        Matrix multiplication
        参数:
        a - Array a
        b - Array b
        返回:
        Result array
      • vdot

        public static double vdot​(Array a,
                                  Array b)
        Return the dot product of two vectors.
        参数:
        a - Vector a
        b - Vector b
        返回:
        Result
      • toDegrees

        public static Array toDegrees​(Array a)
        Convert radians to degrees function
        参数:
        a - Array a
        返回:
        Result array
      • toRadians

        public static Array toRadians​(Array a)
        Convert radians to degrees function
        参数:
        a - Array a
        返回:
        Result array
      • sin

        public static Array sin​(Array a)
        Sine function
        参数:
        a - Array a
        返回:
        Result array
      • cos

        public static Array cos​(Array a)
        Cosine function
        参数:
        a - Array a
        返回:
        Result array
      • tan

        public static Array tan​(Array a)
        Tangent function
        参数:
        a - Array a
        返回:
        Result array
      • asin

        public static Array asin​(Array a)
        Arc sine function
        参数:
        a - Array a
        返回:
        Result array
      • acos

        public static Array acos​(Array a)
        Arc cosine function
        参数:
        a - Array a
        返回:
        Result array
      • atan

        public static Array atan​(Array a)
        Arc tangen function
        参数:
        a - Array a
        返回:
        Result array
      • atan2

        public static Array atan2​(Array a,
                                  Array b)
        Arc tangen function
        参数:
        a - Array a
        b - Array b
        返回:
        Result array
      • cartesianToPolar

        public static Array[] cartesianToPolar​(Array x,
                                               Array y)
        Convert cartesian to polar coordinate
        参数:
        x - X array
        y - Y array
        返回:
        Angle and radius
      • polarToCartesian

        public static Array[] polarToCartesian​(Array B,
                                               Array r)
        Convert poar to cartesian coordinate
        参数:
        r - Radius
        B - Angle in radians
        返回:
        X and y in cartesian coordinate
      • cartesianToPolar

        public static double[] cartesianToPolar​(double x,
                                                double y)
        Convert cartesian to polar coordinate
        参数:
        x - X
        y - Y
        返回:
        Angle and radius
      • polarToCartesian

        public static double[] polarToCartesian​(double B,
                                                double r)
        Convert poar to cartesian coordinate
        参数:
        r - Radius
        B - Angle in radians
        返回:
        X and y in cartesian coordinate
      • copy

        public static Array copy​(Array a)
        Copy array
        参数:
        a - Input array
        返回:
        Copied array
      • section

        public static Array section​(Array a,
                                    int[] origin,
                                    int[] size,
                                    int[] stride)
                             throws InvalidRangeException
        Section array
        参数:
        a - Array a
        origin - Origin array
        size - Size array
        stride - Stride array
        返回:
        Result array
        抛出:
        InvalidRangeException
      • take

        public static Array take​(Array a,
                                 java.util.List<java.lang.Object> ranges)
        Take elements from an array along an axis.
        参数:
        a - The array
        ranges - The indices of the values to extract.
        返回:
        The returned array has the same type as a.
      • takeValues

        public static Array takeValues​(Array a,
                                       java.util.List<java.util.List<java.lang.Integer>> ranges)
        Take elements from an array.
        参数:
        a - The array
        ranges - The indices of the values to extract.
        返回:
        The returned array has the same type as a.
      • setSection_Mix

        public static Array setSection_Mix​(Array a,
                                           java.util.List<java.lang.Object> ranges,
                                           java.lang.Number v)
        Set section
        参数:
        a - Array a
        ranges - Ranges
        v - Number value
        返回:
        Result array
      • setSection_Mix

        public static Array setSection_Mix​(Array a,
                                           java.util.List<java.lang.Object> ranges,
                                           Array v)
        Set section
        参数:
        a - Array a
        ranges - Ranges
        v - Array value
        返回:
        Result array
      • setSection_List

        public static Array setSection_List​(Array a,
                                            java.util.List<java.util.List<java.lang.Integer>> ranges,
                                            java.lang.Number v)
        Set section
        参数:
        a - Array a
        ranges - Ranges
        v - Number value
        返回:
        Result array
      • setSection_List

        public static Array setSection_List​(Array a,
                                            java.util.List<java.util.List<java.lang.Integer>> ranges,
                                            Array v)
        Set section
        参数:
        a - Array a
        ranges - Ranges
        v - Array value
        返回:
        Result array
      • flip

        public static Array flip​(Array a,
                                 java.util.List<java.lang.Integer> idxs)
        Flip array
        参数:
        a - Array a
        idxs - Dimension index list
        返回:
        Result array
      • flip

        public static Array flip​(Array a,
                                 int idx)
        Flip array
        参数:
        a - Array a
        idx - Dimension idex
        返回:
        Result array
      • transpose

        public static Array transpose​(Array a,
                                      int dim1,
                                      int dim2)
        Transpose array
        参数:
        a - Array a
        dim1 - Dimension index 1
        dim2 - Dimension index 2
        返回:
        Result array
      • rot90

        public static Array rot90​(Array a,
                                  int k)
        Rotate an array by 90 degrees in counter-clockwise direction.
        参数:
        a - The array
        k - Rotate times
        返回:
        Rotated array
      • join

        public static Array join​(Array a,
                                 Array b,
                                 int dim)
        Join two arrays by a dimension
        参数:
        a - Array a
        b - Array b
        dim - Dimension for join
        返回:
        Joined array
      • getMinimum

        public static double getMinimum​(Array a)
        Get minimum value
        参数:
        a - Array a
        返回:
        Minimum value
      • getMaximum

        public static double getMaximum​(Array a)
        Get maximum value
        参数:
        a - Array a
        返回:
        Maximum value
      • getMinimum

        public static double getMinimum​(Array a,
                                        double missingv)
        Get minimum value
        参数:
        a - Array a
        missingv - Missing value
        返回:
        Minimum value
      • getMaximum

        public static double getMaximum​(Array a,
                                        double missingv)
        Get maximum value
        参数:
        a - Array a
        missingv - Missing value
        返回:
        Maximum value
      • min

        public static double min​(Array a)
        Compute minimum value of an array
        参数:
        a - Array a
        返回:
        Minimum value
      • max

        public static double max​(Array a)
        Compute maximum value of an array
        参数:
        a - Array a
        返回:
        Maximum value
      • sum

        public static Array sum​(java.util.List<Array> alist)
        Compute the sum arry from a list of arrays
        参数:
        alist - list of arrays
        返回:
        Sum array
      • sum

        public static double sum​(Array a)
        Summarize array
        参数:
        a - Array a
        返回:
        Summarize value
      • sum

        public static double sum​(Array a,
                                 double missingValue)
        Summarize array skip missing value
        参数:
        a - Array a
        missingValue - Missing value
        返回:
        Summarize value
      • cumsum

        public static java.util.List<java.lang.Double> cumsum​(Array a,
                                                              java.util.List<Range> ranges)
                                                       throws InvalidRangeException
        Compute cumulative sum value of an array
        参数:
        a - Array a
        ranges - Range list
        返回:
        Sum value
        抛出:
        InvalidRangeException
      • prodDouble

        public static double prodDouble​(Array a)
        Produce array
        参数:
        a - Array a
        返回:
        Produce value
      • aveDouble

        public static double aveDouble​(Array a)
        Average array
        参数:
        a - Array a
        返回:
        Average value
      • aveDouble

        public static double aveDouble​(Array a,
                                       double missingValue)
        Average array skip missing value
        参数:
        a - Array a
        missingValue - Missing value
        返回:
        Average value
      • mean

        public static double mean​(Array a)
        Compute mean value of an array
        参数:
        a - Array a
        返回:
        Mean value
      • mean

        public static Array mean​(java.util.List<Array> alist)
        Compute the arithmetic mean arry from a list of arrays
        参数:
        alist - list of arrays
        返回:
        Mean array
      • median

        public static double median​(Array a)
        Compute median value of an array
        参数:
        a - Array a
        返回:
        Median value
      • maximum

        public static Array maximum​(Array x1,
                                    Array x2)
        Element-wise maximum of array elements.
        参数:
        x1 - Array 1
        x2 - Array 2
        返回:
        The maximum of x1 and x2, element-wise.
      • fmax

        public static Array fmax​(Array x1,
                                 Array x2)
        Element-wise maximum of array elements, ignores NaNs.
        参数:
        x1 - Array 1
        x2 - Array 2
        返回:
        The maximum of x1 and x2, element-wise.
      • minimum

        public static Array minimum​(Array x1,
                                    Array x2)
        Element-wise minimum of array elements.
        参数:
        x1 - Array 1
        x2 - Array 2
        返回:
        The minimum of x1 and x2, element-wise.
      • fmin

        public static Array fmin​(Array x1,
                                 Array x2)
        Element-wise minimum of array elements, ignores NaNs.
        参数:
        x1 - Array 1
        x2 - Array 2
        返回:
        The minimum of x1 and x2, element-wise.
      • rolling_mean

        public static Array rolling_mean​(Array x,
                                         int window,
                                         boolean center)
        Moving average function
        参数:
        x - The data array
        window - Size of moving window
        center - Set the data in center moving window
        返回:
        Moving averaged array
      • missingToNaN

        public static void missingToNaN​(Array a,
                                        java.lang.Number missingv)
        Set missing value to NaN
        参数:
        a - Array a
        missingv - Missing value
      • setValue

        public static void setValue​(Array a,
                                    Array b,
                                    java.lang.Number value)
        Set value
        参数:
        a - Array a
        b - Array b - 0/1 data
        value - Value
      • setValue

        public static void setValue​(Array a,
                                    Array b,
                                    Array value)
        Set value
        参数:
        a - Array a
        b - Array b - 0/1 data
        value - Value array
      • asList

        public static java.util.List<java.lang.Object> asList​(Array a)
        As number list
        参数:
        a - Array a
        返回:
        Result number list
      • uv2ds

        public static Array[] uv2ds​(Array u,
                                    Array v)
        Get wind direction and wind speed from U/V
        参数:
        u - U component
        v - V component
        返回:
        Wind direction and wind speed
      • uv2ds

        public static double[] uv2ds​(double u,
                                     double v)
        Get wind direction and wind speed from U/V
        参数:
        u - U component
        v - V component
        返回:
        Wind direction and wind speed
      • ds2uv

        public static Array[] ds2uv​(Array windDir,
                                    Array windSpeed)
        Get wind U/V components from wind direction and speed
        参数:
        windDir - Wind direction
        windSpeed - Wind speed
        返回:
        Wind U/V components
      • ds2uv

        public static double[] ds2uv​(double windDir,
                                     double windSpeed)
        Get wind U/V components from wind direction and speed
        参数:
        windDir - Wind direction
        windSpeed - Wind speed
        返回:
        Wind U/V components
      • inPolygon

        public static Array inPolygon​(Array a,
                                      java.util.List<java.lang.Number> x,
                                      java.util.List<java.lang.Number> y,
                                      VectorLayer layer)
        In polygon function
        参数:
        a - Array a
        x - X dimension values
        y - Y dimension values
        layer - Polygon vector layer
        返回:
        Result array with cell values of 1 inside polygons and -1 outside polygons
      • inPolygon

        public static Array inPolygon​(Array a,
                                      java.util.List<java.lang.Number> x,
                                      java.util.List<java.lang.Number> y,
                                      PolygonShape ps)
        In polygon function
        参数:
        a - Array a
        x - X dimension values
        y - Y dimension values
        ps - Polygon shape
        返回:
        Result array with cell values of 1 inside polygons and -1 outside polygons
      • inPolygon

        public static Array inPolygon​(Array a,
                                      java.util.List<java.lang.Number> x,
                                      java.util.List<java.lang.Number> y,
                                      java.util.List<PolygonShape> polygons)
        In polygon function
        参数:
        a - Array a
        x - X dimension values
        y - Y dimension values
        polygons - PolygonShape list
        返回:
        Result array with cell values of 1 inside polygons and -1 outside polygons
      • inPolygon

        public static Array inPolygon​(Array x,
                                      Array y,
                                      java.util.List<PolygonShape> polygons)
        In polygon function
        参数:
        x - X coordinates
        y - Y coordinates
        polygons - PolygonShape list
        返回:
        Result boolean array
      • inPolygon

        public static Array inPolygon​(Array a,
                                      java.util.List<java.lang.Number> x,
                                      java.util.List<java.lang.Number> y,
                                      java.util.List<java.lang.Number> x_p,
                                      java.util.List<java.lang.Number> y_p)
        In polygon function
        参数:
        a - Array a
        x - X dimension values
        y - Y dimension values
        x_p - X coordinate of the polygon
        y_p - Y coordinate of the polygon
        返回:
        Result array with cell values of 1 inside polygons and -1 outside polygons
      • inPolygon

        public static Array inPolygon​(Array x,
                                      Array y,
                                      Array x_p,
                                      Array y_p)
        In polygon function
        参数:
        x - X coordinates
        y - Y coordinates
        x_p - X coordinate of the polygon
        y_p - Y coordinate of the polygon
        返回:
        Result boolean array
      • maskout

        public static Array maskout​(Array a,
                                    java.util.List<java.lang.Number> x,
                                    java.util.List<java.lang.Number> y,
                                    VectorLayer layer,
                                    java.lang.Number missingValue)
        Maskout function
        参数:
        a - Array a
        x - X dimension values
        y - Y dimension values
        layer - VectorLayer
        missingValue - Missing value
        返回:
        Result array with cell values of missing outside polygons
      • maskout

        public static Array maskout​(Array a,
                                    java.util.List<java.lang.Number> x,
                                    java.util.List<java.lang.Number> y,
                                    PolygonShape polygon,
                                    java.lang.Number missingValue)
        Maskout function
        参数:
        a - Array a
        x - X dimension values
        y - Y dimension values
        polygon - Polygon shape
        missingValue - Missing value
        返回:
        Result array with cell values of missing outside polygons
      • maskout

        public static Array maskout​(Array a,
                                    Array x,
                                    Array y,
                                    java.util.List<PolygonShape> polygons)
        Maskout function
        参数:
        a - Array a
        x - X Array
        y - Y Array
        polygons - Polygons for maskout
        返回:
        Result array with cell values of missing outside polygons
      • maskin

        public static Array maskin​(Array a,
                                   Array x,
                                   Array y,
                                   java.util.List<PolygonShape> polygons)
        Maskin function
        参数:
        a - Array a
        x - X Array
        y - Y Array
        polygons - Polygons for maskin
        返回:
        Result array with cell values of missing inside polygons
      • maskout_Remove

        public static Array[] maskout_Remove​(Array a,
                                             Array x,
                                             Array y,
                                             java.util.List<PolygonShape> polygons)
        Maskout function
        参数:
        a - Array a
        x - X Array
        y - Y Array
        polygons - Polygons for maskout
        返回:
        Result arrays removing cells outside polygons
      • maskin_Remove

        public static Array[] maskin_Remove​(Array a,
                                            Array x,
                                            Array y,
                                            java.util.List<PolygonShape> polygons)
        Maskin function
        参数:
        a - Array a
        x - X Array
        y - Y Array
        polygons - Polygons for maskin
        返回:
        Result arrays removing cells inside polygons
      • maskout

        public static Array maskout​(Array a,
                                    java.util.List<java.lang.Number> x,
                                    java.util.List<java.lang.Number> y,
                                    java.util.List<PolygonShape> polygons)
        Maskout function
        参数:
        a - Array a
        x - X dimension values
        y - Y dimension values
        polygons - PolygonShape list
        返回:
        Result array with cell values of missing outside polygons
      • maskout

        public static Array maskout​(Array a,
                                    java.util.List<java.lang.Number> x,
                                    java.util.List<java.lang.Number> y,
                                    java.util.List<PolygonShape> polygons,
                                    java.lang.Number missingValue)
        Maskout function
        参数:
        a - Array a
        x - X dimension values
        y - Y dimension values
        polygons - PolygonShape list
        missingValue - Missing value
        返回:
        Result array with cell values of missing outside polygons
      • maskout

        public static Array maskout​(Array a,
                                    Array m,
                                    java.lang.Number missingValue)
        Maskout function
        参数:
        a - Array a
        m - Array mask
        missingValue - Missing value
        返回:
        Result array
      • maskout

        public static Array maskout​(Array a,
                                    Array m)
        Maskout function
        参数:
        a - Array a
        m - Array mask
        返回:
        Result array
      • maskin

        public static Array maskin​(Array a,
                                   Array m)
        Maskin function
        参数:
        a - Array a
        m - Array mask
        返回:
        Result array
      • getR

        public static float getR​(java.util.List<java.lang.Number> xData,
                                 java.util.List<java.lang.Number> yData)
        Get correlation coefficient How well did the forecast values correspond to the observed values? Range: -1 to 1. Perfect score: 1.
        参数:
        xData - X data array
        yData - Y data array
        返回:
        Correlation coefficent
      • getR

        public static float getR​(Array xData,
                                 Array yData)
        Get correlation coefficient How well did the forecast values correspond to the observed values? Range: -1 to 1. Perfect score: 1.
        参数:
        xData - X data array
        yData - Y data array
        返回:
        Correlation coefficent
      • leastSquareTrend

        public static double[] leastSquareTrend​(java.util.List<java.lang.Number> xData,
                                                java.util.List<java.lang.Number> yData)
        Determine the least square trend equation - linear fitting
        参数:
        xData - X data array
        yData - Y data array
        返回:
        Result array - y intercept and slope
      • lineRegress

        public static double[] lineRegress​(java.util.List<java.lang.Number> xData,
                                           java.util.List<java.lang.Number> yData)
        Linear regress
        参数:
        xData - X data array
        yData - Y data array
        返回:
        Result array - y intercept, slope and correlation coefficent
      • lineRegress

        public static double[] lineRegress​(Array xData,
                                           Array yData)
        Linear regress
        参数:
        xData - X data array
        yData - Y data array
        返回:
        Slope, intercept, correlation coefficent, two-sided p-value, the standard error of the estimate for the slope, valid data number
      • polyVal

        public static Array polyVal​(java.util.List<java.lang.Number> p,
                                    Array x)
        Evaluate a polynomial at specific values. If p is of length N, this function returns the value: p[0]*x**(N-1) + p[1]*x**(N-2) + ... + p[N-2]*x + p[N-1]
        参数:
        p - array_like or poly1d object
        x - array_like or poly1d object
        返回:
        ndarray or poly1d
      • cdiff

        public static Array cdiff​(Array data,
                                  int dimIdx)
        Performs a centered difference operation on a grid data along one dimension direction
        参数:
        data - The grid data
        dimIdx - Direction dimension index
        返回:
        Result grid data
      • cdiff_bak

        public static Array cdiff_bak​(Array data,
                                      boolean isX)
        Performs a centered difference operation on a grid data in the x or y direction
        参数:
        data - The grid data
        isX - If is x direction
        返回:
        Result grid data
      • hcurl

        public static Array hcurl​(Array uData,
                                  Array vData,
                                  java.util.List<java.lang.Number> xx,
                                  java.util.List<java.lang.Number> yy)
        Calculates the vertical component of the curl (ie, vorticity)
        参数:
        uData - U component
        vData - V component
        xx - X dimension value
        yy - Y dimension value
        返回:
        Curl
      • hdivg

        public static Array hdivg​(Array uData,
                                  Array vData,
                                  java.util.List<java.lang.Number> xx,
                                  java.util.List<java.lang.Number> yy)
        Calculates the horizontal divergence using finite differencing
        参数:
        uData - U component
        vData - V component
        xx - X dimension value
        yy - Y dimension value
        返回:
        Divergence
      • magnitude

        public static Array magnitude​(Array uData,
                                      Array vData)
        Take magnitude value from U/V grid data
        参数:
        uData - U grid data
        vData - V grid data
        返回:
        Magnitude grid data
      • tc2tf

        public static Array tc2tf​(Array tc)
        Calculate fahrenheit temperature from celsius temperature
        参数:
        tc - Celsius temperature
        返回:
        Fahrenheit temperature
      • tf2tc

        public static Array tf2tc​(Array tf)
        Calculate celsius temperature from fahrenheit temperature
        参数:
        tf - Fahrenheit temperature
        返回:
        Celsius temperature
      • qair2rh

        public static Array qair2rh​(Array qair,
                                    Array temp,
                                    double press)
        Calculate relative humidity from specific humidity
        参数:
        qair - Specific humidity, dimensionless (e.g. kg/kg) ratio of water mass / total air mass
        temp - Temperature - degree c
        press - Pressure - hPa (mb)
        返回:
        Relative humidity as percent (i.e. 80%)
      • qair2rh

        public static Array qair2rh​(Array qair,
                                    Array temp,
                                    Array press)
        Calculate relative humidity
        参数:
        qair - Specific humidity, dimensionless (e.g. kg/kg) ratio of water mass / total air mass
        temp - Temperature - degree c
        press - Pressure - hPa (mb)
        返回:
        Relative humidity as percent (i.e. 80%)
      • press2Height

        public static Array press2Height​(Array press)
        Calculate height from pressure
        参数:
        press - Pressure - hPa
        返回:
        Height - m
      • height2Press

        public static Array height2Press​(Array height)
        Calculate pressure from height
        参数:
        height - Height - m
        返回:
        Pressure - hPa