MyriadDataset#

class irdl.MyriadDataset#

Bases: BaseDataset

Download the MYRiAD database (RIR subset) from Zenodo.

Attributes:
namestr

Dataset name (“myriad”).

doistr

Digital Object Identifier (“10.5281/zenodo.7389996”).

_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 _process can extract and process the requested files.

Parameters:
provider_dirpathlib.Path

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

**dataset_kwargsdict

Dataset keyword arguments.

Returns:
pathlib.Path

Path 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.IR array 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_artifactpathlib.Path

Ingest directory populated by _process().

sofa_pathpathlib.Path

Target path for the retained SOFA file.

Returns:
pathlib.Path

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

Path to the downloaded MYRiAD ZIP archive.

ingest_pathpathlib.Path

Target directory for the extracted files.

Returns:
pathlib.Path

Path 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_params can reject them, and config is passed through untouched.

Parameters:
roomstr

Room being loaded. Used to look up the speakers and to exclude the circular array from 'all' for room SAL.

arraystr or list of str

Requested group(s): 'all', a comma-separated string, or a list of the array group names.

configstr or None

Microphone configuration placement in the AIL ('P1' or 'P2'). Ignored for the SAL.

Returns:
dict

Resolved 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:
str

Filename for the ingest-stage archive.

_validate_params(**dataset_kwargs) None#

Validate MYRiAD-specific parameters.

Parameters:
**dataset_kwargsdict

Must contain 'room' (one of 'SAL', 'AIL'), 'array' (one or more valid group names or 'all') and 'config' (one of 'P1', 'P2'). output_format is also passed but unused here.

Raises:
ValueError

If any parameter is out of range, the circular array is requested for 'SAL', or 'MultiSpeakerBRIR' is combined with more than the 'dummy_head' group.

doi: str = '10.5281/zenodo.7389996'#
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_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/MYRIAD/>. Else, it remains in <cache_dir/output/>.

output_formatstr

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

roomstr

Room to load. Either 'SAL' or 'AIL'. Default is 'SAL'.

arraystr

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

configstr

Microphone configuration placement in the AIL. Either 'P1' or 'P2'. Ignored for the SAL. Default is 'P1'.

Returns:
dict or Path

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

name: str = 'myriad'#