hdf5: gonum.org/v1/hdf5 Index | Files | Directories

package hdf5

import "gonum.org/v1/hdf5"

Package hdf5 provides access to the HDF5 C library.

Index

Package Files

cgoflags.go errors.go h5a_attribute.go h5d_dataset.go h5f_file.go h5g_group.go h5i_identifier.go h5p_proplist.go h5pt_table.go h5s_dataspace.go h5t_shim.go h5t_types.go hdf5.go

Constants

const (
    F_ACC_RDONLY  int = 0x0000 // absence of rdwr => rd-only
    F_ACC_RDWR    int = 0x0001 // open for read and write
    F_ACC_TRUNC   int = 0x0002 // Truncate file, if it already exists, erasing all data previously stored in the file.
    F_ACC_EXCL    int = 0x0004 // Fail if file already exists.
    F_ACC_DEBUG   int = 0x0008 // print debug info
    F_ACC_CREAT   int = 0x0010 // create non-existing files
    F_ACC_DEFAULT int = 0xffff // value passed to set_elink_acc_flags to cause flags to be taken from the parent file
)

File constants

func Close Uses

func Close() error

Close flushes all data to disk, closes all open identifiers, and cleans up memory. It should generally be called before your application exits.

func DisplayErrors Uses

func DisplayErrors(on bool) error

DisplayErrors enables/disables HDF5's automatic error printing

func GarbageCollect Uses

func GarbageCollect() error

GarbageCollect collects garbage on all free-lists of all types.

func IsHDF5 Uses

func IsHDF5(name string) bool

IsHDF5 Determines whether a file is in the HDF5 format.

type ArrayType Uses

type ArrayType struct {
    Datatype
}

func NewArrayType Uses

func NewArrayType(base_type *Datatype, dims []int) (*ArrayType, error)

NewArrayType creates a new ArrayType. The base_type specifies the element type of the array and dims specify the dimensions of the array. The returned arraytype must be closed by the user when it is no longer needed.

func (*ArrayType) ArrayDims Uses

func (t *ArrayType) ArrayDims() []int

ArrayDims returns the array dimensions.

func (*ArrayType) NDims Uses

func (t *ArrayType) NDims() int

NDims returns the rank of an ArrayType.

type Attribute Uses

type Attribute struct {
    Identifier
}

func (*Attribute) Close Uses

func (s *Attribute) Close() error

Close releases and terminates access to an attribute.

func (*Attribute) GetType Uses

func (s *Attribute) GetType() Identifier

Access the type of an attribute

func (*Attribute) Read Uses

func (s *Attribute) Read(data interface{}, dtype *Datatype) error

Read reads raw data from a attribute into a buffer.

func (*Attribute) Space Uses

func (s *Attribute) Space() *Dataspace

Space returns an identifier for a copy of the dataspace for a attribute.

func (*Attribute) Write Uses

func (s *Attribute) Write(data interface{}, dtype *Datatype) error

Write writes raw data from a buffer to an attribute.

type CommonFG Uses

type CommonFG struct {
    Identifier
}

CommonFG is for methods common to both File and Group

func (*CommonFG) CreateDataset Uses

func (g *CommonFG) CreateDataset(name string, dtype *Datatype, dspace *Dataspace) (*Dataset, error)

CreateDataset creates a new Dataset. The returned dataset must be closed by the user when it is no longer needed.

func (*CommonFG) CreateDatasetWith Uses

func (g *CommonFG) CreateDatasetWith(name string, dtype *Datatype, dspace *Dataspace, dcpl *PropList) (*Dataset, error)

CreateDatasetWith creates a new Dataset with a user-defined PropList. The returned dataset must be closed by the user when it is no longer needed.

func (*CommonFG) CreateGroup Uses

func (g *CommonFG) CreateGroup(name string) (*Group, error)

CreateGroup creates and returns a new empty group and links it to a location in the file. The returned group must be closed by the user when it is no longer needed.

func (*CommonFG) NumObjects Uses

func (g *CommonFG) NumObjects() (uint, error)

NumObjects returns the number of objects in the Group.

func (*CommonFG) ObjectNameByIndex Uses

func (g *CommonFG) ObjectNameByIndex(idx uint) (string, error)

ObjectNameByIndex returns the name of the object at idx.

func (*CommonFG) OpenDataset Uses

func (g *CommonFG) OpenDataset(name string) (*Dataset, error)

OpenDataset opens and returns a named Dataset. The returned dataset must be closed by the user when it is no longer needed.

func (*CommonFG) OpenGroup Uses

func (g *CommonFG) OpenGroup(name string) (*Group, error)

OpenGroup opens and returns an existing child group from this Group. The returned group must be closed by the user when it is no longer needed.

type CompoundType Uses

type CompoundType struct {
    Datatype
}

func NewCompoundType Uses

func NewCompoundType(size int) (*CompoundType, error)

NewCompoundType creates a new CompoundType. The size is the size in bytes of the compound datatype. The returned compound type must be closed by the user when it is no longer needed.

func (*CompoundType) Insert Uses

func (t *CompoundType) Insert(name string, offset int, field *Datatype) error

Insert adds a new member to a compound datatype.

func (*CompoundType) MemberClass Uses

func (t *CompoundType) MemberClass(mbr_idx int) TypeClass

MemberClass returns datatype class of compound datatype member.

func (*CompoundType) MemberIndex Uses

func (t *CompoundType) MemberIndex(name string) int

MemberIndex returns the index of a compound or enumeration datatype member.

func (*CompoundType) MemberName Uses

func (t *CompoundType) MemberName(mbr_idx int) string

MemberName returns the name of a compound or enumeration datatype member.

func (*CompoundType) MemberOffset Uses

func (t *CompoundType) MemberOffset(mbr_idx int) int

MemberOffset returns the offset of a field of a compound datatype.

func (*CompoundType) MemberType Uses

func (t *CompoundType) MemberType(mbr_idx int) (*Datatype, error)

MemberType returns the datatype of the specified member. The returned datatype must be closed by the user when it is no longer needed.

func (*CompoundType) NMembers Uses

func (t *CompoundType) NMembers() int

NMembers returns the number of elements in a compound or enumeration datatype.

func (*CompoundType) Pack Uses

func (t *CompoundType) Pack() error

Pack recursively removes padding from within a compound datatype. This is analogous to C struct packing and will give a space-efficient type on the disk. However, using this may require type conversions on more machines, so may be a worse option.

type Dataset Uses

type Dataset struct {
    Identifier
    // contains filtered or unexported fields
}

func (*Dataset) Close Uses

func (s *Dataset) Close() error

Close releases and terminates access to a dataset.

func (*Dataset) CreateAttribute Uses

func (s *Dataset) CreateAttribute(name string, dtype *Datatype, dspace *Dataspace) (*Attribute, error)

Creates a new attribute at this location. The returned attribute must be closed by the user when it is no longer needed.

func (*Dataset) CreateAttributeWith Uses

func (s *Dataset) CreateAttributeWith(name string, dtype *Datatype, dspace *Dataspace, acpl *PropList) (*Attribute, error)

Creates a new attribute at this location. The returned attribute must be closed by the user when it is no longer needed.

func (*Dataset) Datatype Uses

func (s *Dataset) Datatype() (*Datatype, error)

Datatype returns the HDF5 Datatype of the Dataset. The returned datatype must be closed by the user when it is no longer needed.

func (*Dataset) OpenAttribute Uses

func (s *Dataset) OpenAttribute(name string) (*Attribute, error)

Opens an existing attribute. The returned attribute must be closed by the user when it is no longer needed. The returned attribute must be closed by the user when it is no longer needed.

func (*Dataset) Read Uses

func (s *Dataset) Read(data interface{}) error

Read reads raw data from a dataset into a buffer.

func (*Dataset) ReadSubset Uses

func (s *Dataset) ReadSubset(data interface{}, memspace, filespace *Dataspace) error

ReadSubset reads a subset of raw data from a dataset into a buffer.

func (*Dataset) Space Uses

func (s *Dataset) Space() *Dataspace

Space returns an identifier for a copy of the dataspace for a dataset.

func (*Dataset) Write Uses

func (s *Dataset) Write(data interface{}) error

Write writes raw data from a buffer to a dataset.

func (*Dataset) WriteSubset Uses

func (s *Dataset) WriteSubset(data interface{}, memspace, filespace *Dataspace) error

WriteSubset writes a subset of raw data from a buffer to a dataset.

type Dataspace Uses

type Dataspace struct {
    Identifier
}

func CreateDataspace Uses

func CreateDataspace(class SpaceClass) (*Dataspace, error)

CreateDataspace creates a new dataspace of a specified type. The returned dataspace must be closed by the user when it is no longer needed.

func CreateSimpleDataspace Uses

func CreateSimpleDataspace(dims, maxDims []uint) (*Dataspace, error)

CreateSimpleDataspace creates a new simple dataspace and opens it for access. The returned dataspace must be closed by the user when it is no longer needed.

func (*Dataspace) Close Uses

func (s *Dataspace) Close() error

Close releases and terminates access to a dataspace.

func (*Dataspace) Copy Uses

func (s *Dataspace) Copy() (*Dataspace, error)

Copy creates an exact copy of a dataspace. The returned dataspace must be closed by the user when it is no longer needed.

func (*Dataspace) IsSimple Uses

func (s *Dataspace) IsSimple() bool

IsSimple returns whether a dataspace is a simple dataspace.

func (*Dataspace) SelectHyperslab Uses

func (s *Dataspace) SelectHyperslab(offset, stride, count, block []uint) error

SelectHyperslab creates a subset of the data space.

func (*Dataspace) SetOffset Uses

func (s *Dataspace) SetOffset(offset []uint) error

SetOffset sets the offset of a simple dataspace.

func (*Dataspace) SimpleExtentDims Uses

func (s *Dataspace) SimpleExtentDims() (dims, maxdims []uint, err error)

SimpleExtentDims returns dataspace dimension size and maximum size.

func (*Dataspace) SimpleExtentNDims Uses

func (s *Dataspace) SimpleExtentNDims() int

SimpleExtentNDims returns the dimensionality of a dataspace.

func (*Dataspace) SimpleExtentNPoints Uses

func (s *Dataspace) SimpleExtentNPoints() int

SimpleExtentNPoints returns the number of elements in a dataspace.

func (*Dataspace) SimpleExtentType Uses

func (s *Dataspace) SimpleExtentType() SpaceClass

SimpleExtentType returns the current class of a dataspace.

type Datatype Uses

type Datatype struct {
    Identifier
    // contains filtered or unexported fields
}
var (
    T_C_S1       *Datatype = NewDatatype(C._H5T_C_S1())
    T_FORTRAN_S1 *Datatype = NewDatatype(C._H5T_FORTRAN_S1())

    T_STD_I8BE  *Datatype = NewDatatype(C._H5T_STD_I8BE())
    T_STD_I8LE  *Datatype = NewDatatype(C._H5T_STD_I8LE())
    T_STD_I16BE *Datatype = NewDatatype(C._H5T_STD_I16BE())
    T_STD_I16LE *Datatype = NewDatatype(C._H5T_STD_I16LE())
    T_STD_I32BE *Datatype = NewDatatype(C._H5T_STD_I32BE())
    T_STD_I32LE *Datatype = NewDatatype(C._H5T_STD_I32LE())
    T_STD_I64BE *Datatype = NewDatatype(C._H5T_STD_I64BE())
    T_STD_I64LE *Datatype = NewDatatype(C._H5T_STD_I64LE())
    T_STD_U8BE  *Datatype = NewDatatype(C._H5T_STD_U8BE())
    T_STD_U8LE  *Datatype = NewDatatype(C._H5T_STD_U8LE())
    T_STD_U16BE *Datatype = NewDatatype(C._H5T_STD_U16BE())
    T_STD_U16LE *Datatype = NewDatatype(C._H5T_STD_U16LE())
    T_STD_U32BE *Datatype = NewDatatype(C._H5T_STD_U32BE())
    T_STD_U32LE *Datatype = NewDatatype(C._H5T_STD_U32LE())
    T_STD_U64BE *Datatype = NewDatatype(C._H5T_STD_U64BE())
    T_STD_U64LE *Datatype = NewDatatype(C._H5T_STD_U64LE())
    T_STD_B8BE  *Datatype = NewDatatype(C._H5T_STD_B8BE())
    T_STD_B8LE  *Datatype = NewDatatype(C._H5T_STD_B8LE())

    T_STD_B16BE       *Datatype = NewDatatype(C._H5T_STD_B16BE())
    T_STD_B16LE       *Datatype = NewDatatype(C._H5T_STD_B16LE())
    T_STD_B32BE       *Datatype = NewDatatype(C._H5T_STD_B32BE())
    T_STD_B32LE       *Datatype = NewDatatype(C._H5T_STD_B32LE())
    T_STD_B64BE       *Datatype = NewDatatype(C._H5T_STD_B64BE())
    T_STD_B64LE       *Datatype = NewDatatype(C._H5T_STD_B64LE())
    T_STD_REF_OBJ     *Datatype = NewDatatype(C._H5T_STD_REF_OBJ())
    T_STD_REF_DSETREG *Datatype = NewDatatype(C._H5T_STD_REF_DSETREG())

    T_IEEE_F32BE *Datatype = NewDatatype(C._H5T_IEEE_F32BE())
    T_IEEE_F32LE *Datatype = NewDatatype(C._H5T_IEEE_F32LE())
    T_IEEE_F64BE *Datatype = NewDatatype(C._H5T_IEEE_F64BE())
    T_IEEE_F64LE *Datatype = NewDatatype(C._H5T_IEEE_F64LE())

    T_UNIX_D32BE *Datatype = NewDatatype(C._H5T_UNIX_D32BE())
    T_UNIX_D32LE *Datatype = NewDatatype(C._H5T_UNIX_D32LE())
    T_UNIX_D64BE *Datatype = NewDatatype(C._H5T_UNIX_D64BE())
    T_UNIX_D64LE *Datatype = NewDatatype(C._H5T_UNIX_D64LE())

    T_INTEL_I8  *Datatype = NewDatatype(C._H5T_INTEL_I8())
    T_INTEL_I16 *Datatype = NewDatatype(C._H5T_INTEL_I16())
    T_INTEL_I32 *Datatype = NewDatatype(C._H5T_INTEL_I32())
    T_INTEL_I64 *Datatype = NewDatatype(C._H5T_INTEL_I64())
    T_INTEL_U8  *Datatype = NewDatatype(C._H5T_INTEL_U8())
    T_INTEL_U16 *Datatype = NewDatatype(C._H5T_INTEL_U16())
    T_INTEL_U32 *Datatype = NewDatatype(C._H5T_INTEL_U32())
    T_INTEL_U64 *Datatype = NewDatatype(C._H5T_INTEL_U64())
    T_INTEL_B8  *Datatype = NewDatatype(C._H5T_INTEL_B8())
    T_INTEL_B16 *Datatype = NewDatatype(C._H5T_INTEL_B16())
    T_INTEL_B32 *Datatype = NewDatatype(C._H5T_INTEL_B32())
    T_INTEL_B64 *Datatype = NewDatatype(C._H5T_INTEL_B64())
    T_INTEL_F32 *Datatype = NewDatatype(C._H5T_INTEL_F32())
    T_INTEL_F64 *Datatype = NewDatatype(C._H5T_INTEL_F64())

    T_ALPHA_I8  *Datatype = NewDatatype(C._H5T_ALPHA_I8())
    T_ALPHA_I16 *Datatype = NewDatatype(C._H5T_ALPHA_I16())
    T_ALPHA_I32 *Datatype = NewDatatype(C._H5T_ALPHA_I32())
    T_ALPHA_I64 *Datatype = NewDatatype(C._H5T_ALPHA_I64())
    T_ALPHA_U8  *Datatype = NewDatatype(C._H5T_ALPHA_U8())
    T_ALPHA_U16 *Datatype = NewDatatype(C._H5T_ALPHA_U16())
    T_ALPHA_U32 *Datatype = NewDatatype(C._H5T_ALPHA_U32())
    T_ALPHA_U64 *Datatype = NewDatatype(C._H5T_ALPHA_U64())
    T_ALPHA_B8  *Datatype = NewDatatype(C._H5T_ALPHA_B8())
    T_ALPHA_B16 *Datatype = NewDatatype(C._H5T_ALPHA_B16())
    T_ALPHA_B32 *Datatype = NewDatatype(C._H5T_ALPHA_B32())
    T_ALPHA_B64 *Datatype = NewDatatype(C._H5T_ALPHA_B64())
    T_ALPHA_F32 *Datatype = NewDatatype(C._H5T_ALPHA_F32())
    T_ALPHA_F64 *Datatype = NewDatatype(C._H5T_ALPHA_F64())

    T_MIPS_I8  *Datatype = NewDatatype(C._H5T_MIPS_I8())
    T_MIPS_I16 *Datatype = NewDatatype(C._H5T_MIPS_I16())
    T_MIPS_I32 *Datatype = NewDatatype(C._H5T_MIPS_I32())
    T_MIPS_I64 *Datatype = NewDatatype(C._H5T_MIPS_I64())
    T_MIPS_U8  *Datatype = NewDatatype(C._H5T_MIPS_U8())
    T_MIPS_U16 *Datatype = NewDatatype(C._H5T_MIPS_U16())
    T_MIPS_U32 *Datatype = NewDatatype(C._H5T_MIPS_U32())
    T_MIPS_U64 *Datatype = NewDatatype(C._H5T_MIPS_U64())
    T_MIPS_B8  *Datatype = NewDatatype(C._H5T_MIPS_B8())
    T_MIPS_B16 *Datatype = NewDatatype(C._H5T_MIPS_B16())
    T_MIPS_B32 *Datatype = NewDatatype(C._H5T_MIPS_B32())
    T_MIPS_B64 *Datatype = NewDatatype(C._H5T_MIPS_B64())
    T_MIPS_F32 *Datatype = NewDatatype(C._H5T_MIPS_F32())
    T_MIPS_F64 *Datatype = NewDatatype(C._H5T_MIPS_F64())

    T_NATIVE_CHAR   *Datatype = NewDatatype(C._H5T_NATIVE_CHAR())
    T_NATIVE_INT    *Datatype = NewDatatype(C._H5T_NATIVE_INT())
    T_NATIVE_FLOAT  *Datatype = NewDatatype(C._H5T_NATIVE_FLOAT())
    T_NATIVE_SCHAR  *Datatype = NewDatatype(C._H5T_NATIVE_SCHAR())
    T_NATIVE_UCHAR  *Datatype = NewDatatype(C._H5T_NATIVE_UCHAR())
    T_NATIVE_SHORT  *Datatype = NewDatatype(C._H5T_NATIVE_SHORT())
    T_NATIVE_USHORT *Datatype = NewDatatype(C._H5T_NATIVE_USHORT())
    T_NATIVE_UINT   *Datatype = NewDatatype(C._H5T_NATIVE_UINT())
    T_NATIVE_LONG   *Datatype = NewDatatype(C._H5T_NATIVE_LONG())
    T_NATIVE_ULONG  *Datatype = NewDatatype(C._H5T_NATIVE_ULONG())
    T_NATIVE_LLONG  *Datatype = NewDatatype(C._H5T_NATIVE_LLONG())
    T_NATIVE_ULLONG *Datatype = NewDatatype(C._H5T_NATIVE_ULLONG())
    T_NATIVE_DOUBLE *Datatype = NewDatatype(C._H5T_NATIVE_DOUBLE())
    //#if H5_SIZEOF_LONG_DOUBLE !=0
    T_NATIVE_LDOUBLE *Datatype = NewDatatype(C._H5T_NATIVE_LDOUBLE())
    //#endif
    T_NATIVE_B8     *Datatype = NewDatatype(C._H5T_NATIVE_B8())
    T_NATIVE_B16    *Datatype = NewDatatype(C._H5T_NATIVE_B16())
    T_NATIVE_B32    *Datatype = NewDatatype(C._H5T_NATIVE_B32())
    T_NATIVE_B64    *Datatype = NewDatatype(C._H5T_NATIVE_B64())
    T_NATIVE_OPAQUE *Datatype = NewDatatype(C._H5T_NATIVE_OPAQUE())
    T_NATIVE_HSIZE  *Datatype = NewDatatype(C._H5T_NATIVE_HSIZE())
    T_NATIVE_HSSIZE *Datatype = NewDatatype(C._H5T_NATIVE_HSSIZE())
    T_NATIVE_HERR   *Datatype = NewDatatype(C._H5T_NATIVE_HERR())
    T_NATIVE_HBOOL  *Datatype = NewDatatype(C._H5T_NATIVE_HBOOL())

    T_NATIVE_INT8   *Datatype = NewDatatype(C._H5T_NATIVE_INT8())
    T_NATIVE_UINT8  *Datatype = NewDatatype(C._H5T_NATIVE_UINT8())
    T_NATIVE_INT16  *Datatype = NewDatatype(C._H5T_NATIVE_INT16())
    T_NATIVE_UINT16 *Datatype = NewDatatype(C._H5T_NATIVE_UINT16())
    T_NATIVE_INT32  *Datatype = NewDatatype(C._H5T_NATIVE_INT32())
    T_NATIVE_UINT32 *Datatype = NewDatatype(C._H5T_NATIVE_UINT32())
    T_NATIVE_INT64  *Datatype = NewDatatype(C._H5T_NATIVE_INT64())
    T_NATIVE_UINT64 *Datatype = NewDatatype(C._H5T_NATIVE_UINT64())

    T_GO_STRING *Datatype = makeGoStringDatatype()
)

list of predefined hdf5 data types

func CreateDatatype Uses

func CreateDatatype(class TypeClass, size int) (*Datatype, error)

CreateDatatype creates a new datatype. The value of class must be T_COMPOUND, T_OPAQUE, T_ENUM or T_STRING, and size is the size of the new datatype in bytes. The returned datatype must be closed by the user when it is no longer needed.

func NewDataTypeFromType Uses

func NewDataTypeFromType(t reflect.Type) (*Datatype, error)

NewDatatypeFromType creates a new Datatype from a reflect.Type. The returned datatype must be closed by the user when it is no longer needed.

func NewDatatype Uses

func NewDatatype(id C.hid_t) *Datatype

NewDatatype creates a Datatype from an hdf5 id.

func NewDatatypeFromValue Uses

func NewDatatypeFromValue(v interface{}) (*Datatype, error)

NewDatatypeFromValue creates a datatype from a value in an interface. The returned datatype must be closed by the user when it is no longer needed.

func OpenDatatype Uses

func OpenDatatype(c CommonFG, name string, tapl_id int) (*Datatype, error)

OpenDatatype opens a named datatype. The returned datastype must be closed by the user when it is no longer needed.

func (*Datatype) Class Uses

func (t *Datatype) Class() TypeClass

Class returns the TypeClass of the DataType

func (*Datatype) Close Uses

func (t *Datatype) Close() error

Close releases a datatype.

func (*Datatype) Committed Uses

func (t *Datatype) Committed() bool

Committed determines whether a datatype is a named type or a transient type.

func (*Datatype) Copy Uses

func (t *Datatype) Copy() (*Datatype, error)

Copy copies an existing datatype.

func (*Datatype) Equal Uses

func (t *Datatype) Equal(o *Datatype) bool

Equal determines whether two datatype identifiers refer to the same datatype.

func (*Datatype) GoType Uses

func (t *Datatype) GoType() reflect.Type

GoType returns the reflect.Type associated with the Datatype's TypeClass

func (*Datatype) Lock Uses

func (t *Datatype) Lock() error

Lock locks a datatype.

func (*Datatype) SetSize Uses

func (t *Datatype) SetSize(sz int) error

SetSize sets the total size of a Datatype.

func (*Datatype) Size Uses

func (t *Datatype) Size() uint

Size returns the size of the Datatype.

type File Uses

type File struct {
    CommonFG
}

a HDF5 file

func CreateFile Uses

func CreateFile(name string, flags int) (*File, error)

Creates an HDF5 file.

func OpenFile Uses

func OpenFile(name string, flags int) (*File, error)

Open opens and returns an an existing HDF5 file. The returned file must be closed by the user when it is no longer needed.

func (*File) Close Uses

func (f *File) Close() error

Close closes the file.

func (*File) CreateTable Uses

func (f *File) CreateTable(name string, dtype *Datatype, chunkSize, compression int) (*Table, error)

Creates a packet table to store fixed-length packets. The returned table must be closed by the user when it is no longer needed.

func (*File) CreateTableFrom Uses

