|
Terrenus HRPT v2.2 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectterrenus.util.HDFServices
public class HDFServices
The HDFServices
class contains a number of static
methods to help write Hierarchical Data Format (HDF) version 4
data files.
Constructor Summary | |
---|---|
HDFServices()
|
Method Summary | |
---|---|
static int |
createVariable(int sdid,
java.lang.String name,
int hdfType,
java.lang.String units,
int[] dims,
boolean keepOpen)
Creates a new HDF variable with standard attributes. |
static void |
writeAtt(int sdid,
java.lang.String name,
java.lang.Object value)
Writes an HDF attribute. |
static void |
writeVariable(int sdid,
int varRef,
boolean isOpen,
int[] start,
int[] stride,
int[] count,
java.lang.Object data)
Writes data to an HDF variable. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HDFServices()
Method Detail |
---|
public static void writeAtt(int sdid, java.lang.String name, java.lang.Object value) throws java.io.IOException
sdid
- the scientific dataset ID for either a file or variable.name
- the name of the attribute.value
- the value for the attribute. Primitive Java
types must be passed as an array.
java.io.IOException
- if an HDF or other error occurred
writing the attribute.public static int createVariable(int sdid, java.lang.String name, int hdfType, java.lang.String units, int[] dims, boolean keepOpen) throws java.io.IOException
sdid
- the scientific dataset ID for the HDF file.name
- the new variable name to create.hdfType
- the HDF type for the variable. Currently
only DFNT_INT16 (scale_factor = 0.01) and DFNT_FLOAT32 (no
scale_factor) are supported.units
- the data units string.dims
- the variable dimensions.keepOpen
- the keep open flag, true to keep the
variable open after creating it or false to end access to
the variable.
java.io.IOException
- if an HDF or other error occurred
creating the variable.public static void writeVariable(int sdid, int varRef, boolean isOpen, int[] start, int[] stride, int[] count, java.lang.Object data) throws java.io.IOException
sdid
- the scientific dataset ID for the file.varRef
- the variable reference, either the scientific
dataset ID for open variables, or the scientific dataset
index for closed variables. See the createVariable(int, java.lang.String, int, java.lang.String, int[], boolean)
method for an explanation of open versus closed.isOpen
- the open flag, true if the variable is open
already or false if not. If the variable is not open, it is
opened, written to, and then closed. If the variable is
already open, it is left open.start
- the starting data coordinates for writing data.stride
- the stride for for writing data.count
- the count of data values to write in each data
dimension.data
- the data value array to write.
java.io.IOException
- if an HDF error occurred writing the
variable data.
|
Terrenus HRPT v2.2 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |