pypore.event_finder module

Created on Aug 19, 2013

@author: @parkin

class pypore.event_finder.Parameters

Bases: object

Parameter object to pass to find_events(). Defines the following:

  • min_event_length – Minimum event length to count as an event [us].
  • max_event_length – Maximum event length to count as an event [us].
  • detect_positive_events – Whether to detect events where the current increases.
  • detect_negative_events – Whether to detect events where the current decreases.
  • baseline_strategy – Strategy for keeping track of the baseline current. See BaselineStrategy for a definition of methods and AdaptiveBaselineStrategy as an example implementation of an adaptive baseline.
  • threshold_strategy – Strategy for the thresholds deciding the start and end of an event. See ThresholdStrategy for a definition of the methods and NoiseBasedThresholdStrategy for an example implementation.

Usage:

>>> from pypore.strategies.adaptive_baseline_strategy import AdaptiveBaselineStrategy    >>> from pypore.event_finder import Parameters
>>> from pypore.event_finder import find_events
>>> params = Parameters(baseline_strategy=AdaptiveBaselineStrategy(baseline_filter_parameter=0.93))
>>> event_database_filenames = find_events(['test.log'], parameters=params)
__init__

Initialize the Parameters object.

Parameters:
  • min_event_length (double) – Minimum event length in microseconds. Default is 10.0.
  • max_event_length (double) – Maximum event length in microseconds. Default is 1.e4.
  • detect_positive_events (bool) – Event finder should look for events where the current increases. Default is True.
  • detect_negative_events (bool) – Event finder should look for events where the current decreases. Default is True.
  • baseline_strategy – Type of the baseline. Default is AdaptiveBaselineStrategy. Note that this needs to be a subclass of BaselineStrategy.
  • threshold_strategy – Type of the threshold for beginning and end to an event. Default is NoiseBasedThresholdStrategy. Note that this must be a subclass of ThresholdStrategy.
baseline_strategy
detect_negative_events
detect_positive_events
max_event_length
min_event_length
threshold_strategy
pypore.event_finder.find_events()
Parameters:
  • data

    List of data to search. Each item in the list can be one of the following:

    1. An already opened reader. A subclass of pypore.i_o.abstract_reader.AbstractReader. For example, a pypore.i_o.chimera_reader.ChimeraReader.
    2. A string filename to be opened. The appropriate reader will be chosen based on the file extension.
  • pipe – (Optional) multiprocessing.Pipe for status updates during the run. If omitted, status updates will just be printed to standard output.
  • h5file – (Optional) An already opened pypore.filetypes.event_database.EventDatabase(). If left out, a new EventDatabase will be created.
  • save_file_names ([string]) – (Optional) List of names for the output data. If omitted, appropriate save file names will be generated.
  • parameters (Parameters) – Parameters for event finding.
  • debug (boolean) –

    If set to True, more information will be added to the resulting EventDatabase, including

    • The baseline used at every point.
    • The thresholds at every point (positive, negative, or both depending on the Parameters)
Returns:

List of String file names of the created EventDatabases.

>>> file_names = ['tests/testDataFiles/chimera_1event.log']
>>> output_files = find_events(file_names)
>>> # .... ....
>>> output_files2 = find_events(file_names, parameters=Parameters(min_event_length=15.))