skippylab package¶
Subpackages¶
Submodules¶
skippylab.daq module¶
Use the scope as a DAQ
-
class
skippylab.daq.
DAQ
[source]¶ Bases:
object
A virtual DAQ using an oscilloscope
-
acquire
(*pullargs, **pullkwargs)[source]¶ Go through the instrument list and trigger their pull methods to build an event
Keyword Arguments: **pullkwargs (dict) – will be passed on the individual pull methods Returns: pyosci.Event
-
acquire_n_events
(n_events, trigger_hook=<function DAQ.<lambda>>, trigger_hook_args=(None, ), pull_args=(), pull_kwargs={})[source]¶ Continuous acquisition. Acquires n events. Yields events. Use trigger hook to define a function to decide when data is returned.
Parameters: Yields: Event
-
register_instrument
(instrument, label='instrument')[source]¶ Register an instrument and assign a channel to it. Instruments must have a pull() method which allows to pull data from them at a certain event.
Parameters: - instrument (ducktype) – needs to be configured already and must have a pull() method
- channel_name (int) – identify the instrument under this registered channel
Returns: None
-
skippylab.loggers module¶
Prepare logging functionality for the module
skippylab.plotting module¶
Convenient plot functions
-
skippylab.plotting.
plot_histogram
(bincenters, bincontent, fig=None, savename='test.png', remove_empty_bins=True)[source]¶ Plot a histogram returned by TektronixDPO4104B.get_histogram Use pylab.plot
Parameters: - bincenters (np.ndarray); bincenters (x) –
- bincontent (np.ndarray) – bincontent (y)
Keyword Arguments:
skippylab.tools module¶
Convenient operations
-
skippylab.tools.
average_wf
(waveforms)[source]¶ Get the average waveform
Parameters: waveforms (iterable of np.ndarrays) – Returns: np.ndarray
-
skippylab.tools.
integrate_wf
(waveform, xs, xstep, method=<Mock name='mock.integrate.simps' id='140515038155160'>, impedance=50)[source]¶ Integrate a waveform, i.e. a voltage curve. If the desired result shall be indeed a charge, please make sure to give xs in seconds and impedance in Ohm accordingly. xstep needs to be in seconds as well.
Parameters: - waveform (np.ndarray) – voltage values
- xs (np.ndarray) – timing values
- xstep (float) – timing bin size
Keyword Arguments: - method (func) – integration method
- impedance (float) – needed to calculate actual charge
Returns: float
-
skippylab.tools.
load_waveform
(filename, converter=<function <lambda>>)[source]¶ load a waveform from a file
Parameters: filenaame (str) – An existing filename Keyword Arguments: converter (func) – If the data is saved in digitizer levels, use the converter function to convert to Volts Returns: tuple (dict, np.ndarray)
Module contents¶
Package to read out TektronixDPO4104B oscilloscope