Constructor
new H5File(file, optionsopt)
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
file |
string | Path to the HDF5 file. |
||
options |
object |
<optional> |
{}
|
Further options to pass to the H5Group constructor. |
Extends
Classes
Members
attributes :Array
- Source:
- Overrides:
Array containing the names of all attributes of this object.
Type:
- Array
children :object
- Source:
- Overrides:
An object where the keys are the names of the immediate children and the values are strings specifying the object type of each child.
Each string can be one of "Group"
, "DataSet"
or "Other"
.
Type:
- object
file :string
- Source:
- Overrides:
Path to the HDF5 file.
Type:
- string
name :string
- Source:
- Overrides:
Name of the object inside the file.
Type:
- string
Methods
createDataSet(name, type, shape, optionsopt) → {H5DataSet}
- Source:
- Overrides:
Parameters:
Name | Type | Attributes | Default | Description | |||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
name |
string | Name of the dataset to create. |
|||||||||||||||||||||||||||
type |
string | Type of dataset to create.
This can be |
|||||||||||||||||||||||||||
shape |
Array | Array containing the dimensions of the dataset to create. This can be set to an empty array to create a scalar dataset. |
|||||||||||||||||||||||||||
options |
object |
<optional> |
{}
|
Optional parameters. Properties
|
Returns:
A dataset of the specified type and shape is created as an immediate child of the current group. A H5DataSet object is returned representing this new dataset.
- Type
- H5DataSet
createGroup(name)
- Source:
- Overrides:
Parameters:
Name | Type | Description |
---|---|---|
name |
string | Name of the group to create. |
Returns:
{@H5Group} A group is created as an immediate child of the current group.
A H5Group object is returned representing this new group.
If a group already exists at name
, it is returned directly.
open(name, optionsopt) → {H5Group|H5DataSet}
- Source:
- Overrides:
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
name |
string | Name of the child element to open. |
||
options |
object |
<optional> |
{}
|
Further options to pass to the H5Group or H5DataSet constructors. |
Returns:
Object representing the child element.
readAttribute(attr) → {object}
- Source:
- Overrides:
Read an attribute of the object.
Parameters:
Name | Type | Description |
---|---|---|
attr |
string | Name of the attribute. |
Returns:
Object containing the attribute values
and the shape
of the attribute.
For HDF5 enums, an additional level
property is present, containing the levels indexed by the integer values
.
- Type
- object
writeAttribute(attr, type, shapenullable, x, optionsopt)
- Source:
- Overrides:
Write an attribute for the object.
Parameters:
Name | Type | Attributes | Default | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
attr |
string | Name of the attribute. |
|||||||||||||||||
type |
string | Type of dataset to create.
This can be |
|||||||||||||||||
shape |
Array |
<nullable> |
Array containing the dimensions of the dataset to create.
If set to an empty array, this will create a scalar dataset.
If set to |
||||||||||||||||
x |
TypedArray | Array | string | number | Values to be written to the new dataset, see |
|||||||||||||||||
options |
object |
<optional> |
{}
|
Optional parameters. Properties
|
writeDataSet(name, type, shape, x, optionsopt) → {H5DataSet}
- Source:
- Overrides:
This convenience method combines createDataSet
with write
.
It is particularly useful for string types as it avoids having to specify the maxStringLength
during creation based on the x
used during writing.
Parameters:
Name | Type | Attributes | Default | Description | |||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
name |
string | Name of the dataset to create. |
|||||||||||||||||||||||||||
type |
string | Type of dataset to create.
This can be |
|||||||||||||||||||||||||||
shape |
Array | Array containing the dimensions of the dataset to create.
If set to an empty array, this will create a scalar dataset.
If set to |
|||||||||||||||||||||||||||
x |
TypedArray | Array | string | number | Values to be written to the new dataset, see |
|||||||||||||||||||||||||||
options |
object |
<optional> |
{}
|
Optional parameters. Properties
|
Returns:
A dataset of the specified type and shape is created as an immediate child of the current group.
The same dataset is then filled with the contents of x
.
A H5DataSet object is returned representing this new dataset.
- Type
- H5DataSet