Documentation ¶
Overview ¶
Package hdf5 provides access to the HDF5 C library.
Index ¶
- Constants
- Variables
- func Close() error
- func DisplayErrors(on bool) error
- func GarbageCollect() error
- func IsHDF5(name string) bool
- type ArrayType
- type Attribute
- type CommonFG
- func (g *CommonFG) CreateDataset(name string, dtype *Datatype, dspace *Dataspace) (*Dataset, error)
- func (g *CommonFG) CreateDatasetWith(name string, dtype *Datatype, dspace *Dataspace, dcpl *PropList) (*Dataset, error)
- func (g *CommonFG) CreateGroup(name string) (*Group, error)
- func (g *CommonFG) LinkExists(name string) bool
- func (g *CommonFG) NumObjects() (uint, error)
- func (g *CommonFG) ObjectNameByIndex(idx uint) (string, error)
- func (g *CommonFG) OpenDataset(name string) (*Dataset, error)
- func (g *CommonFG) OpenDatasetWith(name string, dapl *PropList) (*Dataset, error)
- func (g *CommonFG) OpenGroup(name string) (*Group, error)
- type CompoundType
- func (t *CompoundType) Insert(name string, offset int, field *Datatype) error
- func (t *CompoundType) MemberClass(mbr_idx int) TypeClass
- func (t *CompoundType) MemberIndex(name string) int
- func (t *CompoundType) MemberName(mbr_idx int) string
- func (t *CompoundType) MemberOffset(mbr_idx int) int
- func (t *CompoundType) MemberType(mbr_idx int) (*Datatype, error)
- func (t *CompoundType) NMembers() int
- func (t *CompoundType) Pack() error
- type Dataset
- func (s *Dataset) Close() error
- func (s *Dataset) CreateAttribute(name string, dtype *Datatype, dspace *Dataspace) (*Attribute, error)
- func (s *Dataset) CreateAttributeWith(name string, dtype *Datatype, dspace *Dataspace, acpl *PropList) (*Attribute, error)
- func (s *Dataset) Datatype() (*Datatype, error)
- func (s *Dataset) OpenAttribute(name string) (*Attribute, error)
- func (s *Dataset) Read(data interface{}) error
- func (s *Dataset) ReadSubset(data interface{}, memspace, filespace *Dataspace) error
- func (s *Dataset) Space() *Dataspace
- func (s *Dataset) Write(data interface{}) error
- func (s *Dataset) WriteSubset(data interface{}, memspace, filespace *Dataspace) error
- type Dataspace
- func (s *Dataspace) Close() error
- func (s *Dataspace) Copy() (*Dataspace, error)
- func (s *Dataspace) IsSimple() bool
- func (s *Dataspace) SelectHyperslab(offset, stride, count, block []uint) error
- func (s *Dataspace) SetOffset(offset []uint) error
- func (s *Dataspace) SimpleExtentDims() (dims, maxdims []uint, err error)
- func (s *Dataspace) SimpleExtentNDims() int
- func (s *Dataspace) SimpleExtentNPoints() int
- func (s *Dataspace) SimpleExtentType() SpaceClass
- type Datatype
- func (t *Datatype) Class() TypeClass
- func (t *Datatype) Close() error
- func (t *Datatype) Committed() bool
- func (t *Datatype) Copy() (*Datatype, error)
- func (t *Datatype) Equal(o *Datatype) bool
- func (t *Datatype) GoType() reflect.Type
- func (t *Datatype) Lock() error
- func (t *Datatype) SetSize(sz int) error
- func (t *Datatype) Size() uint
- type File
- func (f *File) Close() error
- func (f *File) CreateTable(name string, dtype *Datatype, chunkSize, compression int) (*Table, error)
- func (f *File) CreateTableFrom(name string, dtype interface{}, chunkSize, compression int) (*Table, error)
- func (f *File) FileName() string
- func (f *File) Flush(scope Scope) error
- func (f *File) OpenTable(name string) (*Table, error)
- func (f *File) ReOpen() (*File, error)
- type Group
- func (g *Group) Close() error
- func (g *Group) CreateAttribute(name string, dtype *Datatype, dspace *Dataspace) (*Attribute, error)
- func (g *Group) CreateAttributeWith(name string, dtype *Datatype, dspace *Dataspace, acpl *PropList) (*Attribute, error)
- func (g *Group) CreateTable(name string, dtype *Datatype, chunkSize, compression int) (*Table, error)
- func (g *Group) CreateTableFrom(name string, dtype interface{}, chunkSize, compression int) (*Table, error)
- func (g *Group) OpenAttribute(name string) (*Attribute, error)
- func (g *Group) OpenTable(name string) (*Table, error)
- type IType
- type Identifier
- type Object
- type OpaqueDatatype
- type PropList
- func (p *PropList) Close() error
- func (p *PropList) Copy() (*PropList, error)
- func (p *PropList) GetChunk(ndims int) (dims []uint, err error)
- func (p *PropList) GetChunkCache() (nslots, nbytes int, w0 float64, err error)
- func (p *PropList) SetChunk(dims []uint) error
- func (p *PropList) SetChunkCache(nslots, nbytes int, w0 float64) error
- func (p *PropList) SetDeflate(level int) error
- type PropType
- type Scope
- type SpaceClass
- type Table
- func (t *Table) Append(args ...interface{}) error
- func (t *Table) Close() error
- func (t *Table) CreateIndex() error
- func (t *Table) IsValid() bool
- func (t *Table) Next(data interface{}) error
- func (t *Table) NumPackets() (int, error)
- func (t *Table) ReadPackets(start, nrecords int, data interface{}) error
- func (t *Table) SetIndex(index int) error
- func (t *Table) Type() (*Datatype, error)
- type TypeClass
- type VarLenType
- type Version
Constants ¶
const ( D_CHUNK_CACHE_NSLOTS_DEFAULT int = -1 // The number of chunk slots in the raw data chunk cache for this dataset D_CHUNK_CACHE_NBYTES_DEFAULT int = -1 // The total size of the raw data chunk cache for this dataset D_CHUNK_CACHE_W0_DEFAULT float64 = -1 // The chunk preemption policy for this dataset )
Used to unset chunk cache configuration parameter. https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetChunkCache
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
const ( NoCompression = zlib.NoCompression BestSpeed = zlib.BestSpeed BestCompression = zlib.BestCompression DefaultCompression = zlib.DefaultCompression )
Variables ¶
var ( P_DEFAULT *PropList = newPropList(C._go_hdf5_H5P_DEFAULT()) P_DATASET_CREATE PropType = PropType(C._go_hdf5_H5P_DATASET_CREATE()) // Properties for dataset creation P_DATASET_ACCESS PropType = PropType(C._go_hdf5_H5P_DATASET_ACCESS()) // Properties for dataset access )
Functions ¶
func Close ¶
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 ¶
DisplayErrors enables/disables HDF5's automatic error printing
func GarbageCollect ¶
func GarbageCollect() error
GarbageCollect collects garbage on all free-lists of all types.
Types ¶
type ArrayType ¶
type ArrayType struct {
Datatype
}
func NewArrayType ¶
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.
type Attribute ¶
type Attribute struct {
Identifier
}
func (*Attribute) GetType ¶
func (s *Attribute) GetType() Identifier
Access the type of an attribute
type CommonFG ¶
type CommonFG struct {
Identifier
}
CommonFG is for methods common to both File and Group
func (*CommonFG) CreateDataset ¶
CreateDataset creates a new Dataset. The returned dataset must be closed by the user when it is no longer needed.
func (*CommonFG) CreateDatasetWith ¶
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 ¶
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) LinkExists ¶
LinkExists returns whether a link with the specified name exists in the group.
func (*CommonFG) NumObjects ¶
NumObjects returns the number of objects in the Group.
func (*CommonFG) ObjectNameByIndex ¶
ObjectNameByIndex returns the name of the object at idx.
func (*CommonFG) OpenDataset ¶
OpenDataset opens and returns a named Dataset. The returned dataset must be closed by the user when it is no longer needed.
func (*CommonFG) OpenDatasetWith ¶
OpenDatasetWith opens and returns a named Dataset with a user-defined PropList. The returned dataset must be closed by the user when it is no longer needed.
type CompoundType ¶
type CompoundType struct {
Datatype
}
func NewCompoundType ¶
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 ¶
func (t *CompoundType) Insert(name string, offset int, field *Datatype) error
Insert adds a new member to a compound datatype.
func (*CompoundType) MemberClass ¶
func (t *CompoundType) MemberClass(mbr_idx int) TypeClass
MemberClass returns datatype class of compound datatype member.
func (*CompoundType) MemberIndex ¶
func (t *CompoundType) MemberIndex(name string) int
MemberIndex returns the index of a compound or enumeration datatype member.
func (*CompoundType) MemberName ¶
func (t *CompoundType) MemberName(mbr_idx int) string
MemberName returns the name of a compound or enumeration datatype member.
func (*CompoundType) MemberOffset ¶
func (t *CompoundType) MemberOffset(mbr_idx int) int
MemberOffset returns the offset of a field of a compound datatype.
func (*CompoundType) MemberType ¶
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 ¶
func (t *CompoundType) NMembers() int
NMembers returns the number of elements in a compound or enumeration datatype.
func (*CompoundType) Pack ¶
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 ¶
type Dataset struct { Identifier // contains filtered or unexported fields }
func (*Dataset) CreateAttribute ¶
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 ¶
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 ¶
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 ¶
Opens an existing attribute. The returned attribute must be closed by the user when it is no longer needed.
func (*Dataset) ReadSubset ¶
ReadSubset reads a subset of raw data from a dataset into a buffer.
func (*Dataset) WriteSubset ¶
WriteSubset writes a subset of raw data from a buffer to a dataset.
type Dataspace ¶
type Dataspace struct {
Identifier
}
func CreateDataspace ¶
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 ¶
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) Copy ¶
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) SelectHyperslab ¶
SelectHyperslab creates a subset of the data space.
func (*Dataspace) SimpleExtentDims ¶
SimpleExtentDims returns dataspace dimension size and maximum size.
func (*Dataspace) SimpleExtentNDims ¶
SimpleExtentNDims returns the dimensionality of a dataspace.
func (*Dataspace) SimpleExtentNPoints ¶
SimpleExtentNPoints returns the number of elements in a dataspace.
func (*Dataspace) SimpleExtentType ¶
func (s *Dataspace) SimpleExtentType() SpaceClass
SimpleExtentType returns the current class of a dataspace.
type Datatype ¶
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 ¶
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 ¶
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 ¶
NewDatatype creates a Datatype from an hdf5 id.
func NewDatatypeFromValue ¶
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 ¶
OpenDatatype opens a named datatype. The returned datastype must be closed by the user when it is no longer needed.
func (*Datatype) Committed ¶
Committed determines whether a datatype is a named type or a transient type.
func (*Datatype) Equal ¶
Equal determines whether two datatype identifiers refer to the same datatype.
type File ¶
type File struct {
CommonFG
}
a HDF5 file
func OpenFile ¶
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) CreateTable ¶
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 ¶
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.
type Group ¶
type Group struct {
CommonFG
}
Group is an HDF5 container object. It can contain any Location.
func (*Group) CreateAttribute ¶
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 ¶
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 ¶
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 ¶
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) OpenAttribute ¶
Opens an existing attribute. The returned attribute must be closed by the user when it is no longer needed.
type IType ¶
type IType C.H5I_type_t
type Identifier ¶
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 ¶
func (i Identifier) File() *File
File returns the file associated with this Identifier.
func (Identifier) ID ¶
func (i Identifier) ID() int64
ID returns the integer value of an identifier.
func (Identifier) Name ¶
func (i Identifier) Name() string
Name returns the full name of the Identifier
type OpaqueDatatype ¶
type OpaqueDatatype struct {
Datatype
}
func (*OpaqueDatatype) SetTag ¶
func (t *OpaqueDatatype) SetTag(tag string) error
SetTag tags an opaque datatype.
func (*OpaqueDatatype) Tag ¶
func (t *OpaqueDatatype) Tag() string
Tag returns the tag associated with an opaque datatype.
type PropList ¶
type PropList struct {
Identifier
}
func NewPropList ¶
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) GetChunk ¶
GetChunk retrieves the size of chunks for the raw data of a chunked layout dataset. https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-GetChunk
func (*PropList) GetChunkCache ¶
GetChunkCache retrieves the number of chunk slots in the raw data chunk cache hash table. https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-GetChunkCache
func (*PropList) SetChunk ¶
SetChunk sets the size of the chunks used to store a chunked layout dataset. https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetChunk
func (*PropList) SetChunkCache ¶
SetChunkCache sets the raw data chunk cache parameters. To reset them as default, use `D_CHUNK_CACHE_NSLOTS_DEFAULT`, `D_CHUNK_CACHE_NBYTES_DEFAULT` and `D_CHUNK_CACHE_W0_DEFAULT`. https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetChunkCache
func (*PropList) SetDeflate ¶
SetDeflate sets deflate (GNU gzip) compression method and compression level. If level is set as DefaultCompression, 6 will be used. https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetDeflate
type Scope ¶
type Scope C.H5F_scope_t
The difference between a single file and a set of mounted files.
type SpaceClass ¶
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 ¶
type Table struct {
Identifier
}
Table is an hdf5 packet-table.
func (*Table) Append ¶
Append appends packets to the end of a packet table.
Struct values must only have exported fields, otherwise Append will panic.
func (*Table) CreateIndex ¶
CreateIndex resets a packet table's index to the first packet.
func (*Table) Next ¶
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 ¶
NumPackets returns the number of packets in a packet table.
func (*Table) ReadPackets ¶
ReadPackets reads a number of packets from a packet table.
type TypeClass ¶
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 ¶
type VarLenType struct {
Datatype
}
func NewVarLenType ¶
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 ¶
func (vl *VarLenType) IsVariableStr() bool
IsVariableStr determines whether the VarLenType is a string.
type Version ¶
Version represents the currently used hdf5 library version
func LibVersion ¶
LibVersion returns version information for the HDF5 library.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
Package cmem provides helper functionality for accessing memory in a C compatible fashion.
|
Package cmem provides helper functionality for accessing memory in a C compatible fashion. |