func (f *File) CreateTableFrom(name string, dtype interface{}, chunkSize, compression int) (*Table, error)

Creates a packet table to store fixed-length packets. The returned table must be closed by the user when it is no longer needed.

func (*File) FileName Uses

func (f *File) FileName() string

FIXME Retrieves name of file to which object belongs.

func (*File) Flush Uses

func (f *File) Flush(scope Scope) error

Flushes all buffers associated with a file to disk.

func (*File) OpenTable Uses

func (f *File) OpenTable(name string) (*Table, error)

Opens an existing packet table. The returned table must be closed by the user when it is no longer needed.

func (*File) ReOpen Uses

func (f *File) ReOpen() (*File, error)

ReOpen returns a new identifier for a previously-opened HDF5 file. The returned file must be closed by the user when it is no longer needed.

type Group Uses

type Group struct {
    CommonFG
}

Group is an HDF5 container object. It can contain any Location.

func (*Group) Close Uses

func (g *Group) Close() error

Close closes the Group.

func (*Group) CreateAttribute Uses

func (g *Group) CreateAttribute(name string, dtype *Datatype, dspace *Dataspace) (*Attribute, error)

CreateAttribute creates a new attribute at this location. The returned attribute must be closed by the user when it is no longer needed.

func (*Group) CreateAttributeWith Uses

func (g *Group) CreateAttributeWith(name string, dtype *Datatype, dspace *Dataspace, acpl *PropList) (*Attribute, error)

CreateAttributeWith creates a new attribute at this location with a user-defined PropList. The returned dataset must be closed by the user when it is no longer needed.

func (*Group) CreateTable Uses

func (g *Group) CreateTable(name string, dtype *Datatype, chunkSize, compression int) (*Table, error)

CreateTable creates a packet table to store fixed-length packets. The returned table must be closed by the user when it is no longer needed.

func (*Group) CreateTableFrom Uses

func (g *Group) CreateTableFrom(name string, dtype interface{}, chunkSize, compression int) (*Table, error)

CreateTableFrom creates a packet table to store fixed-length packets. The returned table must be closed by the user when it is no longer needed.

func (*Group) OpenTable Uses

func (g *Group) OpenTable(name string) (*Table, error)

OpenTable opens an existing packet table. The returned table must be closed by the user when it is no longer needed.

type IType Uses

type IType C.H5I_type_t
const (
    FILE      IType = C.H5I_FILE
    GROUP     IType = C.H5I_GROUP
    DATATYPE  IType = C.H5I_DATATYPE
    DATASPACE IType = C.H5I_DATASPACE
    DATASET   IType = C.H5I_DATASET
    ATTRIBUTE IType = C.H5I_ATTR
    BAD_ID    IType = C.H5I_BADID
)

type Identifier Uses

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

Identifier is a simple wrapper around a C hid_t. It has basic methods which apply to every type in the go-hdf5 API.

func (Identifier) File Uses

func (i Identifier) File() *File

File returns the file associated with this Identifier.

func (Identifier) ID Uses

func (i Identifier) ID() int64

ID returns the integer value of an identifier.

func (Identifier) Name Uses

func (i Identifier) Name() string

Name returns the full name of the Identifier

func (Identifier) Type Uses

func (i Identifier) Type() IType

Type returns the type of the identifier.

type Object Uses

type Object interface {
    Name() string
    Id() int
    File() *File
}

Object represents an hdf5 object.

type OpaqueDatatype Uses

type OpaqueDatatype struct {
    Datatype
}

func (*OpaqueDatatype) SetTag Uses

func (t *OpaqueDatatype) SetTag(tag string) error

SetTag tags an opaque datatype.

func (*OpaqueDatatype) Tag Uses

func (t *OpaqueDatatype) Tag() string

Tag returns the tag associated with an opaque datatype.

type PropList Uses

type PropList struct {
    Identifier
}
var (
    P_DEFAULT *PropList = newPropList(C._go_hdf5_H5P_DEFAULT())
)

func NewPropList Uses

func NewPropList(cls_id PropType) (*PropList, error)

NewPropList creates a new PropList as an instance of a property list class. The returned proplist must be closed by the user when it is no longer needed.

