Fork PyRPL on GitHub

pyrpl.widgets.module_widgets package

Submodules

pyrpl.widgets.module_widgets.acquisition_module_widget module

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.
class pyrpl.widgets.module_widgets.acquisition_module_widget.AcquisitionModuleWidget(name, module, parent=None)[source]

Bases: pyrpl.widgets.module_widgets.base_module_widget.ModuleWidget

init_gui()[source]
restart_clicked()[source]
run_continuous_clicked()[source]

Toggles the button run_continuous to stop or vice versa and starts he acquisition timer

run_single_clicked()[source]
update_current_average()[source]
update_running_buttons()[source]

Change text of Run continuous button and visibility of run single button according to module.running_continuous

class pyrpl.widgets.module_widgets.acquisition_module_widget.CurrentAvgLabel(parent=None)[source]

Bases: <MagicMock name='mock.QtWidgets' id='139827381765584'>.QWidget

set_value(val)[source]

pyrpl.widgets.module_widgets.asg_widget module

A widget for the scope module

class pyrpl.widgets.module_widgets.asg_widget.AsgWidget(*args, **kwds)[source]

Bases: pyrpl.widgets.module_widgets.base_module_widget.ModuleWidget

pyrpl.widgets.module_widgets.base_module_widget module

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.

class pyrpl.widgets.module_widgets.base_module_widget.EditLabel(module_widget)[source]

Bases: pyrpl.widgets.module_widgets.base_module_widget.MyMenuLabel

“Edit” label

func(state)[source]
get_menu()[source]
text = ' .:Edit:. '
class pyrpl.widgets.module_widgets.base_module_widget.EraseLabel(module_widget)[source]

Bases: pyrpl.widgets.module_widgets.base_module_widget.MyMenuLabel

“Erase” label

func(state)[source]
text = ' .:Erase:. '
class pyrpl.widgets.module_widgets.base_module_widget.HideShowLabel(module_widget)[source]

Bases: pyrpl.widgets.module_widgets.base_module_widget.MyMenuLabel

“Hide/Show” label

get_menu()[source]
text = ' .:Hide/Show:. '
class pyrpl.widgets.module_widgets.base_module_widget.LoadLabel(module_widget)[source]

Bases: pyrpl.widgets.module_widgets.base_module_widget.MyMenuLabel

“Load” label

func(state)[source]
text = ' .:Load:. '
class 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.

create_title_bar()[source]
set_title(title)[source]
class 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.

contextMenuEvent(event)[source]
get_menu()[source]
class 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

create_title_bar()[source]
hide_widget()[source]

shows the widget after it has been hidden

init_attribute_layout()[source]

Automatically creates the gui properties for the register_widgets in register_names. :return:

init_gui()[source]

To be overwritten in derived class :return:

init_main_layout(orientation='horizontal')[source]
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:
  • x_values – numpy array with x values
  • y_values – numpy array with y values
  • attributes – extra curve parameters (such as relevant module settings)
set_title(title)[source]
show_widget()[source]

shows the widget after it has been hidden

title_pos = (12, 0)
update_attribute_by_name(name, new_value_list)[source]

SLOT: don’t change name unless you know what you are doing Updates a specific attribute. New value is passed as a 1-element list to avoid typing problems in signal-slot.

class pyrpl.widgets.module_widgets.base_module_widget.SaveLabel(module_widget)[source]

Bases: pyrpl.widgets.module_widgets.base_module_widget.MyMenuLabel

“Save” label

func(state)[source]
get_menu()[source]
new_state()[source]
text = ' .:Save:. '

pyrpl.widgets.module_widgets.curve_viewer_widget module

class pyrpl.widgets.module_widgets.curve_viewer_widget.CurveViewerWidget(name, module, parent=None)[source]

Bases: pyrpl.widgets.module_widgets.base_module_widget.ReducedModuleWidget

init_attribute_layout()[source]
init_gui()[source]

To be overwritten in derived class :return:

pyrpl.widgets.module_widgets.iir_widget module

