evlib.codec.fileformat.hdf5

hdf5 formats for various existing datasets.

Functions

hdf5append(data, new_arr)

For utility: append an array to hdf5 data.

load_event_timestamp_hdf5(path, key_pairs[, ...])

For utility: load only timestamps from the hdf5 data.

load_hdf5(path, key_dtype_pairs)

Load all the contents of .hdf5 file at once.

open_hdf5(path)

Open .hdf5 file, not to load them at once.

evlib.codec.fileformat.hdf5.load_hdf5(path, key_dtype_pairs)

Load all the contents of .hdf5 file at once.

Parameters:
  • path (str) – Path to the .hdf5 file.

  • key_dtype_pairs (list of tuple) – A triplet, or list of triplets of (key of the return dictionary, key of the hdf5 file data, data type for numpy).For example, [(“ts”, “raw_events/ts”, np.int32), (“x”, “raw_events/x”, np.int16), …]

Returns:

{key of the return dictionary: np.ndarray}

Return type:

dict

evlib.codec.fileformat.hdf5.open_hdf5(path)

Open .hdf5 file, not to load them at once.

Parameters:

path (str) – Path to the .hdf5 file.

Returns:

(Any) opened hdf5 object.

Return type:

Any

evlib.codec.fileformat.hdf5.load_event_timestamp_hdf5(path, key_pairs, dtype=<class 'numpy.int32'>)

For utility: load only timestamps from the hdf5 data.

Parameters:
  • path (str) – Path to the .hdf5 file.

  • key_pairs (Tuple[str, str]) – The tuple of (key of the return dictionary, key of the hdf5 file data)

  • dtype (type)

Returns:

dict

Return type:

Dict[str, ndarray]

evlib.codec.fileformat.hdf5.hdf5append(data, new_arr)

For utility: append an array to hdf5 data.

Parameters:
  • data (Any) – _description_

  • new_arr (np.ndarray) – _description_

Return type:

None