SrirachaDataset#

class irdl.SrirachaDataset#

Bases: IstaBaseDataset

Download and merge the SRIRACHA database from DepositOnce.

Attributes:
namestr

Dataset name (“sriracha”).

doistr

Digital Object Identifier (“10.14279/depositonce-23943”).

room_volumefloat

Room volume in cubic meters (73.5).

measurement_datefloat

Release date in POSIX seconds, used as the SOFA MeasurementDate (no per-measurement date is available).

_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_dirpathlib.Path

Provider directory (e.g., cache/SRIRACHA/provider/).

**dataset_kwargsdict

Must contain ‘scenario’. May contain ‘dataset_split’.

Returns:
pathlib.Path

Path 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.

Parameters:
scenariostr

Scenario name (e.g. ‘SR1’).

provider_artifactPath

Provider directory where split files are downloaded.

ingest_pathPath

Target path in the ingest directory for the merged file.

Returns:
Path

Path to the merged HDF5 file.

_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_artifactPath

Path to the downloaded file or the provider directory.

ingest_pathpathlib.Path

Path to the HDF5 file in the ingest directory.

**dataset_kwargsdict

Must contain ‘scenario’. May contain ‘dataset_split’.

Returns:
Path

Path to the processed file in the ingest directory.

_validate_params(**dataset_kwargs) None#

Validate SRIRACHA-specific parameters.

Parameters:
**dataset_kwargsdict

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_format is also passed and used to forbid ‘raw’ for non-dense full-plane scenarios.

Raises:
ValueError

If scenario or split is invalid, a dense scenario is combined with a split, or ‘raw’ is requested for a non-dense full plane.

doi: str = '10.14279/depositonce-23943'#
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_dirstr

Cache directory for downloads. Defaults is the OS user cache directory. This default can be overridden by setting IRDL_CACHE_DIR environment variable.

export_dirstr, optional

Directory for final output. If specified, the data will be exported to <export_dir/SRIRACHA/>. Else, it remains in <cache_dir/output/>.

output_formatstr

Output format: ‘pyfar’, ‘numpy’, ‘hdf5’, ‘sofa’, or ‘raw’.

scenariostr, optional

Scenario to download. One of ‘SR1’, ‘SRA1’, ‘SR1-D’, ‘SRA1-D’, ‘SR2’, ‘SRA2’, ‘SR2-D’, ‘SRA2-D’. Default is ‘SR1-D’.

dataset_splitstr or None, 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.

Returns:
dict or Path

For ‘pyfar’ / ‘numpy’: dict of in-memory objects. For ‘sofa’ / ‘hdf5’ / ‘raw’: Path to file on disk.

measurement_date = 1755648000.0#
name: str = 'sriracha'#
room_volume = 73.5#