类 ArrayUtil
- java.lang.Object
-
- org.meteoinfo.bak.ArrayUtil
-
public class ArrayUtil extends java.lang.Object- 作者:
- yaqiang
-
-
构造器概要
构造器 构造器 说明 ArrayUtil()
-
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 static ArrayargSort(Array a, java.lang.Integer axis)Get sorted array index along an axisstatic Arrayarray(java.lang.Object data)Create an arraystatic Arrayarray(java.util.ArrayList data)Create an arraystatic Arrayarray(java.util.List<java.lang.Object> data)Create an arraystatic ArrayarrayRange(java.lang.Number start, java.lang.Number stop, java.lang.Number step)Array rangestatic ArrayarrayRange_bak(java.lang.Number start, java.lang.Number stop, java.lang.Number step)Array rangestatic ArrayarrayRange1(java.lang.Number start, int length, java.lang.Number step)Array rangestatic Arraybroadcast(Array a, int[] shape)Broadcast array to a new shapestatic Arraybroadcast(Array a, java.util.List<java.lang.Integer> shape)Broadcast array to a new shapestatic Arrayconcatenate(java.util.List<Array> arrays, java.lang.Integer axis)Concatenate arrays to one array along a axisstatic Arrayconcatenate(Array a, Array b, java.lang.Integer axis)Concatenate two arrays to one array along a axisstatic java.lang.StringconvertToString(Array a)Array to stringstatic PolygonShapeconvexHull(Array x, Array y)Computes the smallest convexPolygonthat contains all the pointsprotected static voidcopyTo1DJavaArray(IndexIterator iter, java.lang.Object javaArray)protected static voidcopyTo1DJavaArray_Long(IndexIterator iter, java.lang.Object javaArray)static java.lang.ObjectcopyToNDJavaArray(Array a)Convert array to N-Dimension double Java arraystatic java.lang.ObjectcopyToNDJavaArray(Array a, java.lang.String dtype)Convert array to N-Dimension double Java arraystatic java.lang.ObjectcopyToNDJavaArray_Double(Array a)Convert array to N-Dimension double Java arraystatic java.lang.ObjectcopyToNDJavaArray_Long(Array a)Convert array to N-Dimension double Java arraystatic Arraycressman(java.util.List<java.lang.Number> x_s, java.util.List<java.lang.Number> y_s, Array v_s, java.util.List<java.lang.Number> X, java.util.List<java.lang.Number> Y, java.util.List<java.lang.Number> radList)Cressman analysisstatic Arraycressman_bak(java.util.List<java.lang.Number> x_s, java.util.List<java.lang.Number> y_s, Array v_s, java.util.List<java.lang.Number> X, java.util.List<java.lang.Number> Y, java.util.List<java.lang.Number> radList)Cressman analysisstatic java.lang.StringdataTypeString(DataType dt)Get data type stringstatic Arraydelete(Array a, int idx, int axis)Return a new array with sub-arrays along an axis deletedstatic Arraydelete(Array a, java.util.List<java.lang.Integer> idx, int axis)Return a new array with sub-arrays along an axis deletedstatic Arraydiag(Array a, int k)Extract a diagonal or construct a diagonal array.static Array[]extendHalfCell(Array x, Array y)Extend the grid to half cell, so the grid points are the centers of the cellsstatic Arrayeye(int n, int m, int k, java.lang.String dtype)Return a 2-D array with ones on the diagonal and zeros elsewhere.static java.lang.Object[]findIndices(java.util.List<java.util.List<java.lang.Number>> points, java.util.List<java.lang.Number> xi)Find indicesstatic java.lang.Object[]findIndices(java.util.List<Array> points, Array xi)Find indicesstatic Arrayfull(java.util.List<java.lang.Integer> shape, java.lang.Object fillValue, DataType dtype)Return a new array of given shape and type, filled with fill value.static java.util.List<Array>getArraysFromStationData(StationData stdata)Get array list from StationDatastatic intgetDimIndex(Array dim, double v)Get value index in a dimension arraystatic java.util.List<Array>histogram(Array a, double[] bins)Histogram x/y arraystatic java.util.List<Array>histogram(Array a, int nbins)Histogram x/y arraystatic java.util.List<Array>histogram(Array a, Array bins)Histogram x/y arraystatic Arrayidentity(int n, java.lang.String dtype)Return the identity array - a square array with ones on the main diagonal.static Arrayinterpn(java.util.List<Array> points, Array values, java.util.List<Array> xi)Multidimensional interpolation on regular grids.static java.lang.Objectinterpn(java.util.List<Array> points, Array values, Array xi)Multidimensional interpolation on regular grids.static doubleinterpn_s(java.util.List<java.util.List<java.lang.Number>> points, Array values, java.util.List<java.lang.Number> xi)Multidimensional interpolation on regular grids.static doubleinterpn_s(java.util.List<Array> points, Array values, Array xi)Multidimensional interpolation on regular grids.Arrayinterpolate(Array a, java.util.List<java.lang.Number> X, java.util.List<java.lang.Number> Y)Interpolate array datastatic Arrayinterpolate_1d(double x, Array xp, Array a, int axis)Interpolates data with any shape over a specified axis.static Arrayinterpolate_1d(Array xa, Array xp, Array a, int axis)Interpolates data with any shape over a specified axis.static Arrayinterpolation_IDW_Neighbor(java.util.List<java.lang.Number> x_s, java.util.List<java.lang.Number> y_s, Array a, java.util.List<java.lang.Number> X, java.util.List<java.lang.Number> Y, java.lang.Integer points)Interpolation with IDW neighbor methodstatic Arrayinterpolation_IDW_Neighbor_bak(java.util.List<java.lang.Number> x_s, java.util.List<java.lang.Number> y_s, Array a, java.util.List<java.lang.Number> X, java.util.List<java.lang.Number> Y, int NumberOfNearestNeighbors)Interpolation with IDW neighbor methodstatic Arrayinterpolation_IDW_Radius(java.util.List<java.lang.Number> x_s, java.util.List<java.lang.Number> y_s, Array a, java.util.List<java.lang.Number> X, java.util.List<java.lang.Number> Y, int neededPointNum, double radius)Interpolation with IDW radius methodstatic Arrayinterpolation_IDW_Radius_bak(java.util.List<java.lang.Number> x_s, java.util.List<java.lang.Number> y_s, Array a, java.util.List<java.lang.Number> X, java.util.List<java.lang.Number> Y, int NeededPointNum, double radius)Interpolation with IDW radius methodstatic Arrayinterpolation_Inside(java.util.List<java.lang.Number> x_s, java.util.List<java.lang.Number> y_s, Array a, java.util.List<java.lang.Number> X, java.util.List<java.lang.Number> Y, boolean centerPoint)Interpolate with inside method - The grid cell value is the average value of the inside points or fill value if no inside point.static Arrayinterpolation_Inside(Array x_s, Array y_s, Array a, Array X, Array Y, boolean centerPoint)Interpolate with inside method - The grid cell value is the average value of the inside points or fill value if no inside point.static java.lang.Objectinterpolation_Inside_Count(java.util.List<java.lang.Number> x_s, java.util.List<java.lang.Number> y_s, java.util.List<java.lang.Number> X, java.util.List<java.lang.Number> Y, boolean pointDensity, boolean centerPoint)Interpolate with inside method - The grid cell value is the count number of the inside points or fill value if no inside point.static Arrayinterpolation_Inside_Max(java.util.List<java.lang.Number> x_s, java.util.List<java.lang.Number> y_s, Array a, java.util.List<java.lang.Number> X, java.util.List<java.lang.Number> Y, boolean centerPoint)Interpolate with inside method - The grid cell value is the maximum value of the inside points or fill value if no inside point.static Arrayinterpolation_Inside_Min(java.util.List<java.lang.Number> x_s, java.util.List<java.lang.Number> y_s, Array a, java.util.List<java.lang.Number> X, java.util.List<java.lang.Number> Y, boolean centerPoint)Interpolate with inside method - The grid cell value is the minimum value of the inside points or fill value if no inside point.static Arrayinterpolation_Nearest(java.util.List<java.lang.Number> x_s, java.util.List<java.lang.Number> y_s, Array a, java.util.List<java.lang.Number> X, java.util.List<java.lang.Number> Y, double radius)Interpolate with nearest methodstatic Arrayinterpolation_Surface(Array x_s, Array y_s, Array a, Array X, Array Y)Interpolate with surface methodstatic Arrayinterpolation_Surface_1(Array x_s, Array y_s, Array a, Array X, Array Y, double unDefData)Interpolate with surface methodstatic Arrayinterpolation_Surface_bak(Array x_s, Array y_s, Array a, Array X, Array Y)Interpolate with surface methodstatic ArraylineSpace(java.lang.Number start, java.lang.Number stop, int n, boolean endpoint)Array line spacestatic ArraylineSpace_bak(java.lang.Number start, java.lang.Number stop, int n, boolean endpoint)Array line spacestatic Arraylinint2(Array a, Array X, Array Y, Array newX, Array newY)Interpolates from a rectilinear grid to another rectilinear grid using bilinear interpolation.static DataTypemergeDataType(DataType dt1, DataType dt2)Merge data type to one data typestatic Array[]meshgrid(Array... xs)Mesh gridstatic Array[]meshgrid(Array x, Array y)Mesh gridstatic VectorLayermeshLayer(Array x_s, Array y_s, Array a, LegendScheme ls)Create mesh polygon layerstatic VectorLayermeshLayer(Array x_s, Array y_s, Array a, LegendScheme ls, double lonlim)Create mesh polygon layerstatic intnumASCIICol(java.lang.String fileName, java.lang.String delimiter, int headerLines)Get row number of a ASCII filestatic intnumASCIIRow(java.lang.String fileName)Get row number of a ASCII filestatic Arrayones(int n)Get ones arraystatic Arrayones(java.util.List<java.lang.Integer> shape, java.lang.String dtype)Get ones arraystatic doublerand()Get random valuestatic Arrayrand(int n)Get random array - one dimensionstatic Arrayrand(java.util.List<java.lang.Integer> shape)Get random arraystatic ArrayreadASCIIFile(java.lang.String fileName, java.lang.String delimiter, int headerLines, java.lang.String dataType, java.util.List<java.lang.Integer> shape, boolean readFirstCol)Read ASCII data file to an arraystatic ArrayreadBinFile(java.lang.String fn, java.util.List<java.lang.Integer> dims, java.lang.String dataType, int skip, java.lang.String byteOrder)Read array from a binary filestatic Arrayrepeat(java.lang.Number v, int n)Repeat a value n timesstatic Arrayrepeat(Array a, java.util.List<java.lang.Integer> repeats)Repeat elements of an array.static Arrayrepeat(Array a, java.util.List<java.lang.Integer> repeats, int axis)Repeat elements of an array.static Arrayreproject(Array data, java.util.List<java.lang.Number> x, java.util.List<java.lang.Number> y, java.util.List<java.lang.Number> rx, java.util.List<java.lang.Number> ry, ProjectionInfo fromProj, ProjectionInfo toProj, double fill_value, ResampleMethods resampleMethod)Reprojectstatic Arrayreproject(Array data, java.util.List<java.lang.Number> x, java.util.List<java.lang.Number> y, Array rx, Array ry, ProjectionInfo fromProj, ProjectionInfo toProj, double fill_value, ResampleMethods resampleMethod)Reprojectstatic Arrayreproject(Array data, java.util.List<java.lang.Number> x, java.util.List<java.lang.Number> y, Array rx, Array ry, ProjectionInfo fromProj, ProjectionInfo toProj, ResampleMethods resampleMethod)Reprojectstatic java.lang.Object[]reproject(Array data, java.util.List<java.lang.Number> xx, java.util.List<java.lang.Number> yy, ProjectionInfo fromProj, ProjectionInfo toProj)Project grid datastatic java.lang.Object[]reproject(Array data, java.util.List<java.lang.Number> xx, java.util.List<java.lang.Number> yy, ProjectionInfo fromProj, ProjectionInfo toProj, ResampleMethods method)Project grid datastatic Array[]reproject(Array x, Array y, ProjectionInfo toProj)Reprojectstatic Array[]reproject(Array x, Array y, ProjectionInfo fromProj, ProjectionInfo toProj)Reprojectstatic java.lang.Object[]reproject_back(Array data, java.util.List<java.lang.Number> xx, java.util.List<java.lang.Number> yy, ProjectionInfo fromProj, ProjectionInfo toProj)Project grid datastatic Arrayresample_Bilinear(Array a, java.util.List<java.lang.Number> X, java.util.List<java.lang.Number> Y, java.util.List<java.lang.Number> newX, java.util.List<java.lang.Number> newY)Resample grid array with bilinear methodstatic Arrayresample_Bilinear(Array a, Array X, Array Y, Array newX, Array newY)Resample grid array with bilinear methodstatic Arrayresample_Neighbor(Array a, Array X, Array Y, Array newX, Array newY)Resample grid array with neighbor methodstatic voidsaveASCIIFile(java.lang.String fn, Array a, int colNum, java.lang.String format, java.lang.String delimiter)Save an array data to a ASCII filestatic voidsaveBinFile(java.lang.String fn, Array a, java.lang.String byteOrder, boolean append, boolean sequential)Save an array data to a binary filestatic intsearchSorted(java.util.List<java.lang.Number> a, double v)Search sorted list indexstatic intsearchSorted(Array a, double v)Search sorted list indexstatic Arraysmooth5(Array a)Smooth with 5 pointsstatic Arraysmooth5(Array a, int rowNum, int colNum, double unDefData)Smooth with 5 pointsstatic Arraysmooth9(Array a)Smooth with 9 pointsstatic Arraysort(Array a, java.lang.Integer axis)Sort array along an axisstatic Arraytile(java.lang.Number v, int n)Repeat a value n timesstatic Arraytile(java.lang.Number v, java.util.List<java.lang.Integer> repeats)Repeat a value n timesstatic Arraytile(Array a, java.util.List<java.lang.Integer> repeats)Repeat elements of an array.static ArraytoBoolean(Array a)Convert array to boolean typestatic DataTypetoDataType(java.lang.String dt)To data type - ucar.ma2static ArraytoDouble(Array a)Convert array to double typestatic ArraytoFloat(Array a)Convert array to float typestatic ArraytoInteger(Array a)Convert array to integer typestatic doubletoStation(Array data, java.util.List<java.lang.Number> xArray, java.util.List<java.lang.Number> yArray, double x, double y)Interpolate data to a station pointstatic doubletoStation(Array data, java.util.List<java.lang.Number> xArray, java.util.List<java.lang.Number> yArray, double x, double y, double missingValue)Interpolate data to a station pointstatic doubletoStation(Array data, Array xArray, Array yArray, double x, double y)Interpolate data to a station pointstatic doubletoStation_Neighbor(Array data, java.util.List<java.lang.Number> xArray, java.util.List<java.lang.Number> yArray, double x, double y)Interpolate data to a station pointstatic doubletoStation_Neighbor(Array data, java.util.List<java.lang.Number> xArray, java.util.List<java.lang.Number> yArray, double x, double y, double missingValue)Interpolate data to a station pointstatic doubletoStation_Neighbor(Array data, Array xArray, Array yArray, double x, double y)Interpolate data to a station pointstatic java.lang.StringtoString_old(Array a)Array to stringstatic Arrayzeros(int n)Get zero arraystatic Arrayzeros(java.util.List<java.lang.Integer> shape, java.lang.String dtype)Get zero arraystatic Arrayzeros(java.util.List<java.lang.Integer> shape, DataType dtype)Get zero array
-
-
-
方法详细资料
-
readASCIIFile
public static Array readASCIIFile(java.lang.String fileName, java.lang.String delimiter, int headerLines, java.lang.String dataType, java.util.List<java.lang.Integer> shape, boolean readFirstCol) throws java.io.UnsupportedEncodingException, java.io.FileNotFoundException, java.io.IOException
Read ASCII data file to an array- 参数:
fileName- File namedelimiter- DelimiterheaderLines- Headerline numberdataType- Data type stringshape- ShapereadFirstCol- Read first column data or not- 返回:
- Result array
- 抛出:
java.io.UnsupportedEncodingExceptionjava.io.FileNotFoundExceptionjava.io.IOException
-
numASCIIRow
public static int numASCIIRow(java.lang.String fileName) throws java.io.FileNotFoundExceptionGet row number of a ASCII file- 参数:
fileName- File name- 返回:
- Row number
- 抛出:
java.io.FileNotFoundException
-
numASCIICol
public static int numASCIICol(java.lang.String fileName, java.lang.String delimiter, int headerLines) throws java.io.FileNotFoundException, java.io.IOExceptionGet row number of a ASCII file- 参数:
fileName- File namedelimiter-headerLines-- 返回:
- Row number
- 抛出:
java.io.FileNotFoundExceptionjava.io.IOException
-
saveBinFile
public static void saveBinFile(java.lang.String fn, Array a, java.lang.String byteOrder, boolean append, boolean sequential)Save an array data to a binary file- 参数:
fn- File patha- ArraybyteOrder- Byte orderappend- If append to existing filesequential- If write as sequential binary file - Fortran
-
saveASCIIFile
public static void saveASCIIFile(java.lang.String fn, Array a, int colNum, java.lang.String format, java.lang.String delimiter) throws java.io.IOExceptionSave an array data to a ASCII file- 参数:
fn- File patha- ArraycolNum- Column number of each lineformat- String formatdelimiter- Delimiter- 抛出:
java.io.IOException
-
readBinFile
public static Array readBinFile(java.lang.String fn, java.util.List<java.lang.Integer> dims, java.lang.String dataType, int skip, java.lang.String byteOrder)
Read array from a binary file- 参数:
fn- Binary file namedims- DimensionsdataType- Data type stringskip- Skip bytesbyteOrder- Byte order- 返回:
- Result array
-
array
public static Array array(java.lang.Object data)
Create an array- 参数:
data- Object- 返回:
- Array
-
array
public static Array array(java.util.ArrayList data)
Create an array- 参数:
data- Array like data- 返回:
-
array
public static Array array(java.util.List<java.lang.Object> data)
Create an array- 参数:
data- Array like data- 返回:
- Array
-
arrayRange_bak
public static Array arrayRange_bak(java.lang.Number start, java.lang.Number stop, java.lang.Number step)
Array range- 参数:
start- Start valuestop- Stop valuestep- Step value- 返回:
- Array
-
arrayRange
public static Array arrayRange(java.lang.Number start, java.lang.Number stop, java.lang.Number step)
Array range- 参数:
start- Start valuestop- Stop valuestep- Step value- 返回:
- Array
-
arrayRange1
public static Array arrayRange1(java.lang.Number start, int length, java.lang.Number step)
Array range- 参数:
start- Start valuelength- Lengthstep- Step value- 返回:
- Array
-
lineSpace
public static Array lineSpace(java.lang.Number start, java.lang.Number stop, int n, boolean endpoint)
Array line space- 参数:
start- Start valuestop- Stop valuen- Number valueendpoint- If stop is included- 返回:
- Array
-
lineSpace_bak
public static Array lineSpace_bak(java.lang.Number start, java.lang.Number stop, int n, boolean endpoint)
Array line space- 参数:
start- Start valuestop- Stop valuen- Number valueendpoint- If stop is included- 返回:
- Array
-
zeros
public static Array zeros(int n)
Get zero array- 参数:
n- Number- 返回:
- Array
-
zeros
public static Array zeros(java.util.List<java.lang.Integer> shape, java.lang.String dtype)
Get zero array- 参数:
shape- Shapedtype- Data type- 返回:
- Array Result array
-
zeros
public static Array zeros(java.util.List<java.lang.Integer> shape, DataType dtype)
Get zero array- 参数:
shape- Shapedtype- Data type- 返回:
- Array Result array
-
full
public static Array full(java.util.List<java.lang.Integer> shape, java.lang.Object fillValue, DataType dtype)
Return a new array of given shape and type, filled with fill value.- 参数:
shape- ShapefillValue- Fill valuedtype- Data type- 返回:
- Array Result array
-
ones
public static Array ones(int n)
Get ones array- 参数:
n- Number- 返回:
- Array Result array
-
ones
public static Array ones(java.util.List<java.lang.Integer> shape, java.lang.String dtype)
Get ones array- 参数:
shape- Shapedtype- Data type- 返回:
- Array Result array
-
identity
public static Array identity(int n, java.lang.String dtype)
Return the identity array - a square array with ones on the main diagonal.- 参数:
n- Number of rows (and columns) in n x n output.dtype- Data type- 返回:
- Identity array
-
eye
public static Array eye(int n, int m, int k, java.lang.String dtype)
Return a 2-D array with ones on the diagonal and zeros elsewhere.- 参数:
n- Number of rows in the output.m- Number of columns in the output.k- Index of the diagonal: 0 (the default) refers to the main diagonal, a positive value refers to an upper diagonal, and a negative value to a lower diagonal.dtype- Data type- 返回:
- Created array
-
diag
public static Array diag(Array a, int k)
Extract a diagonal or construct a diagonal array.- 参数:
a- If a is a 2-D array, return a copy of its k-th diagonal. If a is a 1-D array, return a 2-D array with a on the k-th diagonal.k- Diagonal in question.- 返回:
- Diagonal array
-
repeat
public static Array repeat(java.lang.Number v, int n)
Repeat a value n times- 参数:
v- The valuen- N times- 返回:
- Repeated array
-
repeat
public static Array repeat(Array a, java.util.List<java.lang.Integer> repeats)
Repeat elements of an array.- 参数:
a- The valuerepeats- The number of repetitions for each element- 返回:
- Repeated array
-
repeat
public static Array repeat(Array a, java.util.List<java.lang.Integer> repeats, int axis)
Repeat elements of an array.- 参数:
a- The valuerepeats- The number of repetitions for each elementaxis- The axis- 返回:
- Repeated array
-
tile
public static Array tile(java.lang.Number v, int n)
Repeat a value n times- 参数:
v- The valuen- N times- 返回:
- Repeated array
-
tile
public static Array tile(java.lang.Number v, java.util.List<java.lang.Integer> repeats)
Repeat a value n times- 参数:
v- The valuerepeats- The number of repetitions for each element- 返回:
- Repeated array
-
tile
public static Array tile(Array a, java.util.List<java.lang.Integer> repeats)
Repeat elements of an array.- 参数:
a- The valuerepeats- The number of repetitions for each element- 返回:
- Repeated array
-
rand
public static double rand()
Get random value- 返回:
- Random value
-
rand
public static Array rand(int n)
Get random array - one dimension- 参数:
n- Array length- 返回:
- Result array
-
rand
public static Array rand(java.util.List<java.lang.Integer> shape)
Get random array- 参数:
shape- Shape- 返回:
- Array Result array
-
mergeDataType
public static DataType mergeDataType(DataType dt1, DataType dt2)
Merge data type to one data type- 参数:
dt1- Data type 1dt2- Data type 2- 返回:
- Merged data type
-
convertToString
public static java.lang.String convertToString(Array a)
Array to string- 参数:
a- Array a- 返回:
- String
-
toString_old
public static java.lang.String toString_old(Array a)
Array to string- 参数:
a- Array a- 返回:
- String
-
getArraysFromStationData
public static java.util.List<Array> getArraysFromStationData(StationData stdata)
Get array list from StationData- 参数:
stdata- StationData- 返回:
- Array list
-
dataTypeString
public static java.lang.String dataTypeString(DataType dt)
Get data type string- 参数:
dt- The data type- 返回:
- Data type string
-
toDataType
public static DataType toDataType(java.lang.String dt)
To data type - ucar.ma2- 参数:
dt- Data type string- 返回:
- Data type
-
toInteger
public static Array toInteger(Array a)
Convert array to integer type- 参数:
a- Array a- 返回:
- Result array
-
toFloat
public static Array toFloat(Array a)
Convert array to float type- 参数:
a- Array a- 返回:
- Result array
-
toDouble
public static Array toDouble(Array a)
Convert array to double type- 参数:
a- Array a- 返回:
- Result array
-
toBoolean
public static Array toBoolean(Array a)
Convert array to boolean type- 参数:
a- Array a- 返回:
- Result array
-
concatenate
public static Array concatenate(java.util.List<Array> arrays, java.lang.Integer axis) throws InvalidRangeException
Concatenate arrays to one array along a axis- 参数:
arrays- Array listaxis- The axis- 返回:
- Concatenated array
- 抛出:
InvalidRangeException
-
concatenate
public static Array concatenate(Array a, Array b, java.lang.Integer axis) throws InvalidRangeException
Concatenate two arrays to one array along a axis- 参数:
a- Array ab- Array baxis- The axis- 返回:
- Concatenated array
- 抛出:
InvalidRangeException
-
sort
public static Array sort(Array a, java.lang.Integer axis) throws InvalidRangeException
Sort array along an axis- 参数:
a- Array aaxis- The axis- 返回:
- Sorted array
- 抛出:
InvalidRangeException
-
argSort
public static Array argSort(Array a, java.lang.Integer axis) throws InvalidRangeException
Get sorted array index along an axis- 参数:
a- Array aaxis- The axis- 返回:
- Index of sorted array
- 抛出:
InvalidRangeException
-
copyToNDJavaArray
public static java.lang.Object copyToNDJavaArray(Array a, java.lang.String dtype)
Convert array to N-Dimension double Java array- 参数:
a- Array adtype- Data type string- 返回:
- N-D Java array
-
copyToNDJavaArray
public static java.lang.Object copyToNDJavaArray(Array a)
Convert array to N-Dimension double Java array- 参数:
a- Array a- 返回:
- N-D Java array
-
copyToNDJavaArray_Long
public static java.lang.Object copyToNDJavaArray_Long(Array a)
Convert array to N-Dimension double Java array- 参数:
a- Array a- 返回:
- N-D Java array
-
copyToNDJavaArray_Double
public static java.lang.Object copyToNDJavaArray_Double(Array a)
Convert array to N-Dimension double Java array- 参数:
a- Array a- 返回:
- N-D Java array
-
copyTo1DJavaArray
protected static void copyTo1DJavaArray(IndexIterator iter, java.lang.Object javaArray)
-
copyTo1DJavaArray_Long
protected static void copyTo1DJavaArray_Long(IndexIterator iter, java.lang.Object javaArray)
-
delete
public static Array delete(Array a, int idx, int axis)
Return a new array with sub-arrays along an axis deleted- 参数:
a- Input arrayidx- Indexaxis- The axis- 返回:
-
delete
public static Array delete(Array a, java.util.List<java.lang.Integer> idx, int axis)
Return a new array with sub-arrays along an axis deleted- 参数:
a- Input arrayidx- Indexaxis- The axis- 返回:
-
histogram
public static java.util.List<Array> histogram(Array a, int nbins)
Histogram x/y array- 参数:
a- Data arraynbins- bin number- 返回:
- X/Y arrays
-
histogram
public static java.util.List<Array> histogram(Array a, Array bins)
Histogram x/y array- 参数:
a- Data arraybins- bin edges- 返回:
- X/Y arrays
-
histogram
public static java.util.List<Array> histogram(Array a, double[] bins)
Histogram x/y array- 参数:
a- Data arraybins- bin edges- 返回:
- X/Y arrays
-
broadcast
public static Array broadcast(Array a, int[] shape)
Broadcast array to a new shape- 参数:
a- Array ashape- Shape- 返回:
- Result array
-
broadcast
public static Array broadcast(Array a, java.util.List<java.lang.Integer> shape)
Broadcast array to a new shape- 参数:
a- Array ashape- Shape- 返回:
- Result array
-
meshgrid
public static Array[] meshgrid(Array x, Array y)
Mesh grid- 参数:
x- X array - vectory- Y array - vector- 返回:
- Result arrays - matrix
-
meshgrid
public static Array[] meshgrid(Array... xs)
Mesh grid- 参数:
xs- X arrays- 返回:
- Result arrays - matrix
-
meshLayer
public static VectorLayer meshLayer(Array x_s, Array y_s, Array a, LegendScheme ls, double lonlim)
Create mesh polygon layer- 参数:
x_s- scatter X arrayy_s- scatter Y arraya- scatter value arrayls- Legend schemelonlim- Longiutde limitation - to avoid the polygon cross -180/180- 返回:
- Mesh polygon layer
-
meshLayer
public static VectorLayer meshLayer(Array x_s, Array y_s, Array a, LegendScheme ls)
Create mesh polygon layer- 参数:
x_s- scatter X arrayy_s- scatter Y arraya- scatter value arrayls- Legend scheme- 返回:
- Mesh polygon layer
-
smooth5
public static Array smooth5(Array a, int rowNum, int colNum, double unDefData)
Smooth with 5 points- 参数:
a- ArrayrowNum- Row numbercolNum- Column numberunDefData- Missing value- 返回:
- Result array
-
interpolation_IDW_Radius
public static Array interpolation_IDW_Radius(java.util.List<java.lang.Number> x_s, java.util.List<java.lang.Number> y_s, Array a, java.util.List<java.lang.Number> X, java.util.List<java.lang.Number> Y, int neededPointNum, double radius)
Interpolation with IDW radius method- 参数:
x_s- scatter X arrayy_s- scatter Y arraya- scatter value arrayX- grid X arrayY- grid Y arrayneededPointNum- needed at least point numberradius- search radius- 返回:
- interpolated grid data
-
interpolation_IDW_Radius_bak
public static Array interpolation_IDW_Radius_bak(java.util.List<java.lang.Number> x_s, java.util.List<java.lang.Number> y_s, Array a, java.util.List<java.lang.Number> X, java.util.List<java.lang.Number> Y, int NeededPointNum, double radius)
Interpolation with IDW radius method- 参数:
x_s- scatter X arrayy_s- scatter Y arraya- scatter value arrayX- grid X arrayY- grid Y arrayNeededPointNum- needed at least point numberradius- search radius- 返回:
- interpolated grid data
-
interpolation_IDW_Neighbor
public static Array interpolation_IDW_Neighbor(java.util.List<java.lang.Number> x_s, java.util.List<java.lang.Number> y_s, Array a, java.util.List<java.lang.Number> X, java.util.List<java.lang.Number> Y, java.lang.Integer points)
Interpolation with IDW neighbor method- 参数:
x_s- scatter X arrayy_s- scatter Y arraya- scatter value arrayX- grid X arrayY- grid Y arraypoints- Number of points used for interpolation- 返回:
- interpolated grid data
-
interpolation_IDW_Neighbor_bak
public static Array interpolation_IDW_Neighbor_bak(java.util.List<java.lang.Number> x_s, java.util.List<java.lang.Number> y_s, Array a, java.util.List<java.lang.Number> X, java.util.List<java.lang.Number> Y, int NumberOfNearestNeighbors)
Interpolation with IDW neighbor method- 参数:
x_s- scatter X arrayy_s- scatter Y arraya- scatter value arrayX- grid X arrayY- grid Y arrayNumberOfNearestNeighbors-- 返回:
- interpolated grid data
-
interpolation_Nearest
public static Array interpolation_Nearest(java.util.List<java.lang.Number> x_s, java.util.List<java.lang.Number> y_s, Array a, java.util.List<java.lang.Number> X, java.util.List<java.lang.Number> Y, double radius)
Interpolate with nearest method- 参数:
x_s- scatter X arrayy_s- scatter Y arraya- scatter value arrayX- x coordinateY- y coordinateradius- Radius- 返回:
- grid data
-
extendHalfCell
public static Array[] extendHalfCell(Array x, Array y)
Extend the grid to half cell, so the grid points are the centers of the cells- 参数:
x- Input x coordinatey- Input y coordinate- 返回:
- Result x and y coordinates
-
interpolation_Inside
public static Array interpolation_Inside(java.util.List<java.lang.Number> x_s, java.util.List<java.lang.Number> y_s, Array a, java.util.List<java.lang.Number> X, java.util.List<java.lang.Number> Y, boolean centerPoint)
Interpolate with inside method - The grid cell value is the average value of the inside points or fill value if no inside point.- 参数:
x_s- scatter X arrayy_s- scatter Y arraya- scatter value arrayX- x coordinateY- y coordinatecenterPoint- the points locate at center or border or grid- 返回:
- grid data
-
interpolation_Inside
public static Array interpolation_Inside(Array x_s, Array y_s, Array a, Array X, Array Y, boolean centerPoint)
Interpolate with inside method - The grid cell value is the average value of the inside points or fill value if no inside point.- 参数:
x_s- scatter X arrayy_s- scatter Y arraya- scatter value arrayX- x coordinateY- y coordinatecenterPoint- If the grid point is center or border- 返回:
- grid data
-
interpolation_Inside_Max
public static Array interpolation_Inside_Max(java.util.List<java.lang.Number> x_s, java.util.List<java.lang.Number> y_s, Array a, java.util.List<java.lang.Number> X, java.util.List<java.lang.Number> Y, boolean centerPoint)
Interpolate with inside method - The grid cell value is the maximum value of the inside points or fill value if no inside point.- 参数:
x_s- scatter X arrayy_s- scatter Y arraya- scatter value arrayX- x coordinateY- y coordinatecenterPoint- points locate at center or border of grid- 返回:
- grid data
-
interpolation_Inside_Min
public static Array interpolation_Inside_Min(java.util.List<java.lang.Number> x_s, java.util.List<java.lang.Number> y_s, Array a, java.util.List<java.lang.Number> X, java.util.List<java.lang.Number> Y, boolean centerPoint)
Interpolate with inside method - The grid cell value is the minimum value of the inside points or fill value if no inside point.- 参数:
x_s- scatter X arrayy_s- scatter Y arraya- scatter value arrayX- x coordinateY- y coordinatecenterPoint- points locate at center or border of grid- 返回:
- grid data
-
interpolation_Inside_Count
public static java.lang.Object interpolation_Inside_Count(java.util.List<java.lang.Number> x_s, java.util.List<java.lang.Number> y_s, java.util.List<java.lang.Number> X, java.util.List<java.lang.Number> Y, boolean pointDensity, boolean centerPoint)Interpolate with inside method - The grid cell value is the count number of the inside points or fill value if no inside point.- 参数:
x_s- scatter X arrayy_s- scatter Y arrayX- x coordinateY- y coordinatepointDensity- If return point density valuecenterPoint- points locate at center or border of grid- 返回:
- grid data
-
interpolation_Surface_1
public static Array interpolation_Surface_1(Array x_s, Array y_s, Array a, Array X, Array Y, double unDefData)
Interpolate with surface method- 参数:
x_s- scatter X arrayy_s- scatter Y arraya- scatter value arrayX- x coordinateY- y coordinateunDefData- undefine value- 返回:
- grid data
-
interpolation_Surface
public static Array interpolation_Surface(Array x_s, Array y_s, Array a, Array X, Array Y)
Interpolate with surface method- 参数:
x_s- scatter X arrayy_s- scatter Y arraya- scatter value arrayX- x coordinateY- y coordinate- 返回:
- grid data
-
interpolation_Surface_bak
public static Array interpolation_Surface_bak(Array x_s, Array y_s, Array a, Array X, Array Y)
Interpolate with surface method- 参数:
x_s- scatter X arrayy_s- scatter Y arraya- scatter value arrayX- x coordinateY- y coordinate- 返回:
- grid data
-
cressman
public static Array cressman(java.util.List<java.lang.Number> x_s, java.util.List<java.lang.Number> y_s, Array v_s, java.util.List<java.lang.Number> X, java.util.List<java.lang.Number> Y, java.util.List<java.lang.Number> radList)
Cressman analysis- 参数:
x_s- scatter X arrayy_s- scatter Y arrayv_s- scatter value arrayX- x arrayY- y arrayradList- radii list- 返回:
- result grid data
-
cressman_bak
public static Array cressman_bak(java.util.List<java.lang.Number> x_s, java.util.List<java.lang.Number> y_s, Array v_s, java.util.List<java.lang.Number> X, java.util.List<java.lang.Number> Y, java.util.List<java.lang.Number> radList)
Cressman analysis- 参数:
x_s- scatter X arrayy_s- scatter Y arrayv_s- scatter value arrayX- x arrayY- y arrayradList- radii list- 返回:
- result grid data
-
linint2
public static Array linint2(Array a, Array X, Array Y, Array newX, Array newY)
Interpolates from a rectilinear grid to another rectilinear grid using bilinear interpolation.- 参数:
a- The sample arrayX- X coordinate of the sample arrayY- Y coordinate of the sample arraynewX- X coordinate of the query pointsnewY- Y coordinate of the query points- 返回:
- Resampled array
-
resample_Bilinear
public static Array resample_Bilinear(Array a, java.util.List<java.lang.Number> X, java.util.List<java.lang.Number> Y, java.util.List<java.lang.Number> newX, java.util.List<java.lang.Number> newY)
Resample grid array with bilinear method- 参数:
a- The sample arrayX- X coordinate of the sample arrayY- Y coordinate of the sample arraynewX- X coordinate of the query pointsnewY- Y coordinate of the query points- 返回:
- Resampled array
-
resample_Bilinear
public static Array resample_Bilinear(Array a, Array X, Array Y, Array newX, Array newY)
Resample grid array with bilinear method- 参数:
a- The sample arrayX- X coordinate of the sample arrayY- Y coordinate of the sample arraynewX- X coordinate of the query pointsnewY- Y coordinate of the query points- 返回:
- Resampled array
-
resample_Neighbor
public static Array resample_Neighbor(Array a, Array X, Array Y, Array newX, Array newY)
Resample grid array with neighbor method- 参数:
a- The sample arrayX- X coordinate of the sample arrayY- Y coordinate of the sample arraynewX- X coordinate of the query pointsnewY- Y coordinate of the query points- 返回:
- Resampled array
-
interpolate
public Array interpolate(Array a, java.util.List<java.lang.Number> X, java.util.List<java.lang.Number> Y)
Interpolate array data- 参数:
a- ArrayX- X coordinatesY- Y coordinates- 返回:
- Result array data
-
interpn_s
public static double interpn_s(java.util.List<java.util.List<java.lang.Number>> points, Array values, java.util.List<java.lang.Number> xi)Multidimensional interpolation on regular grids.- 参数:
points- The points defining the regular grid in n dimensions.values- The data on the regular grid in n dimensions.xi- The coordinates to sample the gridded data at- 返回:
- Interpolation value
-
interpn_s
public static double interpn_s(java.util.List<Array> points, Array values, Array xi)
Multidimensional interpolation on regular grids.- 参数:
points- The points defining the regular grid in n dimensions.values- The data on the regular grid in n dimensions.xi- The coordinates to sample the gridded data at- 返回:
- Interpolation value
-
interpn
public static Array interpn(java.util.List<Array> points, Array values, java.util.List<Array> xi)
Multidimensional interpolation on regular grids.- 参数:
points- The points defining the regular grid in n dimensions.values- The data on the regular grid in n dimensions.xi- The coordinates to sample the gridded data at - 2D- 返回:
- Interpolation value
-
interpn
public static java.lang.Object interpn(java.util.List<Array> points, Array values, Array xi) throws InvalidRangeException
Multidimensional interpolation on regular grids.- 参数:
points- The points defining the regular grid in n dimensions.values- The data on the regular grid in n dimensions.xi- The coordinates to sample the gridded data at - 2D- 返回:
- Interpolation value
- 抛出:
InvalidRangeException
-
findIndices
public static java.lang.Object[] findIndices(java.util.List<java.util.List<java.lang.Number>> points, java.util.List<java.lang.Number> xi)Find indices- 参数:
points- The points defining the regular grid in n dimensions.xi- The coordinates to sample the gridded data at- 返回:
- Indices
-
findIndices
public static java.lang.Object[] findIndices(java.util.List<Array> points, Array xi)
Find indices- 参数:
points- The points defining the regular grid in n dimensions.xi- The coordinates to sample the gridded data at- 返回:
- Indices
-
searchSorted
public static int searchSorted(java.util.List<java.lang.Number> a, double v)Search sorted list index- 参数:
a- Sorted listv- value- 返回:
- Index
-
searchSorted
public static int searchSorted(Array a, double v)
Search sorted list index- 参数:
a- Sorted listv- value- 返回:
- Index
-
interpolate_1d
public static Array interpolate_1d(double x, Array xp, Array a, int axis) throws InvalidRangeException
Interpolates data with any shape over a specified axis.- 参数:
x- Desired interpolated valuexp- The x-coordinates of the data points.a- The data to be interpolated.axis- The axis to interpolate over.- 返回:
- Interpolated data
- 抛出:
InvalidRangeException
-
interpolate_1d
public static Array interpolate_1d(Array xa, Array xp, Array a, int axis) throws InvalidRangeException
Interpolates data with any shape over a specified axis.- 参数:
xa- Desired interpolated valuesxp- The x-coordinates of the data points.a- The data to be interpolated.axis- The axis to interpolate over.- 返回:
- Interpolated data
- 抛出:
InvalidRangeException
-
reproject
public static Array[] reproject(Array x, Array y, ProjectionInfo toProj)
Reproject- 参数:
x- X arrayy- Y arraytoProj- To projection- 返回:
- Result arrays
-
reproject
public static Array[] reproject(Array x, Array y, ProjectionInfo fromProj, ProjectionInfo toProj)
Reproject- 参数:
x- X arrayy- Y arrayfromProj- From projectiontoProj- To projection- 返回:
- Result arrays
-
toStation
public static double toStation(Array data, java.util.List<java.lang.Number> xArray, java.util.List<java.lang.Number> yArray, double x, double y, double missingValue)
Interpolate data to a station point- 参数:
data- Data arrayxArray- X arrayyArray- Y arrayx- X coordinate of the stationy- Y coordinate of the stationmissingValue- Missing value- 返回:
- Interpolated value
-
toStation
public static double toStation(Array data, java.util.List<java.lang.Number> xArray, java.util.List<java.lang.Number> yArray, double x, double y)
Interpolate data to a station point- 参数:
data- Data arrayxArray- X arrayyArray- Y arrayx- X coordinate of the stationy- Y coordinate of the station- 返回:
- Interpolated value
-
getDimIndex
public static int getDimIndex(Array dim, double v)
Get value index in a dimension array- 参数:
dim- Dimension arrayv- The value- 返回:
- value index
-
toStation
public static double toStation(Array data, Array xArray, Array yArray, double x, double y)
Interpolate data to a station point- 参数:
data- Data arrayxArray- X arrayyArray- Y arrayx- X coordinate of the stationy- Y coordinate of the station- 返回:
- Interpolated value
-
toStation_Neighbor
public static double toStation_Neighbor(Array data, java.util.List<java.lang.Number> xArray, java.util.List<java.lang.Number> yArray, double x, double y, double missingValue)
Interpolate data to a station point- 参数:
data- Data arrayxArray- X arrayyArray- Y arrayx- X coordinate of the stationy- Y coordinate of the stationmissingValue- Missing value- 返回:
- Interpolated value
-
toStation_Neighbor
public static double toStation_Neighbor(Array data, java.util.List<java.lang.Number> xArray, java.util.List<java.lang.Number> yArray, double x, double y)
Interpolate data to a station point- 参数:
data- Data arrayxArray- X arrayyArray- Y arrayx- X coordinate of the stationy- Y coordinate of the station- 返回:
- Interpolated value
-
toStation_Neighbor
public static double toStation_Neighbor(Array data, Array xArray, Array yArray, double x, double y)
Interpolate data to a station point- 参数:
data- Data arrayxArray- X arrayyArray- Y arrayx- X coordinate of the stationy- Y coordinate of the station- 返回:
- Interpolated value
-
reproject_back
public static java.lang.Object[] reproject_back(Array data, java.util.List<java.lang.Number> xx, java.util.List<java.lang.Number> yy, ProjectionInfo fromProj, ProjectionInfo toProj) throws InvalidRangeException
Project grid data- 参数:
data- Data arrayxx- X arrayyy- Y arrayfromProj- From projectiontoProj- To projection- 返回:
- Porjected grid data
- 抛出:
InvalidRangeException
-
reproject
public static java.lang.Object[] reproject(Array data, java.util.List<java.lang.Number> xx, java.util.List<java.lang.Number> yy, ProjectionInfo fromProj, ProjectionInfo toProj, ResampleMethods method) throws InvalidRangeException
Project grid data- 参数:
data- Data arrayxx- X arrayyy- Y arrayfromProj- From projectiontoProj- To projectionmethod- Resample method- 返回:
- Porjected grid data
- 抛出:
InvalidRangeException
-
reproject
public static java.lang.Object[] reproject(Array data, java.util.List<java.lang.Number> xx, java.util.List<java.lang.Number> yy, ProjectionInfo fromProj, ProjectionInfo toProj) throws InvalidRangeException
Project grid data- 参数:
data- Data arrayxx- X arrayyy- Y arrayfromProj- From projectiontoProj- To projection- 返回:
- Porjected grid data
- 抛出:
InvalidRangeException
-
reproject
public static Array reproject(Array data, java.util.List<java.lang.Number> x, java.util.List<java.lang.Number> y, Array rx, Array ry, ProjectionInfo fromProj, ProjectionInfo toProj, double fill_value, ResampleMethods resampleMethod) throws InvalidRangeException
Reproject- 参数:
data- Data arrayx- X arrayy- Y arrayrx- Result x arrayry- Result y arrayfromProj- From projectiontoProj- To projectionfill_value- Fill valueresampleMethod- Resample method- 返回:
- Result arrays
- 抛出:
InvalidRangeException
-
reproject
public static Array reproject(Array data, java.util.List<java.lang.Number> x, java.util.List<java.lang.Number> y, Array rx, Array ry, ProjectionInfo fromProj, ProjectionInfo toProj, ResampleMethods resampleMethod) throws InvalidRangeException
Reproject- 参数:
data- Data arrayx- X arrayy- Y arrayrx- Result x arrayry- Result y arrayfromProj- From projectiontoProj- To projectionresampleMethod- Resample method- 返回:
- Result arrays
- 抛出:
InvalidRangeException
-
reproject
public static Array reproject(Array data, java.util.List<java.lang.Number> x, java.util.List<java.lang.Number> y, java.util.List<java.lang.Number> rx, java.util.List<java.lang.Number> ry, ProjectionInfo fromProj, ProjectionInfo toProj, double fill_value, ResampleMethods resampleMethod)
Reproject- 参数:
data- Data arrayx- X arrayy- Y arrayrx- Result x arrayry- Result y arrayfromProj- From projectiontoProj- To projectionfill_value- Fill valueresampleMethod- Resample method- 返回:
- Result arrays
-
convexHull
public static PolygonShape convexHull(Array x, Array y)
Computes the smallest convexPolygonthat contains all the points- 参数:
x- X arrayy- Y array- 返回:
- PolygonShape
-
-