Acquisition modules are the modules used to acquire data from the Red Pitaya.
At the moment, they include the
All the acquisition modules have in common a plot area where the data is
displayed and a control panel BELOW the plot for changing acquisition
settings. Widgets for specialized acquisition modules
(e.g. Scope
) have an additional control
panel ABOVE the plot are for settings that are only available for that module.
The different buttons in the acquisition module control panel below the plot are:
trace_average
chooses the number of successive traces to average together.curve_name
is the name for the next curve that is saved.Run single
starts a single acquisition of trace_average
traces (calls AcquisitionModule.single()
).Run continuous
starts a continuous acquisition with a running
average filter, where trace_average
is the decay constant of the
running average filter (calls AcquisitionModule.continuous()
).Restart average
resets trace averages to zero to start a new
measurement from scratch.Save curve
saves the current measurement data to a new
pyrpl.curvedb.CurveDB
object under the name
curve_name
.pyrpl.widgets.module_widgets.acquisition_module_widget.
AcquisitionModuleWidget
(name, module, parent=None)[source]¶Bases: pyrpl.widgets.module_widgets.base_module_widget.ModuleWidget
run_continuous_clicked
()[source]¶Toggles the button run_continuous to stop or vice versa and starts he acquisition timer
Change text of Run continuous button and visibility of run single button according to module.running_continuous
A widget for the scope module
pyrpl.widgets.module_widgets.asg_widget.
AsgWidget
(*args, **kwds)[source]¶Bases: pyrpl.widgets.module_widgets.base_module_widget.ModuleWidget
The basic functionality of all module widgets are inherited from the base
class ModuleWidget
.
A module widget is delimited by a dashed-line (a QGroupBox). The following
menu is available on the top part of each ModuleWidget, directly behind the
name of the module (e.g. pid0
, pid1
, ...). Right click on
the item (e.g. .:Load:.
, .:Save:.
, ...) to access the associated
submenu:
.:Load:.
Loads the state of the module from a list of previously saved states..:Save:.
Saves the current state under a given state name..:Erase:.
Erases one of the previously saved states..:Edit:.
Opens a text window to edit the yml code of a state..:Hide/Show:.
Hides or shows the content of the module widget.Inside the module widget, different attribute values can be manipulated using
the shown sub-widgets (e.g. input
, setpoint
, max_voltage
, ...). The
modifications will take effect immediately. Only the module state
<current state>
is affected by these changes. Saving the state under
a different name only preserves the state at the moment of saving for later
retrieval.
At the next startup with the same config file, the :code:<current state> of all modules is loaded.
If a module-widget is grayed out completely, it has been reserved by another,
higher-level module whose name appears in parentheses after the name of the
module (e.g. pid2 (output1)
means that the module pid2
is
being used by the module output1
, which is actually a submodule of the
lockbox
module). You can right-click anywhere on the grayed out
widget and click on “Free” to override that reservation and use the module
for your own purposes.
Warning
If you override a module reservation, the module in parenthesis might stop to function properly. A better practice is to identify the top-level module responsible for the reservation, remove its name from the list in your configuration file (located at /HOME/pyrpl_user_dir/config/<string_shown_in_top_bar_of_the_gui>.yml) and restart PyRPL with that configuration.
pyrpl.widgets.module_widgets.base_module_widget.
EditLabel
(module_widget)[source]¶Bases: pyrpl.widgets.module_widgets.base_module_widget.MyMenuLabel
“Edit” label
text
= ' .:Edit:. '¶pyrpl.widgets.module_widgets.base_module_widget.
EraseLabel
(module_widget)[source]¶Bases: pyrpl.widgets.module_widgets.base_module_widget.MyMenuLabel
“Erase” label
text
= ' .:Erase:. '¶pyrpl.widgets.module_widgets.base_module_widget.
HideShowLabel
(module_widget)[source]¶Bases: pyrpl.widgets.module_widgets.base_module_widget.MyMenuLabel
“Hide/Show” label
text
= ' .:Hide/Show:. '¶pyrpl.widgets.module_widgets.base_module_widget.
LoadLabel
(module_widget)[source]¶Bases: pyrpl.widgets.module_widgets.base_module_widget.MyMenuLabel
“Load” label
text
= ' .:Load:. '¶pyrpl.widgets.module_widgets.base_module_widget.
ModuleWidget
(name, module, parent=None)[source]¶Bases: pyrpl.widgets.module_widgets.base_module_widget.ReducedModuleWidget
Base class for a module Widget. In general, this is one of the DockWidget of the Pyrpl MainWindow.
pyrpl.widgets.module_widgets.base_module_widget.
MyMenuLabel
(module_widget)[source]¶Bases: <MagicMock name='mock.QtWidgets' id='139827381765584'>.QLabel
A label on top of the menu widget that is able to display save or load menu.
pyrpl.widgets.module_widgets.base_module_widget.
ReducedModuleWidget
(name, module, parent=None)[source]¶Bases: <MagicMock name='mock.QtWidgets' id='139827381765584'>.QGroupBox
Base class for a module Widget.
In general, this is one of the DockWidget of the Pyrpl MainWindow.
attribute_changed
= <MagicMock name='mock.QtCore.Signal()' id='139827380610576'>¶change_options
(select_attribute_name, new_options)[source]¶SLOT: don’t change name unless you know what you are doing New options should be displayed for some SelectAttribute.
change_ownership
()[source]¶SLOT: don’t change name unless you know what you are doing Display the new ownership
init_attribute_layout
()[source]¶Automatically creates the gui properties for the register_widgets in register_names. :return:
refresh_filter_options
(filter_attribute_name)[source]¶SLOT: don’t change name unless you know what you are doing New options should be displayed for some FilterProperty.
save_curve
(x_values, y_values, **attributes)[source]¶Saves the curve in some database system. To change the database system, overwrite this function or patch Module.curvedb if the interface is identical.
Parameters: |
|
---|
title_pos
= (12, 0)¶The Iir widget allows to dynamically select zeros and poles of the iir filter
pyrpl.widgets.module_widgets.iir_widget.
IirBottomWidget
(parent)[source]¶Bases: <MagicMock name='mock.QtWidgets' id='139827381765584'>.QGroupBox
BUTTONWIDTH
= 300¶pyrpl.widgets.module_widgets.iir_widget.
IirButtonWidget
(parent)[source]¶Bases: <MagicMock name='mock.QtWidgets' id='139827381765584'>.QGroupBox
BUTTONWIDTH
= 100¶pyrpl.widgets.module_widgets.iir_widget.
IirGraphWidget
(parent)[source]¶Bases: <MagicMock name='mock.QtWidgets' id='139827381765584'>.QGroupBox
xlog
= True¶pyrpl.widgets.module_widgets.iir_widget.
IirWidget
(name, module, parent=None)[source]¶Bases: pyrpl.widgets.module_widgets.base_module_widget.ModuleWidget
frequencies
¶The IQ-module is a very flexible Digital Signal Processing tool. Different values of the internal registers can be configured to perform various tasks:
The PDH locking technique is widely used to lock a laser beam to a high-finesse optical cavity. The principle is to generate a strong phase modulation of the laser beam (for instance, with an electro-optic modulator) at a frequency exceeding the cavity bandwidth and to detect the amplitude modulation in the beam reflected by the cavity. The amplitude modulation is caused by the abrupt phase response of the cavity affecting independently the sidebands from the carrier, and its sign with respect to the imposed modulation depends on cavity detuning. The high-speed digital signal processing of the redpitaya allows us to perform all the modulation/demodulation steps inside the FPGA, with modulations frequencies up to Nyquist frequecies (62.5 MHz). The correct IQ-module settings for PDH generation are (refer to the IQ signal schematic for explanations):
The network analyzer uses an IQ internally to accumulate the demodulated signal. The Network analyzer module automatically sets the following settings for the IQ module registers:
gain=0
quadrature_factor=0
output_direct=output_direct # use output_signal to excite an internal signal
frequency=frequency # is value is scanned over time
bandwidth=rbw # bandwidth of the frequency analysis
input=input
acbandwidth=acbandwidth
The IQ-module can be used to perform phase/frequency comparison between the internal frequency reference and an input signal. This is done by connecting the output multiplexer to a frequency comparator (not represented in the schematic):
output_signal='pfd'
It is possible to realize very narrow bandpass filters by combining a demodulation and a remodulation stage. The correct settings are:
gain=1. # demod-> modulation gain
amplitude=0. # no internal excitation
frequency=1e6 # filter center frequency
bandwidth=100 # filter bandwidth (use a tuple for high-order filters)
quadrature_factor=0
output_signal='ouptut_direct' # if the signal needs to be used internally
phase=30 # eventually include some dephasing to the filter
pyrpl.widgets.module_widgets.iq_widget.
IqWidget
(name, module, parent=None)[source]¶Bases: pyrpl.widgets.module_widgets.base_module_widget.ModuleWidget
Widget for the IQ module
The Lockbox widget is used to produce a control signal to make a system’s output follow a specified setpoint. The system has to behave linearly around the setpoint, which is the case for many systems. The key parts of the widget are:
The lockbox module is completely customizable and allows to implement complex locking logic by inheriting the “Lockbox” class and adding the new class into lockbox/models. For example, below is an end-to-end locking scenario for a Fabry–Pérot interferometer that uses the included “FabryPerot” class:
You should start the lockbox module and first select the model class to FabryPerot. Then continue to configure first the outputs and inputs, filling in the information as good as possible. Critical fields are:
pyrpl.widgets.module_widgets.lockbox_widget.
AnalogTfSpec
(parent)[source]¶Bases: <MagicMock name='mock.QtWidgets' id='139827381765584'>.QWidget
A button + label that allows to display and change the transfer function specification
pyrpl.widgets.module_widgets.lockbox_widget.
InputsWidget
(all_sig_widget)[source]¶Bases: <MagicMock name='mock.QtWidgets' id='139827381765584'>.QWidget
A widget to represent all input signals on the same tab
name
= 'inputs'¶pyrpl.widgets.module_widgets.lockbox_widget.
LockboxInputWidget
(name, module, parent=None)[source]¶Bases: pyrpl.widgets.module_widgets.base_module_widget.ModuleWidget
A widget to represent a single lockbox input
pyrpl.widgets.module_widgets.lockbox_widget.
LockboxSequenceWidget
(name, module, parent=None)[source]¶Bases: pyrpl.widgets.module_widgets.base_module_widget.ModuleWidget
A widget to represent all lockbox stages
pyrpl.widgets.module_widgets.lockbox_widget.
LockboxStageWidget
(name, module, parent=None)[source]¶Bases: pyrpl.widgets.module_widgets.base_module_widget.ReducedModuleWidget
A widget representing a single lockbox stage
name
¶pyrpl.widgets.module_widgets.lockbox_widget.
LockboxWidget
(name, module, parent=None)[source]¶Bases: pyrpl.widgets.module_widgets.base_module_widget.ModuleWidget
The LockboxWidget combines the lockbox submodules widget: model, inputs, outputs, lockbox_control
add_input
(inputs)[source]¶SLOT: don’t change name unless you know what you are doing Adds an input to the widget
Hide/show the signal part of the widget :return:
Hide/show the signal part of the widget :return:
input_calibrated
(inputs)[source]¶SLOT: don’t change name unless you know what you are doing updates the plot of the input expected signal for input inputs[0]
output_created
(outputs)[source]¶SLOT: don’t change name unless you know what you are doing Adds an output to the widget, outputs is a singleton [outpout]
output_deleted
(outputs)[source]¶SLOT: don’t change name unless you know what you are doing Removes an output to the widget, outputs is a singleton [outpout]
output_renamed
()[source]¶SLOT: don’t change name unless you know what you are doing Refresh all output name tabs in the widget
remove_input
(inputs)[source]¶SLOT: don’t change name unless you know what you are doing Remove an input to the widget
pyrpl.widgets.module_widgets.lockbox_widget.
MainOutputProperties
(parent)[source]¶Bases: <MagicMock name='mock.QtWidgets' id='139827381765584'>.QGroupBox
pyrpl.widgets.module_widgets.lockbox_widget.
OutputSignalWidget
(name, module, parent=None)[source]¶Bases: pyrpl.widgets.module_widgets.base_module_widget.ModuleWidget
name
¶pyrpl.widgets.module_widgets.lockbox_widget.
PidProperties
(parent)[source]¶Bases: <MagicMock name='mock.QtWidgets' id='139827381765584'>.QGroupBox
pyrpl.widgets.module_widgets.lockbox_widget.
PlusTab
[source]¶Bases: <MagicMock name='mock.QtWidgets' id='139827381765584'>.QWidget
name
= '+'¶pyrpl.widgets.module_widgets.lockbox_widget.
PostFiltering
(parent)[source]¶Bases: <MagicMock name='mock.QtWidgets' id='139827381765584'>.QGroupBox
pyrpl.widgets.module_widgets.lockbox_widget.
StageOutputWidget
(name, module, parent=None)[source]¶Bases: pyrpl.widgets.module_widgets.base_module_widget.ReducedModuleWidget
pyrpl.widgets.module_widgets.lockbox_widget.
SweepOutputProperties
(parent)[source]¶Bases: <MagicMock name='mock.QtWidgets' id='139827381765584'>.QGroupBox
ModuleManagerWidgets are just a frame containing several identical module widgets such as iqs, pids or asgs
pyrpl.widgets.module_widgets.module_manager_widget.
AsgManagerWidget
(name, module, parent=None)[source]¶Bases: pyrpl.widgets.module_widgets.module_manager_widget.ModuleManagerWidget
pyrpl.widgets.module_widgets.module_manager_widget.
IirManagerWidget
(name, module, parent=None)[source]¶Bases: pyrpl.widgets.module_widgets.module_manager_widget.ModuleManagerWidget
pyrpl.widgets.module_widgets.module_manager_widget.
IqManagerWidget
(name, module, parent=None)[source]¶Bases: pyrpl.widgets.module_widgets.module_manager_widget.ModuleManagerWidget
adjust_drawing
()[source]¶When the user resizes the window, the drawing elements follow the x-positions of the corresponding attribute_widgets.
connect
(widget1, widget2, h_first=True)[source]¶Connects 2 blocks with an arrow h_first means the first line originating from widget1 is horizontal.
pyrpl.widgets.module_widgets.module_manager_widget.
ModuleManagerWidget
(name, module, parent=None)[source]¶Bases: pyrpl.widgets.module_widgets.base_module_widget.ModuleWidget
add_stretch
= True¶pyrpl.widgets.module_widgets.module_manager_widget.
PidManagerWidget
(name, module, parent=None)[source]¶Bases: pyrpl.widgets.module_widgets.module_manager_widget.ModuleManagerWidget
pyrpl.widgets.module_widgets.module_manager_widget.
ScopeManagerWidget
(name, module, parent=None)[source]¶Bases: pyrpl.widgets.module_widgets.module_manager_widget.ModuleManagerWidget
add_stretch
= False¶The network analyzer records the coherent response of the signal at the port
input
to a sinusoidal excitation of variable frequency sent to the
output selected in output_direct
.
Note
If output_direct='off'
, another module’s input can be set
to networkanalyzer
to test its response to a frequency sweep.
amplitude
sets the amplitude of the sinusoidal excitation in Volts.start_freq
/stop_freq
define the frequency range over which a transfer function is recorded.
Swapping the values of start_freq
and stop_freq
reverses the
direction of the frequency sweep. Setting stop_freq = start_freq
enables the “zero-span” mode, where the coherent response at a constant
frequency is recorded as a function of time.points
defines the number of frequency points in the recorded transfer function.rbw
is
the cutoff frequency of the low-pass filter after demodulation. Furthermore,
the time \(\tau\) spent to record each point is
\(\tau=\texttt{avg_per_point} / \texttt{rbw}\).avg_per_point
:
Each point is averaged inside the FPGA before being retrieved by the
client computer that runs PyRPL. You should increase this parameter or
decrease rbw
if the communication time between the Red Pitaya and
the client computer limits the acquisition speed.acbandwidth
is the cutoff frequency of a high-pass filter applied to the input before
demodulation. A setting of zero disables the high-pass filter.logscale
enables the use of a logarithmic scale for the frequency axis, resulting in
a logarithmic distribution of the frequency points as well.infer_open_loop_tf
applies the transformation \(T \rightarrow \frac{T}{1+T}\) to the displayed
transfer function to correct for the effect of a closed feedback loop
(not implemented at the moment).pyrpl.widgets.module_widgets.na_widget.
NaWidget
(name, module, parent=None)[source]¶Bases: pyrpl.widgets.module_widgets.acquisition_module_widget.AcquisitionModuleWidget
Network Analyzer Tab.
CHUNK_SIZE
= 500¶autoscale
()[source]¶log_mode = self.module.logscale self.plot_item.setLogMode(x=log_mod, y=None) # this seems also needed self.plot_item_phase.setLogMode(x=log_mod, y=None)
display_state
(running_state)[source]¶Displays one of the possible states “running_continuous”, “running_single”, “paused_continuous”, “paused_single”, “stopped”
starting_update_rate
= 0.2¶A widget for pid modules.
pyrpl.widgets.module_widgets.pyrpl_config_widget.
PyrplConfigWidget
(name, module, parent=None)[source]¶Bases: pyrpl.widgets.module_widgets.base_module_widget.ReducedModuleWidget
This file defines some primitives to draw a circuit schematic on Widgets. For now it is only used in IqManagerWidget.
pyrpl.widgets.module_widgets.schematics.
Connection
(widget1, widget2, h_first, parent, show_arrow=True)[source]¶Bases: object
arrow_height
= 10¶arrow_width
= 15¶margin
= 15¶pyrpl.widgets.module_widgets.schematics.
MyImage
(widget_name, y, filename, label, parent, x_offset=0)[source]¶pyrpl.widgets.module_widgets.schematics.
MyItem
(widget_name, y, label, parent, x_offset=0)[source]¶Bases: <MagicMock name='mock.QtWidgets' id='139827381765584'>.QWidget
The control panel above the plotting area allows to manipulate the following
attributes specific to the Scope
:
ch1_active
/ch2_active
: Hide/show the trace
corresponding to ch1/ch2.input1
/input2
: Choose the input among a
list of possible signals. Internal signals can be referenced by their
symbolic name e.g. lockbox.outputs.output1
.threshold
: The voltage threshold for the scope trigger.hysteresis
: Hysteresis for the scope trigger, i.e. the scope
input signal must exceed the threshold
value by more than
the hysteresis value to generate a trigger event.duration
: The full duration of the scope trace to acquire,
in units of seconds.trigger_delay
: The delay beteween trigger event and the
center of the trace.trigger_source
: The channel to use as trigger input.average
: Enables “averaging” a.k.a. “high-resolution” mode,
which averages all data samples acquired at the full sampling rate between
two successive points of the trace. If disabled, only a sample of the
full-rate signal is shown as the trace. The averaging mode corresponds to a
moving-average filter with a cutoff frequency of
sampling_time
\(^{-1} = 2^{14}/\mathrm{duration}\)
in units of Hz.trigger_mode
: Multiple options are available.Normal
is used for triggered acquisition.Untriggered (rolling)
is used for continuous acquisition without
requiring a trigger signal, where the traces “roll” through the plotting
area from right to left in real-time. The rolling mode does not allow for
trace averaging nor durations below 0.1 s.pyrpl.widgets.module_widgets.scope_widget.
ScopeWidget
(name, module, parent=None)[source]¶Bases: pyrpl.widgets.module_widgets.acquisition_module_widget.AcquisitionModuleWidget
Widget for scope
autoscale_x
()[source]¶Autoscale pyqtgraph. The current behavior is to autoscale x axis and set y axis to [-1, +1]
change_ownership
()[source]¶For some reason the visibility of the rolling mode panel is not updated when the scope becomes free again unless we ask for it explicitly...
rolling_mode
¶set_rolling_mode
()[source]¶Set rolling mode on or off based on the module’s attribute “rolling_mode”
pyrpl.widgets.module_widgets.spec_an_widget.
BasebandAttributesWidget
(specan_widget)[source]¶Bases: <MagicMock name='mock.QtWidgets' id='139827381765584'>.QWidget
pyrpl.widgets.module_widgets.spec_an_widget.
IqModeAttributesWidget
(specan_widget)[source]¶Bases: <MagicMock name='mock.QtWidgets' id='139827381765584'>.QWidget
pyrpl.widgets.module_widgets.spec_an_widget.
OtherAttributesWidget
(specan_widget)[source]¶Bases: <MagicMock name='mock.QtWidgets' id='139827381765584'>.QWidget
pyrpl.widgets.module_widgets.spec_an_widget.
SpecAnWidget
(name, module, parent=None)[source]¶Bases: pyrpl.widgets.module_widgets.acquisition_module_widget.AcquisitionModuleWidget
This package defines all the widgets to control the different modules of pyrpl. Each Module instance can have a widget created by the function create_widget(). All module widgets inherit from the base class ModuleWidget. The class member ModuleClass._widget_class specifies which ModuleWidget class should be used for the particular ModuleClass.