iracema.core.point

This module contain classes used to manipulate points in TimeSeries objects.

class iracema.core.point.Point(value='0', context=None)[source]

Bases: decimal.Decimal

A point object represents an instant in a time series, i.e., one specific sample index. It is flexible enough to locate samples corresponding to the same instant in time series with different sampling rates.

Hint

This class is also available at the main package level as iracema.Point.

classmethod from_sample_index(index, time_series)[source]
property time

Return the time of the points. This method will be deprecated soon.

map_index(time_series)[source]
get_value(time_series)[source]
class iracema.core.point.PointList(points=None)[source]

Bases: collections.abc.MutableSequence

List of points.

Hint

This class is also available at the main package level as iracema.PointList.

insert(index, item)[source]

S.insert(index, value) – insert value before index

classmethod load_from_file(file_name)[source]

Instantiate a list of points, loaded from a CSV file. Each line in the file must contain the position of a single point. The position must be specified in seconds.

save_to_file(file_name)[source]

Save list of points to CSV file.

classmethod from_list_of_indexes(list_indexes, time_series)[source]

Instantiate a list of points from a list of indexes list_indexes and a time_series object.

property time

Return a list with the time of the points. This method will be deprecated soon.

map_indexes(time_series)[source]

Return an array with the indexes of time_series that correspond to the points in the list.

get_values(time_series)[source]

Get values from the time_series corresponding to the points in the list.

to_numpy()[source]

Retun a numpy array with the time of the points.

classmethod from_numpy(array)[source]

Instantiate a list of points from a numpy array.

to_segments()[source]

Convert list of points to a list of contiguous segments.