aeon.io.reader#

class aeon.io.reader.BitmaskEvent(pattern, value, tag)[source]#

Bases: Harp

Extracts event data matching a specific digital I/O bitmask.

Columns:

event (str): Unique identifier for the event code.

read(file)[source]#

Reads a specific event code from digital data.

Each data value is matched against the unique event identifier.

class aeon.io.reader.Chunk(reader=None, pattern=None, extension=None)[source]#

Bases: Reader

Extracts path and epoch information from chunk files in the dataset.

read(file)[source]#

Returns path and epoch information for the specified chunk.

class aeon.io.reader.Csv(pattern, columns, dtype=None, extension='csv')[source]#

Bases: Reader

Extracts data from comma-separated (CSV) text files.

The first column stores the Aeon timestamp, in seconds.

read(file)[source]#

Reads data from the specified CSV text file.

class aeon.io.reader.DigitalBitmask(pattern, mask, columns)[source]#

Bases: Harp

Extracts event data matching a specific digital I/O bitmask.

Columns:

event (str): Unique identifier for the event code.

read(file)[source]#

Reads a specific event code from digital data.

Each data value is checked against the specified bitmask.

class aeon.io.reader.Encoder(pattern)[source]#

Bases: Harp

Extract magnetic encoder data.

Columns:

angle (float): Absolute angular position, in radians, of the magnetic encoder. intensity (float): Intensity of the magnetic field.

read(file, downsample=True)[source]#

Reads encoder data from the specified Harp binary file.

By default the encoder data is downsampled to 50Hz. Setting downsample to False or None can be used to force the raw data to be returned.

class aeon.io.reader.Harp(pattern, columns, extension='bin')[source]#

Bases: Reader

Extracts data from raw binary files encoded using the Harp protocol.

read(file)[source]#

Reads data from the specified Harp binary file.

class aeon.io.reader.Heartbeat(pattern)[source]#

Bases: Harp

Extract periodic heartbeat event data.

Columns:

second (int): The whole second corresponding to the heartbeat, in seconds.

read(file)#

Reads data from the specified Harp binary file.

class aeon.io.reader.Log(pattern)[source]#

Bases: Csv

Extracts message log data.

Columns:

priority (str): Priority level of the message. type (str): Type of the log message. message (str): Log message data. Can be structured using tab

separated values.

read(file)#

Reads data from the specified CSV text file.

class aeon.io.reader.Metadata(pattern='Metadata')[source]#

Bases: Reader

Extracts metadata information from all epochs in the dataset.

read(file)[source]#

Returns metadata for the specified epoch.

class aeon.io.reader.Pose(pattern, model_root='/ceph/aeon/aeon/data/processed')[source]#

Bases: Harp

Reader for Harp-binarized tracking data given a model that outputs id, parts, and likelihoods.

Columns:

class (int): Int ID of a subject in the environment. class_likelihood (float): Likelihood of the subject’s identity. part (str): Bodypart on the subject. part_likelihood (float): Likelihood of the specified bodypart. x (float): X-coordinate of the bodypart. y (float): Y-coordinate of the bodypart.

static class_int2str(data, classes)[source]#

Converts a class integer in a tracking data dataframe to its associated string (subject id).

Return type:

DataFrame

static get_bodyparts(config_file)[source]#

Returns a list of bodyparts from a model’s config file.

Return type:

list[str]

static get_class_names(config_file)[source]#

Returns a list of classes from a model’s config file.

Return type:

list[str]

classmethod get_config_file(config_file_dir, config_file_names=None)[source]#

Returns the config file from a model’s config directory.

Return type:

Path

read(file)[source]#

Reads data from the Harp-binarized tracking file.

Return type:

DataFrame

class aeon.io.reader.Position(pattern)[source]#

Bases: Harp

Extract 2D position tracking data for a specific camera.

Columns:

x (float): x-coordinate of the object center of mass. y (float): y-coordinate of the object center of mass. angle (float): angle, in radians, of the ellipse fit to the object. major (float): length, in pixels, of the major axis of the ellipse

fit to the object.

minor (float): length, in pixels, of the minor axis of the ellipse

fit to the object.

area (float): number of pixels in the object mass. id (float): unique tracking ID of the object in a frame.

read(file)#

Reads data from the specified Harp binary file.

class aeon.io.reader.Reader(pattern, columns, extension)[source]#

Bases: object

Extracts data from raw files in an Aeon dataset.

pattern#

Pattern used to find raw files, usually in the format <Device>_<DataStream>.

Type:

str

columns#

Column labels to use for the data.

Type:

str or array-like

extension#

Extension of data file pathnames.

Type:

str

read(file)[source]#

Reads data from the specified file.

class aeon.io.reader.Subject(pattern)[source]#

Bases: Csv

Extracts metadata for subjects entering and exiting the environment.

Columns:

id (str): Unique identifier of a subject in the environment. weight (float): Weight measurement of the subject on entering

or exiting the environment.

event (str): Event type. Can be one of Enter, Exit or Remain.

read(file)#

Reads data from the specified CSV text file.

class aeon.io.reader.Video(pattern)[source]#

Bases: Csv

Extracts video frame metadata.

Columns:

hw_counter (int): Hardware frame counter value for the current frame. hw_timestamp (int): Internal camera timestamp for the current frame.

read(file)[source]#

Reads video metadata from the specified file.

aeon.io.reader.from_dict(data, pattern=None)[source]#

Converts a dictionary to a DotMap object.

aeon.io.reader.to_dict(dotmap)[source]#

Converts a DotMap object to a dictionary.