The Iir widget allows to dynamically select zeros and poles of the iir filter

class pyrpl.widgets.module_widgets.iir_widget.IirBottomWidget(parent)[source]

Bases: <MagicMock name='mock.QtWidgets' id='139827381765584'>.QGroupBox

BUTTONWIDTH = 300
class pyrpl.widgets.module_widgets.iir_widget.IirButtonWidget(parent)[source]

Bases: <MagicMock name='mock.QtWidgets' id='139827381765584'>.QGroupBox

BUTTONWIDTH = 100
class pyrpl.widgets.module_widgets.iir_widget.IirGraphWidget(parent)[source]

Bases: <MagicMock name='mock.QtWidgets' id='139827381765584'>.QGroupBox

xlog = True
class pyrpl.widgets.module_widgets.iir_widget.IirWidget(name, module, parent=None)[source]

Bases: pyrpl.widgets.module_widgets.base_module_widget.ModuleWidget

frequencies
init_gui()[source]
keyPressEvent(event)[source]

not working properly yet

keyReleaseEvent(event)[source]

not working properly yet

select_pole(plot_item, spots)[source]
select_zero(plot_item, spots)[source]
update_plot()[source]

pyrpl.widgets.module_widgets.iq_widget module

The IQ-module is a very flexible Digital Signal Processing tool. Different values of the internal registers can be configured to perform various tasks:

Pound Drever Hall signal generation

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):

  • gain=0. # no link from demodulation to modulation stage
  • amplitude=1. # amplitude of the modulation
  • frequency=50e6 # Modulation frequency
  • phase=0 # adjust to compensate for cable length delays
  • output_direct=’out1’ # output to optical phase modulator
  • output_signal=’quadrature’
  • input=’in1’ # input from photodiode
  • bandwidth=1e5 # trade-off between noise and error-signal bandwidth
  • quadrature_factor=256 # adjust for saturation level
  • acbandwidth=1e4 # to prevent internal saturation problems

Network analyzer

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

Phase-frequency detector

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'

Tuanble bandpass filter

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
class 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

init_gui()[source]

pyrpl.widgets.module_widgets.lockbox_widget 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:

  • General controls: “classname” selects a particular Lockbox class from the ones defined in lockbox/models folder, and will determine the overall behaviour of the lockbox. “Calibrate all inputs” performs a sweep and uses acquired data to calibrate parameters relevant for the selected Lockbox class. Before attempting to lock, it’s recommendable, and sometimes even mandatory, to press this button.
  • Stages: In many situations, it might be desirable to start locking the system with a certain set of locking parameters, and once this has been achieved, switch to a different set with possibly a different signal. For example, when locking a Fabry–Pérot interferometer, the first stage might be locking on the side of a transmission fringe, and later transferring to locking on-resonance with Pound-Drever-Hall input signal. It is possible to have as many stages as necessary, and they will be executed sequentially.
  • Stage settings: each stage has its own setpoint (whose units can be chosen in the general setting setpoint_unit) and a gain factor (a premultiplier to account for desired gain differences among different stages). In addition, based on the state of the “lock on” tri-state checkbox, a stage can enable (checkbox checked), disable (checkbox disabled) or leave unaffected (checkbox greyed out) the locking state when the stage is activated. The checkbox and field “reset offset” determine whether the lockbox should reset its output to a certain level when this stage is reached.
  • Inputs and outputs: the PI parameters, together with limits, unit conversions and so on, are set in these tabs.

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:

  • Wavelength (in SI units)
  • Outputs: configure the piezo output in the folding menu of inputs/outputs:
    • Select which output (out1 or out2) is the piezo connected to.
    • If it is the default_sweep_output, set the sweep parameters
    • Fill in the cutoff frequency if there is an analog low-pass filter behind the redpitaya, and start with a unity-gain frequency of 10 Hz.
    • Give an estimate on the displacement in meters per Volt or Hz per Volt (the latter being the obtained resonance frequency shift per volt at the Red Pitaya output), you ensure that the specified unit-gain is the one that Red Pitaya is able to set.
  • Inputs:
    • Set transmission input to “in1” for example.
    • If PDH is used, set PDH input parameters to the same parameters as you have in the IQ configuration. Lockbox takes care of the setting, and is able to compute gains and slopes automatically
  • Make sure to click “Sweep” and test whether a proper sweep is performed, and “Calibrate” to get the right numbers on the y-axis for the plotted input error signals
  • At last, configure the locking sequence:
    • Each stage sleeps for “duration” in seconds after setting the desired gains.
    • The first stage should be used to reset all offsets to either +1 or -1 Volts, and wait for 10 ms or so (depending on analog lowpass filters)
    • Next stage is usually a “drift” stage, where you lock at a detuning of +/- 1 or +/- 2 bandwidths, possibly with a gain_factor below 1. make sure you enable the checkbox “lock enabled” for the piezo output here by clicking twice on it (it is actually a 3-state checkbox, see the information on the 1-click state when hovering over it). When you enable the locking sequence by clicking on lock, monitor the output voltage with a running scope, and make sure that this drift state actually makes the output voltage swing upwards. Otherwise, swap the sign of the setpoint / or the initial offset of the piezo output. Leave enough time for this stage to catch on to the side of a resonance.
    • Next stages can be adapted to switch to other error signals, modify setpoints and gains and so on.
class 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

change(ev)[source]
change_analog_tf()[source]
class 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

add_input(input)[source]
input_calibrated(inputs)[source]
name = 'inputs'
remove_input(input)[source]
class 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

hide_lock()[source]
init_gui()[source]
input_calibrated(input=None)[source]
show_lock(stage)[source]
class 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

hide_widget()[source]
init_gui()[source]
show_widget()[source]
stage_created(stage)[source]
stage_deleted(stage)[source]

removes the widget corresponding to stage

update_stage_names()[source]
class 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

close()[source]
create_title_bar()[source]
init_gui()[source]
name
resizeEvent(evt)[source]
show_lock()[source]
class 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

button_hide1_clicked()[source]

Hide/show the signal part of the widget :return:

button_hide2_clicked()[source]

Hide/show the signal part of the widget :return:

delete_widget()[source]
hide_lock()[source]
init_gui()[source]
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

state_changed(statelist)[source]

SLOT: don’t change name unless you know what you are doing Basically painting some button in green is required

update_lockstatus(islockedlist=[None])[source]
update_transfer_function(outputs)[source]

SLOT: don’t change name unless you know what you are doing updates the plot of the transfer function for output outputs[0]

class pyrpl.widgets.module_widgets.lockbox_widget.MainOutputProperties(parent)[source]

Bases: <MagicMock name='mock.QtWidgets' id='139827381765584'>.QGroupBox

change_analog_tf()[source]
class pyrpl.widgets.module_widgets.lockbox_widget.OutputSignalWidget(name, module, parent=None)[source]

Bases: pyrpl.widgets.module_widgets.base_module_widget.ModuleWidget

change_analog_tf()[source]
init_gui()[source]
name
update_transfer_function()[source]

Updates the transfer function curve of the output.

class pyrpl.widgets.module_widgets.lockbox_widget.PidProperties(parent)[source]

Bases: <MagicMock name='mock.QtWidgets' id='139827381765584'>.QGroupBox

toggle_mode()[source]
update_assisted_design()[source]

Does what must be done when manual/assisted design radio button was clicked

class pyrpl.widgets.module_widgets.lockbox_widget.PlusTab[source]

Bases: <MagicMock name='mock.QtWidgets' id='139827381765584'>.QWidget

name = '+'
class pyrpl.widgets.module_widgets.lockbox_widget.PostFiltering(parent)[source]

Bases: <MagicMock name='mock.QtWidgets' id='139827381765584'>.QGroupBox

class pyrpl.widgets.module_widgets.lockbox_widget.StageOutputWidget(name, module, parent=None)[source]

Bases: pyrpl.widgets.module_widgets.base_module_widget.ReducedModuleWidget

init_attribute_layout()[source]
update_attribute_by_name(name, new_value_list)[source]
update_offset_visibility()[source]
class pyrpl.widgets.module_widgets.lockbox_widget.SweepOutputProperties(parent)[source]

Bases: <MagicMock name='mock.QtWidgets' id='139827381765584'>.QGroupBox

class pyrpl.widgets.module_widgets.lockbox_widget.WidgetAssisted(parent)[source]

Bases: <MagicMock name='mock.QtWidgets' id='139827381765584'>.QWidget

class pyrpl.widgets.module_widgets.lockbox_widget.WidgetManual(parent)[source]

Bases: <MagicMock name='mock.QtWidgets' id='139827381765584'>.QWidget

pyrpl.widgets.module_widgets.module_manager_widget module

ModuleManagerWidgets are just a frame containing several identical module widgets such as iqs, pids or asgs

class pyrpl.widgets.module_widgets.module_manager_widget.AsgManagerWidget(name, module, parent=None)[source]

Bases: pyrpl.widgets.module_widgets.module_manager_widget.ModuleManagerWidget

class pyrpl.widgets.module_widgets.module_manager_widget.IirManagerWidget(name, module, parent=None)[source]

Bases: pyrpl.widgets.module_widgets.module_manager_widget.ModuleManagerWidget

class 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.

button_hide_clicked()[source]
connect(widget1, widget2, h_first=True)[source]

Connects 2 blocks with an arrow h_first means the first line originating from widget1 is horizontal.

init_gui()[source]

In addition to the normal ModuleManagerWidget stacking of module attributes, the IqManagerWidget displays a schematic of the iq module internal logic.

make_drawing()[source]

Uses the primitives defined in schematics.py to draw the diagram.

resizeEvent(event)[source]

call adjust_drawing upon resize.

class 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
contextMenuEvent(event)[source]
create_title_bar()[source]

ModuleManagerWidgets don’t have a title bar

init_gui()[source]
class pyrpl.widgets.module_widgets.module_manager_widget.PidManagerWidget(name, module, parent=None)[source]

Bases: pyrpl.widgets.module_widgets.module_manager_widget.ModuleManagerWidget

class 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

pyrpl.widgets.module_widgets.na_widget module

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).
class 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)

clear_curve()[source]

Clear all chunks

display_state(running_state)[source]

Displays one of the possible states “running_continuous”, “running_single”, “paused_continuous”, “paused_single”, “stopped”

init_gui()[source]

Sets up the gui

scan_finished()[source]

if in run continuous, needs to redisplay the number of averages

set_benchmark_text(text)[source]
starting_update_rate = 0.2
update_attribute_by_name(name, new_value_list)[source]
update_chunk(chunk_index)[source]

updates curve # chunk_index with the data from the module

update_point(index, force=False)[source]

To speed things up, the curves are plotted by chunks of self.CHUNK_SIZE points. All points between last_updated_point and index will be redrawn.

x_log_toggled()[source]

change x_log of axis

pyrpl.widgets.module_widgets.pid_widget module

A widget for pid modules.

class pyrpl.widgets.module_widgets.pid_widget.PidWidget(name, module, parent=None)[source]

Bases: pyrpl.widgets.module_widgets.base_module_widget.ModuleWidget

Widget for a single PID.

init_gui()[source]
update_ival()[source]

pyrpl.widgets.module_widgets.pyrpl_config_widget module

class pyrpl.widgets.module_widgets.pyrpl_config_widget.PyrplConfigWidget(name, module, parent=None)[source]

Bases: pyrpl.widgets.module_widgets.base_module_widget.ReducedModuleWidget

init_attribute_layout()[source]

pyrpl.widgets.module_widgets.schematics module

This file defines some primitives to draw a circuit schematic on Widgets. For now it is only used in IqManagerWidget.

class pyrpl.widgets.module_widgets.schematics.Connection(widget1, widget2, h_first, parent, show_arrow=True)[source]