func (*PropList) Close Uses

func (p *PropList) Close() error

Close terminates access to a PropList.

func (*PropList) Copy Uses

func (p *PropList) Copy() (*PropList, error)

Copy copies an existing PropList to create a new PropList.

type PropType Uses

type PropType C.hid_t

type Scope Uses

type Scope C.H5F_scope_t

The difference between a single file and a set of mounted files.

const (
    F_SCOPE_LOCAL  Scope = 0 // specified file handle only.
    F_SCOPE_GLOBAL Scope = 1 // entire virtual file.
)

type SpaceClass Uses

type SpaceClass C.H5S_class_t
const (
    S_NO_CLASS SpaceClass = -1 // error
    S_SCALAR   SpaceClass = 0  // scalar variable
    S_SIMPLE   SpaceClass = 1  // simple data space
    S_NULL     SpaceClass = 2  // null data space
)

type Table Uses

type Table struct {
    Identifier
}

Table is an hdf5 packet-table.

func (*Table) Append Uses

func (t *Table) Append(args ...interface{}) error

Append appends packets to the end of a packet table.

Struct values must only have exported fields, otherwise Append will panic.

func (*Table) Close Uses

func (t *Table) Close() error

Close closes an open packet table.

func (*Table) CreateIndex Uses

func (t *Table) CreateIndex() error

CreateIndex resets a packet table's index to the first packet.

func (*Table) IsValid Uses

func (t *Table) IsValid() bool

IsValid returns whether or not an indentifier points to a packet table.

func (*Table) Next Uses

func (t *Table) Next(data interface{}) error

Next reads packets from a packet table starting at the current index into the value pointed at by data. i.e. data is a pointer to an array or a slice.

func (*Table) NumPackets Uses

func (t *Table) NumPackets() (int, error)

NumPackets returns the number of packets in a packet table.

func (*Table) ReadPackets Uses

func (t *Table) ReadPackets(start, nrecords int, data interface{}) error

ReadPackets reads a number of packets from a packet table.

func (*Table) SetIndex Uses

func (t *Table) SetIndex(index int) error

SetIndex sets a packet table's index.

func (*Table) Type Uses

func (t *Table) Type() (*Datatype, error)

Type returns an identifier for a copy of the datatype for a dataset. The returned datatype must be closed by the user when it is no longer needed.

type TypeClass Uses

type TypeClass C.H5T_class_t
const (
    T_NO_CLASS  TypeClass = -1 // Error
    T_INTEGER   TypeClass = 0  // integer types
    T_FLOAT     TypeClass = 1  // floating-point types
    T_TIME      TypeClass = 2  // date and time types
    T_STRING    TypeClass = 3  // character string types
    T_BITFIELD  TypeClass = 4  // bit field types
    T_OPAQUE    TypeClass = 5  // opaque types
    T_COMPOUND  TypeClass = 6  // compound types
    T_REFERENCE TypeClass = 7  // reference types
    T_ENUM      TypeClass = 8  // enumeration types
    T_VLEN      TypeClass = 9  // variable-length types
    T_ARRAY     TypeClass = 10 // array types
    T_NCLASSES  TypeClass = 11 // nbr of classes -- MUST BE LAST
)

type VarLenType Uses

type VarLenType struct {
    Datatype
}

func NewVarLenType Uses

func NewVarLenType(base_type *Datatype) (*VarLenType, error)

NewVarLenType creates a new VarLenType. the base_type specifies the element type of the VarLenType. The returned variable length type must be closed by the user when it is no longer needed.

func (*VarLenType) IsVariableStr Uses

func (vl *VarLenType) IsVariableStr() bool

IsVariableStr determines whether the VarLenType is a string.

type Version Uses

type Version struct {
    Major   uint
    Minor   uint
    Release uint
}

Version represents the currently used hdf5 library version

func LibVersion Uses

func LibVersion() (Version, error)

LibVersion returns version information for the HDF5 library.

func (Version) String Uses

func (v Version) String() string

Directories

PathSynopsis
cmemPackage cmem provides helper functionality for accessing memory in a C compatible fashion.

Package hdf5 imports 6 packages (graph) and is imported by 1 packages. Updated 2018-07-03. Refresh now. Tools for package owners.