obci.analysis.obci_signal_processing package

Subpackages

Submodules

obci.analysis.obci_signal_processing.obci_signal_processing_logging module

Module defines a single method get_logger that returns logger with set logging level. Change loggin.INFO lines to change logging level.

obci.analysis.obci_signal_processing.obci_signal_processing_logging.get_logger(p_name, p_level='info')[source]

Return logger with p_name as name. And logging level p_level. p_level should be in (starting with the most talkactive): ‘debug’, ‘info’, ‘warning’, ‘error’, ‘critical’.

obci.analysis.obci_signal_processing.read_manager module

class obci.analysis.obci_signal_processing.read_manager.ReadManager(p_info_source, p_data_source, p_tags_source)[source]

Bases: object

A class responsible for reding openbci file format. Public interface: - start_reading() - open info and data file, - get_next_value() - get next value from data file, - get_param(param_name) - get param_name parameter from info file.

Wanna be able to read a new parameter ‘new_param’? 1. Register reading function in self._create_info_tags_control() under ‘new_param’ key. 2. Implement the function (it should be considered as class private function, not callable from outside; the function should return a value for ‘new_param’ request). 3. Call get_param(‘new_param’) every time you want to get the param.

Just remember info file path and data file path.

get_channel_samples(p_ch_name, p_from=None, p_len=None, p_unit='sample')[source]

Return an array of values for channel p_ch_name, or raise ValueError exception if there is channel with that name. p_unit can be ‘sample’ or ‘second’ and makes sense only if p_from and p_len is not none.

get_channels_samples(p_ch_names, p_from=None, p_len=None, p_unit='sample')[source]
get_param(p_param_name)[source]

Return parameter value for p_param_name. Raise NoParameter exception if p_param_name parameters was not found.

get_params()[source]
get_samples(p_from=None, p_len=None, p_unit='sample')[source]

Return a two dimensional array of signal values. if p_reload then refresh the file, otherwise use cached values. p_unit can be ‘sample’ or ‘second’ and makes sense only if p_from and p_len is not none.

get_tags(p_tag_type=None, p_from=None, p_len=None, p_func=None)[source]

Return all tags of type tag_type, or all types if tag_type is None.

iter_samples()[source]
iter_tags(p_tag_type=None, p_from=None, p_len=None, p_func=None)[source]
reset_params()[source]
save_to_file(p_dir, p_name)[source]
set_param(p_key, p_value)[source]
set_params(p_params)[source]
set_samples(p_samples, p_channel_names, p_copy=False)[source]
set_tags(p_tags)[source]

obci.analysis.obci_signal_processing.smart_tags_manager module

Implement one class - SmartTagsManager.

class obci.analysis.obci_signal_processing.smart_tags_manager.SmartTagsManager(p_tag_def, p_info_file, p_data_file, p_tags_file, p_read_manager=None)[source]

Bases: object

By now manager gets in init tag definition object and dictionary of files paths. Regarding tag definition it iterates smart tags from file in iter_smart_tags(). Public interface: - __init__() - iter_smart_tags()

Init all needed slots, read tags file, init smart tags. Parameters: - p_tag_def - an instance of tag definition object (see smart_tag_definition.py) - p_files - a dictionary with files paths: ‘info’ - info file ‘data’ - data file ‘tags’ - tags file

get_read_manager()[source]
get_smart_tags(p_tag_type=None, p_from=None, p_len=None, p_func=None)[source]
iter_smart_tags()[source]

This is an iterator, so use it like:

for i in mgr.iter_smart_tags():
    pass

It iterates SmartTag objects. You can call get_data() on smart tag, and you will get samples for all channels for that smart tag in format: [[list of all samples from ch 0], [list of all samples from ch 1] ...]

obci.analysis.obci_signal_processing.types_utils module

obci.analysis.obci_signal_processing.types_utils.to_string(p_object)[source]

Convert p_object to string. Convert strings to strings, floats to string with accurate precision etc.

Module contents