类 DataMath


  • public abstract class DataMath
    extends Object
    Template
    作者:
    Yaqiang Wang
    • 构造器详细资料

      • DataMath

        public DataMath()
    • 方法详细资料

      • add

        public static Object add​(Object a,
                                 Object b)
        Tack add operator of two objects
        参数:
        a - Object a
        b - Object b
        返回:
        Result object
      • sub

        public static Object sub​(Object a,
                                 Object b)
        Take subtract operator of two objects
        参数:
        a - Object a
        b - Object b
        返回:
        Result object
      • sub

        public static GridData sub​(double value,
                                   GridData gridData)
        Subtract operation between a double value and a grid data
        参数:
        value - Double value
        gridData - Grid data
        返回:
        Result grid data
      • sub

        public static StationData sub​(double value,
                                      StationData stData)
        Subtract operator between a double value and a station data
        参数:
        value - The value
        stData - Station data
        返回:
        Result station data
      • mul

        public static Object mul​(Object a,
                                 Object b)
        Take multiply operator of two objects
        参数:
        a - Object a
        b - Object b
        返回:
        Result object
      • div

        public static Object div​(Object a,
                                 Object b)
        Take divide operator of two objects
        参数:
        a - Object a
        b - Object b
        返回:
        Result object
      • div_1

        public static GridData div_1​(double value,
                                     GridData gridData)
        Divide operation between a double value and a grid data
        参数:
        value - Double value
        gridData - Grid data
        返回:
        Result grid data
      • div_1

        public static StationData div_1​(double value,
                                        StationData stData)
        Divide operator between a double value and a station data
        参数:
        value - The value
        stData - Station data
        返回:
        Result station data
      • getUVFromDS

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

        public static GridData[] getUVFromDS​(GridData windDirData,
                                             GridData windSpeedData)
        Get wind U/V grid data from wind direction/speed grid data
        参数:
        windDirData - Wind directoin grid data
        windSpeedData - Wind speed grid data
        返回:
        U/V grid data
      • getUVFromDS

        public static StationData[] getUVFromDS​(StationData windDirData,
                                                StationData windSpeedData)
        Get wind U/V station data from wind direction/speed station data
        参数:
        windDirData - Wind direction station data
        windSpeedData - Wind speed station data
        返回:
        U/V station data
      • getDSFromUV

        public static double[] getDSFromUV​(double U,
                                           double V)
        Get wind direction/speed from U/V
        参数:
        U - The U value
        V - The V value
        返回:
        Wind direction/speed array
      • getDSFromUV

        public static GridData[] getDSFromUV​(GridData uData,
                                             GridData vData)
        Get wind direction/speed grid data from wind U/V grid data
        参数:
        uData - U grid data
        vData - V grid data
        返回:
        Wind direction/speed grid data
      • getDSFromUV

        public static StationData[] getDSFromUV​(StationData uData,
                                                StationData vData)
        Get wind direction/speed station data from wind U/V station data
        参数:
        uData - U station data
        vData - V station data
        返回:
        Wind direction/speed station data
      • getEndPoint

        public static double[] getEndPoint​(double x,
                                           double y,
                                           double angle,
                                           double len)
        Get end point by start point, angle and length
        参数:
        x - Start point x
        y - Start point y
        angle - Angle
        len - Length
        返回:
        End point x/y values;
      • sum

        public static double sum​(double[] values)
        Summary the value array
        参数:
        values - Values
        返回:
        Summary
      • abs

        public static Object abs​(Object a)
        Take abstract value
        参数:
        a - Object a
        返回:
        Result object
      • asin

        public static Object asin​(Object a)
        Take anti-sine value
        参数:
        a - Object a
        返回:
        Result object
      • acos

        public static Object acos​(Object a)
        Take anti-cosine value
        参数:
        a - Object a
        返回:
        Result object
      • atan

        public static Object atan​(Object a)
        Take anti-tangent value
        参数:
        a - Object a
        返回:
        Result object
      • sin

        public static Object sin​(Object a)
        Take sine value
        参数:
        a - Object a
        返回:
        Result object
      • cos

        public static Object cos​(Object a)
        Take cosine value
        参数:
        a - Object a
        返回:
        Result object
      • tan

        public static Object tan​(Object a)
        Take tangent value
        参数:
        a - Object a
        返回:
        Result object
      • exp

        public static Object exp​(Object a)
        Take e base power value
        参数:
        a - Object a
        返回:
        Result object
      • pow

        public static Object pow​(Object a,
                                 double p)
        Take power value
        参数:
        a - Object a
        p - Power value
        返回:
        Result object
      • log

        public static Object log​(Object a)
        Take logrithm value
        参数:
        a - Object a
        返回:
        Result object
      • log10

        public static Object log10​(Object a)
        Take 10 base logrithm value
        参数:
        a - Object a
        返回:
        Result object
      • sqrt

        public static Object sqrt​(Object a)
        Take squre root value
        参数:
        a - Object a
        返回:
        Result object
      • average

        public static GridData average​(List<GridData> gDataList)
        Calculate average grid data from grid data list
        参数:
        gDataList - Grid data list
        返回:
        Averaged grid data
      • average

        public static GridData average​(List<GridData> gDataList,
                                       boolean ignoreUndef)
        Calculate average grid data from grid data list
        参数:
        gDataList - Grid data list
        ignoreUndef - If ignore missing data
        返回:
        Averaged grid data
      • average

        public static GridData average​(List<GridData> gDataList,
                                       boolean ignoreUndef,
                                       int validNum)
        Calculate average grid data from grid data list
        参数:
        gDataList - Grid data list
        ignoreUndef - If ignore missing value
        validNum - Valid number
        返回:
        Averaged grid data
      • mean

        public static StationData mean​(List<StationData> datalist)
        Compute the arithmetic mean station data
        参数:
        datalist - station data list
        返回:
        Mean station data
      • leastSquareTrend

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

        public static GridData leastSquareTrend​(List<GridData> dataList,
                                                double[] xData)
        Determine the least square trend equation - linear fitting
        参数:
        dataList - Grid data list
        xData - X data array
        返回:
        Result grid data - slop
      • getR

        public static float getR​(List<Double> xData,
                                 List<Double> 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​(ColumnData xcData,
                                 ColumnData ycData)
        Get correlation coefficient How well did the forecast values correspond to the observed values? Range: -1 to 1. Perfect score: 1.
        参数:
        xcData - X data array
        ycData - Y data array
        返回:
        Correlation coefficent
      • mann_Kendall_Trend

        public static double[] mann_Kendall_Trend​(List<Double> ts)
        Mann-Kendall trend statistics
        参数:
        ts - Input data list
        返回:
        Result array - z (trend)/beta (change value per unit time)
      • mann_Kendall_Trend

        public static double[] mann_Kendall_Trend​(double[] ts)
        Mann-Kendall trend statistics
        参数:
        ts - Input data array
        返回:
        Result array - z (trend)/beta (change value per unit time)
      • mann_Kendall_Trend_1

        public static double[] mann_Kendall_Trend_1​(double[] ts)
        Mann-Kendall trend statistics
        参数:
        ts - Input data array
        返回:
        Result array - z (trend)/beta (change value per unit time)
      • magnitude

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

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

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

        public static GridData hcurl​(GridData uData,
                                     GridData vData)
        Calculates the vertical component of the curl (ie, vorticity)
        参数:
        uData - U component
        vData - V component
        返回:
        Curl
      • hdivg

        public static GridData hdivg​(GridData uData,
                                     GridData vData)
        Calculates the horizontal divergence using finite differencing
        参数:
        uData - U component
        vData - V component
        返回:
        Divergence
      • gauss2Lats

        public static Object[] gauss2Lats​(int nlat)
        This function provides latitudes on a Gaussian grid from the number of latitude lines
        参数:
        nlat - the number of latitude lines
        返回:
        The latitudes of hemisphere