MyriadDataset#
- class irdl.MyriadDataset#
Bases:
BaseDatasetDownload the MYRiAD database (RIR subset) from Zenodo.
- Attributes:
- _ARRAY_GROUPS: ClassVar[dict[str, list[str]]] = {'bte-pieces': ['BTELF', 'BTELB', 'BTERF', 'BTERB'], 'circular-microphone-array': ['CMA10_-90', 'CMA10_0', 'CMA10_90', 'CMA10_180', 'CMA20_-135', 'CMA20_-90', 'CMA20_-45', 'CMA20_0', 'CMA20_45', 'CMA20_90', 'CMA20_135', 'CMA20_180'], 'dummy_head': ['DHL', 'DHR'], 'external-microphones': ['XM1', 'XM2', 'XM3', 'XM4', 'XM5']}#
- _category = 'room_impulse_responses'#
- _download(provider_dir: Path, **dataset_kwargs) Path#
Download MYRiAD ZIP archive to the provider directory.
Only downloads the archive if it is not already cached. Returns the ZIP path so that
_processcan extract and process the requested files.- Parameters:
- provider_dir
pathlib.Path Provider directory (e.g.,
cache/MYRiAD/provider/).- **dataset_kwargs
dict Dataset keyword arguments.
- provider_dir
- Returns:
pathlib.PathPath to the downloaded ZIP archive.
- _ingest(ingest_artifact: Path, sofa_path: Path, **dataset_kwargs) Path#
Build the internal SOFA from the extracted files and write it to sofa_path.
Stacks the selected loudspeaker/microphone WAVs into a
Data.IRarray of shape(M, R, N, E), attaches the geometry from the room coordinate CSV, layers on the descriptive metadata, and writes the result. The loudspeakers are the emitters (E) and the selected microphones are the receivers (R) — the inverse of the moving-source ISTA datasets, where source positions index M.- Parameters:
- ingest_artifact
pathlib.Path Ingest directory populated by
_process().- sofa_path
pathlib.Path Target path for the retained SOFA file.
- ingest_artifact
- Returns:
pathlib.PathPath to the written SOFA file (
sofa_path).
- _process(provider_artifact: Path, ingest_path: Path, **dataset_kwargs) Path#
Extract only the selected RIR WAVs and coordinate CSV into the ingest directory.
Performs no signal processing: selects the WAVs and the room coordinate CSV for the requested selection and extracts them, preserving the archive tree, into
ingest_path. All SOFA construction is deferred to_ingest().- Parameters:
- provider_artifact
pathlib.Path Path to the downloaded MYRiAD ZIP archive.
- ingest_path
pathlib.Path Target directory for the extracted files.
- provider_artifact
- Returns:
pathlib.PathPath to the ingest directory (
ingest_path).
- classmethod _resolve(*, room, array, config=None, **_ignored) dict#
Resolve the raw get() parameters into a concrete selection.
Parses the array selection into a deduplicated, canonical-order group list and bundles it with the room, config, convention, and the resolved speaker and microphone labels. This method performs no validation: unknown group names are kept at the end of
'groups'so that_validate_paramscan reject them, andconfigis passed through untouched.- Parameters:
- room
str Room being loaded. Used to look up the speakers and to exclude the circular array from
'all'for room SAL.- array
strorlistofstr Requested group(s):
'all', a comma-separated string, or a list of the array group names.- config
strorNone Microphone configuration placement in the AIL (
'P1'or'P2'). Ignored for the SAL.
- room
- Returns:
dictResolved selection with keys
'room','config','groups'(requested groups in canonical order, unknowns kept at the end),'speakers'(emitter labels) and'mics'(receiver labels for the known groups).
- _source_filename(**dataset_kwargs) str#
Build the ingest filename encoding the full selection.
The name has the form
MYRIAD_<room>[_<config>]_<groups>_<convention>, where<config>is included only for the AIL and<groups>is the selected array groups as short tokens.<convention>is part of the name because the ingest archive embeds the convention in its metadata sidecar, so each convention must map to a distinct cache file.- Returns:
strFilename for the ingest-stage archive.
- _validate_params(**dataset_kwargs) None#
Validate MYRiAD-specific parameters.
- Parameters:
- **dataset_kwargs
dict Must contain
'room'(one of'SAL','AIL'),'array'(one or more valid group names or'all') and'config'(one of'P1','P2').output_formatis also passed but unused here.
- **dataset_kwargs
- Raises:
ValueErrorIf any parameter is out of range, the circular array is requested for
'SAL', or'MultiSpeakerBRIR'is combined with more than the'dummy_head'group.
- classmethod get(room: str = 'SAL', array: str = 'all', config: str = 'P1', cache_dir: str | Path | None = None, export_dir: str | Path | None = None, output_format: str = 'pyfar') dict | Path | None#
Download the MYRiAD database (RIR subset) from Zenodo.
DOI: https://doi.org/10.5281/zenodo.7389996
- 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/MYRIAD/>. Else, it remains in <cache_dir/output/>.
- output_format
str Output format: ‘pyfar’, ‘numpy’, ‘hdf5’, ‘sofa’, or ‘raw’.
- room
str Room to load. Either
'SAL'or'AIL'. Default is'SAL'.- array
str Microphone array group(s) to load. One of
'dummy_head','bte-pieces','external-microphones','circular-microphone-array', a comma-separated combination of these (e.g.'dummy_head,bte-pieces'), or'all'for every group available in the room. A list of group names is also accepted via the Python API. The circular array is only available in'AIL'. Default is'all'.- config
str Microphone configuration placement in the AIL. Either
'P1'or'P2'. Ignored for the SAL. Default is'P1'.
- cache_dir
- Returns: