Package ucar.nc2.iosp
Class NetcdfFormatUtils
- java.lang.Object
-
- ucar.nc2.iosp.NetcdfFormatUtils
-
public class NetcdfFormatUtils extends Object
Utilities and Constants specific to the Netcdf file format (Netcdf-3 and Netcdf-4)
-
-
Field Summary
Fields Modifier and Type Field Description static byte
NC_FILL_BYTE
static char
NC_FILL_CHAR
static double
NC_FILL_DOUBLE
static float
NC_FILL_FLOAT
static int
NC_FILL_INT
static long
NC_FILL_INT64
static short
NC_FILL_SHORT
static String
NC_FILL_STRING
static byte
NC_FILL_UBYTE
static int
NC_FILL_UINT
static long
NC_FILL_UINT64
static short
NC_FILL_USHORT
static String
NETCDF4_COORDINATES
static String
NETCDF4_DIMID
static String
NETCDF4_NON_COORD
static String
NETCDF4_STRICT
-
Constructor Summary
Constructors Constructor Description NetcdfFormatUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Number
getFillValueDefault(ArrayType dtype)
The default fill value for Netcdf 3 files.static boolean
isValidNetcdfObjectName(String name)
Determine if the given name can be used for a NetCDF object, i.e.static String
makeValidNetcdfObjectName(String name)
Convert a name to a legal netcdf-3 name.
-
-
-
Field Detail
-
NC_FILL_BYTE
public static final byte NC_FILL_BYTE
- See Also:
- Constant Field Values
-
NC_FILL_CHAR
public static final char NC_FILL_CHAR
- See Also:
- Constant Field Values
-
NC_FILL_SHORT
public static final short NC_FILL_SHORT
- See Also:
- Constant Field Values
-
NC_FILL_INT
public static final int NC_FILL_INT
- See Also:
- Constant Field Values
-
NC_FILL_FLOAT
public static final float NC_FILL_FLOAT
- See Also:
- Constant Field Values
-
NC_FILL_DOUBLE
public static final double NC_FILL_DOUBLE
- See Also:
- Constant Field Values
-
NC_FILL_UBYTE
public static final byte NC_FILL_UBYTE
- See Also:
- Constant Field Values
-
NC_FILL_USHORT
public static final short NC_FILL_USHORT
- See Also:
- Constant Field Values
-
NC_FILL_UINT
public static final int NC_FILL_UINT
- See Also:
- Constant Field Values
-
NC_FILL_INT64
public static final long NC_FILL_INT64
- See Also:
- Constant Field Values
-
NC_FILL_UINT64
public static final long NC_FILL_UINT64
- See Also:
- Constant Field Values
-
NC_FILL_STRING
public static final String NC_FILL_STRING
- See Also:
- Constant Field Values
-
NETCDF4_COORDINATES
public static final String NETCDF4_COORDINATES
- See Also:
- Constant Field Values
-
NETCDF4_DIMID
public static final String NETCDF4_DIMID
- See Also:
- Constant Field Values
-
NETCDF4_STRICT
public static final String NETCDF4_STRICT
- See Also:
- Constant Field Values
-
NETCDF4_NON_COORD
public static final String NETCDF4_NON_COORD
- See Also:
- Constant Field Values
-
-
Method Detail
-
getFillValueDefault
public static Number getFillValueDefault(ArrayType dtype)
The default fill value for Netcdf 3 files.
-
isValidNetcdfObjectName
public static boolean isValidNetcdfObjectName(String name)
Determine if the given name can be used for a NetCDF object, i.e. a Dimension, Attribute, or Variable. The allowed name syntax (in RE form) is:([a-zA-Z0-9_]|{UTF8})([^\x00-\x1F\x7F/]|{UTF8})*
where UTF8 represents a multi-byte UTF-8 encoding. Also, no trailing spaces are permitted in names. We do not allow '/' because HDF5 does not permit slashes in names as slash is used as a group separator. If UTF-8 is supported, then a multi-byte UTF-8 character can occur anywhere within an identifier.- Parameters:
name
- the name to validate.- Returns:
true
if the name is valid.
-
makeValidNetcdfObjectName
public static String makeValidNetcdfObjectName(String name)
Convert a name to a legal netcdf-3 name.- Parameters:
name
- the name to convert.- Returns:
- the converted name.
- See Also:
isValidNetcdfObjectName(String)
-
-