Skip to content

Commit

Permalink
Merge pull request #193 from jpgill86/rauc-disabled-by-default
Browse files Browse the repository at this point in the history
RAUC disabled by default
  • Loading branch information
jpgill86 authored Feb 18, 2020
2 parents c6c5064 + 51d8cdb commit bdd2dbd
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
5 changes: 3 additions & 2 deletions docs/metadata.rst
Original file line number Diff line number Diff line change
Expand Up @@ -695,8 +695,9 @@ provided there.
The choice of baseline is controlled by the ``rauc_baseline`` metadata
parameter, which may have the value ``None`` (default), ``'mean'``, or
``'median'``. The size of the bins determines how smooth the RAUC time series
is and is set by ``rauc_bin_duration``, given in seconds. The default bin
duration is 0.1 seconds.
is and is set by ``rauc_bin_duration``, given in seconds. If
``rauc_bin_duration`` is not specified (default ``None``), RAUC time series
will not be calculated.

.. _config-metadata-example:

Expand Down
6 changes: 3 additions & 3 deletions neurotic/datasets/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,18 +101,18 @@ def load_dataset(metadata, lazy=False, signal_group_mode='split-all', filter_eve

# compute rectified area under the curve (RAUC) for each signal if not
# using lazy loading of signals
if not lazy:
if not lazy and metadata.get('rauc_bin_duration', None) is not None:
for sig in blk.segments[0].analogsignals:
rauc_sig = _elephant_tools.rauc(
signal=sig,
baseline=metadata.get('rauc_baseline', None),
bin_duration=metadata.get('rauc_bin_duration', 0.1)*pq.s,
bin_duration=metadata['rauc_bin_duration']*pq.s,
)
rauc_sig.name = sig.name + ' RAUC'
sig.annotate(
rauc_sig=rauc_sig,
rauc_baseline=metadata.get('rauc_baseline', None),
rauc_bin_duration=metadata.get('rauc_bin_duration', 0.1)*pq.s,
rauc_bin_duration=metadata['rauc_bin_duration']*pq.s,
)

return blk
Expand Down
2 changes: 1 addition & 1 deletion neurotic/datasets/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ def _defaults_for_key(key):

# width of bins in seconds used for calculating rectified area under
# the curve (RAUC) for signals
'rauc_bin_duration': 0.1,
'rauc_bin_duration': None,
}

return defaults
Expand Down
2 changes: 2 additions & 0 deletions neurotic/example/metadata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,5 @@ example dataset:

- spiketrain: B4/B5
thresholds: [3, 3] # Hz

rauc_bin_duration: 0.1 # seconds, used only if fast loading is off (lazy=False)

0 comments on commit bdd2dbd

Please sign in to comment.