Documentation
¶
Overview ¶
Package hdf5 reads the open science centre's strain files. The format itself is read by github.com/scigolib/hdf5; this package is the few calls celestial's users build with, held up by theirs.
A File gives a group's members, a dataset's values and a dataset's attributes, each by a slash-separated path such as strain/Strain. Values are floats, integers or texts, read whole.
What their package refuses, this one refuses, with their error inside its own. A failed read gives no result.
Three things here are this package's doing and not the format's. NewFile copies the reader's bytes to a temporary file, since theirs opens a file by name alone, and Close removes the copy.
Their package gives a dataset's integers as float64, so an integer of 2^53 or more is refused: it cannot be told from its neighbours. And the attributes of a group are not read, only a dataset's.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type File ¶
type File struct {
// contains filtered or unexported fields
}
File is an HDF5 file, opened by scigolib's reader from a copy of the caller's bytes.
func NewFile ¶
NewFile opens the size bytes of a reader as an HDF5 file. Bytes that are no HDF5 file, or one their package does not read, give its error and no File. Close the File when done with it.
func (*File) Attribute ¶
Attribute is the values of an attribute of the dataset at a path, such as Xspacing of strain/Strain. A path or a name that is not there gives an error and no values. The attributes of a group are not read.
func (*File) Close ¶ added in v0.0.9
Close closes the file and removes its copy. The caller's reader is left as it was.
type Values ¶
type Values struct {
// contains filtered or unexported fields
}
Values is what a dataset or an attribute holds: its shape, and its elements as the one kind they are.
func (*Values) Floats ¶
Floats is the values as floats, in file order. Values of another kind give an error and no floats.
func (*Values) Integers ¶
Integers is the values as integers, in file order. Values of another kind give an error and no integers.