public interface IHDF5DoubleReader
double
values from HDF5 files.
Note: This interface supports block access and sliced access (which is a special cases of block access) to arrays. The performance of this block access can vary greatly depending on how the data are layed out in the HDF5 file. For best performance, the block (or slice) dimension should be chosen to be equal to the chunk dimensions of the array, as in this case the block written / read are stored as consecutive value in the HDF5 file and one write / read access will suffice.
Note: If the values read are unsigned, use the methods in UnsignedIntUtils
to convert
to a larger Java integer type that can hold all values as unsigned.
Modifier and Type | Method and Description |
---|---|
double[] |
getArrayAttr(java.lang.String objectPath,
java.lang.String attributeName)
Reads a
double[] attribute named attributeName from the data set
objectPath. |
java.lang.Iterable<HDF5DataBlock<double[]>> |
getArrayNaturalBlocks(java.lang.String dataSetPath)
Provides all natural blocks of this one-dimensional data set to iterate over.
|
double |
getAttr(java.lang.String objectPath,
java.lang.String attributeName)
Reads a
double attribute named attributeName from the data set
objectPath. |
double[][] |
getMatrixAttr(java.lang.String objectPath,
java.lang.String attributeName)
Reads a
double matrix attribute named attributeName
from the data set objectPath. |
MDDoubleArray |
getMDArrayAttr(java.lang.String objectPath,
java.lang.String attributeName)
Reads a multi-dimensional array
double attribute named attributeName
from the data set objectPath. |
java.lang.Iterable<HDF5MDDataBlock<MDDoubleArray>> |
getMDArrayNaturalBlocks(java.lang.String dataSetPath)
Provides all natural blocks of this multi-dimensional data set to iterate over.
|
double |
read(java.lang.String objectPath)
Reads a
double value from the data set objectPath. |
double[] |
readArray(java.lang.String objectPath)
Reads a
double array (of rank 1) from the data set objectPath. |
double[] |
readArrayBlock(java.lang.String objectPath,
int blockSize,
long blockNumber)
Reads a block from a
double array (of rank 1) from the data set
objectPath. |
double[] |
readArrayBlockWithOffset(java.lang.String objectPath,
int blockSize,
long offset)
Reads a block from
double array (of rank 1) from the data set
objectPath. |
double[][] |
readMatrix(java.lang.String objectPath)
Reads a
double matrix (array of arrays) from the data set
objectPath. |
double[][] |
readMatrixBlock(java.lang.String objectPath,
int blockSizeX,
int blockSizeY,
long blockNumberX,
long blockNumberY)
Reads a
double matrix (array of arrays) from the data set
objectPath. |
double[][] |
readMatrixBlockWithOffset(java.lang.String objectPath,
int blockSizeX,
int blockSizeY,
long offsetX,
long offsetY)
Reads a
double matrix (array of arrays) from the data set
objectPath. |
MDDoubleArray |
readMDArray(java.lang.String objectPath)
Reads a multi-dimensional
double array from the data set
objectPath. |
MDDoubleArray |
readMDArrayBlock(java.lang.String objectPath,
int[] blockDimensions,
long[] blockNumber)
Reads a block from a multi-dimensional
double array from the data set
objectPath. |
MDDoubleArray |
readMDArrayBlockWithOffset(java.lang.String objectPath,
int[] blockDimensions,
long[] offset)
Reads a block from a multi-dimensional
double array from the data set
objectPath. |
MDDoubleArray |
readMDArraySlice(java.lang.String objectPath,
IndexMap boundIndices)
Reads a slice of a multi-dimensional
double array from the data set
objectPath. |
MDDoubleArray |
readMDArraySlice(java.lang.String objectPath,
long[] boundIndices)
Reads a slice of a multi-dimensional
double array from the data set
objectPath. |
MDDoubleArray |
readSlicedMDArrayBlock(java.lang.String objectPath,
int[] blockDimensions,
long[] blockNumber,
IndexMap boundIndices)
Reads a sliced block from a multi-dimensional
double array from the data set
objectPath. |
MDDoubleArray |
readSlicedMDArrayBlock(java.lang.String objectPath,
int[] blockDimensions,
long[] blockNumber,
long[] boundIndices)
Reads a sliced block from a multi-dimensional
double array from the data set
objectPath. |
MDDoubleArray |
readSlicedMDArrayBlockWithOffset(java.lang.String objectPath,
int[] blockDimensions,
long[] offset,
IndexMap boundIndices)
Reads a sliced block of a multi-dimensional
double array from the data set
objectPath. |
MDDoubleArray |
readSlicedMDArrayBlockWithOffset(java.lang.String objectPath,
int[] blockDimensions,
long[] offset,
long[] boundIndices)
Reads a sliced block of a multi-dimensional
double array from the data set
objectPath. |
int[] |
readToMDArrayBlockWithOffset(java.lang.String objectPath,
MDDoubleArray array,
int[] blockDimensions,
long[] offset,
int[] memoryOffset)
Reads a block of the multi-dimensional
double array data set
objectPath into a given array in memory. |
int[] |
readToMDArrayWithOffset(java.lang.String objectPath,
MDDoubleArray array,
int[] memoryOffset)
Reads a multi-dimensional
double array data set objectPath
into a given array in memory. |
double getAttr(java.lang.String objectPath, java.lang.String attributeName)
double
attribute named attributeName from the data set
objectPath.objectPath
- The name (including path information) of the data set object in the file.attributeName
- The name of the attribute to read.double[] getArrayAttr(java.lang.String objectPath, java.lang.String attributeName)
double[]
attribute named attributeName from the data set
objectPath.objectPath
- The name (including path information) of the data set object in the file.attributeName
- The name of the attribute to read.MDDoubleArray getMDArrayAttr(java.lang.String objectPath, java.lang.String attributeName)
double
attribute named attributeName
from the data set objectPath.objectPath
- The name (including path information) of the data set object in the file.attributeName
- The name of the attribute to read.double[][] getMatrixAttr(java.lang.String objectPath, java.lang.String attributeName) throws HDF5JavaException
double
matrix attribute named attributeName
from the data set objectPath.objectPath
- The name (including path information) of the data set object in the file.attributeName
- The name of the attribute to read.HDF5JavaException
double read(java.lang.String objectPath)
double
value from the data set objectPath. This method
doesn't check the data space but simply reads the first value.objectPath
- The name (including path information) of the data set object in the file.double[] readArray(java.lang.String objectPath)
double
array (of rank 1) from the data set objectPath.objectPath
- The name (including path information) of the data set object in the file.int[] readToMDArrayWithOffset(java.lang.String objectPath, MDDoubleArray array, int[] memoryOffset)
double
array data set objectPath
into a given array in memory.objectPath
- The name (including path information) of the data set object in the file.array
- The array to read the data into.memoryOffset
- The offset in the array to write the data to.int[] readToMDArrayBlockWithOffset(java.lang.String objectPath, MDDoubleArray array, int[] blockDimensions, long[] offset, int[] memoryOffset)
double
array data set
objectPath into a given array in memory.objectPath
- The name (including path information) of the data set object in the file.array
- The array to read the data into.blockDimensions
- The size of the block to read along each axis.offset
- The offset of the block in the data set.memoryOffset
- The offset of the block in the array to write the data to.double[] readArrayBlock(java.lang.String objectPath, int blockSize, long blockNumber)
double
array (of rank 1) from the data set
objectPath.objectPath
- The name (including path information) of the data set object in the file.blockSize
- The block size (this will be the length of the double[]
returned
if the data set is long enough).blockNumber
- The number of the block to read (starting with 0, offset: multiply with
blockSize).double[] readArrayBlockWithOffset(java.lang.String objectPath, int blockSize, long offset)
double
array (of rank 1) from the data set
objectPath.objectPath
- The name (including path information) of the data set object in the file.blockSize
- The block size (this will be the length of the double[]
returned).offset
- The offset of the block in the data set to start reading from (starting with 0).double[][] readMatrix(java.lang.String objectPath) throws HDF5JavaException
double
matrix (array of arrays) from the data set
objectPath.objectPath
- The name (including path information) of the data set object in the file.HDF5JavaException
- If the data set objectPath is not of rank 2.double[][] readMatrixBlock(java.lang.String objectPath, int blockSizeX, int blockSizeY, long blockNumberX, long blockNumberY) throws HDF5JavaException
double
matrix (array of arrays) from the data set
objectPath.objectPath
- The name (including path information) of the data set object in the file.blockSizeX
- The size of the block in the x dimension.blockSizeY
- The size of the block in the y dimension.blockNumberX
- The block number in the x dimension (offset: multiply with
blockSizeX
).blockNumberY
- The block number in the y dimension (offset: multiply with
blockSizeY
).HDF5JavaException
- If the data set objectPath is not of rank 2.double[][] readMatrixBlockWithOffset(java.lang.String objectPath, int blockSizeX, int blockSizeY, long offsetX, long offsetY) throws HDF5JavaException
double
matrix (array of arrays) from the data set
objectPath.objectPath
- The name (including path information) of the data set object in the file.blockSizeX
- The size of the block in the x dimension.blockSizeY
- The size of the block in the y dimension.offsetX
- The offset in x dimension in the data set to start reading from.offsetY
- The offset in y dimension in the data set to start reading from.HDF5JavaException
- If the data set objectPath is not of rank 2.MDDoubleArray readMDArray(java.lang.String objectPath)
double
array from the data set
objectPath.objectPath
- The name (including path information) of the data set object in the file.MDDoubleArray readMDArraySlice(java.lang.String objectPath, IndexMap boundIndices)
double
array from the data set
objectPath. The slice is defined by "bound indices", each of which is fixed to a
given value. The returned data block only contains the free (i.e. non-fixed) indices.objectPath
- The name (including path information) of the data set object in the file.boundIndices
- The mapping of indices to index values which should be bound. For example
a map of new IndexMap().mapTo(2, 5).mapTo(4, 7)
has 2 and 4 as bound
indices and binds them to the values 5 and 7, respectively.MDDoubleArray readMDArraySlice(java.lang.String objectPath, long[] boundIndices)
double
array from the data set
objectPath. The slice is defined by "bound indices", each of which is fixed to a
given value. The returned data block only contains the free (i.e. non-fixed) indices.objectPath
- The name (including path information) of the data set object in the file.boundIndices
- The array containing the values of the bound indices at the respective
index positions, and -1 at the free index positions. For example an array of
new long[] { -1, -1, 5, -1, 7, -1 }
has 2 and 4 as bound indices and
binds them to the values 5 and 7, respectively.MDDoubleArray readMDArrayBlock(java.lang.String objectPath, int[] blockDimensions, long[] blockNumber)
double
array from the data set
objectPath.objectPath
- The name (including path information) of the data set object in the file.blockDimensions
- The extent of the block in each dimension.blockNumber
- The block number in each dimension (offset: multiply with the
blockDimensions in the according dimension).MDDoubleArray readSlicedMDArrayBlock(java.lang.String objectPath, int[] blockDimensions, long[] blockNumber, IndexMap boundIndices)
double
array from the data set
objectPath. The slice is defined by "bound indices", each of which is fixed to a
given value. The returned data block only contains the free (i.e. non-fixed) indices.objectPath
- The name (including path information) of the data set object in the file.blockDimensions
- The extent of the block in each dimension.blockNumber
- The block number in each dimension (offset: multiply with the
blockDimensions in the according dimension).boundIndices
- The mapping of indices to index values which should be bound. For example
a map of new IndexMap().mapTo(2, 5).mapTo(4, 7)
has 2 and 4 as bound
indices and binds them to the values 5 and 7, respectively.MDDoubleArray readSlicedMDArrayBlock(java.lang.String objectPath, int[] blockDimensions, long[] blockNumber, long[] boundIndices)
double
array from the data set
objectPath. The slice is defined by "bound indices", each of which is fixed to a
given value. The returned data block only contains the free (i.e. non-fixed) indices.objectPath
- The name (including path information) of the data set object in the file.blockDimensions
- The extent of the block in each dimension.blockNumber
- The block number in each dimension (offset: multiply with the
blockDimensions in the according dimension).boundIndices
- The array containing the values of the bound indices at the respective
index positions, and -1 at the free index positions. For example an array of
new long[] { -1, -1, 5, -1, 7, -1 }
has 2 and 4 as bound indices and
binds them to the values 5 and 7, respectively.MDDoubleArray readMDArrayBlockWithOffset(java.lang.String objectPath, int[] blockDimensions, long[] offset)
double
array from the data set
objectPath.objectPath
- The name (including path information) of the data set object in the file.blockDimensions
- The extent of the block in each dimension.offset
- The offset in the data set to start reading from in each dimension.MDDoubleArray readSlicedMDArrayBlockWithOffset(java.lang.String objectPath, int[] blockDimensions, long[] offset, IndexMap boundIndices)
double
array from the data set
objectPath. The slice is defined by "bound indices", each of which is fixed to a
given value. The returned data block only contains the free (i.e. non-fixed) indices.objectPath
- The name (including path information) of the data set object in the file.blockDimensions
- The extent of the block in each dimension.offset
- The offset in the data set to start reading from in each dimension.boundIndices
- The mapping of indices to index values which should be bound. For example
a map of new IndexMap().mapTo(2, 5).mapTo(4, 7)
has 2 and 4 as bound
indices and binds them to the values 5 and 7, respectively.MDDoubleArray readSlicedMDArrayBlockWithOffset(java.lang.String objectPath, int[] blockDimensions, long[] offset, long[] boundIndices)
double
array from the data set
objectPath. The slice is defined by "bound indices", each of which is fixed to a
given value. The returned data block only contains the free (i.e. non-fixed) indices.objectPath
- The name (including path information) of the data set object in the file.blockDimensions
- The extent of the block in each dimension.offset
- The offset in the data set to start reading from in each dimension.boundIndices
- The array containing the values of the bound indices at the respective
index positions, and -1 at the free index positions. For example an array of
new long[] { -1, -1, 5, -1, 7, -1 }
has 2 and 4 as bound indices and
binds them to the values 5 and 7, respectively.java.lang.Iterable<HDF5DataBlock<double[]>> getArrayNaturalBlocks(java.lang.String dataSetPath) throws HDF5JavaException
HDF5JavaException
- If the data set is not of rank 1.HDF5DataBlock
java.lang.Iterable<HDF5MDDataBlock<MDDoubleArray>> getMDArrayNaturalBlocks(java.lang.String dataSetPath)
HDF5MDDataBlock