Package ucar.unidata.data.grid
Class GridUtil
java.lang.Object
ucar.unidata.data.grid.GridUtil
- Direct Known Subclasses:
WrfUtil
Set of static methods for messing with grids. A grid is defined
as a FieldImpl which has one of the following MathTypes structures:
(x,y) -> (parm) (x,y) -> (parm1, ..., parmN) (x,y,z) -> (parm) (x,y,z) -> (parm1, ..., parmN) (t -> (x,y) -> (parm)) (t -> (x,y) -> (parm1, ..., parmN)) (t -> (x,y,z) -> (parm)) (t -> (x,y,z) -> (parm1, ..., parmN)) (t -> (index -> (x,y) -> (parm))) (t -> (index -> (x,y) -> (parm1, ..., parmN))) (t -> (index -> (x,y,z) -> (parm))) (t -> (index -> (x,y,z) -> (parm1, ..., parmN)))In general, t is a time variable, but it might also be just an index.
- Version:
- $Revision: 1.112 $
- Author:
- Don Murray
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Class Grid2D holds a 2d lat/lon and value arraystatic class
static class
static class
The formula of the Robustscaler in sklearn is: X_scale = (X_i - X_med)/(X_percentile75 - X_percentile25) -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Default error mode used for subsampling gridsstatic final int
Default sampling mode used for subsampling gridsstatic final int
Dependent error modestatic final RealType
ensemble RealTypestatic final String
function for the applyFunctionOverTime routine deprecated use GridMath.FUNC_AVERAGEstatic final String
function for the timeStepFunc routine deprecated use GridMath.FUNC_DIFFERENCEstatic final String
function for the applyFunctionOverTime routine deprecated use GridMath.FUNC_MAXstatic final String
function for the applyFunctionOverTime routine deprecated use GridMath.FUNC_MINstatic final String
function for the applyFunctionOverTime routine deprecated use GridMath.FUNC_SUMstatic final int
Independent error modestatic final int
Nearest Neighbor sampling modestatic final int
No error modestatic final String
Five point smoother identifierstatic final String
Nine point smoother identifierstatic final String
Barnes circular smoother identifierstatic final String
Cressman smoother identifierstatic final String
Gaussian smoother identifierstatic final String
Barnes circular smoother identifierstatic final int
Weighted average sampling mode -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic FieldImpl
addLevelToGrid
(FieldImpl grid, double levelValue, String levelUnit) Add a level to a 2D gridstatic FieldImpl
applyFunctionOverTime
(FieldImpl grid, String function, boolean makeTimes) Apply the function to the time steps of the given grid.static FieldImpl
averageOverTime
(FieldImpl grid, boolean makeTimes) Average the grid over timestatic boolean
canSliceAtLevel
(FieldImpl grid, Real level) Determine whether the grid in question can be sliced at the level specified (i.e., units or CS allows this)static boolean
canSliceAtLevel
(SampledSet spatialSet, Real level) Determine whether the set in question can be sliced at the level specified (i.e., units or CS allows this)static boolean
canSwapLatLon
(FieldImpl grid) Can the lat/lons be swapped?static FieldImpl
classifier
(FieldImpl field, String classifierStr, String outFileName) A classifier in machine learning is an algorithm that automatically orders or categorizes data into one or more of a set of “classes.”static FieldImpl
This creates a field where D(T) = D(T)-D(0) Any time steps up to the offset time are set to missingstatic void
exportGridToNetcdf
(FieldImpl grid) Write grid out to a netCDF CF compliant filestatic void
exportGridToNetcdf
(FieldImpl grid, String filename) Write grid out to a netCDF CF compliant fileextractParam
(FieldImpl grid, MathType paramType) Extract a single parameter from a grid of multiple parameters.static FieldImpl
extractParam
(FieldImpl grid, ScalarType param) Extract the param from a sequence, it will be the range type of the individual elements.static Range[]
fieldMinMax
(FlatField field) Find min and max of range data in any VisAD FlatFieldstatic void
fillMissing
(float[][] grid2D, float missingValue) Fill a structure with missing values with nearby grid valuesstatic int[][]
findContainedIndices
(float[][] latlon, UnionSet map) Find the indices of the latlon values contained in the mapstatic int[][]
findContainedIndices
(GriddedSet domain, UnionSet map) Find the indices of the domain values contained in the mapstatic float[][][]
findContainedLatLons
(float[][] latlons, UnionSet maps) Find the lat/lon values in the given spatial domain contained by the polygons in the given map setstatic float[][][]
findContainedLatLons
(GriddedSet domain, UnionSet maps) Find the lat/lon values in the given spatial domain contained by the polygons in the given map setstatic int[][]
findIndicesInsideRange
(float[][] values, float min, float max) Finds the indices of the values array whose value is in the given rangestatic int[][]
findIndicesOutsideRange
(float[][] values, float min, float max) Finds the indices of the values array whose value is not in the given rangestatic List
<FieldStats> findMinMaxAverage
(FieldImpl field, UnionSet mapSets) Find the min/max and average of a file inside the mapsetsstatic FieldStats
findMinMaxAverageFromRange
(FlatField field, UnionSet mapSets) Find the min, max and average from the rangestatic int[][]
findNotContainedIndices
(float[][] latlon, UnionSet map) Find the indices of the latlon values contained in the mapstatic int[][]
findNotContainedIndices
(GriddedSet domain, UnionSet map) find the indices not contained in the map domianstatic double
findOptimalLambda
(double[] data, double minLambda, double maxLambda, double stepSize) static double
findOptimalLambda
(float[] data, double minLambda, double maxLambda, double stepSize) static Real
getAltitude
(FieldImpl grid, Real level) Get the altitude corresponding to the level specified using the domain of the grid.static Real
getAltitude
(SampledSet domainSet, Real level) Get the altitude corresponding to the level specified using the domain of the grid.static LatLonPoint
Get the latitude/longitude point at the center of the grid.static LatLonPoint
getCenterLatLonPoint
(SampledSet spatialDomain) Get the latitude/longitude point at the center of the domain.static RealTuple
getCenterPoint
(FieldImpl grid) Method to get the center point of a grid's spatial domain as a RealTuple.static RealTuple
getCenterPoint
(SampledSet spatialDomain) Method to get the center point of a spatial domain as a RealTuple.getDateTimeList
(FieldImpl grid) Get the list of DateTime objects from the domain of the given gridstatic float[][]
getEarthLocationPoints
(GriddedSet domain) Convert the domain to the reference earth located pointsstatic Gridded1DSet
getEnsembleSet
(FieldImpl ensGrid) Return the ensemble set for the fieldstatic RealType
getEnsembleType
(FieldImpl grid) Get the RealType of the ensemble.static FieldImpl
getGridAsPointObs
(FieldImpl grid) Convert a grid to point obsstatic float[][]
getLatLon
(GriddedSet domain) Convert the domain to the reference earth located points.static ucar.unidata.geoloc.LatLonRect
getLatLonRect
(GriddedSet domain) Convert the domain to the latlonRectstatic float[][][]
getLatLons
(float[][] latlons, int[][] indices) Find the lat/lon values in the given spatial domain for the given indicesstatic float[][][]
getLatLons
(GriddedSet domain, int[][] indices) Find the lat/lon values in the given spatial domain for the given indicesstatic Real
Get the altitude corresponding to the level specified using the domain of the grid.static Range[]
get max and min of all range values in the current active fieldImplstatic MapProjection
getNavigation
(FieldImpl grid) Get the navigation for this gridstatic MapProjection
getNavigation
(SampledSet spatialSet) Get the navigation for this spatialDomainstatic FieldImpl
Extract the range MathType of the lowest element.static FieldImpl
Extract the range MathType of the lowest element.static TupleType
getParamType
(FieldImpl grid) Get the range MathType of the lowest element.static Unit[]
getParamUnits
(FieldImpl grid) Get the range MathType of the lowest element.static FieldImpl
getProfileAtLatLonPoint
(FieldImpl grid, LatLonPoint point) Returns a vertical profile of a grid at a Lat/Lon point.static FieldImpl
getProfileAtLatLonPoint
(FieldImpl grid, LatLonPoint point, int samplingMode) Returns a vertical profile of a grid at a Lat/Lon point.static FieldImpl
getProfileAtLatLonPoint
(FieldImpl grid, LatLonPoint point, int samplingMode, int errorMode) Returns a vertical profile of a grid at a Lat/Lon point.static RealType
getSequenceType
(FieldImpl grid) Get the RealType of the sequence.static SampledSet
getSpatialDomain
(FieldImpl grid) Get the spatial domain for this grid.static SampledSet
getSpatialDomain
(FieldImpl grid, int timeIndex) Get the spatial domain for this grid at the specified time step.static Set
getTimeSet
(FieldImpl grid) Get the time set from the grid.static RealType
getVerticalType
(FieldImpl grid) Get the RealType of the vertical dimension of the spatial domain of the grid.static RealType
getVerticalType
(SampledSet domainSet) Get the unit of the vertical dimension of the domain set.static Unit
getVerticalUnit
(FieldImpl grid) Get the unit of the vertical dimension of the spatial domain of the grid.static Unit
getVerticalUnit
(SampledSet domainSet) Get the unit of the vertical dimension of the domain.static SampledSet
Get the spatial domain for this grid.static UnionSet
glyphsToMap
(GriddedSet domainSet, List glyphs) Process the glyph to Unionset.static boolean
hasEnsemble
(FieldImpl grid) Check to see if this is an ensemble gridstatic boolean
Check to see if this is a 2D gridstatic boolean
is2D
(SampledSet domainSet) Check to see if this is a 2D domainstatic boolean
Check to see if this is a 3D gridstatic boolean
is3D
(SampledSet domainSet) Check to see if this is a 3D domainstatic boolean
isAllMissing
(FieldImpl field) Check if all real values in a FieldImpl are missing.static boolean
isAllMissing
(FieldImpl grid, boolean popupErrorMessage) Check if all real values in a FieldImpl are missing.static boolean
isAnyMissing
(FieldImpl grid) Check if any of the real values in a FieldImpl are missing.static boolean
See if the spatial domain of this grid is constant (ie: not time varying)static boolean
Check to see if this field is a grid that can be handled by these methodsstatic boolean
isLatLonOrder
(FieldImpl grid) Check to see if this is a navigated grid (domain can be converted to lat/lon)static boolean
isLatLonOrder
(SampledSet spatialSet) Check to see if this is a navigated domain (can be converted to lat/lon)static boolean
isLonCyclic
(double first, double last) Check to see if the longitude values are cyclic within the default epsilon (i.e., last == first+360 +- 0.0005)static boolean
isLonCyclic
(double first, double last, double epsilon) Check to see if the longitude values are cyclic (i.e., last == first+360 within esplion)static boolean
isNavigated
(FieldImpl grid) Check to see if this is a navigated grid (domain can be converted to lat/lon)static boolean
isNavigated
(SampledSet spatialSet) Check to see if this is a navigated domain (can be converted to lat/lon)static boolean
isSequence
(FieldImpl grid) Check to see if this is a single grid or if it is a sequence of grids.static boolean
isSinglePointDomain
(FieldImpl grid) See if the domain of the grid is a single point (only 1 x and y value).static boolean
See if the domain is a single point (only 1 x and y value).static boolean
isTimeSequence
(FieldImpl grid) Check to see if this is a single grid or if it is a time sequence of grids.static boolean
Is the gievn field a volume.static double
logLikelihood
(double[] data, double lambda) static FieldImpl
Flip the grid along the central longitude.static void
teststatic FieldImpl
make2DGridFromSlice
(FieldImpl slice) Transform a 2D slice (3D grid with 2D manifold) into a 2D grid.static FieldImpl
make2DGridFromSlice
(FieldImpl slice, boolean copy) Transform a 2D slice (3D grid with 2D manifold) into a 2D grid.static DataRange
makeDataRange
(Range range) Make a DataRange from a Rangestatic DataRange[]
makeDataRanges
(Range[] range) Make an array of DataRanges from an array of Rangesstatic Gridded2DSet
makeDomain2D
(GriddedSet domainSet) Transform a (possibly) 3D set into a 2D set (removing the Z dimension)static float[][]
makeGrid
(float[][][] grid2D, int numCols, int numRows, float missingValue) Make a grid structurestatic float[][]
makeGrid
(float[][] grid2D, int numCols, int numRows, float missingValue) Make a grid structurestatic GridUtil.Grid2D
makeGrid2D
(FieldImpl grid) rectangulrize the given field, making a grid2d out of its spatial domain and valuesstatic TupleType
makeNewParamType
(TupleType oldParamType, String newSuffix) Make a new type for the field by appending the suffix to the exiting RealTypes in the rangestatic MapProjection
makeRadarMapProjection
(CoordinateSystem radarCS) Return a MapProjection that relates to the Radar*DCoordinateSystem.static Range
Make a range from a VisAD data rangestatic Range[]
makeRanges
(DataRange[] range) Make an array of Ranges from an array of DataRangesstatic float
max
(float[] array) static FieldImpl
maxOverTime
(FieldImpl grid, boolean makeTimes) Take the max value at each grid pointstatic double
mean
(double[] data) static float[]
medianFilter
(float[] A, int lenx, int leny, int window_lenx, int window_leny) Process medianFilterstatic FieldImpl
medianFilter
(FieldImpl field, int window_lenx, int window_leny) Process medianFilter mean filtering is simply to replace each pixel value in an image with the mean (average) value of its neighbors, including itselfstatic FlatField
medianFilter
(FlatField fltFld, int window_lenx, int window_leny) Process medianFilterstatic float[]
medianFilterOrg
(float[] A, int lenx, int leny, int window_lenx, int window_leny) static float
min
(float[] array) static FieldImpl
minOverTime
(FieldImpl grid, boolean makeTimes) Take the min value at each grid pointstatic double
normalizeLongitude
(SampledSet domain, double lon) Make sure a longitude value for use in a spatial domain Set with Longitude in the spatial domain is inside the spatial domain's longitude range.static double
normalizeLongitude
(SampledSet domain, double lon, Unit lonUnit) Make sure a longitude value for use in a spatial domain Set with Longitude in the spatial domain is inside the spatial domain's longitude range.static Real
normalizeLongitude
(SampledSet domain, Real lon) Make sure a longitude value for use in a spatial domain Set with Longitude in the spatial domain is inside the spatial domain's longitude range.static List
Process the glyph xml with only polygon glyph.static String
Print the type of the sample of a data objectstatic String
printModes
(int samplingMode, int errorMode) Print out the sampling and error modes modesstatic List
<DrawingGlyph> respond to the read data call and return list of Glyphstatic FieldImpl
replaceRangeValues
(FieldImpl grid, float low, float high, float newValue) Process for classifierstatic FieldImpl
resampleGrid
(FieldImpl grid, SampledSet subDomain) Resample the grid at the positions defined by a SampledSet using the default methods and error propagation.static FieldImpl
resampleGrid
(FieldImpl grid, SampledSet subDomain, int samplingMode) Resample the grid at the positions defined by a SampledSet using the method specified and default error propagation.static FieldImpl
resampleGrid
(FieldImpl grid, SampledSet subDomain, int samplingMode, int errorMode) Resample the grid at the positions defined by a SampledSet.static FieldImpl
Sample the grid at the position defined by the EarthLocationstatic FieldImpl
sample
(FieldImpl grid, EarthLocation location) Sample the grid at the position defined by the EarthLocationstatic FieldImpl
sample
(FieldImpl grid, EarthLocation location, int samplingMode) Sample the grid at the position defined by the EarthLocationstatic FieldImpl
sample
(FieldImpl grid, EarthLocation location, int samplingMode, int errorMode) Sample the grid at the position defined by the EarthLocation with the VisAD resampling method given.static FieldImpl
sample
(FieldImpl grid, LatLonPoint point) Sample the grid at the position defined by the LatLonPointstatic FieldImpl
sample
(FieldImpl grid, LatLonPoint point, int samplingMode) Sample the grid at the position defined by the LatLonPointstatic FieldImpl
sample
(FieldImpl grid, LatLonPoint point, int samplingMode, int errorMode) Sample the grid at the position defined by the LatLonPointstatic Real
sampleToReal
(FieldImpl grid, EarthLocation el, Real animationValue) This samples the given grid in both time and space and trys to return a Real valuestatic Real
sampleToReal
(FieldImpl grid, EarthLocation el, Real animationValue, int samplingMode) This samples the given grid in both time and space and trys to return a Real valuestatic Real
sampleToReal
(FieldImpl grid, EarthLocation el, Real animationValue, int samplingMode, int errorMode) This samples the given grid in both time and space and trys to return a Real valuestatic RealTuple
sampleToRealTuple
(FieldImpl grid, EarthLocation el, Real animationValue, int samplingMode) This samples the given grid in both time and space and trys to return a Real valuestatic RealTuple
sampleToRealTuple
(FieldImpl grid, EarthLocation el, Real animationValue, int samplingMode, int errorMode) This samples the given grid in both time and space and trys to return a Real valuestatic FieldImpl
setAltitudeValues
(FieldImpl grid, float[] altValues) Set the altitude values for a gridstatic FieldImpl
setParamType
(FieldImpl grid, String newName) Set the range MathType of the lowest element.static FieldImpl
setParamType
(FieldImpl grid, String[] newNames, boolean copy) Set the range MathType of the lowest element.static FieldImpl
setParamType
(FieldImpl grid, String newName, boolean copy) Set the range MathType of the lowest element.static FieldImpl
setParamType
(FieldImpl grid, RealType newParam) Set the range MathType of the lowest element.static FieldImpl
setParamType
(FieldImpl grid, RealType newParam, boolean copy) Set the range MathType of the lowest element.static FieldImpl
setParamType
(FieldImpl grid, TupleType newParam) Set the range MathType of the lowest element.static FieldImpl
setParamType
(FieldImpl grid, TupleType newParam, boolean copy) Set the range MathType of the lowest element.static FieldImpl
setPressureValues
(FieldImpl grid, float[] pressValues) Set the pressure values for a gridstatic FieldImpl
setSpatialDomain
(FieldImpl grid, SampledSet newDomain) Change the spatial domain of a grid using the new one.static FieldImpl
setSpatialDomain
(FieldImpl grid, SampledSet newDomain, boolean copy) Change the spatial domain of a grid using the new one.static FieldImpl
setVerticalValues
(FieldImpl grid, float[] newValues, RealType vertType, Unit vertUnit) Set the vertical valuesstatic FieldImpl
slice
(FieldImpl grid, SampledSet slice) Slice the grid at the positions defined by a SampledSet.static FieldImpl
slice
(FieldImpl grid, SampledSet slice, int samplingMode) Slice the grid at the positions defined by a SampledSet.static FieldImpl
slice
(FieldImpl grid, SampledSet slice, int samplingMode, int errorMode) Slice the grid at the positions defined by a SampledSet.static FieldImpl
sliceAlongLatLonLine
(FieldImpl grid, List<LatLonPoint> points, int samplingMode) Slice the grid along the line specified by the two LatLonPoint-sstatic FieldImpl
sliceAlongLatLonLine
(FieldImpl grid, List<LatLonPoint> points, int samplingMode, int errorMode) Slice the grid along the line specified by the two LatLonPoint-sstatic FieldImpl
sliceAlongLatLonLine
(FieldImpl grid, LatLonPoint start, LatLonPoint end) Slice the grid along the line specified by the two LatLonPoint-sstatic FieldImpl
sliceAlongLatLonLine
(FieldImpl grid, LatLonPoint start, LatLonPoint end, int samplingMode) Slice the grid along the line specified by the two LatLonPoint-sstatic FieldImpl
sliceAlongLatLonLine
(FieldImpl grid, LatLonPoint start, LatLonPoint end, int samplingMode, int errorMode) Slice the grid along the line specified by the two LatLonPoint-sstatic FieldImpl
sliceAtLevel
(FieldImpl grid, double levelValue) Slice the grid at the vertical level indictated.static FieldImpl
sliceAtLevel
(FieldImpl grid, Real level) Slice the grid at the vertical level indictated.static FieldImpl
sliceAtLevel
(FieldImpl grid, Real level, int samplingMode) Slice the grid at the vertical level indictated.static FieldImpl
sliceAtLevel
(FieldImpl grid, Real level, int samplingMode, int errorMode) Slice the grid at the vertical level indictated.static FieldImpl
Smooth a 2D fieldstatic FieldImpl
Smooth a 2D fieldstatic FieldImpl
Create a subset of the grid, skipping every nth point in the X and Y direction.static FieldImpl
Create a subset of the grid skipping every i'th x and j'th y point.static FieldImpl
Create a subset of the grid skipping every i'th x and j'th y point and k'th z pointstatic GriddedSet
subsetDomain
(GriddedSet domainSet, int skipx, int skipy, int skipz) Create a subset of the domainset skipping every i'th x and j'th y point.static FieldImpl
sumFromBaseTime
(FieldImpl grid) This creates a field where D(T) = D(T)+D(0) Any time steps up to the offset time are set to missingstatic FieldImpl
sumOverTime
(FieldImpl grid, boolean makeTimes) Sum each grid pointstatic FieldImpl
swapLatLon
(FieldImpl grid) Swap the lat/lon coordinates of the grid.static void
teststatic FieldImpl
timeStepDifference
(FieldImpl grid, int offset) This creates a field where D(T) = D(T)-D(T+offset) Any time steps up to the offset time are set to missingstatic FieldImpl
timeStepFunc
(FieldImpl grid, int offset, String func) This creates a field where is either D(T) = D(T)-D(T+offset) or D(T) = D(T)+D(T+offset) depending on the value of the func argument Any time steps up to the offset time are set to missing.static FieldImpl
timeStepSum
(FieldImpl grid, int offset) This creates a field where D(T) = D(T)+D(T+offset) Any time steps up to the offset time are set to missingstatic void
writeGridAtPolygonToXls
(FieldImpl grid, String filename, String fxgrfName) extract grid along polygon and write out to an Excel spreadsheetstatic void
writeGridToCsv
(FieldImpl grid, String filename) Write grid out to a CSV ascii filestatic void
writeGridToXls
(FieldImpl grid) Write grid out to an Excel spreadsheetstatic void
writeGridToXls
(FieldImpl grid, String filename) Write grid out to an Excel spreadsheetstatic double[]
yeoJohnsonTransform
(double[] data, double lambda) static float[]
yeoJohnsonTransform
(float[] data, double lambda)
-
Field Details
-
WEIGHTED_AVERAGE
public static final int WEIGHTED_AVERAGEWeighted average sampling mode- See Also:
-
NEAREST_NEIGHBOR
public static final int NEAREST_NEIGHBORNearest Neighbor sampling mode- See Also:
-
NO_ERRORS
public static final int NO_ERRORSNo error mode- See Also:
-
DEPENDENT_ERRORS
public static final int DEPENDENT_ERRORSDependent error mode- See Also:
-
INDEPENDENT_ERRORS
public static final int INDEPENDENT_ERRORSIndependent error mode- See Also:
-
DEFAULT_SAMPLING_MODE
public static final int DEFAULT_SAMPLING_MODEDefault sampling mode used for subsampling grids- See Also:
-
DEFAULT_ERROR_MODE
public static final int DEFAULT_ERROR_MODEDefault error mode used for subsampling grids- See Also:
-
FUNC_AVERAGE
function for the applyFunctionOverTime routine deprecated use GridMath.FUNC_AVERAGE- See Also:
-
FUNC_SUM
function for the applyFunctionOverTime routine deprecated use GridMath.FUNC_SUM- See Also:
-
FUNC_MAX
function for the applyFunctionOverTime routine deprecated use GridMath.FUNC_MAX- See Also:
-
FUNC_MIN
function for the applyFunctionOverTime routine deprecated use GridMath.FUNC_MIN- See Also:
-
FUNC_DIFFERENCE
function for the timeStepFunc routine deprecated use GridMath.FUNC_DIFFERENCE- See Also:
-
SMOOTH_5POINT
Five point smoother identifier- See Also:
-
SMOOTH_9POINT
Nine point smoother identifier- See Also:
-
SMOOTH_GAUSSIAN
Gaussian smoother identifier- See Also:
-
SMOOTH_CRESSMAN
Cressman smoother identifier- See Also:
-
SMOOTH_CIRCULAR
Barnes circular smoother identifier- See Also:
-
SMOOTH_RECTANGULAR
Barnes circular smoother identifier- See Also:
-
ENSEMBLE_TYPE
ensemble RealType
-
-
Constructor Details
-
GridUtil
public GridUtil()Default ctor
-
-
Method Details
-
isGrid
Check to see if this field is a grid that can be handled by these methods- Parameters:
field
- fieldImpl to check- Returns:
- true if the MathType of the grid is compatible with the ones this class can deal with
-
isConstantSpatialDomain
See if the spatial domain of this grid is constant (ie: not time varying)- Parameters:
grid
- grid to check- Returns:
- true if the spatial domain is constant
- Throws:
VisADException
- problem getting Data object
-
getSpatialDomain
Get the spatial domain for this grid.- Parameters:
grid
- grid to check- Returns:
- the spatial domain of the grid. If this is a time series it is the spatial domain of the first grid in the series
- Throws:
VisADException
- problem getting domain set
-
getWholeSpatialDomain
Get the spatial domain for this grid. If the grid is time sequence, this will check the domain in the sequence and find the largest domain , this is very useful in point data observation when returning the first time step spatial domain is not big enough to cover the later time step.- Parameters:
grid
- grid to check- Returns:
- the spatial domain of the grid. If this is a time series it is the spatial domain of the first grid in the series
- Throws:
VisADException
- problem getting domain set
-
getSpatialDomain
Get the spatial domain for this grid at the specified time step.- Parameters:
grid
- grid to checktimeIndex
- timestep to check- Returns:
- the spatial domain of the grid at the time step. If this is not a time series, timeIndex is ignored
- Throws:
VisADException
- problem getting domain set
-
setSpatialDomain
public static FieldImpl setSpatialDomain(FieldImpl grid, SampledSet newDomain) throws VisADException Change the spatial domain of a grid using the new one. Range values are not copied.- Parameters:
grid
- grid to change.newDomain
- Must have same length as current spatial domain of grid- Returns:
- new grid with new domain
- Throws:
VisADException
- wrong domain length or VisAD problem.
-
setSpatialDomain
public static FieldImpl setSpatialDomain(FieldImpl grid, SampledSet newDomain, boolean copy) throws VisADException Change the spatial domain of a grid using the new one.- Parameters:
grid
- grid to change.newDomain
- Must have same length as current spatial domain of gridcopy
- copy values- Returns:
- new grid with new domain
- Throws:
VisADException
- wrong domain length or VisAD problem.
-
isSinglePointDomain
See if the domain of the grid is a single point (only 1 x and y value). May have multiple vertical values at that one point.- Parameters:
grid
- grid to check- Returns:
- true if only one x,y value.
- Throws:
VisADException
- problem accessing grid
-
isSinglePointDomain
See if the domain is a single point (only 1 x and y value). May have multiple vertical values at that one point- Parameters:
ss
- domain set of the grid- Returns:
- true if only one x,y value.
- Throws:
VisADException
- problem accessing grid
-
isSequence
Check to see if this is a single grid or if it is a sequence of grids.- Parameters:
grid
- grid to check- Returns:
- true if the domain of the grid is 1 dimensional. It is not automatically a time sequence, though.
- See Also:
-
hasEnsemble
Check to see if this is an ensemble grid- Parameters:
grid
- grid to check- Returns:
- true if the domain of the grid is 1 dimensional and the type is convertible with ENSEMBLE_TYPE or a sequence and the inner type has a domain of ENSEMBLE_TYPE;
- Throws:
VisADException
- problem determining this
-
getEnsembleType
Get the RealType of the ensemble.- Parameters:
grid
- grid to check- Returns:
- RealType of ensemble paramter
- Throws:
VisADException
- unable to get the information- See Also:
-
getEnsembleSet
Return the ensemble set for the field- Parameters:
ensGrid
- the ensemble grid- Returns:
- the set or null if not an ensemble
- Throws:
VisADException
- problems reading data
-
isTimeSequence
Check to see if this is a single grid or if it is a time sequence of grids.- Parameters:
grid
- grid to check- Returns:
- true if the domain of the grid is 1 dimensional and the type is convertible with RealType.Time
- Throws:
VisADException
- problem determining this
-
getTimeSet
Get the time set from the grid.- Parameters:
grid
- grid to check- Returns:
- set of times or null if no times.
- Throws:
VisADException
- problem determining this
-
getDateTimeList
Get the list of DateTime objects from the domain of the given grid- Parameters:
grid
- grid to check- Returns:
- list of times or null list if no times.
- Throws:
VisADException
- problem determining this
-
isLatLonOrder
Check to see if this is a navigated grid (domain can be converted to lat/lon)- Parameters:
grid
- grid to check- Returns:
- true if the domain of the grid is in or has a reference to Latitude/Longitude
- Throws:
VisADException
- can't get at VisAD objects
-
isLatLonOrder
Check to see if this is a navigated domain (can be converted to lat/lon)- Parameters:
spatialSet
- spatial domain of the grid- Returns:
- true if the domain of the grid is in or has a reference to Latitude/Longitude
- Throws:
VisADException
- can't get at VisAD objects
-
getSequenceType
Get the RealType of the sequence.- Parameters:
grid
- grid to check- Returns:
- RealType of sequence paramter
- Throws:
VisADException
- unable to get the information- See Also:
-
is3D
Check to see if this is a 3D grid- Parameters:
grid
- grid to check- Returns:
- true if the spatial domain is 3 dimensional (i.e, (x,y,z))
- Throws:
VisADException
- unable to get the information
-
isVolume
Is the gievn field a volume. It is a volume if it is a 3d grid and if the manifold dimension is 3.- Parameters:
grid
- The grid- Returns:
- Is it a volume
- Throws:
VisADException
- On badness
-
sampleToRealTuple
public static RealTuple sampleToRealTuple(FieldImpl grid, EarthLocation el, Real animationValue, int samplingMode) throws VisADException, RemoteException This samples the given grid in both time and space and trys to return a Real value- Parameters:
grid
- The gridel
- LocationanimationValue
- The time to sample at. If null then we just sample at the locationsamplingMode
- mode to use- Returns:
- Real at the given location and time
- Throws:
RemoteException
- On badnessVisADException
- On badness
-
sampleToRealTuple
public static RealTuple sampleToRealTuple(FieldImpl grid, EarthLocation el, Real animationValue, int samplingMode, int errorMode) throws VisADException, RemoteException This samples the given grid in both time and space and trys to return a Real value- Parameters:
grid
- The gridel
- LocationanimationValue
- The time to sample at. If null then we just sample at the locationsamplingMode
- sampling mode to useerrorMode
- error mode to use- Returns:
- Real at the given location and time
- Throws:
RemoteException
- On badnessVisADException
- On badness
-
sampleToReal
public static Real sampleToReal(FieldImpl grid, EarthLocation el, Real animationValue) throws VisADException, RemoteException This samples the given grid in both time and space and trys to return a Real value- Parameters:
grid
- The gridel
- LocationanimationValue
- Time- Returns:
- Real at the given location and time
- Throws:
RemoteException
- On badnessVisADException
- On badness
-
sampleToReal
public static Real sampleToReal(FieldImpl grid, EarthLocation el, Real animationValue, int samplingMode) throws VisADException, RemoteException This samples the given grid in both time and space and trys to return a Real value- Parameters:
grid
- The gridel
- LocationanimationValue
- The time to sample at. If null then we just sample at the locationsamplingMode
- mode to use- Returns:
- Real at the given location and time
- Throws:
RemoteException
- On badnessVisADException
- On badness
-
sampleToReal
public static Real sampleToReal(FieldImpl grid, EarthLocation el, Real animationValue, int samplingMode, int errorMode) throws VisADException, RemoteException This samples the given grid in both time and space and trys to return a Real value- Parameters:
grid
- The gridel
- LocationanimationValue
- The time to sample at. If null then we just sample at the locationsamplingMode
- sampling mode to useerrorMode
- error mode to use- Returns:
- Real at the given location and time
- Throws:
RemoteException
- On badnessVisADException
- On badness
-
is3D
Check to see if this is a 3D domain- Parameters:
domainSet
- spatial domain of the grid- Returns:
- true if the spatial domain is 3 dimensional (i.e, (x,y,z))
- Throws:
VisADException
- unable to get the information
-
is2D
Check to see if this is a 2D grid- Parameters:
grid
- grid to check- Returns:
- true if the spatial domain is 2 dimensional (i.e, (x,y))
- Throws:
VisADException
- unable to get the information
-
is2D
Check to see if this is a 2D domain- Parameters:
domainSet
- spatial domain to check- Returns:
- true if the spatial domain is 2 dimensional (i.e, (x,y))
- Throws:
VisADException
- unable to get the information
-
subset
Create a subset of the grid, skipping every nth point in the X and Y direction.- Parameters:
grid
- grid to subsetskip
- x and y skip factor- Returns:
- subsampled grid
- Throws:
VisADException
- unable to subset the grid
-
subset
Create a subset of the grid skipping every i'th x and j'th y point.- Parameters:
grid
- grid to subsampleskipx
- x skip factorskipy
- y skip factor- Returns:
- subsampled grid
- Throws:
VisADException
- unable to subsample grid
-
subset
public static FieldImpl subset(FieldImpl grid, int skipx, int skipy, int skipz) throws VisADException Create a subset of the grid skipping every i'th x and j'th y point and k'th z point- Parameters:
grid
- grid to subsampleskipx
- x skip factorskipy
- y skip factorskipz
- z skip factor- Returns:
- subsampled grid
- Throws:
VisADException
- unable to subsample grid
-
subsetDomain
public static GriddedSet subsetDomain(GriddedSet domainSet, int skipx, int skipy, int skipz) throws VisADException Create a subset of the domainset skipping every i'th x and j'th y point.- Parameters:
domainSet
- domain to subsampleskipx
- x skip factorskipy
- y skip factorskipz
- z skip factor- Returns:
- subsampled grid
- Throws:
VisADException
- unable to subsample grid
-
sliceAtLevel
Slice the grid at the vertical level indictated.- Parameters:
grid
- grid to slice (must be a valid 3D grid)level
- level to slice at. level must have units convertible with the vertial coordinate of the spatial domain or it's reference if there is a CoordinateSystem associated with the domain.- Returns:
- spatial slice at level. If this is a sequence of grids it will be a sequence of the slices.
- Throws:
VisADException
- problem in resampling
-
sliceAtLevel
public static FieldImpl sliceAtLevel(FieldImpl grid, Real level, int samplingMode) throws VisADException Slice the grid at the vertical level indictated.- Parameters:
grid
- grid to slice (must be a valid 3D grid)level
- level to slice at. level must have units convertible with the vertial coordinate of the spatial domain or it's reference if there is a CoordinateSystem associated with the domain.samplingMode
- Data.WEIGHTED_AVERAGE or Data.NEAREST_NEIGHBOR- Returns:
- spatial slice at level. If this is a sequence of grids it will be a sequence of the slices.
- Throws:
VisADException
- problem in resampling
-
sliceAtLevel
public static FieldImpl sliceAtLevel(FieldImpl grid, Real level, int samplingMode, int errorMode) throws VisADException Slice the grid at the vertical level indictated.- Parameters:
grid
- grid to slice (must be a valid 3D grid)level
- level to slice at. level must have units convertible with the vertial coordinate of the spatial domain or it's reference if there is a CoordinateSystem associated with the domain.samplingMode
- Data.WEIGHTED_AVERAGE or Data.NEAREST_NEIGHBORerrorMode
- Data.NO_ERRORS, Data.DEPENDENT, Data.INDEPENDENT- Returns:
- spatial slice at level. If this is a sequence of grids it will be a sequence of the slices.
- Throws:
VisADException
- problem in resampling
-
isAllMissing
Check if all real values in a FieldImpl are missing.- Parameters:
field
- fieldImpl to check- Returns:
- true if all values are missing
- Throws:
VisADException
- unable to open VisAD object
-
isAllMissing
Check if all real values in a FieldImpl are missing.- Parameters:
grid
- grid to checkpopupErrorMessage
- pop up a JOptionDialog box is all are missing- Returns:
- true if all values are missing
- Throws:
VisADException
- unable to open VisAD object
-
isAnyMissing
Check if any of the real values in a FieldImpl are missing.- Parameters:
grid
- grid to check- Returns:
- true if all values are missing
- Throws:
VisADException
- unable to open VisAD object
-
averageOverTime
Average the grid over time- Parameters:
grid
- grid to averagemakeTimes
- If true then make a time field with the range being the same computed value If false then just return a single field of the computed values- Returns:
- the new field
- Throws:
VisADException
- On badness deprecated use GridMath.averageOverTime(FieldImpl, boolean)
-
timeStepDifference
This creates a field where D(T) = D(T)-D(T+offset) Any time steps up to the offset time are set to missing- Parameters:
grid
- grid to averageoffset
- time step offset. e.g., offset=-1 results in D(T)=D(T)-D(T-1)- Returns:
- the new field
- Throws:
VisADException
- On badness deprecated use GridMath.timeStepDifference(FieldImpl, int)
-
timeStepSum
This creates a field where D(T) = D(T)+D(T+offset) Any time steps up to the offset time are set to missing- Parameters:
grid
- grid to averageoffset
- time step offset. e.g., offset=-1 results in D(T)=D(T)+D(T-1)- Returns:
- the new field
- Throws:
VisADException
- On badness deprecated use GridMath.timeStepSum(FieldImpl, int)
-
differenceFromBaseTime
This creates a field where D(T) = D(T)-D(0) Any time steps up to the offset time are set to missing- Parameters:
grid
- grid to average- Returns:
- the new field
- Throws:
VisADException
- On badness deprecated use GridMath.differenceFromBaseTime(FieldImpl)
-
sumFromBaseTime
This creates a field where D(T) = D(T)+D(0) Any time steps up to the offset time are set to missing- Parameters:
grid
- grid to average- Returns:
- the new field
- Throws:
VisADException
- On badness deprecated use GridMath.sumFromBaseTime(FieldImpl)
-
timeStepFunc
This creates a field where is either D(T) = D(T)-D(T+offset) or D(T) = D(T)+D(T+offset) depending on the value of the func argument Any time steps up to the offset time are set to missing. If offset == 0 then we use D(0) as the fixed operand foreach operator, e.g.: D(T) = D(T) - D(0)- Parameters:
grid
- grid to averageoffset
- time step offset.func
- which function to apply, SUM or DIFFERENCE- Returns:
- the new field
- Throws:
VisADException
- On badness deprecated use GridMath.timeStepFunc(FieldImpl, int, String)
-
sumOverTime
Sum each grid point- Parameters:
grid
- grid to analyzemakeTimes
- If true then make a time field with the range being the same computed value. If false then just return a single field of the computed values- Returns:
- the new field
- Throws:
VisADException
- On badness deprecated use GridMath.sumOverTime(FieldImpl, boolean)
-
minOverTime
Take the min value at each grid point- Parameters:
grid
- grid to analyzemakeTimes
- If true then make a time field with the range being the same computed value. If false then just return a single field of the computed values- Returns:
- the new field
- Throws:
VisADException
- On badness deprecated use GridMath.minOverTime
-
maxOverTime
Take the max value at each grid point- Parameters:
grid
- grid to analyzemakeTimes
- If true then make a time field with the range being the same computed value. If false then just return a single field of the computed values- Returns:
- the new field
- Throws:
VisADException
- On badness deprecated use GridMath.maxOverTime(FieldImpl, boolean)
-
applyFunctionOverTime
public static FieldImpl applyFunctionOverTime(FieldImpl grid, String function, boolean makeTimes) throws VisADException Apply the function to the time steps of the given grid. The function is one of the GridMath.FUNC_ enums- Parameters:
grid
- grid to averagefunction
- One of the GridMath.FUNC_ enumsmakeTimes
- If true then make a time field with the range being the same computed value. If false then just return a single field of the computed values- Returns:
- the new field
- Throws:
VisADException
- On badness deprecated use GridMath.applyFunctionOverTime(FieldImpl, String, boolean)
-
makeDomain2D
Transform a (possibly) 3D set into a 2D set (removing the Z dimension)- Parameters:
domainSet
- the 2 or 3D domain- Returns:
- a 2D version with Z values removed
- Throws:
VisADException
- unable to create 2D slice
-
addLevelToGrid
public static FieldImpl addLevelToGrid(FieldImpl grid, double levelValue, String levelUnit) throws VisADException Add a level to a 2D grid- Parameters:
grid
- the gridlevelValue
- the level valuelevelUnit
- the level unit- Returns:
- new grid
- Throws:
VisADException
- for bad
-
makeNewParamType
public static TupleType makeNewParamType(TupleType oldParamType, String newSuffix) throws VisADException Make a new type for the field by appending the suffix to the exiting RealTypes in the range- Parameters:
oldParamType
- old parameter type containing only real componentsnewSuffix
- the new suffix for Range RealTypes- Returns:
- the new Range type
- Throws:
VisADException
- problem creating new types
-
makeGrid2D
rectangulrize the given field, making a grid2d out of its spatial domain and values- Parameters:
grid
- the grid- Returns:
- the grid2d
- Throws:
RemoteException
- On badnessVisADException
- On badness
-
testIt
test- Parameters:
grid
- test- Throws:
RemoteException
- On badnessVisADException
- On badness
-
sliceAtLevel
Slice the grid at the vertical level indictated. Value is assumed to be in the units of the domain set.- Parameters:
grid
- grid to slice (must be a valid 3D grid)levelValue
- level value to slice at. Value is assumed to be in the units of the vertical coordinate of the spatial domain of the FieldImpl- Returns:
- spatial slice at level. If this is a sequence of grids it will be a sequence of the slices.
- Throws:
VisADException
- problem in resampling
-
getProfileAtLatLonPoint
public static FieldImpl getProfileAtLatLonPoint(FieldImpl grid, LatLonPoint point) throws VisADException Returns a vertical profile of a grid at a Lat/Lon point. Returnsnull
if no such profile could be created.- Parameters:
grid
- grid to slice (must be a valid 3D grid)point
- LatLonPoint to sample at.- Returns:
- vertical slice at point or
null
. If this is a sequence of grids it will be a sequence of the slices. - Throws:
VisADException
- problem in resampling
-
getProfileAtLatLonPoint
public static FieldImpl getProfileAtLatLonPoint(FieldImpl grid, LatLonPoint point, int samplingMode) throws VisADException Returns a vertical profile of a grid at a Lat/Lon point. Returnsnull
if no such profile could be created.- Parameters:
grid
- grid to slice (must be a valid 3D grid)point
- LatLonPoint to sample at.samplingMode
- Data.WEIGHTED_AVERAGE or NEAREST_NEIGHBOR- Returns:
- vertical slice at point or
null
. If this is a sequence of grids it will be a sequence of the slices. - Throws:
VisADException
- problem in resampling
-
getProfileAtLatLonPoint
public static FieldImpl getProfileAtLatLonPoint(FieldImpl grid, LatLonPoint point, int samplingMode, int errorMode) throws VisADException Returns a vertical profile of a grid at a Lat/Lon point. Returnsnull
if no such profile could be created.- Parameters:
grid
- grid to slice (must be a valid 3D grid)point
- LatLonPoint to sample at.samplingMode
- Data.WEIGHTED_AVERAGE or NEAREST_NEIGHBORerrorMode
- Data.NO_ERRORS, Data.DEPENDENT, Data.INDEPENDENT- Returns:
- vertical slice at point or
null
. If this is a sequence of grids it will be a sequence of the slices. - Throws:
VisADException
- problem in resampling
-
sliceAlongLatLonLine
public static FieldImpl sliceAlongLatLonLine(FieldImpl grid, LatLonPoint start, LatLonPoint end) throws VisADException Slice the grid along the line specified by the two LatLonPoint-s- Parameters:
grid
- grid to slice (must be a valid 2D or 3D grid)start
- starting LatLonPoint of the lineend
- starting LatLonPoint of the line- Returns:
- spatial slice along the line. If this is a sequence of grids it will be a sequence of the slices.
- Throws:
VisADException
- problem in resampling
-
sliceAlongLatLonLine
public static FieldImpl sliceAlongLatLonLine(FieldImpl grid, LatLonPoint start, LatLonPoint end, int samplingMode) throws VisADException Slice the grid along the line specified by the two LatLonPoint-s- Parameters:
grid
- grid to slice (must be a valid 2D or 3D grid)start
- starting LatLonPoint of the lineend
- starting LatLonPoint of the linesamplingMode
- Data.WEIGHTED_AVERAGE or NEAREST_NEIGHBOR- Returns:
- spatial slice along the line. If this is a sequence of grids it will be a sequence of the slices.
- Throws:
VisADException
- problem in resampling
-
sliceAlongLatLonLine
public static FieldImpl sliceAlongLatLonLine(FieldImpl grid, List<LatLonPoint> points, int samplingMode) throws VisADException Slice the grid along the line specified by the two LatLonPoint-s- Parameters:
grid
- grid to slice (must be a valid 2D or 3D grid)points
- list of points along the linesamplingMode
- mode for sampling- Returns:
- spatial slice along the line. If this is a sequence of grids it will be a sequence of the slices.
- Throws:
VisADException
- problem in resampling
-
sliceAlongLatLonLine
public static FieldImpl sliceAlongLatLonLine(FieldImpl grid, List<LatLonPoint> points, int samplingMode, int errorMode) throws VisADException Slice the grid along the line specified by the two LatLonPoint-s- Parameters:
grid
- grid to slice (must be a valid 2D or 3D grid)points
- list of points along the linesamplingMode
- mode for samplingerrorMode
- Data.NO_ERRORS, Data.DEPENDENT, Data.INDEPENDENT- Returns:
- spatial slice along the line. If this is a sequence of grids it will be a sequence of the slices.
- Throws:
VisADException
- problem in resampling
-
sliceAlongLatLonLine
public static FieldImpl sliceAlongLatLonLine(FieldImpl grid, LatLonPoint start, LatLonPoint end, int samplingMode, int errorMode) throws VisADException Slice the grid along the line specified by the two LatLonPoint-s- Parameters:
grid
- grid to slice (must be a valid 2D or 3D grid)start
- starting LatLonPoint of the lineend
- starting LatLonPoint of the linesamplingMode
- mode for samplingerrorMode
- Data.NO_ERRORS, Data.DEPENDENT, Data.INDEPENDENT- Returns:
- spatial slice along the line. If this is a sequence of grids it will be a sequence of the slices.
- Throws:
VisADException
- problem in resampling
-
sample
Sample the grid at the position defined by the EarthLocation- Parameters:
grid
- grid to sample (must be a valid 3D grid)location
- EarthLocation to sample at.- Returns:
- grid representing the values of the original grid at the point defined by location. If this is a sequence of grids it will be a sequence of the values.
- Throws:
VisADException
- invalid point or some other problem
-
sample
public static FieldImpl sample(FieldImpl grid, float lat, float lon) throws VisADException, RemoteException Sample the grid at the position defined by the EarthLocation- Parameters:
grid
- grid to sample (must be a valid 3D grid)lat
- EarthLocation to sample at.lon
- EarthLocation to sample at.- Returns:
- grid representing the values of the original grid at the point defined by location. If this is a sequence of grids it will be a sequence of the values.
- Throws:
VisADException
- invalid point or some other problemRemoteException
-
sample
public static FieldImpl sample(FieldImpl grid, EarthLocation location, int samplingMode) throws VisADException Sample the grid at the position defined by the EarthLocation- Parameters:
grid
- grid to sample (must be a valid 3D grid)location
- EarthLocation to sample at.samplingMode
- Data.WEIGHTED_AVERAGE or NEAREST_NEIGHBOR- Returns:
- grid representing the values of the original grid at the point defined by location. If this is a sequence of grids it will be a sequence of the values.
- Throws:
VisADException
- invalid point or some other problem
-
sample
public static FieldImpl sample(FieldImpl grid, EarthLocation location, int samplingMode, int errorMode) throws VisADException Sample the grid at the position defined by the EarthLocation with the VisAD resampling method given.- Parameters:
grid
- grid to sample (must be a valid 3D grid)location
- EarthLocation to sample at.samplingMode
- Data.WEIGHTED_AVERAGE or NEAREST_NEIGHBORerrorMode
- Data.NO_ERRORS, Data.DEPENDENT, Data.INDEPENDENT- Returns:
- grid representing the values of the original grid at the point defined by location. If this is a sequence of grids it will be a sequence of the values.
- Throws:
VisADException
- invalid point or some other problem
-
sample
Sample the grid at the position defined by the LatLonPoint- Parameters:
grid
- grid to sample (must be a valid 3D grid)point
- LatLonPoint to sample at.- Returns:
- grid representing the values of the original grid at the point defined by point. If this is a sequence of grids it will be a sequence of the values.
- Throws:
VisADException
- invalid point or some other problem
-
sample
public static FieldImpl sample(FieldImpl grid, LatLonPoint point, int samplingMode) throws VisADException Sample the grid at the position defined by the LatLonPoint- Parameters:
grid
- grid to sample (must be a valid 3D grid)point
- LatLonPoint to sample at.samplingMode
- Data.WEIGHTED_AVERAGE or NEAREST_NEIGHBOR- Returns:
- grid representing the values of the original grid at the point defined by point. If this is a sequence of grids it will be a sequence of the values.
- Throws:
VisADException
- invalid point or some other problem
-
sample
public static FieldImpl sample(FieldImpl grid, LatLonPoint point, int samplingMode, int errorMode) throws VisADException Sample the grid at the position defined by the LatLonPoint- Parameters:
grid
- grid to sample (must be a valid 3D grid)point
- LatLonPoint to sample at.samplingMode
- Data.WEIGHTED_AVERAGE or NEAREST_NEIGHBORerrorMode
- Data.NO_ERRORS, Data.DEPENDENT, Data.INDEPENDENT- Returns:
- grid representing the values of the original grid at the point defined by point. If this is a sequence of grids it will be a sequence of the values.
- Throws:
VisADException
- invalid point or some other problem
-
slice
Slice the grid at the positions defined by a SampledSet.- Parameters:
grid
- grid to slice (must be a valid 3D grid)slice
- set of points to sample on. It must be compatible with the spatial domain of the grid.- Returns:
- a FieldImpl the grid representing the values of the original grid at the points defined by slice. If this is a sequence of grids it will be a sequence of the slices.
- Throws:
VisADException
- invalid slice or some other problem
-
slice
public static FieldImpl slice(FieldImpl grid, SampledSet slice, int samplingMode) throws VisADException Slice the grid at the positions defined by a SampledSet.- Parameters:
grid
- grid to slice (must be a valid 3D grid)slice
- set of points to sample on. It must be compatible with the spatial domain of the grid.samplingMode
- Data.WEIGHTED_AVERAGE or NEAREST_NEIGHBOR- Returns:
- a FieldImpl the grid representing the values of the original grid at the points defined by slice. If this is a sequence of grids it will be a sequence of the slices.
- Throws:
VisADException
- invalid slice or some other problem
-
slice
public static FieldImpl slice(FieldImpl grid, SampledSet slice, int samplingMode, int errorMode) throws VisADException Slice the grid at the positions defined by a SampledSet.- Parameters:
grid
- grid to slice (must be a valid 3D grid)slice
- set of points to sample on. It must be compatible with the spatial domain of the grid.samplingMode
- Data.WEIGHTED_AVERAGE or NEAREST_NEIGHBORerrorMode
- Data.NO_ERRORS, Data.DEPENDENT, Data.INDEPENDENT- Returns:
- a FieldImpl the grid representing the values of the original grid at the points defined by slice. If this is a sequence of grids it will be a sequence of the slices.
- Throws:
VisADException
- invalid slice or some other problem
-
make2DGridFromSlice
Transform a 2D slice (3D grid with 2D manifold) into a 2D grid.- Parameters:
slice
- slice to transform- Returns:
- slice as a 2D grid
- Throws:
VisADException
- unable to create 2D slice
-
make2DGridFromSlice
Transform a 2D slice (3D grid with 2D manifold) into a 2D grid.- Parameters:
slice
- slice to transformcopy
- true to copy data- Returns:
- slice as a 2D grid
- Throws:
VisADException
- unable to create 2D slice
-
getParamUnits
Get the range MathType of the lowest element. If this is a sequence, it will be the range type of the individual elements. If not, it will be the range- Parameters:
grid
- grid to check- Returns:
- TupleType of lowest element
- Throws:
VisADException
- unable to get at data types
-
printit
Print the type of the sample of a data object- Parameters:
field
- the field- Returns:
- the data type
- Throws:
RemoteException
- java RMI problemVisADException
- unable to get at data types
-
getParamType
Get the range MathType of the lowest element. If this is a sequence, it will be the range type of the individual elements. If not, it will be the range- Parameters:
grid
- grid to check- Returns:
- TupleType of lowest element
- Throws:
VisADException
- unable to get at data types
-
getParam
Extract the range MathType of the lowest element. If this is a sequence, it will be the range type of the individual elements. If not, it will be the range- Parameters:
grid
- grid to checkindex
- parameter index- Returns:
- TupleType of lowest element
- Throws:
VisADException
- unable to get at data types
-
getParam
Extract the range MathType of the lowest element. If this is a sequence, it will be the range type of the individual elements. If not, it will be the range- Parameters:
grid
- grid to checkindex
- parameter indexcopy
- true to make a copy- Returns:
- TupleType of lowest element
- Throws:
VisADException
- unable to get at data types
-
setParamType
Set the range MathType of the lowest element. If this is a sequence, it will be the range type of the individual elements. If not, it will be the range. Data is replicated.- Parameters:
grid
- grid to changenewName
- name of new parameter- Returns:
- a new FieldImpl with the new parameter type
- Throws:
VisADException
- problem setting new parameter
-
setParamType
public static FieldImpl setParamType(FieldImpl grid, String newName, boolean copy) throws VisADException Set the range MathType of the lowest element. If this is a sequence, it will be the range type of the individual elements. If not, it will be the range. Data is replicated.- Parameters:
grid
- grid to changenewName
- name of new parametercopy
- true to make a copy- Returns:
- a new FieldImpl with the new parameter type
- Throws:
VisADException
- problem setting new parameter
-
setParamType
public static FieldImpl setParamType(FieldImpl grid, String[] newNames, boolean copy) throws VisADException Set the range MathType of the lowest element. If this is a sequence, it will be the range type of the individual elements. If not, it will be the range. Data is replicated.- Parameters:
grid
- grid to changenewNames
- names of new parameterscopy
- true to make a copy- Returns:
- a new FieldImpl with the new parameter type
- Throws:
VisADException
- problem setting new parameter
-
setParamType
Set the range MathType of the lowest element. If this is a sequence, it will be the range type of the individual elements. If not, it will be the range. Data is replicated.- Parameters:
grid
- grid to changenewParam
- MathType of new parameter- Returns:
- a new FieldImpl with the new parameter type
- Throws:
VisADException
- problem setting new parameter
-
setParamType
public static FieldImpl setParamType(FieldImpl grid, RealType newParam, boolean copy) throws VisADException Set the range MathType of the lowest element. If this is a sequence, it will be the range type of the individual elements. If not, it will be the range.- Parameters:
grid
- grid to changenewParam
- RealType of new parametercopy
- true to copy data- Returns:
- a new FieldImpl with the new parameter type
- Throws:
VisADException
- problem setting new parameter
-
setParamType
Set the range MathType of the lowest element. If this is a sequence, it will be the range type of the individual elements. If not, it will be the range. Data is replicated.- Parameters:
grid
- grid to changenewParam
- MathType of new parameter- Returns:
- a new FieldImpl with the new parameter type
- Throws:
VisADException
- problem setting new parameter
-
setParamType
public static FieldImpl setParamType(FieldImpl grid, TupleType newParam, boolean copy) throws VisADException Set the range MathType of the lowest element. If this is a sequence, it will be the range type of the individual elements. If not, it will be the range.- Parameters:
grid
- grid to changenewParam
- MathType of new parametercopy
- true to copy the data- Returns:
- a new FieldImpl with the new parameter type
- Throws:
VisADException
- problem setting new parameter
-
extractParam
Extract the param from a sequence, it will be the range type of the individual elements. If not, it will be the range.- Parameters:
grid
- grid to changeparam
- MathType of new parameter- Returns:
- grid with just param in it
- Throws:
VisADException
- problem setting new parameter
-
extractParam
Extract a single parameter from a grid of multiple parameters.- Parameters:
grid
- to extract fromparamType
- param to extract- Returns:
- grid with just that param in it
- Throws:
VisADException
- some problem occured (like the param isn't in the grid)
-
normalizeLongitude
Make sure a longitude value for use in a spatial domain Set with Longitude in the spatial domain is inside the spatial domain's longitude range. If not, then adjust so that it is. If domain not of such coordinates, do nothing and return input value.- Parameters:
domain
- domain set of value for normalizationlon
- longitude- Returns:
- normalized longitude
- Throws:
VisADException
- problem accessing set
-
normalizeLongitude
Make sure a longitude value for use in a spatial domain Set with Longitude in the spatial domain is inside the spatial domain's longitude range. If not, then adjust so that it is. If domain not of such coordinates, do nothing and return input value.- Parameters:
domain
- domain set of value for normalizationlon
- longitude values- Returns:
- normalized longitude
- Throws:
VisADException
- problem accessing set
-
normalizeLongitude
public static double normalizeLongitude(SampledSet domain, double lon, Unit lonUnit) throws VisADException Make sure a longitude value for use in a spatial domain Set with Longitude in the spatial domain is inside the spatial domain's longitude range. If not, then adjust so that it is. If domain not of such coordinates, do nothing and return input value.- Parameters:
domain
- domain set of value for normalizationlon
- longitude valueslonUnit
- longitude unit- Returns:
- normalized longitude
- Throws:
VisADException
- problem accessing set
-
makeRadarMapProjection
Return a MapProjection that relates to the Radar*DCoordinateSystem.- Parameters:
radarCS
- radar coordinate system (Radar2DCoordinateSystem or Radar3DCoordinateSystem)- Returns:
- MapProjection corresponding to the radar CS
- Throws:
VisADException
- problem creating MapProjection.
-
resampleGrid
Resample the grid at the positions defined by a SampledSet using the default methods and error propagation.- Parameters:
grid
- grid to resample (must be a valid 3D grid)subDomain
- set of points to sample on. It must be compatible with the spatial domain of the grid.- Returns:
- a FieldImpl the grid representing the values of the original grid at the points defined by subDomain. If this is a sequence of grids it will be a sequence of the resamples.
- Throws:
VisADException
- invalid subDomain or some other problem
-
resampleGrid
public static FieldImpl resampleGrid(FieldImpl grid, SampledSet subDomain, int samplingMode) throws VisADException Resample the grid at the positions defined by a SampledSet using the method specified and default error propagation.- Parameters:
grid
- grid to resample (must be a valid 3D grid)subDomain
- set of points to sample on. It must be compatible with the spatial domain of the grid.samplingMode
- sampling method to use for slicing- Returns:
- a FieldImpl the grid representing the values of the original grid at the points defined by sampling set. If this is a sequence of grids it will be a sequence of the subsamples.
- Throws:
VisADException
- invalid subDomain or some other problem
-
getCenterPoint
Method to get the center point of a grid's spatial domain as a RealTuple.- Parameters:
grid
- grid to evaluate- Returns:
- center point (x,y,z) of the grid in native coordinates. If the domain has a CoordinateSystem (e.g., (x,y,z) -> (lat,lon,alt) that will be included in the returned tuple.
- Throws:
VisADException
- problem accessing the data
-
getCenterPoint
Method to get the center point of a spatial domain as a RealTuple.- Parameters:
spatialDomain
- domain to evaluate- Returns:
- center point (x,y,z) of the domain in native coordinates. If the domain has a CoordinateSystem (e.g., (x,y,z) -> (lat,lon,alt) that will be included in the returned tuple.
- Throws:
VisADException
- problem accessing the data
-
getCenterLatLonPoint
Get the latitude/longitude point at the center of the grid.- Parameters:
grid
- grid to evaluate- Returns:
- center lat/lon or null if not navigated
- Throws:
VisADException
- problem accessing the data
-
getCenterLatLonPoint
Get the latitude/longitude point at the center of the domain.- Parameters:
spatialDomain
- domain to evaluate- Returns:
- center lat/lon or null if not navigated
- Throws:
VisADException
- problem accessing the data
-
resampleGrid
public static FieldImpl resampleGrid(FieldImpl grid, SampledSet subDomain, int samplingMode, int errorMode) throws VisADException Resample the grid at the positions defined by a SampledSet.- Parameters:
grid
- grid to resample (must be a valid 3D grid)subDomain
- set of points to sample on. It must be compatible with the spatial domain of the grid.samplingMode
- sampling method to use for slicingerrorMode
- error method to use for error propagation- Returns:
- a FieldImpl the grid representing the values of the original grid at the points defined by subDomain. If this is a sequence of grids it will be a sequence of the subsets.
- Throws:
VisADException
- invalid subDomain or some other problem
-
getLevel
Get the altitude corresponding to the level specified using the domain of the grid.- Parameters:
grid
- grid to usealtitude
- altitude to convert.- Returns:
- corresponding value of the vertical dimension of the grid. May be missing if conversion can't happen.
- Throws:
VisADException
- for bad
-
getAltitude
Get the altitude corresponding to the level specified using the domain of the grid.- Parameters:
grid
- grid to uselevel
- must be compatible (unit wise) with vertical coordinate of the grid- Returns:
- altitude (in m) corresponding to level using coordinate system of the grid's domain. May be missing if conversion can't happen.
- Throws:
VisADException
- VisAD error
-
getAltitude
Get the altitude corresponding to the level specified using the domain of the grid.- Parameters:
domainSet
- sampledSet to uselevel
- must be compatible (unit wise) with vertical coordinate of the grid- Returns:
- altitude (in m) corresponding to level using coordinate system of the grid's domain. May be missing if conversion can't happen.
- Throws:
VisADException
- VisAD error
-
getVerticalType
Get the RealType of the vertical dimension of the spatial domain of the grid.- Parameters:
grid
- grid to check- Returns:
- RealType of the vertical dimension of the grid's spatial domain
- Throws:
VisADException
- problem getting the type
-
getVerticalType
Get the unit of the vertical dimension of the domain set.- Parameters:
domainSet
- domainSet to check- Returns:
- RealType of the vertical dimension domainSet
- Throws:
VisADException
- problem getting the type
-
getVerticalUnit
Get the unit of the vertical dimension of the spatial domain of the grid.- Parameters:
grid
- domain to check- Returns:
- unit of the raw vertical data in the grid's domain set.
- Throws:
VisADException
- problem getting the unit
-
getVerticalUnit
Get the unit of the vertical dimension of the domain.- Parameters:
domainSet
- domain to check- Returns:
- unit of the raw data in the domainSet
- Throws:
VisADException
- problem getting the unit
-
canSliceAtLevel
Determine whether the grid in question can be sliced at the level specified (i.e., units or CS allows this)- Parameters:
grid
- grid in questionlevel
- level in question- Returns:
- true if the level is compatible with the grid.
- Throws:
VisADException
- problem creating VisAD object
-
canSliceAtLevel
Determine whether the set in question can be sliced at the level specified (i.e., units or CS allows this)- Parameters:
spatialSet
- domain set to checklevel
- level in question- Returns:
- true if the level is compatible with the grid.
- Throws:
VisADException
- problem creating VisAD object
-
fieldMinMax
Find min and max of range data in any VisAD FlatField- Parameters:
field
- a VisAD FlatField. Cannot be null- Returns:
- the range of the data. Dimension is the number of parameters in the range of the flat field
- Throws:
RemoteException
- Java RMI errorVisADException
- VisAD Error
-
makeRange
Make a range from a VisAD data range- Parameters:
range
- the data range- Returns:
- range
-
makeRanges
Make an array of Ranges from an array of DataRanges- Parameters:
range
- the DataRanges- Returns:
- the Ranges
-
makeDataRange
Make a DataRange from a Range- Parameters:
range
- the Range- Returns:
- the DataRange
-
makeDataRanges
Make an array of DataRanges from an array of Ranges- Parameters:
range
- the Ranges- Returns:
- DataRanges
-
getMinMax
get max and min of all range values in the current active fieldImpl- Parameters:
fieldImpl
- input field with outer dimension of time- Returns:
- range of all parameters in the field
- Throws:
RemoteException
- Java RMI errorVisADException
- VisAD Error
-
printModes
Print out the sampling and error modes modes- Parameters:
samplingMode
- sampling modeerrorMode
- error mode- Returns:
- String for these modes
-
getGridAsPointObs
Convert a grid to point obs- Parameters:
grid
- grid to convert- Returns:
- Field of point observations for each point
- Throws:
VisADException
- problem getting data
-
getEarthLocationPoints
Convert the domain to the reference earth located points- Parameters:
domain
- the domain set- Returns:
- the lat/lon/(alt) points
- Throws:
VisADException
- problem converting points
-
findContainedIndices
Find the indices of the domain values contained in the map- Parameters:
domain
- domain to usemap
- the map lines containing bounding polygons- Returns:
- indices in the domain
- Throws:
VisADException
- problem sampling
-
findContainedIndices
Find the indices of the latlon values contained in the map- Parameters:
latlon
- set of lat/lon valuesmap
- the map lines containing bounding polygons- Returns:
- indices in the domain
- Throws:
VisADException
- problem sampling
-
findNotContainedIndices
public static int[][] findNotContainedIndices(GriddedSet domain, UnionSet map) throws VisADException find the indices not contained in the map domian- Parameters:
domain
- grid domainmap
- map of values- Returns:
- array of indicies
- Throws:
VisADException
- problem getting at the data
-
findNotContainedIndices
Find the indices of the latlon values contained in the map- Parameters:
latlon
- set of lat/lon valuesmap
- the map lines containing bounding polygons- Returns:
- indices in the domain
- Throws:
VisADException
- problem sampling
-
getLatLons
Find the lat/lon values in the given spatial domain for the given indices- Parameters:
domain
- domain to useindices
- index array we get from findContainedIndices methods. i.e., indices[numPolygons][numIndices]- Returns:
- the lat lons of the form:
float[numPolygonPoints][2][numPoints]
- Throws:
VisADException
- problem sampling
-
getLatLons
Find the lat/lon values in the given spatial domain for the given indices- Parameters:
latlons
- lat/lons from the spatial domainindices
- index array we get from findContainedIndices methods. i.e., indices[numPolygons][numIndices]- Returns:
- the lat lons of the form:
float[numPolygonPoints][2][numPoints]
- Throws:
VisADException
- problem sampling
-
findContainedLatLons
public static float[][][] findContainedLatLons(GriddedSet domain, UnionSet maps) throws VisADException Find the lat/lon values in the given spatial domain contained by the polygons in the given map set- Parameters:
domain
- domain to usemaps
- The maps- Returns:
- the lat lons of the form:
float[numPolygonPoints][2][numPoints]
- Throws:
VisADException
- problem sampling
-
findContainedLatLons
public static float[][][] findContainedLatLons(float[][] latlons, UnionSet maps) throws VisADException Find the lat/lon values in the given spatial domain contained by the polygons in the given map set- Parameters:
latlons
- the lat/lons from the domainmaps
- The maps- Returns:
- the lat lons of the form:
float[numPolygonPoints][2][numPoints]
- Throws:
VisADException
- problem sampling
-
findIndicesInsideRange
public static int[][] findIndicesInsideRange(float[][] values, float min, float max) throws VisADException Finds the indices of the values array whose value is in the given range- Parameters:
values
- valuesmin
- min valuemax
- max value- Returns:
- indices
- Throws:
VisADException
- On badness
-
findIndicesOutsideRange
public static int[][] findIndicesOutsideRange(float[][] values, float min, float max) throws VisADException Finds the indices of the values array whose value is not in the given range- Parameters:
values
- valuesmin
- min valuemax
- max value- Returns:
- indices
- Throws:
VisADException
- On badness
-
getLatLon
Convert the domain to the reference earth located points. If the domain is not in lat/lon order then reset the order so that result[0] is the latitudes, result[1] is the longitudes- Parameters:
domain
- the domain set- Returns:
- the lat/lon/(alt) points
- Throws:
VisADException
- problem converting points
-
getLatLonRect
Convert the domain to the latlonRect- Parameters:
domain
- the domain set- Returns:
- the latlonrect
- Throws:
VisADException
- problem converting points
-
max
public static float max(float[] array) -
min
public static float min(float[] array) -
main
test- Parameters:
args
- args- Throws:
Exception
- On badness
-
writeGridToXls
Write grid out to an Excel spreadsheet- Parameters:
grid
- grid to write- Throws:
Exception
- problem writing grid
-
writeGridToXls
Write grid out to an Excel spreadsheet- Parameters:
grid
- grid to writefilename
- filename- Throws:
Exception
- problem writing grid
-
writeGridAtPolygonToXls
public static void writeGridAtPolygonToXls(FieldImpl grid, String filename, String fxgrfName) throws Exception extract grid along polygon and write out to an Excel spreadsheet- Parameters:
grid
- grid to writefilename
- filenamefxgrfName
- xgrf filename- Throws:
Exception
- problem writing grid
-
writeGridToCsv
Write grid out to a CSV ascii file- Parameters:
grid
- grid to writefilename
- filename- Throws:
Exception
- problem writing grid
-
exportGridToNetcdf
Write grid out to a netCDF CF compliant file- Parameters:
grid
- grid to write- Throws:
Exception
- problem writing grid
-
exportGridToNetcdf
Write grid out to a netCDF CF compliant file- Parameters:
grid
- grid to writefilename
- filename- Throws:
Exception
- problem writing grid
-
setPressureValues
public static FieldImpl setPressureValues(FieldImpl grid, float[] pressValues) throws VisADException Set the pressure values for a grid- Parameters:
grid
- grid to changepressValues
- pressure values. Must match number of levels in the grid. Units are millibars.- Returns:
- a grid with vertical levels in pressure
- Throws:
VisADException
- problem setting the values
-
setAltitudeValues
Set the altitude values for a grid- Parameters:
grid
- grid to changealtValues
- altitude values. Must match number of levels in the grid. Units are meters.- Returns:
- a grid with vertical levels in meters
- Throws:
VisADException
- problem setting the values
-
setVerticalValues
public static FieldImpl setVerticalValues(FieldImpl grid, float[] newValues, RealType vertType, Unit vertUnit) throws VisADException Set the vertical values- Parameters:
grid
- the grid to changenewValues
- the new vertical values. Must match the number of vertical levels in the grid.vertType
- the type of the datavertUnit
- the unit ofnewValues
- Returns:
- modified grid
- Throws:
VisADException
- problem setting the values
-
findMinMaxAverage
public static List<FieldStats> findMinMaxAverage(FieldImpl field, UnionSet mapSets) throws VisADException, RemoteException Find the min/max and average of a file inside the mapsets- Parameters:
field
- the fieldmapSets
- The map sets- Returns:
- the list of FieldStats
- Throws:
RemoteException
- Java RMI problemVisADException
- problem getting the values
-
findMinMaxAverageFromRange
public static FieldStats findMinMaxAverageFromRange(FlatField field, UnionSet mapSets) throws VisADException, RemoteException Find the min, max and average from the range- Parameters:
field
- the fieldmapSets
- the mapsets- Returns:
- the stats
- Throws:
RemoteException
- Java RMI errorVisADException
- VisAD Data error
-
canSwapLatLon
Can the lat/lons be swapped?- Parameters:
grid
- to check- Returns:
- true if 2D and no CS and either lat/lon or lon/lat
- Throws:
VisADException
- problem determining if we can swap
-
swapLatLon
Swap the lat/lon coordinates of the grid. Grid must be 2D and have no coordinate system- Parameters:
grid
- grid to swap- Returns:
- lat/lon swapped grid
- Throws:
VisADException
- VisAD problem
-
smooth
Smooth a 2D field- Parameters:
slice
- the 2D slicetype
- the type of smoothing (SMOOTH_5POINT, etc)- Returns:
- the smoothed grid or null
- Throws:
VisADException
- VisAD Error
-
smooth
Smooth a 2D field- Parameters:
slice
- the 2D slicetype
- the type of smoothing (SMOOTH_5POINT, etc)filterLevel
- level of filtering (used for SMOOTH_GAUSSIAN only)- Returns:
- the smoothed grid or null
- Throws:
VisADException
- VisAD Error
-
makeGrid
public static float[][] makeGrid(float[][] grid2D, int numCols, int numRows, float missingValue) Make a grid structure- Parameters:
grid2D
- the valuesnumCols
- number of columnsnumRows
- number of rowsmissingValue
- the missing value- Returns:
- the grid structure
-
makeGrid
public static float[][] makeGrid(float[][][] grid2D, int numCols, int numRows, float missingValue) Make a grid structure- Parameters:
grid2D
- the valuesnumCols
- number of columnsnumRows
- number of rowsmissingValue
- the missing value- Returns:
- the grid structure
-
fillMissing
public static void fillMissing(float[][] grid2D, float missingValue) Fill a structure with missing values with nearby grid values- Parameters:
grid2D
- grid structuremissingValue
- missing value
-
lonFlip
Flip the grid along the central longitude. Useful for converting 0-360 to -180 to 180 or vice-versa.- Parameters:
grid
- the grid to flip- Returns:
- the flipped grid
- Throws:
RemoteException
- Java RMI problemVisADException
- VisAD problem reading data
-
isLonCyclic
public static boolean isLonCyclic(double first, double last) Check to see if the longitude values are cyclic within the default epsilon (i.e., last == first+360 +- 0.0005)- Parameters:
first
- first valuelast
- last value- Returns:
- true if they are cyclic
-
isLonCyclic
public static boolean isLonCyclic(double first, double last, double epsilon) Check to see if the longitude values are cyclic (i.e., last == first+360 within esplion)- Parameters:
first
- first valuelast
- last valueepsilon
- last value- Returns:
- true if they are cyclic
-
read
respond to the read data call and return list of Glyph- Parameters:
filename
- input file name- Returns:
- list of drawinglyph
-
parseXml
public static List parseXml(Element root, boolean initialXml) throws VisADException, RemoteException Process the glyph xml with only polygon glyph.- Parameters:
root
- Root of the xml dominitialXml
- Did this come from the data choice or from an import- Returns:
- list of glyph
- Throws:
RemoteException
- When bad things happenVisADException
- When bad things happen
-
glyphsToMap
Process the glyph to Unionset.- Parameters:
domainSet
- domain setglyphs
- list of polygon glyph- Returns:
- unionset
- Throws:
Exception
- for bad
-
medianFilter
public static FieldImpl medianFilter(FieldImpl field, int window_lenx, int window_leny) throws VisADException, RemoteException, CloneNotSupportedException Process medianFilter mean filtering is simply to replace each pixel value in an image with the mean (average) value of its neighbors, including itself- Parameters:
field
- inputwindow_lenx
- default value is 10window_leny
- default value is 10- Returns:
- the filtered field
- Throws:
VisADException
- for badRemoteException
- for badCloneNotSupportedException
- for bad
-
medianFilter
public static FlatField medianFilter(FlatField fltFld, int window_lenx, int window_leny) throws VisADException, RemoteException Process medianFilter- Parameters:
fltFld
- input ffwindow_lenx
- default value is 10window_leny
- default value is 10- Returns:
- the median filtered flatfield
- Throws:
VisADException
- for badRemoteException
- for bad
-
medianFilter
public static float[] medianFilter(float[] A, int lenx, int leny, int window_lenx, int window_leny) throws VisADException Process medianFilter- Parameters:
A
- array of floatlenx
- x dimensionleny
- y dimensionwindow_lenx
- x dimension lengthwindow_leny
- y dimension length- Returns:
- float array
- Throws:
VisADException
- for bad
-
medianFilterOrg
public static float[] medianFilterOrg(float[] A, int lenx, int leny, int window_lenx, int window_leny) throws VisADException - Throws:
VisADException
-
classifier
public static FieldImpl classifier(FieldImpl field, String classifierStr, String outFileName) throws Exception A classifier in machine learning is an algorithm that automatically orders or categorizes data into one or more of a set of “classes.”- Parameters:
field
- the input fieldclassifierStr
- input string of classifieroutFileName
- output file name- Returns:
- the classifier fieldimpl
- Throws:
Exception
- for bad
-
replaceRangeValues
public static FieldImpl replaceRangeValues(FieldImpl grid, float low, float high, float newValue) throws VisADException, RemoteException Process for classifier- Parameters:
grid
- the input fieldlow
- lower rangehigh
- higher rangenewValue
- replace value- Returns:
- the field with new values
- Throws:
VisADException
- for badRemoteException
- for bad
-
yeoJohnsonTransform
public static double[] yeoJohnsonTransform(double[] data, double lambda) -
yeoJohnsonTransform
public static float[] yeoJohnsonTransform(float[] data, double lambda) -
findOptimalLambda
public static double findOptimalLambda(double[] data, double minLambda, double maxLambda, double stepSize) -
findOptimalLambda
public static double findOptimalLambda(float[] data, double minLambda, double maxLambda, double stepSize) -
logLikelihood
public static double logLikelihood(double[] data, double lambda) -
mean
public static double mean(double[] data)
-