SrirachaDataset#
- class irdl.SrirachaDataset#
Bases:
IstaBaseDatasetDownload and merge the SRIRACHA database from DepositOnce.
- Attributes:
- _category = 'room_impulse_responses'#
- _download(provider_dir: Path, **dataset_kwargs) Path#
Download SRIRACHA dataset file(s) to the provider directory.
For dense scenarios or explicit splits, downloads a single file. For non-dense full-plane scenarios, downloads all 4 split files and returns the provider directory path.
- Parameters:
- provider_dir
pathlib.Path Provider directory (e.g.,
cache/SRIRACHA/provider/).- **dataset_kwargs
dict Must contain ‘scenario’. May contain ‘dataset_split’.
- provider_dir
- Returns:
pathlib.PathPath to the downloaded file (inside provider) or the provider directory (for non-dense full-plane scenarios).
- _merge_split_files(scenario: str, provider_artifact: Path, ingest_path: Path) Path#
Merge four quadrant HDF5 files into a full-plane file.
Reads metadata from the first split file in the provider directory, allocates output datasets with the full source-grid shape, copies each split’s measurements into the interleaved grid positions, and deletes the provider split files afterwards.
- _process(provider_artifact: Path, ingest_path: Path, **dataset_kwargs) Path#
Post-process SRIRACHA file if needed.
For non-dense full-plane scenarios, merges the 4 downloaded split files from the provider directory into a single file in the ingest directory. Otherwise promotes the single file to the ingest stage.
- Parameters:
- provider_artifact
Path Path to the downloaded file or the provider directory.
- 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:
PathPath to the processed file in the ingest directory.
- _validate_params(**dataset_kwargs) None#
Validate SRIRACHA-specific parameters.
- Parameters:
- **dataset_kwargs
dict Must contain ‘scenario’ (one of ‘SR1’, ‘SRA1’, ‘SR1-D’, ‘SRA1-D’, ‘SR2’, ‘SRA2’, ‘SR2-D’, ‘SRA2-D’). May contain ‘dataset_split’ (one of ‘C1’, ‘C2’, ‘C3’, ‘C4’, or None). Dense scenarios (ending in ‘-D’) cannot be split.
output_formatis also passed and used to forbid ‘raw’ for non-dense full-plane scenarios.
- **dataset_kwargs
- Raises:
ValueErrorIf scenario or split is invalid, a dense scenario is combined with a split, or ‘raw’ is requested for a non-dense full plane.
- classmethod get(scenario: str = 'SR1-D', 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 and merge the SRIRACHA database from DepositOnce.
DOI: https://doi.org/10.14279/depositonce-23943
- 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/SRIRACHA/>. Else, it remains in <cache_dir/output/>.
- output_format
str Output format: ‘pyfar’, ‘numpy’, ‘hdf5’, ‘sofa’, or ‘raw’.
- scenario
str,optional Scenario to download. One of ‘SR1’, ‘SRA1’, ‘SR1-D’, ‘SRA1-D’, ‘SR2’, ‘SRA2’, ‘SR2-D’, ‘SRA2-D’. Default is ‘SR1-D’.
- dataset_split
strorNone,optional Optional dataset split for full-plane scenarios. One of ‘C1’, ‘C2’, ‘C3’, ‘C4’ or None. Dense scenarios (ending in ‘-D’) do not have splits. Default is None.
- cache_dir
- Returns:
- measurement_date = 1755648000.0#
- room_volume = 73.5#