lumicks.pylake.channel.Slice¶
-
class
Slice(data_source, labels=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_source : Any
A slice data source. Can be
Continuous,TimeSeries, ‘TimeTags’, or any other source which conforms to the same interface.- labels : Dict[str, str]
Plot labels: “x”, “y”, “title”.
-
__init__(data_source, labels=None)¶ Initialize self. See help(type(self)) for accurate signature.
Methods
__init__(data_source[, labels])Initialize self. downsampled_by(factor[, reduce])Return a copy of this slice which is downsampled by factorplot(**kwargs)A simple line plot to visualize the data over time Attributes
dataThe primary values of this channel slice sample_rateThe data frequency for continuous data sources or Noneif it’s variabletimestampsAbsolute timestamps (since epoch) which correspond to the channel data -
__getitem__(item)¶ All indexing is in timestamp units (ns)
-
downsampled_by(factor, reduce=<function mean>)¶ Return a copy of this slice which is downsampled by
factorParameters: - factor : int
The size and sample rate of the data will be divided by this factor.
- reduce : callable
The
numpyfunction which is going to reduce multiple samples into one. The default isnp.mean, butnp.sumcould also be appropriate for some cases, e.g. photon counts.
-
plot(**kwargs)¶ A simple line plot to visualize the data over time
Parameters: - **kwargs
Forwarded to
matplotlib.pyplot.plot().
-
data¶ The primary values of this channel slice
-
sample_rate¶ The data frequency for continuous data sources or
Noneif it’s variable
-
timestamps¶ Absolute timestamps (since epoch) which correspond to the channel data