类 GridArray


  • public class GridArray
    extends Object
    作者:
    yaqiang
    • 字段详细资料

      • xArray

        public double[] xArray
      • yArray

        public double[] yArray
      • missingValue

        public double missingValue
      • fieldName

        public String fieldName
    • 构造器详细资料

      • GridArray

        public GridArray()
        Constructor
      • GridArray

        public GridArray​(GridArray aGridData)
        Constructor
        参数:
        aGridData - The grid data
      • GridArray

        public GridArray​(double xStart,
                         double xDelt,
                         int xNum,
                         double yStart,
                         double yDelt,
                         int yNum)
        Constructor
        参数:
        xStart - xArray start
        xDelt - xArray delt
        xNum - xArray number
        yStart - yArray start
        yDelt - yArray delt
        yNum - yArray number
      • GridArray

        public GridArray​(org.meteoinfo.ndarray.Array array,
                         List<Number> xdata,
                         List<Number> ydata,
                         double missingValue,
                         ProjectionInfo projInfo)
        Constructor
        参数:
        array - Data array
        xdata - X data
        ydata - Y data
        missingValue - Missing value
        projInfo - Projection info
      • GridArray

        public GridArray​(org.meteoinfo.ndarray.Array array,
                         org.meteoinfo.ndarray.Array xdata,
                         org.meteoinfo.ndarray.Array ydata,
                         Number missingValue,
                         ProjectionInfo projInfo)
        Constructor
        参数:
        array - Data array
        xdata - X data
        ydata - Y data
        missingValue - Missing value
        projInfo - Projection info
      • GridArray

        public GridArray​(org.meteoinfo.ndarray.Array array,
                         org.meteoinfo.ndarray.Array xdata,
                         org.meteoinfo.ndarray.Array ydata,
                         Number missingValue)
        Constructor
        参数:
        array - Data array
        xdata - X data
        ydata - Y data
        missingValue - Missing value
    • 方法详细资料

      • getData

        public org.meteoinfo.ndarray.Array getData()
        Get data array
        返回:
        Data array
      • setData

        public void setData​(org.meteoinfo.ndarray.Array value)
        Set data array
        参数:
        value - Data array
      • getXNum

        public int getXNum()
        Get xArray number
        返回:
        xArray number
      • getYNum

        public int getYNum()
        Get yArray number
        返回:
        yArray number
      • getXDelt

        public double getXDelt()
        Get xArray delt
        返回:
        xArray delt
      • getYDelt

        public double getYDelt()
        Get yArray delt
        返回:
        yArray delt
      • getExtent

        public org.meteoinfo.common.Extent getExtent()
        Get Extent
        返回:
        Extent
      • isGlobal

        public boolean isGlobal()
        Get if the data is global
        返回:
        If the data is global
      • isXStagger

        public boolean isXStagger()
        Get if is x stagger
        返回:
        Boolean
      • setXStagger

        public void setXStagger​(boolean value)
        Set if is x stagger
        参数:
        value - Boolean
      • isYStagger

        public boolean isYStagger()
        Get if is y stagger
        返回:
        Boolean
      • setYStagger

        public void setYStagger​(boolean value)
        Set if is y stagger
        参数:
        value - Boolean
      • getValue

        public Number getValue​(int i,
                               int j)
        Get value
        参数:
        i - I index
        j - J index
        返回:
        Value
      • getDoubleValue

        public double getDoubleValue​(int i,
                                     int j)
        Get double value
        参数:
        i - I index
        j - J index
        返回:
        Double value
      • getDimensions

        public List<org.meteoinfo.ndarray.Dimension> getDimensions()
        Get dimensions
        返回:
        Dimensions
      • getXMin

        public double getXMin()
        Get minimum x
        返回:
        Minimum x
      • getXMax

        public double getXMax()
        Get maximum x
        返回:
        Maximum x
      • getYMin

        public double getYMin()
        Get minimum y
        返回:
        Minimum y
      • getYMax

        public double getYMax()
        Get maximum y
        返回:
        Maximum y
      • getBorderXMin

        public double getBorderXMin()
        Get minimum x of the grid border
        返回:
        Minimum x of the grid border
      • getBorderXMax

        public double getBorderXMax()
        Get maximum x of the grid border
        返回:
        Maximum x of the grid border
      • getBorderYMin

        public double getBorderYMin()
        Get minimum y of the grid border
        返回:
        Minimum y of the grid border
      • getBorderYMax

        public double getBorderYMax()
        Get maximum y of the grid border
        返回:
        Maximum y of the grid border
      • getIJIndex

        public int[] getIJIndex​(double x,
                                double y)
        Get i/j index of a point in the grid
        参数:
        x - The x coordinate
        y - The y coordinate
        返回:
        I/J index array
      • testUniqueValues

        public boolean testUniqueValues()
        Test unique values
        返回:
        True if unique value number less then 20
      • getUniqueValues

        public List<Number> getUniqueValues()
        Get unique values
        返回:
        Unique values
      • getGridDataSetting

        public GridDataSetting getGridDataSetting()
        Get grid data setting
        返回:
        Grid data setting
      • getMaxMinValue

        public boolean getMaxMinValue​(double[] maxmin)
        Get maximum and minimum values
        参数:
        maxmin - Max/Min array
        返回:
        If has undefine data
      • min

        public double min()
        Minimum
        返回:
        Minimum value
      • max

        public double max()
        Maximum
        返回:
        Maximum value
      • hasNaN

        public boolean hasNaN()
        Get if has NaN value
        返回:
        Boolean
      • project

        public GridArray project​(ProjectionInfo toProj)
                          throws org.meteoinfo.ndarray.InvalidRangeException
        Project grid data
        参数:
        toProj - To projection
        返回:
        Projected grid data
        抛出:
        org.meteoinfo.ndarray.InvalidRangeException
      • project

        public GridArray project​(ProjectionInfo fromProj,
                                 ProjectionInfo toProj,
                                 org.meteoinfo.common.ResampleMethods resampleMethod)
                          throws org.meteoinfo.ndarray.InvalidRangeException
        Project grid data
        参数:
        fromProj - From projection
        toProj - To projection
        resampleMethod - Interpolation method
        返回:
        Porjected grid data
        抛出:
        org.meteoinfo.ndarray.InvalidRangeException
      • saveAsSurferASCIIFile

        public void saveAsSurferASCIIFile​(String aFile)
        Save as Surfer ASCII data file
        参数:
        aFile - File path
      • saveAsESRIASCIIFile

        public void saveAsESRIASCIIFile​(String aFile)
        Save as ESRI ASCII data file
        参数:
        aFile - File path
      • saveAsBILFile

        public void saveAsBILFile​(String fileName)
                           throws IOException
        Save as BIL data file
        参数:
        fileName - File path
        抛出:
        IOException
      • saveAsMICAPS4File

        public void saveAsMICAPS4File​(String aFile,
                                      String description,
                                      LocalDateTime aTime,
                                      int hours,
                                      int level,
                                      float smooth,
                                      float boldValue,
                                      String floatFormat)
                               throws IOException
        Save as MICAPS 4 data file
        参数:
        aFile - File path
        description - Description
        aTime - Data time
        hours - Hours
        level - Levels
        smooth - Smooth coefficient
        boldValue - Bold value
        floatFormat - Float format
        抛出:
        IOException
      • saveAsMICAPS4File

        public void saveAsMICAPS4File​(String aFile,
                                      String description,
                                      LocalDateTime aTime,
                                      int hours,
                                      int level,
                                      float smooth,
                                      float boldValue,
                                      String floatFormat,
                                      ProjectionInfo projInfo)
                               throws IOException
        Save as MICAPS 4 data file
        参数:
        aFile - File path
        description - Description
        aTime - Data time
        hours - Hours
        level - Levels
        smooth - Smooth coefficient
        boldValue - Bold value
        floatFormat - Float format
        projInfo - Projection info
        抛出:
        IOException
      • clone

        public Object clone()
        Clone
        覆盖:
        clone 在类中 Object
        返回:
        Grid data object