=======
Signals
=======

The purpose of the :mod:`signals` component is to store metadata about recordings
of time-varying signals.

This component depends on :mod:`helmholtz.recording` and on :mod:`helmholtz.storage`.

In general, :class:`Signal` and :class:`Channel` are intended to be subclassed,
since different signal types (electrical signal, optical signal) have different
metadata. However, :class:`Signal` can be used directly::

    >>> from helmholtz.signals.models import Signal
    >>> s = Signal(label="abc", file=datafile, protocol=rec1, configuration=rec_conf)
    >>> s.save()
    
This signal is part of :class:`ProtocolRecording` ``rec1`` and was obtained with
:class:`RecordingConfiguration` ``rec_conf`` (see :doc:`recording`). The actual
data is stored in ``datafile`` (see :doc:`storage`).

Reference
---------

.. automodule:: helmholtz.signals.models

.. autoclass:: ChannelType
   :members:
    
.. autoclass:: RecordingMode
   :members:
    
.. autoclass:: Channel
   :members:
    
.. autoclass:: Signal
   :members:
