|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectNetCDFUtilities
public class NetCDFUtilities
Set of NetCDF utility methods.
Nested Class Summary | |
---|---|
static class |
NetCDFUtilities.CheckType
|
static class |
NetCDFUtilities.DatasetAttribs
|
static class |
NetCDFUtilities.KeyValuePair
|
static class |
NetCDFUtilities.ProjAttribs
|
Field Summary | |
---|---|
static String |
COORDINATE_AXIS_TYPE
|
static String |
COORDSYS
|
static String |
DEPTH
|
static String |
HEIGHT
|
static String |
LAT
|
static String |
LATITUDE
|
static String |
LON
|
static String |
LONG_NAME
|
static String |
LONGITUDE
|
static String |
LOWER_LEFT_LATITUDE
|
static String |
LOWER_LEFT_LONGITUDE
|
static String |
NAME
|
static String |
POSITIVE
|
static String |
TIME
|
static String |
UNITS
|
static String |
UPPER_RIGHT_LATITUDE
|
static String |
UPPER_RIGHT_LONGITUDE
|
static Set<DataType> |
VALID_TYPES
The data type to accept in images. |
static int |
X_DIMENSION
The dimension relative to the rank in #variable
to use as image width. |
static int |
Y_DIMENSION
The dimension relative to the rank in #variable
to use as image height. |
static int |
Z_DIMENSION
The default dimension relative to the rank in #variable to use as Z dimension. |
static String |
ZETA
|
Method Summary | |
---|---|
static NetCDFUtilities.KeyValuePair |
getAttribute(Variable var,
int attributeIndex)
|
static Number |
getAttributesAsNumber(Variable var,
String attributeName)
|
static String |
getAttributesAsString(Attribute attr)
|
static String |
getAttributesAsString(Attribute attr,
boolean isUnsigned)
Return the value of a NetCDF Attribute instance as a
String . |
static String |
getAttributesAsString(Variable var,
String attributeName)
|
static Format |
getAxisFormat(AxisType type,
String prototype)
Returns a format to use for parsing values along the specified axis type. |
static NetCDFUtilities.CheckType |
getCheckType(NetcdfDataset dataset)
Depending on the type of model/netcdf file, we will check for the presence of some variables rather than some others. |
static NetcdfDataset |
getDataset(Object input)
Returns a NetcdfDataset given an input object |
static NetCDFUtilities.KeyValuePair |
getGlobalAttribute(NetcdfDataset dataset,
int attributeIndex)
|
static String |
getGlobalAttributeAsString(NetcdfDataset dataset,
String attributeName)
Return a global attribute as a String . |
static int |
getRawDataType(VariableIF variable)
Returns the data type which most closely represents the "raw" internal data of the variable. |
static int |
getTIndex(Variable var,
Range range,
int imageIndex)
Utility method to retrieve the t-index of a Variable descriptor stored on NetCDFImageReader NetCDF Flat Reader HashMap indexMap. |
static int |
getZIndex(Variable var,
Range range,
int imageIndex)
Utility method to retrieve the z-index of a Variable descriptor stored on NetCDFImageReader NetCDF Flat Reader HashMap indexMap. |
static boolean |
isVariableAccepted(Variable var,
NetCDFUtilities.CheckType checkType)
NetCDF files may contains a wide set of variables. |
static String |
trimFractionalPart(String value)
|
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String LOWER_LEFT_LONGITUDE
public static final String LOWER_LEFT_LATITUDE
public static final String UPPER_RIGHT_LONGITUDE
public static final String UPPER_RIGHT_LATITUDE
public static final String COORDSYS
public static final String LATITUDE
public static final String LAT
public static final String LONGITUDE
public static final String LON
public static final String DEPTH
public static final String ZETA
public static final String HEIGHT
public static final String TIME
public static final String COORDINATE_AXIS_TYPE
public static final String POSITIVE
public static final String UNITS
public static final String NAME
public static final String LONG_NAME
public static final int X_DIMENSION
#variable
to use as image width. The actual dimension is
variable.getRank() - X_DIMENSION
. Is hard-coded because the loop
in the read
method expects this order.
public static final int Y_DIMENSION
#variable
to use as image height. The actual dimension is
variable.getRank() - Y_DIMENSION
. Is hard-coded because the loop
in the read
method expects this order.
public static final int Z_DIMENSION
#variable
to use as Z dimension. The actual dimension is
variable.getRank() - Z_DIMENSION
.
public static final Set<DataType> VALID_TYPES
Method Detail |
---|
public static int getTIndex(Variable var, Range range, int imageIndex)
NetCDFImageReader
NetCDF Flat Reader HashMap
indexMap.
var
- Variable
range
- Range
imageIndex
- int
int
-1 if variable rank > 4public static int getZIndex(Variable var, Range range, int imageIndex)
NetCDFImageReader
NetCDF Flat Reader HashMap
indexMap.
var
- Variable
range
- Range
imageIndex
- int
int
-1 if variable rank < 3public static int getRawDataType(VariableIF variable)
NetcdfImageReader#getRawDataType
.
variable
- The variable.
DataBuffer.TYPE_UNDEFINED
if unknown.NetcdfImageReader#getRawDataType
public static String getAttributesAsString(Attribute attr)
public static String getAttributesAsString(Variable var, String attributeName)
public static Number getAttributesAsNumber(Variable var, String attributeName)
public static String getAttributesAsString(Attribute attr, boolean isUnsigned)
Attribute
instance as a
String
. The isUnsigned
parameter allow to handle byte
attributes as unsigned, in order to represent values in the range
[0,255].
public static boolean isVariableAccepted(Variable var, NetCDFUtilities.CheckType checkType)
true
if the
specified variable is accepted.
public static String trimFractionalPart(String value)
value
-
public static NetcdfDataset getDataset(Object input) throws IOException
NetcdfDataset
given an input object
input
- the input object (usually a File
, a
String
or a {@code FileImageInputStreamExt).
NetcdfDataset
in case of success.
IOException
- if some error occur while opening the dataset.
{@link
- IllegalArgumentException}
in case the specified input is a directorypublic static Format getAxisFormat(AxisType type, String prototype)
DateFormat
using the "yyyy-MM-dd HH:mm:ss"
pattern in UTC
timezone.NumberFormat
.The Canada locale is used by default for most formats because it is relatively close to ISO (for example regarding days and months order in dates) while using the English symbols.
type
- The type of the axis.prototype
- An example of the values to be parsed. Implementations may
parse this prototype when the axis type alone is not
sufficient. For example the time
axis type should uses the "yyyy-MM-dd"
date
pattern, but some files do not follow this convention and
use the default local instead.
public static NetCDFUtilities.CheckType getCheckType(NetcdfDataset dataset)
dataset
- the input dataset.
NetCDFUtilities.CheckType
to be performed on the specified
dataset.public static String getGlobalAttributeAsString(NetcdfDataset dataset, String attributeName)
String
. The required global
attribute is specified by name
attributeName
- the name of the required attribute.
public static NetCDFUtilities.KeyValuePair getGlobalAttribute(NetcdfDataset dataset, int attributeIndex) throws IOException
IOException
public static NetCDFUtilities.KeyValuePair getAttribute(Variable var, int attributeIndex)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |