MiracleDataset#
- class irdl.MiracleDataset#
Bases:
IstaBaseDatasetDownload the MIRACLE database from DepositOnce.
- Attributes:
- _category = 'room_impulse_responses'#
- _download(provider_dir: Path, **dataset_kwargs) Path#
Download MIRACLE dataset file.
Downloads the full scenario HDF5 file. If a split is requested, the split will be extracted in _process().
- Parameters:
- provider_dir
pathlib.Path Provider directory (e.g.,
cache/MIRACLE/provider/).- **dataset_kwargs
dict Must contain ‘scenario’. May contain ‘dataset_split’.
- provider_dir
- Returns:
pathlib.PathPath to the downloaded full scenario HDF5 file inside the provider directory.
- _extract_split(ingest_path: Path, dataset_split: str, output_path: Path) Path#
Extract a dataset split from a full MIRACLE HDF5 file.
Reads the full file, indexes the requested quadrant of the source grid, and writes the result to a new HDF5 file.
- Parameters:
- ingest_path
pathlib.Path Path to the full HDF5 file in the provider directory.
- dataset_split
str Split to extract. One of ‘C1’, ‘C2’, ‘C3’, ‘C4’.
- output_path
pathlib.Path Target path in the ingest directory.
- ingest_path
- Returns:
pathlib.PathPath to the extracted split HDF5 file.
- _process(provider_artifact: Path, ingest_path: Path, **dataset_kwargs) Path#
Post-process MIRACLE file if needed.
If a dataset_split is requested and the file is the full scenario file, extracts the corresponding quadrant split into the ingest directory. Otherwise promotes the provider file to the ingest stage.
- Parameters:
- provider_artifact
pathlib.Path Path to the provider file (full scenario HDF5).
- ingest_path
pathlib.Path Path to the HDF5 file in the ingest directory.
- **dataset_kwargs
dict Must contain ‘scenario’. May contain ‘dataset_split’.
- provider_artifact
- Returns:
pathlib.PathPath to the processed file in the ingest directory.
- _validate_params(**dataset_kwargs) None#
Validate MIRACLE-specific parameters.
- Parameters:
- **dataset_kwargs
dict Must contain ‘scenario’ (one of ‘A1’, ‘A2’, ‘D1’, ‘R2’). May contain ‘dataset_split’ (one of ‘C1’, ‘C2’, ‘C3’, ‘C4’, or None). Scenario ‘D1’ cannot be split.
output_formatis also passed but unused here.
- **dataset_kwargs
- Raises:
ValueErrorIf scenario or split is out of range, or ‘D1’ is combined with a split.
- classmethod get(scenario: str = 'A1', dataset_split: str | None = None, cache_dir: str | Path | None = None, export_dir: str | Path | None = None, output_format: str = 'pyfar') dict | Path | None#
Download the MIRACLE database from DepositOnce.
DOI: https://doi.org/10.14279/depositonce-20837
- Parameters:
- cache_dir
str Cache directory for downloads. Defaults is the OS user cache directory. This default can be overridden by setting IRDL_CACHE_DIR environment variable.
- export_dir
str,optional Directory for final output. If specified, the data will be exported to <export_dir/MIRACLE/>. Else, it remains in <cache_dir/output/>.
- output_format
str Output format: ‘pyfar’, ‘numpy’, ‘hdf5’, ‘sofa’, or ‘raw’.
- scenario
str Scenario to download. One of ‘A1’, ‘A2’, ‘D1’, ‘R2’.
- dataset_split
strorNone,optional Artificial dataset split. One of ‘C1’, ‘C2’, ‘C3’, ‘C4’ or None. Dense scenarios (D1) cannot be split.
- cache_dir
- Returns:
- measurement_date = 1697068800.0#
- room_volume = 830#