ChimeraReaderVC100

class ChimeraReaderVC100(settings: Optional[dict] = None)

Bases: MetaReader

Subclass of MetaReader for reading chimera VC1100 .log files

Public Methods

ChimeraReaderVC100.close_resources(channel=None)

Perform any actions necessary to gracefully close resources before app exit

Parameters:

channel (int) – channel ID

ChimeraReaderVC100.get_empty_settings(globally_available_plugins=None, standalone=False)

Get a dict populated with keys needed to initialize the filter if they are not set yet. This dict must have the following structure, but Min, Max, and Options can be skipped or explicitly set to None if they are not used. Value and Type are required. All values provided must be consistent with Type.

settings = {'Parameter 1': {'Type': <int, float, str, bool>,
                                 'Value': <value> or None,
                                 'Options': [<option_1>, <option_2>, ... ] or None,
                                 'Min': <min_value> or None,
                                 'Max': <max_value> or None,
                                 'Units': <unit str> or None
                                },
                ...
                }

Several parameter keywords are reserved: these are

‘Input File’ ‘Output File’ ‘Folder’

These must have Type str and will cause the GUI to generate widgets to allow selection of these elements when used

Parameters:

globally_available_plugins (Mapping[str, List[str]]) – a dict containing all data plugins that exist to date, keyes by metaclass

Returns:

the dict that must be filled in to initialize the filter

Return type:

Mapping[str, Mapping[str, Union[int, float, str, list[Union[int,float,str,None], None]]]]

ChimeraReaderVC100.reset_channel(channel=None)

Perform any actions necessary to gracefully close resources before app exit. If channel is not None, handle only that channel, else close all of them.

Parameters:

channel (int) – channel ID

Private Methods

ChimeraReaderVC100._convert_data(data, config, raw_data=False)

Scale or otherwise transform and return requested data. Default behavior assumes data is already scaled when read. if raw_data is true, return also scale and offset

Parameters:
  • data (numpy.ndarray) – Data to convert.

  • config (dict) – Configuration dictionary for data conversion.

  • raw_data (bool) – Decide whether to rescale data or return raw adc codes

Returns:

Converted data, and scale and offset if and only if raw_data is True

Return type:

Union[Tuple[np.ndarray, float, float], np.ndarray]

ChimeraReaderVC100._get_configs(datafiles)

Load configuration files as dictionaries, corresponding to datamaps as needed. Default behavior assumes there are no config files needed.

Parameters:

datafiles (List[os.PathLike]) – List of data file paths.

Returns:

List of configuration dictionaries.

Return type:

List[dict]

ChimeraReaderVC100._get_file_channel_stamps(file_names, configs)

Get a list of serialization keys used to sort the list of files associated to the experiment.

Parameters:
  • file_names (List[os.PathLike]) – List of file paths.

  • configs (List[dict]) – List of configuration dictionaries.

Returns:

List of channel numbers parsed from configuration.

Return type:

List[int]

ChimeraReaderVC100._get_file_pattern(file_name)

Get the base name for matching other files to the same dataset as the initial one provided to the constructor.

Parameters:

file_name (os.PathLike) – File path.

Returns:

Base name for matching other files.

Return type:

str

Raises:

ValueError – If the base naming pattern cannot be ascertained.

ChimeraReaderVC100._get_file_time_stamps(file_names, configs)

Get a list of serialization keys used to sort the list of files associated to the experiment.

Parameters:
  • file_names (List[os.PathLike]) – List of file paths.

  • configs (List[dict]) – List of configuration dictionaries.

Returns:

List of timestamps parsed from configuration.

Return type:

List[datetime]

ChimeraReaderVC100._init()

called at the start of base class initialization

ChimeraReaderVC100._map_data(datafiles, configs)

Map data files into a set of memmaps or similarly define a way to access the raw data on disk. Returns a list of memmaps corresponding to each datafile/configfile pair.

Parameters:
  • datafiles (List[os.PathLike]) – List of data file paths.

  • configs (List[dict]) – List of configuration dictionaries.

Returns:

List of memmaps containing raw data.

Return type:

List[numpy.ndarray]

Raises:
  • FileNotFoundError – If at least one of the input raw data files is missing or renamed.

  • OSError – If the file indicated is inaccessible.

ChimeraReaderVC100._set_file_extension()

Set the expected file extension for files read using this reader subclass

ChimeraReaderVC100._set_raw_dtype(configs)

Set the data type for the raw data in files of this type

Parameters:

configs (List[dict]) – List of configuration dictionaries corresponding to data files.

Returns:

the dtype of the raw data in your data files

Return type:

np.dtype

ChimeraReaderVC100._validate_file_type(filename: PathLike) None

Check that the file(s) being opened are of the correct type, and raise IOError if not

Parameters:

filename (os.Pathlike) – the path to one of the files to be opened

Raises:

IOError – If the wrong type is file is fed to the plugin

ChimeraReaderVC100._validate_settings(settings: dict) None

Validate that the settings dict contains the correct information for use by the subclass.

Parameters:

settings (dict) – Parameters for event detection.

Raises:

ValueError – If the settings dict does not contain the correct information.