Bases: object

adjust()[source]
arrow_height = 10
arrow_width = 15
margin = 15
class pyrpl.widgets.module_widgets.schematics.MyImage(widget_name, y, filename, label, parent, x_offset=0)[source]

Bases: pyrpl.widgets.module_widgets.schematics.MyItem

class pyrpl.widgets.module_widgets.schematics.MyItem(widget_name, y, label, parent, x_offset=0)[source]

Bases: <MagicMock name='mock.QtWidgets' id='139827381765584'>.QWidget

item_x()[source]
item_y()[source]
move_to_right_position()[source]
class pyrpl.widgets.module_widgets.schematics.MyLabel(widget_name, y, label, parent, x_offset=0)[source]

Bases: pyrpl.widgets.module_widgets.schematics.MyItem

class pyrpl.widgets.module_widgets.schematics.MyLabelSignal[source]

Bases: <MagicMock name='mock.QtWidgets' id='139827381765584'>.QLabel

pyrpl.widgets.module_widgets.scope_widget module

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.
class 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...

display_channel(ch)[source]

Displays channel ch (1 or 2) on the graph :param ch:

display_curve(list_of_arrays)[source]

Displays all active channels on the graph.

init_gui()[source]

sets up all the gui for the scope.

rolling_mode
rolling_mode_toggled()[source]
save_clicked()[source]
set_rolling_mode()[source]

Set rolling mode on or off based on the module’s attribute “rolling_mode”

update_attribute_by_name(name, new_value_list)[source]

Updates all attributes on the gui when their values have changed.

update_rolling_mode_visibility()[source]

Hide rolling mode checkbox for duration < 100 ms

pyrpl.widgets.module_widgets.spec_an_widget module

The spectrum-analyzer has 2 different working modes:
  • iq-mode (not available in the current version): the data are first demodulated by an IQ-module around a center frequency and then Fourier Transformed. This mode allows to study a narrow span around the center frequency
  • baseband: The Fourier transform is directly applied on the sampled data. Two inputs can be used in baseband mode, such that the complex cross-spectrum between the two inputs can be computed.
The following attributes can be manipulated by the module widget:
  • acbandwidth (IQ mode only): The cut-off frequency of the high-pass filter for the iq-demodulator.
  • span: frequency range of the analysis. In baseband mode, the span has to be divided by a factor 2.
  • rbw: residual bandwidth of the analysis (span and bandwidth are linked and cannot be set independently)
  • window: type of filtering window used (see scipy.signal.get_window for a list of windows available)
  • diplay_unit: the unit in which the spectrum is represented (internally, all spectra are represented in V_pk^2)
class pyrpl.widgets.module_widgets.spec_an_widget.BasebandAttributesWidget(specan_widget)[source]

Bases: <MagicMock name='mock.QtWidgets' id='139827381765584'>.QWidget

class pyrpl.widgets.module_widgets.spec_an_widget.IqModeAttributesWidget(specan_widget)[source]

Bases: <MagicMock name='mock.QtWidgets' id='139827381765584'>.QWidget

class pyrpl.widgets.module_widgets.spec_an_widget.OtherAttributesWidget(specan_widget)[source]

Bases: <MagicMock name='mock.QtWidgets' id='139827381765584'>.QWidget

class pyrpl.widgets.module_widgets.spec_an_widget.SpecAnWidget(name, module, parent=None)[source]

Bases: pyrpl.widgets.module_widgets.acquisition_module_widget.AcquisitionModuleWidget

autoscale_x()[source]

Autoscale pyqtgraph

display_curve(datas)[source]
display_curve_old(datas)[source]

Displays all active channels on the graph.

init_gui()[source]

Sets up the gui.

run_continuous_clicked()[source]

Toggles the button run_continuous to stop or vice versa and starts the acquisition timer

run_single_clicked()[source]
unit_changed()[source]
update_attribute_by_name(name, new_value_list)[source]
update_baseband_visibility()[source]

Module contents

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.