visad.data.hdf5.hdf5objects
Class HDF5Dataset
- java.lang.Object
-
- visad.data.hdf5.hdf5objects.HDF5Object
-
- visad.data.hdf5.hdf5objects.HDF5Dataset
-
- All Implemented Interfaces:
- java.io.Serializable
- Direct Known Subclasses:
- HDF5Attribute, HDF5DatasetAdapted
public class HDF5Dataset extends HDF5Object
This class provides a mechanism to describe properties of datasets and to transfer data between memory and disk. A dataset is composed of a collection of raw data points and four classes of meta data to describe the data points.
The four classes of meta data are:
Constant Meta Data Meta data that is created when the dataset is created and exists unchanged for the life of the dataset. For instance, the data type of stored array elements is defined when the dataset is created and cannot be subsequently changed. Persistent Meta Data Meta data that is an integral and permanent part of a dataset but can change over time. For instance, the size in any dimension can increase over time if such an increase is allowed when the dataset was created. Memory Meta Data Meta data that exists to describe how raw data is organized in the application's memory space. For instance, the data type of elements in an application array might not be the same as the data type of those elements as stored in the HDF5 file. Transport Meta Data Meta data that is used only during the transfer of raw data from one location to another. For instance, the number of processes participating in a collective I/O request or hints to the library to control caching of raw data.For details of the HDF5 libraries, see the HDF5 Documentation at: http://hdf.ncsa.uiuc.edu/HDF5/doc/- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description HDF5Dataset()Constructs a HDF5DatasetHDF5Dataset(int loc_id, java.lang.String set_name)Opens a HDF5DatasetHDF5Dataset(int loc_id, java.lang.String set_name, int type_id, int space_id, int create_plist_id)Creates a dataset at the specified locationHDF5Dataset(java.lang.String name)Constructs a HDF5Dataset
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description static java.lang.ObjectconvertUnsignedData(java.lang.Object data_in)convert unsigned data because Java does not support unsigned integers.long[]getCount()Returns the selected counts of the datajava.lang.ObjectgetData()Returns the data arrayHDF5DataspacegetDataspace()Returns the dataspaceHDF5DatatypegetDatatype()Returns the datatypelong[]getDims()Returns the dimensions of the datasetlong[]getMaxdims()Returns the maximum dimensions of the dataspaceintgetRank()Returns the rank of the datasetvoidinit()initialize the HDF5Dataset: open HDF5 library.java.lang.ObjectreadData()Read the entire dataset from filejava.lang.ObjectreadData(int mspace, int fspace)Read the data with specified memory and file spacejava.lang.StringtoString()Converts this object to a String representation.voidwriteData(int mspace, int fspace, java.lang.Object buf)write the data with specified memory and file spacevoidwriteData(java.lang.Object buf)write the entire dataset from file-
Methods inherited from class visad.data.hdf5.hdf5objects.HDF5Object
getDescription, getID, getName, getShortName, getType, setID, setShortName, setType
-
-
-
-
Constructor Detail
-
HDF5Dataset
public HDF5Dataset()
Constructs a HDF5Dataset
-
HDF5Dataset
public HDF5Dataset(java.lang.String name)
Constructs a HDF5Dataset
-
HDF5Dataset
public HDF5Dataset(int loc_id, java.lang.String set_name, int type_id, int space_id, int create_plist_id)Creates a dataset at the specified location- Parameters:
loc_id- Identifier of the file or group to create the dataset within.set_name- The name of the dataset to create.type_id- Identifier of the datatype to use when creating the dataset.space_id- Identifier of the dataspace to use when creating the dataset.create_plist_id- Identifier of the set creation property list.
-
HDF5Dataset
public HDF5Dataset(int loc_id, java.lang.String set_name)Opens a HDF5Dataset- Parameters:
loc_id- A file, group, or datatype identifier.set_name- A datatset name.
-
-
Method Detail
-
init
public void init() throws ncsa.hdf.hdf5lib.exceptions.HDF5Exceptioninitialize the HDF5Dataset:- open HDF5 library.
- Set up datatype and dataspace.
- Set up data ranks and dimensions.
- Overrides:
initin classHDF5Object- Throws:
ncsa.hdf.hdf5lib.exceptions.HDF5Exception
-
readData
public java.lang.Object readData() throws ncsa.hdf.hdf5lib.exceptions.HDF5Exception, java.lang.NullPointerExceptionRead the entire dataset from file- Returns:
- the data array
- Throws:
ncsa.hdf.hdf5lib.exceptions.HDF5Exceptionjava.lang.NullPointerException
-
readData
public java.lang.Object readData(int mspace, int fspace) throws ncsa.hdf.hdf5lib.exceptions.HDF5Exception, java.lang.NullPointerExceptionRead the data with specified memory and file space- Parameters:
mspace- the memory space idfspace- the file space id- Returns:
- the data array
- Throws:
ncsa.hdf.hdf5lib.exceptions.HDF5Exceptionjava.lang.NullPointerException
-
convertUnsignedData
public static java.lang.Object convertUnsignedData(java.lang.Object data_in) throws ncsa.hdf.hdf5lib.exceptions.HDF5Exceptionconvert unsigned data because Java does not support unsigned integers.- Throws:
ncsa.hdf.hdf5lib.exceptions.HDF5Exception
-
writeData
public void writeData(java.lang.Object buf) throws ncsa.hdf.hdf5lib.exceptions.HDF5Exception, java.lang.NullPointerExceptionwrite the entire dataset from file- Throws:
ncsa.hdf.hdf5lib.exceptions.HDF5Exceptionjava.lang.NullPointerException
-
writeData
public void writeData(int mspace, int fspace, java.lang.Object buf) throws ncsa.hdf.hdf5lib.exceptions.HDF5Exception, java.lang.NullPointerExceptionwrite the data with specified memory and file space- Throws:
ncsa.hdf.hdf5lib.exceptions.HDF5Exceptionjava.lang.NullPointerException
-
getData
public java.lang.Object getData()
Returns the data array
-
getDatatype
public HDF5Datatype getDatatype()
Returns the datatype
-
getDataspace
public HDF5Dataspace getDataspace()
Returns the dataspace
-
getRank
public int getRank()
Returns the rank of the dataset
-
getDims
public long[] getDims()
Returns the dimensions of the dataset
-
getMaxdims
public long[] getMaxdims()
Returns the maximum dimensions of the dataspace
-
getCount
public long[] getCount()
Returns the selected counts of the data
-
toString
public java.lang.String toString()
Converts this object to a String representation.- Overrides:
toStringin classHDF5Object- Returns:
- a string representation of this object
-
-
DMelt 3.0 © DataMelt by jWork.ORG