Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Locata dataset #34

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
43 changes: 30 additions & 13 deletions pyroomacoustics/datasets/locata.py
Original file line number Diff line number Diff line change
@@ -186,14 +186,28 @@ class LocataRecording(AudioSample):
sources: dict or None
A dictionary containing the reference audio recording, as well as the
timestamps and location information for the sources (only available for
the `dev` dataset)
ts: list of datetime.DateTime
A list of timestamps corresponding to the audio samples
pos: list
A list of timestamps and position information for the microphone array
at each time instant
the `dev` dataset), format:
.. code-block:: python
{
'src_name' : {
'audio' : 'pyroomacoustics.datasets.AudioSample',
'ts' : 'list of { 'ts' : datetime.DateTime }',
'pos' : 'list of dict similar to pos attribute',
},
}
ts: list of dict
A list of timestamps corresponding to the audio samples each element is
a dict with entry ``'ts'``
pos: list of dict
A list of dict containing ``['ts', 'point', 'ref_vec', 'rot_mat']``
(timestamps, location point, reference vector, rotation matrix) for the
microphone array at each time instant
req: list
The list of timestamps at which the source location needs to be computed
The list of timestamps at which the source location needs to be computed,
same format as ``ts`` attribute
Parameters
----------
@@ -274,7 +288,8 @@ def get_ts(self, ts):
Returns
-------
A datetime object or None if the sample doesn't exist
datetime.Datetime or None
The audio sample timestamp closest to a given timestamp
'''

if type(ts) == int:
@@ -298,7 +313,8 @@ def get_array(self, ts):
Returns
-------
An ndarray containing the microphone locations in the columns.
ndarray
An ndarray with the microphone locations in the columns ``(ndim, nmics)``
'''

ts = self.get_ts(ts)
@@ -323,10 +339,11 @@ def get_doa(self, ts):
Returns
-------
A dictionary containing the spherical coordinates (radius, azimuth,
colatitude) of the sources with respect to the array or None if the
timestamp is unavailable, or the sources information is unavailable
(eval recordings).
dict
A dictionary containing the spherical coordinates (radius, azimuth,
colatitude) of the sources with respect to the array or None if the
timestamp is unavailable, or the sources information is unavailable
(eval recordings).
'''

if not self.meta.dev: