hdf5

package
v0.0.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 13, 2026 License: Apache-2.0 Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package hdf5 reads the HDF5 structures used by the open science centre’s strain files, following the HDF5 File Format Specification, version 3.0.

Supported files have a version 0 superblock with eight-byte offsets and lengths, version 1 object headers and continuations, and old-style groups using version 1 B-trees, symbol table nodes, and local name heaps.

Datasets and attributes may contain little-endian integers, IEEE binary32 and binary64 floats, and fixed- or variable-length strings. Storage may be contiguous or chunked; chunks may use deflate and Fletcher-32, whose checksum is verified.

Other features return errors. Errors explain unsupported structures, damaged data, or a missing HDF5 signature in words, with the address and specification section where applicable. Failed reads return no result.

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 reads on demand from its io.ReaderAt, retaining the parsed superblock rather than copying the whole file.

func NewFile

func NewFile(reader io.ReaderAt, size int64) (*File, error)

NewFile validates a reader and byte length as a supported HDF5 file. Negative sizes, missing signatures, and unsupported format features return an error and no File. Format errors identify the feature and its location.

func (*File) Attribute

func (file *File) Attribute(path, name string) (*Values, error)

Attribute reads a named attribute from a group or dataset, such as Xspacing on strain/Strain. Missing paths or names return an error.

func (*File) Members

func (file *File) Members(path string) ([]string, error)

Members lists a group’s members in file order. Empty path and / identify the root. Missing paths and non-group objects return an error.

func (*File) Read

func (file *File) Read(path string) (*Values, error)

Read loads the dataset at a slash-separated path such as strain/Strain. Missing paths, objects that are not datasets, and unsupported storage return an error with no values.

type Values

type Values struct {
	// contains filtered or unexported fields
}

Values holds a dataset or attribute’s shape and stored bytes, decoded into a requested value type on demand.

func (*Values) Floats

func (held *Values) Floats() ([]float64, error)

Floats decodes floating-point elements in file order and rejects other element types.

func (*Values) Integers

func (held *Values) Integers() ([]int64, error)

Integers decodes integer elements in file order and rejects other element types.

func (*Values) Shape

func (held *Values) Shape() []uint64

Shape returns dimension sizes. A scalar has no dimensions.

func (*Values) Texts

func (held *Values) Texts() ([]string, error)

Texts decodes fixed- or variable-length strings in file order and rejects other element types.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL