lumicks.pylake.channel.Slice

class Slice(data_source, labels=None, calibration=None)

A lazily evaluated slice of a timeline/HDF5 channel

Users will only ever get these as a result of slicing a timeline/HDF5 channel or slicing another slice (via this class’ __getitem__), i.e. the __init__ method will never be invoked by users.

Parameters
data_sourceAny

A slice data source. Can be Continuous, TimeSeries, ‘TimeTags’, or any other source which conforms to the same interface.

labelsDict[str, str]

Plot labels: “x”, “y”, “title”.

calibration: ForceCalibration
__init__(data_source, labels=None, calibration=None)

Methods

__getitem__(item)

All indexing is in timestamp units (ns)

_apply_mask(mask)

Apply a logical mask to the data

_unpack_other(other)

_with_data_source(data_source)

Return a copy of this slice with a different data source, but keep other properties

downsampled_by(factor[, reduce])

Return a copy of this slice which is downsampled by factor

downsampled_like(other_slice[, reduce])

Downsample high frequency data analogously to a low frequency channel in the same way that Bluelake does it.

downsampled_over(range_list[, reduce, where])

Downsample channel data based on timestamp ranges.

downsampled_to(frequency[, reduce, where, ...])

Return a copy of this slice downsampled to a specified frequency

plot([start])

A simple line plot to visualize the data over time

range_selector([show])

Attributes

_timesteps

calibration

Calibration data slicing is deferred until calibration is requested to avoid slicing values that may be needed.

data

The primary values of this channel slice

sample_rate

The data frequency for continuous data sources or None if it's variable

seconds

Relative time (in seconds) that corresponds to the channel data

start

Starting timestamp of this time series in nanoseconds

stop

End timestamp of this time series in nanoseconds

timestamps

Absolute timestamps (since epoch) which correspond to the channel data