HDF5¶
rddac.open_h5 and rddac.inspect_h5 are the top level helpers for reading and inspecting a single experiment. Both are re-exported at the package root (rddac.open_h5, rddac.inspect_h5); the implementation lives in rddac.h5_tools.
rddac.open_h5¶
open_h5(experiment_id: int, source: str | Path | None = None, data_dir: str | Path | None = DEFAULT_DATA_DIR, dataset=None) -> h5py.File
¶
Return an h5py.File for the requested RDDAC experiment.
Looks the manifest up, walks the locally mapped zips and reads the h5
member matching the zero-padded <experiment_id>.h5 (e.g. 0042.h5)
into a BytesIO. The returned object is read-only, supports the with
idiom and can be indexed like any other h5py.File.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
experiment_id
|
int
|
The experiment index (matches the h5 filename inside
the zip; |
required |
source
|
str | Path | None
|
Override the Croissant manifest URL / path. |
None
|
data_dir
|
str | Path | None
|
Directory searched for already-downloaded zips. Pass |
DEFAULT_DATA_DIR
|
dataset
|
A pre-loaded |
None
|
Raises:
| Type | Description |
|---|---|
FileNotFoundError
|
No locally mapped zip contained the requested h5. |
Source code in rddac/h5_tools.py
rddac.inspect_h5¶
inspect_h5(file_or_path: h5py.File | str | Path) -> None
¶
Pretty-print the group/dataset hierarchy of an HDF5 file.
Accepts either an open h5py.File (e.g. from ddacs.open_h5) or a path
on disk. Prints to stdout and returns nothing.