package hdf5

  1. Overview
  2. Docs
include module type of struct include H5 end
val escape : string -> string

Escape slash characters in the given string with '\-'.

val unescape : string -> string

Unescape slash characters in the given string with '\-'.

val set_default_deflate : int -> unit

Sets the default deflate to be used when writing data.

val default_deflate : unit -> int

Returns the default deflate used when writing data.

val set_default_split : bool -> unit

Sets whether the create HDF5 files are split by default. See open_.

val default_split : unit -> bool

Returns whether the created HDF5 files are split by default. See open_.

type t

Represents a group inside an HDF5 file.

type open_ = ?meta_block_size:int -> ?split:bool -> string -> t

Parameters for opening files.

  • parameter meta_block_size

    Size of the meta blocks.

  • parameter split

    If set, all HDF5 files are split into a file which contains only metadata and a file which contains only raw data. Their respective extensions are "-m.h5" and "-r.h5". Since reading metadata requires many small accesses to the file, this option may provide a faster access on slow file systems.

val create_trunc : open_

Creates the named file and returns the root group.

val open_rdonly : open_

Opens the named file for reading and returns the root group.

val open_rdwr : open_

Opens the named file for reading and writing and returns the root group.

val open_group : t -> string -> t

Opens the named subgroup. The subgroup is created if it does not already exist.

val open_dataset : t -> string -> t

Opens the dataset with the given name.

val close : t -> unit

Closes the group handle. If given a root group closes the file.

val with_group : t -> string -> (t -> 'a) -> 'a

Performs the given function on the given dir.

val flush : t -> unit

Flushes all buffers associated with a file to disk.

val get_name : t -> string

Returns the name of file to which object belongs.

val exists : t -> string -> bool

Returns whether the given subgroup or a data set exists.

val delete : t -> string -> unit

Deletes the given subgroup or a data set.

val ls : ?index:Hdf5_raw.H5_raw.Index.t -> ?order:Hdf5_raw.H5_raw.Iter_order.t -> t -> string list

Returns all subdirectories and data sets.

val copy : src:t -> src_name:string -> dst:t -> dst_name:string -> unit

Copies data.

val merge : src:t -> dst:t -> on_duplicate:[ `Skip | `Raise | `Call of string list -> unit ] -> unit

Merges the source into the destination. Every group and dataset from the source is copied to the destination. on_duplicate defines what is done in the case of a conflict. The argument to `Call is the path of the conflicting dataset.

Creates a hard link.

Creates a soft link.

Creates an external link.

val hid : t -> Hdf5_raw.Hid.t

Returns the HDF5 handle

val dataset : Hdf5_raw.Hid.t -> t

Construct H5.t from dataset HDF5 handle

val file : Hdf5_raw.Hid.t -> t

Construct H5.t from file HDF5 handle

val group : Hdf5_raw.Hid.t -> t

Construct H5.t from group HDF5 handle

val h5t : Hdf5_raw.Hid.t -> t

Construct H5.t from group, file, or dataset HDF5 handle

val write_uint8_array1 : t -> string -> ?deflate:int -> (char, Bigarray.int8_unsigned_elt, _) Bigarray.Array1.t -> unit

Writes the given uint8 Array1.t to the data set.

val read_uint8_array1 : t -> ?data:(char, Bigarray.int8_unsigned_elt, 'a) Bigarray.Array1.t -> string -> 'a Bigarray.layout -> (char, Bigarray.int8_unsigned_elt, 'a) Bigarray.Array1.t

Reads the data set into a uint8 Array1.t.

  • parameter data

    If provided, the storage for the data.

val write_string : t -> string -> ?deflate:int -> string -> unit

Writes the given string to the data set.

val read_string : t -> string -> string

Reads the data set into a string.

val write_string_array : t -> string -> ?deflate:int -> string array -> unit

Writes the given string array to the data set.

val read_string_array : t -> string -> string array

Reads the data set into a string array.

val write_attribute_int64 : t -> string -> int64 -> unit

write_attribute_int64 t name v writes the given int64 as an attribute with the given name.

val read_attribute_int64 : t -> string -> int64

read_attribute_int64 t name reads the attribute with the given name as a int64.

val write_attribute_string : t -> string -> string -> unit

write_attribute_string t name v writes the given string as an attribute with the given name.

val read_attribute_string : t -> string -> string

read_attribute_string t name reads the attribute with the given name as a string.

val write_attribute_string_array : t -> string -> string array -> unit

write_attribute_string_array t name v writes the given string array as an attribute with the given name.

val read_attribute_string_array : t -> string -> string array

read_attribute_string_array t name reads the attribute with the given name as a string array.

val attribute_exists : t -> string -> bool

Returns whether the given attribute exists.

val delete_attribute : t -> string -> unit

Deletes the given attribute.

val write_float_array : t -> string -> ?deflate:int -> float array -> unit

Writes the given float array to the data set.

val read_float_array : t -> ?data:float array -> string -> float array

Reads the data set into a float array.

  • parameter data

    If provided, the storage for the data.

val write_float_genarray : t -> string -> ?deflate:int -> (float, Bigarray.float64_elt, _) Bigarray.Genarray.t -> unit
val read_float_genarray : t -> ?data:(float, Bigarray.float64_elt, 'a) Bigarray.Genarray.t -> string -> 'a Bigarray.layout -> (float, Bigarray.float64_elt, 'a) Bigarray.Genarray.t

Reads the data set into a float Genarray.t.

  • parameter data

    If provided, the storage for the data.

val write_float_array1 : t -> string -> ?deflate:int -> (float, Bigarray.float64_elt, _) Bigarray.Array1.t -> unit

Writes the given float Array1.t to the data set.

val read_float_array1 : t -> ?data:(float, Bigarray.float64_elt, 'a) Bigarray.Array1.t -> string -> 'a Bigarray.layout -> (float, Bigarray.float64_elt, 'a) Bigarray.Array1.t

Reads the data set into a float Array1.t.

  • parameter data

    If provided, the storage for the data.

val write_float_array2 : t -> string -> ?deflate:int -> (float, Bigarray.float64_elt, _) Bigarray.Array2.t -> unit

Writes the given float Array1.t to the data set.

val read_float_array2 : t -> ?data:(float, Bigarray.float64_elt, 'a) Bigarray.Array2.t -> string -> 'a Bigarray.layout -> (float, Bigarray.float64_elt, 'a) Bigarray.Array2.t

Reads the data set into a float Array2.t.

  • parameter data

    If provided, the storage for the data.

val write_float_array3 : t -> string -> ?deflate:int -> (float, Bigarray.float64_elt, _) Bigarray.Array3.t -> unit

Writes the given float Array1.t to the data set.

val read_float_array3 : t -> ?data:(float, Bigarray.float64_elt, 'a) Bigarray.Array3.t -> string -> 'a Bigarray.layout -> (float, Bigarray.float64_elt, 'a) Bigarray.Array3.t

Reads the data set into a float Array3.t.

  • parameter data

    If provided, the storage for the data.

val write_attribute_float : t -> string -> float -> unit

write_attribute_float t name v writes the given float as an attribute with the given name.

val read_attribute_float : t -> string -> float

read_attribute_float t name reads the attribute with the given name as a float.

val write_attribute_float_array : t -> string -> float array -> unit

Writes the given float as an attribute with the given name.

val read_attribute_float_array : t -> string -> float array

Reads the attribute with the given name as a float.

module Float32 : sig ... end
module Float64 : sig ... end
OCaml

Innovation. Community. Security.