polyfemos.front.sohplot.datacontainer.DataContainer¶
-
class
polyfemos.front.sohplot.datacontainer.
DataContainer
(track_datalen=False, remove_identicals=False)[source]¶ Bases:
object
A class to handle timeseries data consisting of
DataPoint
instances.The class has
__setitem__
and__getitem__
methods so it works like dictionary on that part.Public Methods
-
add_identical_removal_info
()[source]¶ Adds original datapoint and nan amounts and identical datapoint information to
self.__info
.
-
append
(dp)[source]¶ If
self.remove_identicals
isTrue
, the datapoint is not included if it has identical x and y values as one of the already added datapoints.
-
decimate
()[source]¶ Decimates
self.datapoints
list by removing datapoints so that the after decimation, the amount of datapoints in the list is not overdecimation_limit
, which is set to 10000.Bokeh can plot 10000 datapoints with relative ease but more datapoints than that will result in slow plotting.
-
outlier_removal
(outlierremfunc)[source]¶ Applies advanced outlier removal to
datapoints
attribute. Changesy
values of outlying datapoints into nan, while simultaneously creating datasetself.outlier_datapoints
, which contains the outliers.Some functions for removing outliers are in
outlierremover
.- Parameters
outlierremfunc (func) – a function to remove outliers, arguments of the
outlierremfunc
has to be predefined, except the actual data.
-
remove_irrationals
(irlims=None)[source]¶ If
DataPoint
instance’sy
value is not within the interval (including both ends) defined byirlims
, they
is set to nan in place.- Parameters
irlims (list) – lower and upper limit for irrational values
Special Methods
-