:py:mod:`tonic.functional.drop_event`
=====================================

.. py:module:: tonic.functional.drop_event


Module Contents
---------------


Functions
~~~~~~~~~

.. autoapisummary::

   tonic.functional.drop_event.drop_event_numpy
   tonic.functional.drop_event.drop_by_time_numpy
   tonic.functional.drop_event.drop_by_area_numpy



.. py:function:: drop_event_numpy(events: numpy.ndarray, drop_probability: float)

   Randomly drops events with drop_probability.

   :param events: ndarray of shape [num_events, num_event_channels].
   :param drop_probability: probability of dropping out event.

   :returns: augmented events that were not dropped.


.. py:function:: drop_by_time_numpy(events: numpy.ndarray, duration_ratio: float | tuple[float] = 0.2)

   Drops events in a certain time interval with a length proportional to a specified ratio of
   the original length.

   :param events: ndarray of shape [num_events, num_event_channels]
   :type events: np.ndarray
   :param duration_ratio: the length of the dropped time interval, expressed in a ratio of the original sequence duration.
                          - If a float, the value is used to calculate the interval length
                          - If a tuple of 2 floats, the ratio is randomly chosen in [min, max).
                          Defaults to 0.2.
   :type duration_ratio: Union[float, Tuple[float]], optional

   :returns: augmented events that were not dropped (i.e., the events that are not in the time interval).
   :rtype: np.ndarray


.. py:function:: drop_by_area_numpy(events: numpy.ndarray, sensor_size: tuple, area_ratio: float | tuple[float] = 0.2)

   Drops events located in a randomly chosen box area. The size of the box area is defined by a
   specified ratio of the sensor size.

   :param events: ndarray of shape [num_events, num_event_channels]
   :type events: np.ndarray
   :param sensor_size: size of the sensor that was used [W,H,P]
   :type sensor_size: Tuple
   :param area_ratio: Ratio of the sensor resolution that determines the size of the box area where events are dropped.
                      - if a float, the value is used to calculate the size of the box area
                      - if a tuple of 2 floats, the ratio is randomly chosen in [min, max)
                      Defaults to 0.2.
   :type area_ratio: Union[float, Tuple[float]], optional

   :returns: augmented events that were not dropped (i.e., the events that are not located in the box area).
   :rtype: np.ndarray


