File
var hdf5 = require('hdf5').hdf5;
Attributes
- id
hdf5.File(name, access)
- name → name of the file. It can be the file path
- access → how to access the file. See Access for choices
- return ← the constructed file object
File.prototype.enableSingleWriteMultiRead()
Turn on single write, multi read mode
File.prototype.createGroup(xpath)
- xpath → the path to the group to create. Delimited with / and if any group along the stem doesn’t exist creates it too
- return ← the new group object
File.prototype.openGroup(xpath [{separate_attributes: true}])
- xpath → the relative path to the group to open. Delimited with / and will throw an exception if it doesn’t exist. Useful particularly in read only mode
- options → with separate_attributes option returning a destructuring assignment array
- return ← the opened group object or [group, attrs]
File.prototype.getNumAttrs()
File.prototype.refresh()
Refreshes subtree and metadata from h5 file to h5 components in memory and on to the javascript. Reverse action to flush.
File.prototype.move(source, id, destination)
- source → the name of the source group
- id → the group or file id location. Every group and the file return with an id attribute. In this case it is the destination’s future location. If it is the file’s id this essentially renames the source
- destination → the name of the destination group.
File.prototype.delete(name)
- name → the name of the group to delete. An apprehensive activity with an h5 file but sometimes it is necessary
File.prototype.flush()
File.prototype.close()
File.prototype.getNumAttrs()
- return ← an array with the names
File.prototype.getAttributeNames()
- return ← list of attribute names
File.prototype.readAttribute(name)
- name → the name of the attributes
- return ← attribute according to its datatype.
File.prototype.deleteAttribute(name)
Deletes the attribute from this file. Alternatively you can delete with the javascript delete command:
delete file.unitCell;
and it will be deleted in the h5 without any furter step
- name → the name of the attribute
File.prototype.getMemberNames()
- return ← an array with the names in alphabetic order
File.prototype.getMemberNamesByCreationOrder()
- return ← an array with the names in creation order
File.prototype.getChildType(name)
- name → the name of the child
- return ← the type according to H5OType and indicates group, dataset or named datatype
File.prototype.getDatasetType(name)
- name → the name of the child dataset
- return ← the high level type according to HLType and indicates group, dataset or named datatype. Useful when working with h5 in general and programmatically would like to know which part of the api to use
File.prototype.getDatasetDimensions(name)
- name → the name of the child dataset
- return ← an array of length dataset rank and entries for the length of each dimension
File.prototype.getDataType(name)
- name → the name of the child
- return ← the type according to H5Type. Useful when working with h5 in general and programmatically would like to prepare for particular data type
File.prototype.getDatasetAttributes(name)
Attributes on any dataset. These can be arrays of elements.
- name → the name of the child dataset
- return ← object with attributes.
File.prototype.getDatasetAttribute(name, attr_name)
Dataset attribute by its name.
- name → the name of the child dataset
- attr_name → the name of the attribute
- return ← the value of attribute.
Attributes on any dataset. These can be arrays of elements.
- name → the name of the child dataset
- return ← object with attributes.
File.prototype.getFilters(name);
- name → the name of the child dataset
- return ← a Filters object for accessing the dataset’s filters.
Group.prototype.iterate(idx, function(type, name));
Steps thru each child.
- idx → unused starting over index
- function → synchronous callback function returning H5Type and name.
Group.prototype.visit(idx, function(type, xpath));
Recursively steps thru each child and subgroup’s children.
- idx → unused starting over index
- function → synchronous callback function returning H5Type and xpath.