nomad_camels.main_classes package

Submodules

nomad_camels.main_classes.device_class module

class nomad_camels.main_classes.device_class.Connection_Config(parent=None)

Bases: QWidget

Base Class for the widgets used to specify the connection of a given device.

connection_change
get_settings()

Overwrite to return the connection-specific settings

load_settings(settings_dict)

Overwrite to load the connection-specific settings from settings_dict.

Parameters:

settings_dict

staticMetaObject = PySide6.QtCore.QMetaObject("Connection_Config" inherits "QWidget": Methods:   #33 type=Signal, signature=connection_change() )
class nomad_camels.main_classes.device_class.Device(name='', virtual=False, tags=None, ophyd_device=None, ophyd_class_name='', additional_info=None, non_channel_functions=None, main_thread_only=False, **kwargs)

Bases: object

General class for all devices/instruments.

If subclassing this in a driver, subclass should be called “subclass”, it will be imported via importlib in that way. Any derived device should also provide the name of its ophyd-class as a string self.ophyd_class_name.

name

represents the device, should be unique

Type:

str

virtual

whether the device does not need any hardware

Type:

bool

tags

list of strings for the device search

Type:

list

ophyd_class_name

name of the class of ophyd_device

Type:

str

settings

settings handed to the ophyd class at runtime of the protocol

Type:

dict

config

values, the config-attributes / components of the ophyd device should be set to

Type:

dict

channels

channels of the device (i.e.: Signals that are not config)

Type:

dict

controls

Dictionary of additional manual controls this device provides

Type:

dict

get_additional_info()

Returns the additional information about the instrument.

Returns:

self.additional_info

Return type:

dict

get_additional_string()

returns a string that will be added into the protocol after connecting to the device.

Returns:

additional_str

Return type:

str

get_channels()

returns self.channels, should be overwritten for special purposes (e.g. leaving out some keys of the dictionary)

Returns:

self.channels – dictionary containing the device’s channels

Return type:

dict

get_config()

returns self.config, should be overwritten for special purposes (e.g. leaving out some keys of the dictionary)

Returns:

self.config

Return type:

dict

get_controls()

Returns the device’s specific manual controls.

Returns:

self.controls – Dictionary of the device’s manual controls

Return type:

dict

get_finalize_steps()

Returns the string used in the ‘finally’ part of the protocol’s main function to e.g. close the instrument communication.

Returns:

step_str

Return type:

str

get_necessary_devices()

Returns a list of the devices that this device needs to function (e.g. for a PID controller).

get_non_channel_functions()
get_passive_config()

Not used.

get_settings()

returns self.settings, should be overwritten for special purposes (e.g. leaving out some keys of the dictionary)

Returns:

self.settings

Return type:

dict

get_special_steps()

returns a dictionary containing containing device-specific loopsteps. The key is the loopstep’s name, the value a list containing the Class of the step, and its config-widget.

Returns:

steps

Return type:

dict{‘<step_name>’: [Step_Class, Step_Config]}

class nomad_camels.main_classes.device_class.Device_Config(parent=None, device_name='', data='', settings_dict=None, config_dict=None, additional_info=None)

Bases: QWidget

Parent class for the configuration-widgets (shown on the frontpanel) of the devices.

adjust_text_edit_size()

Adjusts the size of the textEdit_desc based on its content.

connection_type_changed()

Called when the comboBox_connection_type is changed. Switches to another connector-widget to specify things like the Address of the device.

eln_connection_button_clicked()
get_config()

Returns the config_dict of the device. Overwrite this function for each device to specify the config.

get_info()
get_settings()

Updates the settings_dict with the current settings. Overwrite this function for each device to specify the settings. It is recommended to still call the super() method for the connection-settings.

load_settings()

Loads the settings from the settings_dict. Depending on the connection-type, the correct widget is set and the settings entered. Overwrite this function (and call it) for the specific settings.

name_change
showEvent(event)

Called when the widget is shown.

staticMetaObject = PySide6.QtCore.QMetaObject("Device_Config" inherits "QWidget": Methods:   #33 type=Signal, signature=name_change(QString), parameters=QString )
class nomad_camels.main_classes.device_class.Device_Config_Sub(settings_dict=None, parent=None, config_dict=None)

Bases: QWidget

get_config()
get_settings()
staticMetaObject = PySide6.QtCore.QMetaObject("Device_Config_Sub" inherits "QWidget": )
class nomad_camels.main_classes.device_class.Local_VISA(parent=None)

Bases: Connection_Config

get_settings()
load_settings(settings_dict)
Parameters:

settings_dict

set_only_resource_name()
staticMetaObject = PySide6.QtCore.QMetaObject("Local_VISA" inherits "Connection_Config": )
class nomad_camels.main_classes.device_class.Simple_Config(parent=None, device_name='', data='', settings_dict=None, config_dict=None, additional_info=None, comboBoxes=None, config_types=None, labels=None)

Bases: Device_Config

get_config()
get_settings()
staticMetaObject = PySide6.QtCore.QMetaObject("Simple_Config" inherits "Device_Config": )
class nomad_camels.main_classes.device_class.Simple_Config_Sub(settings_dict=None, parent=None, config_dict=None, comboBoxes=None, config_types=None, labels=None)

Bases: Device_Config_Sub

config_changed
get_config()
get_settings()
staticMetaObject = PySide6.QtCore.QMetaObject("Simple_Config_Sub" inherits "Device_Config_Sub": Methods:   #33 type=Signal, signature=config_changed() )
nomad_camels.main_classes.device_class.check_logged_in()
nomad_camels.main_classes.device_class.check_output(cls) bool

Returns False if the give cls is an instance of a read-only Signal.

nomad_camels.main_classes.device_class.get_channels(dev: Device, include_metadata=False, include_config=False)

returns the components of an ophyd-device that are not listed in the configuration

Parameters:
  • dev (ophyd.Device) – The device that should be checked

  • include_metadata (bool, default False) – If True, also returns the compnents’ metadata

Returns:

channels – list of the device’s channels if metadata is True, it will be a list of tuples containing the channels’ names and their metadata

Return type:

list

nomad_camels.main_classes.device_class.get_configs(ophyd_instance)

Returns the configuration and passive configuration of the given ophyd-instance.

Parameters:

ophyd_instance (ophyd.Device) – The ophyd-device that should be checked

Returns:

  • config (dict) – The configuration of the device

  • passive_config (dict) – The passive configuration of the device

nomad_camels.main_classes.device_class.get_outputs(dev: Device)

walks through the components of an ophyd-device and checks whether they can be written

Parameters:

dev (ophyd.Device) – The device that should be checked

Returns:

outputs – List of the outputs’ names

Return type:

list

nomad_camels.main_classes.list_plot module

class nomad_camels.main_classes.list_plot.Live_List(value_list, table, *, epoch='run', namespace=None, stream_name='primary', parent=None, plot_all_available=False, **kwargs)

Bases: QObject, CallbackBase

add_to_table(name)
descriptor(doc)
Parameters:

doc

event(doc)
Parameters:

doc

new_data
start(doc)
Parameters:

doc

staticMetaObject = PySide6.QtCore.QMetaObject("Live_List" inherits "QObject": Methods:   #4 type=Signal, signature=new_data() )
class nomad_camels.main_classes.list_plot.Teleporter

Bases: QObject

name_doc_escape
staticMetaObject = PySide6.QtCore.QMetaObject("Teleporter" inherits "QObject": Methods:   #4 type=Signal, signature=name_doc_escape(QString,QVariantMap,PyObject), parameters=QString, QVariantMap, PyObject )
class nomad_camels.main_classes.list_plot.Values_List_Plot(value_list, *, epoch='run', namespace=None, title='', stream_name='primary', parent=None, plot_all_available=True, **kwargs)

Bases: QWidget

autoscale()
clear_plot()
closeEvent(a0)
Parameters:

a0

closing
reopened
show_again()
staticMetaObject = PySide6.QtCore.QMetaObject("Values_List_Plot" inherits "QWidget": Methods:   #33 type=Signal, signature=closing()   #34 type=Signal, signature=reopened() )
nomad_camels.main_classes.list_plot.handle_teleport(name, doc, obj)

nomad_camels.main_classes.loop_step module

class nomad_camels.main_classes.loop_step.Loop_Step(name='', parent_step=None, step_info=None, protocol=None, **kwargs)

Bases: object

Main Class for all Loop_Steps.

Parameters:
  • name (str) – The custom name of the step.

  • parent_step (Loop_Step, default None) – The step containing this step. If None, this step is in the outer layer.

  • step_info (dict, default None) – Dictionary containing all the relevant information of the step.

append_to_model(item_model, parent=None)

Ensures that the full_name of the loop_step is unique and updates name and full_name, then appends the step to the model.

Parameters:
  • item_model (QStandardItemModel) – The item model that manages the view of the steps.

  • parent (QStandardItem) – (Default value = None) The parent of the step inside the item model

get_add_main_string()

Adds for example a call to the protocol function to the steps_add_main function of the script.

get_outer_string()

Returns the string for the protocol, where for example special plots for the step are created.

get_protocol_short_string(n_tabs=0)

Gives a short overview of the step to quickly understand what the protocol does.

Parameters:

n_tabs (int) – (Default value = 0) Number of tabs for indentation inside the overview

Returns:

short_string – The string representing the step

Return type:

str

get_protocol_string(n_tabs=1)

Returns the string that is written into the protocol-file. To make use of the time_weight and status bar, it should start with printing, that the loop_step starts.

Parameters:

n_tabs (int) – (Default value = 1) Number of tabs for indentation inside the script

Returns:

protocol_string – The string representing the step

Return type:

str

update_full_name()

Updates the full_name by combination of step_type and name

update_time_weight()

The number of calls for this step. It is used to set the scaling for the progress bar of the protocol.

update_used_devices()

Should update used_devices to include all necessary devices.

update_variables()

Should update the variables_handling, if the loopstep provides variables.

class nomad_camels.main_classes.loop_step.Loop_Step_Config(parent=None, loop_step=None)

Bases: QWidget

Parent class for the configuration Widget of the loop_step. Provides the main layout and a lineEdit for changing the loop_steps name.

active_changed
add_other_step
adjust_text_edit_size()

Adjusts the size of the textEdit_desc based on its content.

change_active(active)

Changes if the step is active, or “commented out”.

change_name(name)

Changes the name of the loop_step, then emits the name_changed signal.

Parameters:

name

name_changed
showEvent(event)

Called when the widget is shown.

staticMetaObject = PySide6.QtCore.QMetaObject("Loop_Step_Config" inherits "QWidget": Methods:   #33 type=Signal, signature=name_changed()   #34 type=Signal, signature=add_other_step(QVariantMap), parameters=QVariantMap   #35 type=Signal, signature=active_changed() )
update_step_config()

Overwrite this for specific step-configuration. It should provide the loop_step object with all necessary data.

class nomad_camels.main_classes.loop_step.Loop_Step_Container(name='', children=None, parent_step=None, step_info=None, **kwargs)

Bases: Loop_Step

Parent Class for loop_steps that should contain further steps (like e.g. a for-loop).

Parameters:

children (list of Loop_Step) – A list of the children inside this step (in the order, they are to be executed)

add_child(child, position=-1)

Add a child-step at the specified position, default is -1, meaning to append at the end.

Parameters:
  • child (Loop_Step) – The child to be added.

  • position (int) – (Default value = -1) The position, where to insert the child.

append_to_model(item_model: QStandardItemModel, parent=None)

Overwrites this function to additionally append all children to the model.

get_add_main_string()

This is overwritten to include the strings from the children

get_children_strings(n_tabs=1)

Returns the protocol_strings of all the children.

Parameters:

n_tabs (int) – (Default value = 1) Number of tabs for indentation inside the script

Returns:

child_string – The string of all children’s protocol strings.

Return type:

str

get_outer_string()

This is overwritten to include the strings from the children

get_protocol_short_string(n_tabs=0)

This is overwritten to include the strings from the children

get_protocol_string(n_tabs=1)

Returns the string that is written into the protocol-file. To make use of the time_weight and status bar, it should start with printing, that the loop_step starts. Here it is overwritten to include the strings of the children.

remove_child(child)

Removes the specified child from the children.

Parameters:

child (Loop_Step) – Child step to be removed.

update_time_weight()

The time_weight of the children is included.

update_used_devices()

Includes the used devices of the children.

update_variables()

Also updates the variables of the children.

class nomad_camels.main_classes.loop_step.Loop_Step_Name_Widget(parent=None, name='', is_active=True)

Bases: QWidget

Simple class that provides the necessary widgets for the step’s name.

active_changed
change_active()
change_name()
name_changed
staticMetaObject = PySide6.QtCore.QMetaObject("Loop_Step_Name_Widget" inherits "QWidget": Methods:   #33 type=Signal, signature=name_changed(QString), parameters=QString   #34 type=Signal, signature=active_changed(bool), parameters=bool )

nomad_camels.main_classes.manual_control module

class nomad_camels.main_classes.manual_control.Manual_Control(parent=None, title='Manual Control', control_data=None)

Bases: QWidget

Parent class for manual controls.

This class provides the core functionality of a manual control in CAMELS. The parameters device, device_list and ophyd_device may or may not be used by the child class.

name

The name of the manual control. It also determines the window title.

Type:

str

device

The device the manual control is using

Type:

str, None

device_list

A list of the devices, used. The specific implementation lies in the child classes.

Type:

list

ophyd_device

The device’s representation in ophyd.

Type:

ophyd.Device

closeEvent(a0: QCloseEvent) None

Overwritten, so that self.closing is emitted, telling the main UI window that this manual control is no longer opened.

closing
device_ready()

Called when the devices are ready to be used, i.e. when the instantiate_devices_thread is finished.

propagate_exception(exception)

Propagates an exception to the main UI window.

Parameters:

exception (Exception) – The exception to be propagated.

start_device(device_name)

Starts a device by using the device_handling.InstantiateDevicesThread class.

Parameters:

device_name (str) – The name of the device to be started.

start_multiple_devices(device_names, channels=False)

Starts multiple devices at once.

Parameters:
  • device_names (list) – A list of the names of the devices to be started, or the names of the channels, if channels is True.

  • channels (bool) – Whether ‘device_names’ are channel names or device names.

staticMetaObject = PySide6.QtCore.QMetaObject("Manual_Control" inherits "QWidget": Methods:   #33 type=Signal, signature=closing() )
class nomad_camels.main_classes.manual_control.Manual_Control_Config(parent=None, control_data=None, title='Manual Control Config', control_type='')

Bases: QDialog

accept()
closeEvent(a0: QCloseEvent) None
Parameters:

a0 (QCloseEvent :)

staticMetaObject = PySide6.QtCore.QMetaObject("Manual_Control_Config" inherits "QDialog": )

nomad_camels.main_classes.measurement_channel module

class nomad_camels.main_classes.measurement_channel.Measurement_Channel(name='', output=False, device=None, metadata=None)

Bases: object

Class that represents one single channel. Most important attributes are the name, and the device.

get_bluesky_name()
get_meta_str()
get_pv_name()

Returns the name of the corresponding EPICS PV.

nomad_camels.main_classes.measurement_channel.from_pv_name(pv_name)

Returns the corresponding Channel-name of an EPICS PV.

Parameters:

pv_name

nomad_camels.main_classes.plot_2D module

class nomad_camels.main_classes.plot_2D.LivePlot_2D(x, y, z, *, xlim=None, ylim=None, zlim=None, ax=None, xlabel='', ylabel='', zlabel='', cmap='viridis', evaluator=None, stream_name='primary', **kwargs)

Bases: LiveScatter, QObject

clear_plot()
descriptor(doc)
Parameters:

doc

event(doc)
Parameters:

doc

make_colormesh(x_shape=None, y_shape=None)
new_data
start(doc)
Parameters:

doc

staticMetaObject = PySide6.QtCore.QMetaObject("LivePlot_2D" inherits "QObject": Methods:   #4 type=Signal, signature=new_data() )
update(x, y, I)
class nomad_camels.main_classes.plot_2D.PlotWidget_2D(x_name, y_name, z_name, *, xlim=None, ylim=None, zlim=None, parent=None, namespace=None, zlabel='', ylabel='', xlabel='', title='', stream_name='primary', **kwargs)

Bases: QWidget

autoscale()
clear_plot()
closeEvent(a0)
Parameters:

a0

closing
staticMetaObject = PySide6.QtCore.QMetaObject("PlotWidget_2D" inherits "QWidget": Methods:   #33 type=Signal, signature=closing() )

nomad_camels.main_classes.plot_pyqtgraph module

This module contains the classes for the plot widgets, based on pyqtgraph.

class nomad_camels.main_classes.plot_pyqtgraph.ListDeque_skip(iterable=None, maxlen=None, skip_n_points=0)

Bases: object

append(item)
appendleft(item)
change_maxlen(maxlen)
change_skip_n_points(skip_n_points)
clear()
extend(iterable)
extendleft(iterable)
pop()
popleft()
rotate(n=1)
class nomad_camels.main_classes.plot_pyqtgraph.LiveFitPlot(livefit, viewbox, plotItem, *, num_points=100, display_values=False, **kwargs)

Bases: CallbackBase

clear_plot()
event(doc)

Passes the event to the livefit

fit_has_result()
get_ready()

Passes the command to the _livefit

start(doc)
update_plot()
class nomad_camels.main_classes.plot_pyqtgraph.LivePlot(x_name, y_names, plot_item, *, maxlen=inf, multi_stream=False, evaluator=None, stream_name='primary', y_axes=None, title='', xlabel=None, ylabel=None, epoch='run', ax2_viewbox=None, ax2_axis=None, fitPlots=None, **kwargs)

Bases: QObject, CallbackBase

Bluesky callback class for live plotting. This class is used to update the plot with new data.

Parameters:
  • x_name (str) – The name of the x-axis variable

  • y_names (List[str]) – The name(s) of the y-axis variable(s)

  • plot_item (pg.PlotItem) – The plot item to plot the data on

  • maxlen ([int, np.inf], (default: np.inf)) – The maximum number of data points to show

  • multi_stream (bool, (default: False)) – Whether to use multiple streams. If True, all streams including the stream_name are used.

  • evaluator (Evaluator) – The evaluator object used to evaluate expressions.

  • stream_name (str, (default: 'primary')) – The name of the bluesky stream to use for the plot.

  • y_axes (Dict[str, int], (default: None)) – The y-axis to use for each y_name, the ints should be 1 or 2, if 2, the respective y-value is plotted on the right axis

  • title (str, (default: '')) – The title of the plot

  • xlabel (str, (default: '')) – The x-axis label, if empty the x_name is used

  • ylabel (str, (default: '')) – The y-axis label, if empty the first y_name is used

  • epoch ({'run', 'unix'}, (default: 'run')) – If ‘run’ t=0 is the time recorded in the RunStart document. If ‘unix’, t=0 is 1 Jan 1970 (“the UNIX epoch”).

  • ax2_viewbox (pg.ViewBox, (default: None)) – The viewbox for the second y-axis

  • ax2_axis (pg.AxisItem, (default: None)) – The axis for the second y-axis

  • fitPlots (List[LiveFitPlot], (default: [])) – The fit plots connected to the plot.

add_plot(y)
change_maxlen(maxlen)
change_skip_n_points(n)
clear_plot()
descriptor(doc)

This method is called when a new descriptor document is received. If the descriptor is relevant, (compared with self.stream_name), the uid of the descriptor is added to the list of relevant descriptors. If the descriptor is a fit descriptor, the fit stream is added to the list of fits.

Parameters:

doc (dict) – The descriptor document

event(doc)

This method is called when a new event document is received. If the descriptor of the event is not in the list of relevant descriptors, the event is ignored. Otherwise, the data is extracted from the event and added to the plot.

Parameters:

doc (dict) – The event document

new_data_signal
setup_done_signal
start(doc)

This method is called when the RunStart document is received. It sets up the plot and the fits.

Parameters:

doc (dict) – The RunStart document

staticMetaObject = PySide6.QtCore.QMetaObject("LivePlot" inherits "QObject": Methods:   #4 type=Signal, signature=new_data_signal()   #5 type=Signal, signature=setup_done_signal() )
stop(doc)
update_caches(new_x, new_y)
update_plot()
class nomad_camels.main_classes.plot_pyqtgraph.LivePlot_2D(x, y, z, plotItem, graphics_layout, *, cmap='viridis', evaluator=None, stream_name='primary', **kwargs)

Bases: QObject, CallbackBase

change_maxlen(maxlen)
clear_plot()
descriptor(doc)
event(self, event: PySide6.QtCore.QEvent) bool
make_colormesh(x_shape=None, y_shape=None)
new_data
start(doc)
staticMetaObject = PySide6.QtCore.QMetaObject("LivePlot_2D" inherits "QObject": Methods:   #4 type=Signal, signature=new_data() )
update(x, y, z)
update_scatter()
class nomad_camels.main_classes.plot_pyqtgraph.LivePlot_NoBluesky(plotItem, xlabel, ylabel, ylabel2, y_axes, ax2_viewbox=None, ax2_axis=None, labels=(), first_hidden=None)

Bases: QObject

add_data(x, ys, add=True)
change_maxlen(maxlen)
clear_plot()
new_data_signal
setup_done_signal
staticMetaObject = PySide6.QtCore.QMetaObject("LivePlot_NoBluesky" inherits "QObject": Methods:   #4 type=Signal, signature=new_data_signal()   #5 type=Signal, signature=setup_done_signal() )
update_plot()
class nomad_camels.main_classes.plot_pyqtgraph.PlotWidget(x_name, y_names=None, *, legend_keys=None, xlim=None, ylim=None, epoch='run', parent=None, namespace=None, ylabel='', xlabel='', ylabel2='', title='', stream_name='primary', fits=None, do_plot=True, multi_stream=False, y_axes=None, logX=False, logY=False, logY2=False, maxlen=inf, use_bluesky=True, labels=(), first_hidden=None, **kwargs)

Bases: QWidget

Class for creating a plot widget.

Parameters:
  • x_name (str) – The name of the x-axis variable

  • y_names (Union[str, Tuple[str]]) – The name(s) of the y-axis variable(s)

  • legend_keys (List[str]) – deprecated

  • xlim (Tuple[float, float]) – deprecated

  • ylim (Tuple[float, float]) – deprecated

  • epoch ({'run', 'unix'}) – If ‘run’ t=0 is the time recorded in the RunStart document. If ‘unix’, t=0 is 1 Jan 1970 (“the UNIX epoch”). Default is ‘run’.

  • parent (QWidget, optional) – The parent widget, by default None

  • namespace (Mapping[str, Any], optional) – The namespace to use for the Evaluator, by default None

  • ylabel (str, optional) – The y-axis label, if empty the first y_name is used, by default ‘’

  • xlabel (str, optional) – The x-axis label, if empty the x_name is used, by default ‘’

  • title (str, optional) – The title of the plot, by default ‘’

  • stream_name (str) – The name of the bluesky stream to be used for the plot. If multi_stream is True, streams including this name are used. Default is ‘primary’

  • fits (List[Dict[str, Union[str, bool, List[str], Tuple[float, float], Dict[str, Union[str, float]]]]], optional) – The fits for the plot, by default None

  • do_plot (bool) – deprecated

  • multi_stream (bool, optional) – Whether to use multiple streams, see stream name, by default False

  • y_axes (Dict[str, int], optional) – The y-axis to use for each y_name, the ints should be 1 or 2, if 2, the respective y-value is plotted on the right axis, by default None

  • logX (bool) – Whether to use a logarithmic x-axis, by default False

  • logY (bool) – Whether to use a logarithmic y-axis, by default False

  • logY2 (bool) – Whether to use a logarithmic y-axis for the right axis, by default False

  • maxlen (int) – The maximum number of data points to show, by default np.inf

  • use_bluesky (bool)

  • **kwargs (Any, optional) – Additional keyword arguments to pass to MultiLivePlot

auto_range()

Also call the auto range for the second y-axis if it exists.

change_maxlen()

Changes the maximum number of data points to show in the plot. Reads the value from the line edit and sets it as the new maximum length.

change_skip_n_points()
clear_plot()

Clears the plot and the fits.

closeEvent(event)

Emits the closing signal when the widget is closed.

closing
make_toolbar()

Creates the toolbar for the plot widget. This toolbar is based on the context menu of the plot. The View All is connected with auto_range.

reopened
show_again()
show_options()

Shows or hides the plot options. If the options are shown, the button text is changed to “Hide Options”, otherwise it is changed to “Show Options”.

staticMetaObject = PySide6.QtCore.QMetaObject("PlotWidget" inherits "QWidget": Methods:   #33 type=Signal, signature=closing()   #34 type=Signal, signature=reopened() )
class nomad_camels.main_classes.plot_pyqtgraph.PlotWidget_2D(x_name, y_name, z_name, parent=None, namespace=None, xlabel='', ylabel='', zlabel='', title='', maxlen=inf, stream_name='primary', **kwargs)

Bases: QWidget

change_maxlen()

Changes the maximum number of data points to show in the plot. Reads the value from the line edit and sets it as the new maximum length.

clear_plot()
closeEvent(self, event: PySide6.QtGui.QCloseEvent) None
closing
make_toolbar()
reopened
show_again()
staticMetaObject = PySide6.QtCore.QMetaObject("PlotWidget_2D" inherits "QWidget": Methods:   #33 type=Signal, signature=closing()   #34 type=Signal, signature=reopened() )
class nomad_camels.main_classes.plot_pyqtgraph.Plot_Options(parent=None, livePlot=None)

Bases: Ui_Plot_Options, QWidget

Class for the plot options widget. This widget is used to change the appearance of the plot, such as the color, linestyle, marker, and log-scale of the axes.

Parameters:
  • parent (QWidget, optional) – The parent widget, by default None

  • livePlot (LivePlot) – The LivePlot object connected to the plot widget, by default None

change_color(row, just_update=False)

Changes the color of a PlotDataItem connected to the specified row.

Parameters:
  • row (int) – The row of the item in the table widget

  • just_update (bool, (default: False)) – If True, only updates the color of the item to the one already set. If False, opens a color dialog to choose a new color.

change_symbol(symbol, row)

Changes the symbol of a PlotDataItem connected to the specified row.

Parameters:
  • symbol (str) – The new symbol

  • row (int) – The row of the item in the table widget

set_log()

Sets the log-scale of the axes according to the checkboxes.

staticMetaObject = PySide6.QtCore.QMetaObject("Plot_Options" inherits "QWidget": )
update_plot_items()

Updates the items in the table widget to match the items in the plot.

class nomad_camels.main_classes.plot_pyqtgraph.Teleporter

Bases: QObject

name_doc_escape
staticMetaObject = PySide6.QtCore.QMetaObject("Teleporter" inherits "QObject": Methods:   #4 type=Signal, signature=name_doc_escape(QString,QVariantMap,PyObject), parameters=QString, QVariantMap, PyObject )
nomad_camels.main_classes.plot_pyqtgraph.activate_dark_mode()

Changes the plot-style to dark-mode, by changing the config options of pyqtgraph.

nomad_camels.main_classes.plot_pyqtgraph.handle_teleport(name, doc, obj)

nomad_camels.main_classes.plot_widget module

class nomad_camels.main_classes.plot_widget.Fit_Ophyd(prefix='', *, name, kind=None, read_attrs=None, configuration_attrs=None, parent=None, params=None, parent_fit=None, **kwargs)

Bases: Device

A device that extends the functionality of the Device class from Ophyd. It is included in the LiveFit_Eva class.

a

A descriptor representing a device component (or signal)

Unrecognized keyword arguments will be passed directly to the component class initializer.

Parameters:
  • cls (class) –

    Class of signal to create. The required signature of cls.__init__ is (if suffix is given):

    def __init__(self, pv_name, parent=None, **kwargs):
    

    or (if suffix is None)

    def __init__(self, parent=None, **kwargs):
    

    The class may have a wait_for_connection() which is called during the component instance creation.

  • suffix (str, optional) – The PV suffix, which gets appended onto parent.prefix to generate the final PV that the instance component will bind to. Also see add_prefix

  • lazy (bool, optional) – Lazily instantiate the signal. If False, the signal will be instantiated upon component instantiation. Defaults to component.lazy_default.

  • trigger_value (any, optional) – Mark as a signal to be set on trigger. The value is sent to the signal at trigger time.

  • add_prefix (sequence, optional) – Keys in the kwargs to prefix with the Device PV prefix during creation of the component instance. Defaults to ('suffix', 'write_pv', )

  • doc (str, optional) – string to attach to component DvcClass.component.__doc__

b

A descriptor representing a device component (or signal)

Unrecognized keyword arguments will be passed directly to the component class initializer.

Parameters:
  • cls (class) –

    Class of signal to create. The required signature of cls.__init__ is (if suffix is given):

    def __init__(self, pv_name, parent=None, **kwargs):
    

    or (if suffix is None)

    def __init__(self, parent=None, **kwargs):
    

    The class may have a wait_for_connection() which is called during the component instance creation.

  • suffix (str, optional) – The PV suffix, which gets appended onto parent.prefix to generate the final PV that the instance component will bind to. Also see add_prefix

  • lazy (bool, optional) – Lazily instantiate the signal. If False, the signal will be instantiated upon component instantiation. Defaults to component.lazy_default.

  • trigger_value (any, optional) – Mark as a signal to be set on trigger. The value is sent to the signal at trigger time.

  • add_prefix (sequence, optional) – Keys in the kwargs to prefix with the Device PV prefix during creation of the component instance. Defaults to ('suffix', 'write_pv', )

  • doc (str, optional) – string to attach to component DvcClass.component.__doc__

c

A descriptor representing a device component (or signal)

Unrecognized keyword arguments will be passed directly to the component class initializer.

Parameters:
  • cls (class) –

    Class of signal to create. The required signature of cls.__init__ is (if suffix is given):

    def __init__(self, pv_name, parent=None, **kwargs):
    

    or (if suffix is None)

    def __init__(self, parent=None, **kwargs):
    

    The class may have a wait_for_connection() which is called during the component instance creation.

  • suffix (str, optional) – The PV suffix, which gets appended onto parent.prefix to generate the final PV that the instance component will bind to. Also see add_prefix

  • lazy (bool, optional) – Lazily instantiate the signal. If False, the signal will be instantiated upon component instantiation. Defaults to component.lazy_default.

  • trigger_value (any, optional) – Mark as a signal to be set on trigger. The value is sent to the signal at trigger time.

  • add_prefix (sequence, optional) – Keys in the kwargs to prefix with the Device PV prefix during creation of the component instance. Defaults to ('suffix', 'write_pv', )

  • doc (str, optional) – string to attach to component DvcClass.component.__doc__

component_names = ('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 'covar', 'read_ready')
covar

A descriptor representing a device component (or signal)

Unrecognized keyword arguments will be passed directly to the component class initializer.

Parameters:
  • cls (class) –

    Class of signal to create. The required signature of cls.__init__ is (if suffix is given):

    def __init__(self, pv_name, parent=None, **kwargs):
    

    or (if suffix is None)

    def __init__(self, parent=None, **kwargs):
    

    The class may have a wait_for_connection() which is called during the component instance creation.

  • suffix (str, optional) – The PV suffix, which gets appended onto parent.prefix to generate the final PV that the instance component will bind to. Also see add_prefix

  • lazy (bool, optional) – Lazily instantiate the signal. If False, the signal will be instantiated upon component instantiation. Defaults to component.lazy_default.

  • trigger_value (any, optional) – Mark as a signal to be set on trigger. The value is sent to the signal at trigger time.

  • add_prefix (sequence, optional) – Keys in the kwargs to prefix with the Device PV prefix during creation of the component instance. Defaults to ('suffix', 'write_pv', )

  • doc (str, optional) – string to attach to component DvcClass.component.__doc__

d

A descriptor representing a device component (or signal)

Unrecognized keyword arguments will be passed directly to the component class initializer.

Parameters:
  • cls (class) –

    Class of signal to create. The required signature of cls.__init__ is (if suffix is given):

    def __init__(self, pv_name, parent=None, **kwargs):
    

    or (if suffix is None)

    def __init__(self, parent=None, **kwargs):
    

    The class may have a wait_for_connection() which is called during the component instance creation.

  • suffix (str, optional) – The PV suffix, which gets appended onto parent.prefix to generate the final PV that the instance component will bind to. Also see add_prefix

  • lazy (bool, optional) – Lazily instantiate the signal. If False, the signal will be instantiated upon component instantiation. Defaults to component.lazy_default.

  • trigger_value (any, optional) – Mark as a signal to be set on trigger. The value is sent to the signal at trigger time.

  • add_prefix (sequence, optional) – Keys in the kwargs to prefix with the Device PV prefix during creation of the component instance. Defaults to ('suffix', 'write_pv', )

  • doc (str, optional) – string to attach to component DvcClass.component.__doc__

e

A descriptor representing a device component (or signal)

Unrecognized keyword arguments will be passed directly to the component class initializer.

Parameters:
  • cls (class) –

    Class of signal to create. The required signature of cls.__init__ is (if suffix is given):

    def __init__(self, pv_name, parent=None, **kwargs):
    

    or (if suffix is None)

    def __init__(self, parent=None, **kwargs):
    

    The class may have a wait_for_connection() which is called during the component instance creation.

  • suffix (str, optional) – The PV suffix, which gets appended onto parent.prefix to generate the final PV that the instance component will bind to. Also see add_prefix

  • lazy (bool, optional) – Lazily instantiate the signal. If False, the signal will be instantiated upon component instantiation. Defaults to component.lazy_default.

  • trigger_value (any, optional) – Mark as a signal to be set on trigger. The value is sent to the signal at trigger time.

  • add_prefix (sequence, optional) – Keys in the kwargs to prefix with the Device PV prefix during creation of the component instance. Defaults to ('suffix', 'write_pv', )

  • doc (str, optional) – string to attach to component DvcClass.component.__doc__

f

A descriptor representing a device component (or signal)

Unrecognized keyword arguments will be passed directly to the component class initializer.

Parameters:
  • cls (class) –

    Class of signal to create. The required signature of cls.__init__ is (if suffix is given):

    def __init__(self, pv_name, parent=None, **kwargs):
    

    or (if suffix is None)

    def __init__(self, parent=None, **kwargs):
    

    The class may have a wait_for_connection() which is called during the component instance creation.

  • suffix (str, optional) – The PV suffix, which gets appended onto parent.prefix to generate the final PV that the instance component will bind to. Also see add_prefix

  • lazy (bool, optional) – Lazily instantiate the signal. If False, the signal will be instantiated upon component instantiation. Defaults to component.lazy_default.

  • trigger_value (any, optional) – Mark as a signal to be set on trigger. The value is sent to the signal at trigger time.

  • add_prefix (sequence, optional) – Keys in the kwargs to prefix with the Device PV prefix during creation of the component instance. Defaults to ('suffix', 'write_pv', )

  • doc (str, optional) – string to attach to component DvcClass.component.__doc__

g

A descriptor representing a device component (or signal)

Unrecognized keyword arguments will be passed directly to the component class initializer.

Parameters:
  • cls (class) –

    Class of signal to create. The required signature of cls.__init__ is (if suffix is given):

    def __init__(self, pv_name, parent=None, **kwargs):
    

    or (if suffix is None)

    def __init__(self, parent=None, **kwargs):
    

    The class may have a wait_for_connection() which is called during the component instance creation.

  • suffix (str, optional) – The PV suffix, which gets appended onto parent.prefix to generate the final PV that the instance component will bind to. Also see add_prefix

  • lazy (bool, optional) – Lazily instantiate the signal. If False, the signal will be instantiated upon component instantiation. Defaults to component.lazy_default.

  • trigger_value (any, optional) – Mark as a signal to be set on trigger. The value is sent to the signal at trigger time.

  • add_prefix (sequence, optional) – Keys in the kwargs to prefix with the Device PV prefix during creation of the component instance. Defaults to ('suffix', 'write_pv', )

  • doc (str, optional) – string to attach to component DvcClass.component.__doc__

h

A descriptor representing a device component (or signal)

Unrecognized keyword arguments will be passed directly to the component class initializer.

Parameters:
  • cls (class) –

    Class of signal to create. The required signature of cls.__init__ is (if suffix is given):

    def __init__(self, pv_name, parent=None, **kwargs):
    

    or (if suffix is None)

    def __init__(self, parent=None, **kwargs):
    

    The class may have a wait_for_connection() which is called during the component instance creation.

  • suffix (str, optional) – The PV suffix, which gets appended onto parent.prefix to generate the final PV that the instance component will bind to. Also see add_prefix

  • lazy (bool, optional) – Lazily instantiate the signal. If False, the signal will be instantiated upon component instantiation. Defaults to component.lazy_default.

  • trigger_value (any, optional) – Mark as a signal to be set on trigger. The value is sent to the signal at trigger time.

  • add_prefix (sequence, optional) – Keys in the kwargs to prefix with the Device PV prefix during creation of the component instance. Defaults to ('suffix', 'write_pv', )

  • doc (str, optional) – string to attach to component DvcClass.component.__doc__

i

A descriptor representing a device component (or signal)

Unrecognized keyword arguments will be passed directly to the component class initializer.

Parameters:
  • cls (class) –

    Class of signal to create. The required signature of cls.__init__ is (if suffix is given):

    def __init__(self, pv_name, parent=None, **kwargs):
    

    or (if suffix is None)

    def __init__(self, parent=None, **kwargs):
    

    The class may have a wait_for_connection() which is called during the component instance creation.

  • suffix (str, optional) – The PV suffix, which gets appended onto parent.prefix to generate the final PV that the instance component will bind to. Also see add_prefix

  • lazy (bool, optional) – Lazily instantiate the signal. If False, the signal will be instantiated upon component instantiation. Defaults to component.lazy_default.

  • trigger_value (any, optional) – Mark as a signal to be set on trigger. The value is sent to the signal at trigger time.

  • add_prefix (sequence, optional) – Keys in the kwargs to prefix with the Device PV prefix during creation of the component instance. Defaults to ('suffix', 'write_pv', )

  • doc (str, optional) – string to attach to component DvcClass.component.__doc__

j

A descriptor representing a device component (or signal)

Unrecognized keyword arguments will be passed directly to the component class initializer.

Parameters:
  • cls (class) –

    Class of signal to create. The required signature of cls.__init__ is (if suffix is given):

    def __init__(self, pv_name, parent=None, **kwargs):
    

    or (if suffix is None)

    def __init__(self, parent=None, **kwargs):
    

    The class may have a wait_for_connection() which is called during the component instance creation.

  • suffix (str, optional) – The PV suffix, which gets appended onto parent.prefix to generate the final PV that the instance component will bind to. Also see add_prefix

  • lazy (bool, optional) – Lazily instantiate the signal. If False, the signal will be instantiated upon component instantiation. Defaults to component.lazy_default.

  • trigger_value (any, optional) – Mark as a signal to be set on trigger. The value is sent to the signal at trigger time.

  • add_prefix (sequence, optional) – Keys in the kwargs to prefix with the Device PV prefix during creation of the component instance. Defaults to ('suffix', 'write_pv', )

  • doc (str, optional) – string to attach to component DvcClass.component.__doc__

k

A descriptor representing a device component (or signal)

Unrecognized keyword arguments will be passed directly to the component class initializer.

Parameters:
  • cls (class) –

    Class of signal to create. The required signature of cls.__init__ is (if suffix is given):

    def __init__(self, pv_name, parent=None, **kwargs):
    

    or (if suffix is None)

    def __init__(self, parent=None, **kwargs):
    

    The class may have a wait_for_connection() which is called during the component instance creation.

  • suffix (str, optional) – The PV suffix, which gets appended onto parent.prefix to generate the final PV that the instance component will bind to. Also see add_prefix

  • lazy (bool, optional) – Lazily instantiate the signal. If False, the signal will be instantiated upon component instantiation. Defaults to component.lazy_default.

  • trigger_value (any, optional) – Mark as a signal to be set on trigger. The value is sent to the signal at trigger time.

  • add_prefix (sequence, optional) – Keys in the kwargs to prefix with the Device PV prefix during creation of the component instance. Defaults to ('suffix', 'write_pv', )

  • doc (str, optional) – string to attach to component DvcClass.component.__doc__

l

A descriptor representing a device component (or signal)

Unrecognized keyword arguments will be passed directly to the component class initializer.

Parameters:
  • cls (class) –

    Class of signal to create. The required signature of cls.__init__ is (if suffix is given):

    def __init__(self, pv_name, parent=None, **kwargs):
    

    or (if suffix is None)

    def __init__(self, parent=None, **kwargs):
    

    The class may have a wait_for_connection() which is called during the component instance creation.

  • suffix (str, optional) – The PV suffix, which gets appended onto parent.prefix to generate the final PV that the instance component will bind to. Also see add_prefix

  • lazy (bool, optional) – Lazily instantiate the signal. If False, the signal will be instantiated upon component instantiation. Defaults to component.lazy_default.

  • trigger_value (any, optional) – Mark as a signal to be set on trigger. The value is sent to the signal at trigger time.

  • add_prefix (sequence, optional) – Keys in the kwargs to prefix with the Device PV prefix during creation of the component instance. Defaults to ('suffix', 'write_pv', )

  • doc (str, optional) – string to attach to component DvcClass.component.__doc__

m

A descriptor representing a device component (or signal)

Unrecognized keyword arguments will be passed directly to the component class initializer.

Parameters:
  • cls (class) –

    Class of signal to create. The required signature of cls.__init__ is (if suffix is given):

    def __init__(self, pv_name, parent=None, **kwargs):
    

    or (if suffix is None)

    def __init__(self, parent=None, **kwargs):
    

    The class may have a wait_for_connection() which is called during the component instance creation.

  • suffix (str, optional) – The PV suffix, which gets appended onto parent.prefix to generate the final PV that the instance component will bind to. Also see add_prefix

  • lazy (bool, optional) – Lazily instantiate the signal. If False, the signal will be instantiated upon component instantiation. Defaults to component.lazy_default.

  • trigger_value (any, optional) – Mark as a signal to be set on trigger. The value is sent to the signal at trigger time.

  • add_prefix (sequence, optional) – Keys in the kwargs to prefix with the Device PV prefix during creation of the component instance. Defaults to ('suffix', 'write_pv', )

  • doc (str, optional) – string to attach to component DvcClass.component.__doc__

n

A descriptor representing a device component (or signal)

Unrecognized keyword arguments will be passed directly to the component class initializer.

Parameters:
  • cls (class) –

    Class of signal to create. The required signature of cls.__init__ is (if suffix is given):

    def __init__(self, pv_name, parent=None, **kwargs):
    

    or (if suffix is None)

    def __init__(self, parent=None, **kwargs):
    

    The class may have a wait_for_connection() which is called during the component instance creation.

  • suffix (str, optional) – The PV suffix, which gets appended onto parent.prefix to generate the final PV that the instance component will bind to. Also see add_prefix

  • lazy (bool, optional) – Lazily instantiate the signal. If False, the signal will be instantiated upon component instantiation. Defaults to component.lazy_default.

  • trigger_value (any, optional) – Mark as a signal to be set on trigger. The value is sent to the signal at trigger time.

  • add_prefix (sequence, optional) – Keys in the kwargs to prefix with the Device PV prefix during creation of the component instance. Defaults to ('suffix', 'write_pv', )

  • doc (str, optional) – string to attach to component DvcClass.component.__doc__

o

A descriptor representing a device component (or signal)

Unrecognized keyword arguments will be passed directly to the component class initializer.

Parameters:
  • cls (class) –

    Class of signal to create. The required signature of cls.__init__ is (if suffix is given):

    def __init__(self, pv_name, parent=None, **kwargs):
    

    or (if suffix is None)

    def __init__(self, parent=None, **kwargs):
    

    The class may have a wait_for_connection() which is called during the component instance creation.

  • suffix (str, optional) – The PV suffix, which gets appended onto parent.prefix to generate the final PV that the instance component will bind to. Also see add_prefix

  • lazy (bool, optional) – Lazily instantiate the signal. If False, the signal will be instantiated upon component instantiation. Defaults to component.lazy_default.

  • trigger_value (any, optional) – Mark as a signal to be set on trigger. The value is sent to the signal at trigger time.

  • add_prefix (sequence, optional) – Keys in the kwargs to prefix with the Device PV prefix during creation of the component instance. Defaults to ('suffix', 'write_pv', )

  • doc (str, optional) – string to attach to component DvcClass.component.__doc__

p

A descriptor representing a device component (or signal)

Unrecognized keyword arguments will be passed directly to the component class initializer.

Parameters:
  • cls (class) –

    Class of signal to create. The required signature of cls.__init__ is (if suffix is given):

    def __init__(self, pv_name, parent=None, **kwargs):
    

    or (if suffix is None)

    def __init__(self, parent=None, **kwargs):
    

    The class may have a wait_for_connection() which is called during the component instance creation.

  • suffix (str, optional) – The PV suffix, which gets appended onto parent.prefix to generate the final PV that the instance component will bind to. Also see add_prefix

  • lazy (bool, optional) – Lazily instantiate the signal. If False, the signal will be instantiated upon component instantiation. Defaults to component.lazy_default.

  • trigger_value (any, optional) – Mark as a signal to be set on trigger. The value is sent to the signal at trigger time.

  • add_prefix (sequence, optional) – Keys in the kwargs to prefix with the Device PV prefix during creation of the component instance. Defaults to ('suffix', 'write_pv', )

  • doc (str, optional) – string to attach to component DvcClass.component.__doc__

q

A descriptor representing a device component (or signal)

Unrecognized keyword arguments will be passed directly to the component class initializer.

Parameters:
  • cls (class) –

    Class of signal to create. The required signature of cls.__init__ is (if suffix is given):

    def __init__(self, pv_name, parent=None, **kwargs):
    

    or (if suffix is None)

    def __init__(self, parent=None, **kwargs):
    

    The class may have a wait_for_connection() which is called during the component instance creation.

  • suffix (str, optional) – The PV suffix, which gets appended onto parent.prefix to generate the final PV that the instance component will bind to. Also see add_prefix

  • lazy (bool, optional) – Lazily instantiate the signal. If False, the signal will be instantiated upon component instantiation. Defaults to component.lazy_default.

  • trigger_value (any, optional) – Mark as a signal to be set on trigger. The value is sent to the signal at trigger time.

  • add_prefix (sequence, optional) – Keys in the kwargs to prefix with the Device PV prefix during creation of the component instance. Defaults to ('suffix', 'write_pv', )

  • doc (str, optional) – string to attach to component DvcClass.component.__doc__

r

A descriptor representing a device component (or signal)

Unrecognized keyword arguments will be passed directly to the component class initializer.

Parameters:
  • cls (class) –

    Class of signal to create. The required signature of cls.__init__ is (if suffix is given):

    def __init__(self, pv_name, parent=None, **kwargs):
    

    or (if suffix is None)

    def __init__(self, parent=None, **kwargs):
    

    The class may have a wait_for_connection() which is called during the component instance creation.

  • suffix (str, optional) – The PV suffix, which gets appended onto parent.prefix to generate the final PV that the instance component will bind to. Also see add_prefix

  • lazy (bool, optional) – Lazily instantiate the signal. If False, the signal will be instantiated upon component instantiation. Defaults to component.lazy_default.

  • trigger_value (any, optional) – Mark as a signal to be set on trigger. The value is sent to the signal at trigger time.

  • add_prefix (sequence, optional) – Keys in the kwargs to prefix with the Device PV prefix during creation of the component instance. Defaults to ('suffix', 'write_pv', )

  • doc (str, optional) – string to attach to component DvcClass.component.__doc__

read()

Overwrites the read method from Device. Stops reading, as soon as the number of parameters is reached.

read_ready

A descriptor representing a device component (or signal)

Unrecognized keyword arguments will be passed directly to the component class initializer.

Parameters:
  • cls (class) –

    Class of signal to create. The required signature of cls.__init__ is (if suffix is given):

    def __init__(self, pv_name, parent=None, **kwargs):
    

    or (if suffix is None)

    def __init__(self, parent=None, **kwargs):
    

    The class may have a wait_for_connection() which is called during the component instance creation.

  • suffix (str, optional) – The PV suffix, which gets appended onto parent.prefix to generate the final PV that the instance component will bind to. Also see add_prefix

  • lazy (bool, optional) – Lazily instantiate the signal. If False, the signal will be instantiated upon component instantiation. Defaults to component.lazy_default.

  • trigger_value (any, optional) – Mark as a signal to be set on trigger. The value is sent to the signal at trigger time.

  • add_prefix (sequence, optional) – Keys in the kwargs to prefix with the Device PV prefix during creation of the component instance. Defaults to ('suffix', 'write_pv', )

  • doc (str, optional) – string to attach to component DvcClass.component.__doc__

subscriptions: ClassVar[FrozenSet[str]] = frozenset({'acq_done'})
update_data(result, timestamp)

Update the data of all the components. For each fit parameter, the corresponding component is updated.

Parameters:
  • result (lmfit.model.ModelResult) – The result of the fit.

  • timestamp (float) – The timestamp of the fit. Used to update the timestamp metadata of the components.

class nomad_camels.main_classes.plot_widget.Fit_Plot_No_Init_Guess(livefit, *, num_points=100, legend_keys=None, xlim=None, ylim=None, ax=None, ax_is2=False, display_values=False, **kwargs)

Bases: LiveFitPlot

A subclass of LiveFitPlot that doesn’t plot the initial guess for the fit.

clear_plot()

Empties the data of the current plot line.

event(doc)

Passes the event to the livefit

Parameters:

doc

fit_has_result()

If the livefit has a result, a resulting line is calculated, and the plot is updated. Called by LiveFit_Eva.update_fit().

get_ready()

Passes the command to the _livefit

start(doc)

Overwrites the start method of LiveFitPlot to not display the init_guess_line.

Parameters:

doc

update_plot()

Sets the current x and y data, then calls the parent_plot to update.

class nomad_camels.main_classes.plot_widget.Fit_Signal(name, value=0.0, timestamp=None, parent=None, labels=None, kind='hinted', tolerance=None, rtolerance=None, metadata=None, cl=None, attr_name='')

Bases: SignalRO

A subclass of ophyd.SignalRO for storing fit results

This class is a subclass of ophyd.SignalRO, which is used to store the results of a fit. It has an additional method update_data that updates the readback value and timestamp metadata of the signal.

subscriptions: ClassVar[FrozenSet[str]] = frozenset({'meta', 'value'})
update_data(result, timestamp)

Updates the readback value and timestamp metadata of the signal. Called by the parent’s update_data function.

Parameters:
  • result

  • timestamp

class nomad_camels.main_classes.plot_widget.LiveFit_Eva(model, y, independent_vars, evaluator, init_guess=None, additional_data=None, *, name='', params=None, stream_name='primary')

Bases: LiveFit

LiveFit_Eva is a subclass of LiveFit that adds the ability to evaluate the independent variables before fitting. It uses the given evaluator for that.

event(doc)

Handles new events received by the fit. Evaluates the independent variables using the evaluator and updates the fit with the new data.

Parameters:

doc

get_ready()

This function is used to set the ready_to_read attribute to True.

update_fit()

Update the fit by evaluating the model with the current data.

This method updates the fit by evaluating the current data using the model defined by the user. The method uses the params attribute, if available, to pass on the parameters to the fitting method. If the fit is not stale (i.e. no new data has arrived since the last update) the method will return without doing anything. Otherwise, the method updates the result attribute with the fit result and the ophyd_fit with the updated data. It also calls the fit_has_result method on the parent plot. Before doing anything, it will wait for ready_to_read to be True.

class nomad_camels.main_classes.plot_widget.MPLwidget

Bases: FigureCanvasQTAgg

Custom QT widget for displaying matplotlib plots.

This class inherits from matplotlib’s FigureCanvasQTAgg to create a custom QT widget for displaying matplotlib plots. In the init method, a new figure and axes are created using matplotlib.pyplot.subplots(). The grid is then displayed on the axes.

staticMetaObject = PySide6.QtCore.QMetaObject("MPLwidget" inherits "FigureCanvasQTAgg": )
class nomad_camels.main_classes.plot_widget.MultiLivePlot(ys=(), x=None, *, legend_keys=None, xlim=None, ylim=None, ax=None, epoch='run', xlabel='', ylabel='', evaluator=None, title='', stream_name='primary', do_plot=True, fitPlots=None, multi_stream=False, y_axes=None, ax2=None, ylabel2='', **kwargs)

Bases: LivePlot, QObject

change_maxlen(maxlen)
Parameters:

maxlen

clear_plot()
descriptor(doc)
Parameters:

doc

event(doc)

Unpack data from the event and call self.update_plot().

Parameters:

doc

new_data
setup_done
start(doc)
Parameters:

doc

staticMetaObject = PySide6.QtCore.QMetaObject("MultiLivePlot" inherits "QObject": Methods:   #4 type=Signal, signature=new_data()   #5 type=Signal, signature=setup_done() )
stop(doc)
Parameters:

doc

update_caches(x, ys)
Parameters:
  • x

  • ys

update_plot()
class nomad_camels.main_classes.plot_widget.MultiPlot_NoBluesky(ax, xlabel='', ylabel='', ylabel2='', y_axes=None, labels=(), first_hidden=None, show_plot=True)

Bases: QObject

add_data(x, ys, add=True)
Parameters:
  • x

  • ys

  • add – (Default value = True)

change_maxlen(maxlen)
Parameters:

maxlen

clear_plot()
new_data
setup_done
staticMetaObject = PySide6.QtCore.QMetaObject("MultiPlot_NoBluesky" inherits "QObject": Methods:   #4 type=Signal, signature=new_data()   #5 type=Signal, signature=setup_done() )
update_plot()
class nomad_camels.main_classes.plot_widget.PlotWidget(x_name, y_names, *, legend_keys=None, xlim=None, ylim=None, epoch='run', parent=None, namespace=None, ylabel='', xlabel='', title='', stream_name='primary', fits=None, do_plot=True, multi_stream=False, y_axes=None, logX=False, logY=False, logY2=False, maxlen=inf, **kwargs)

Bases: QWidget

Class for creating a plot widget.

Parameters:
  • x_name (str) – The name of the x-axis variable

  • y_names (Union[str, Tuple[str]]) – The name(s) of the y-axis variable(s)

  • legend_keys (List[str], optional) – The keys for the legend, by default None

  • xlim (Tuple[float, float], optional) – passed to Axes.set_xlim

  • ylim (Tuple[float, float], optional) – passed to Axes.set_ylim

  • epoch ({'run', 'unix'}, optional) – If ‘run’ t=0 is the time recorded in the RunStart document. If ‘unix’, t=0 is 1 Jan 1970 (“the UNIX epoch”). Default is ‘run’.

  • parent (QWidget, optional) – The parent widget, by default None

  • namespace (Optional[Mapping[str, Any]]) – The namespace to use for the Evaluator, by default None

  • ylabel (str, optional) – The y-axis label, by default ‘’

  • xlabel (str, optional) – The x-axis label, by default ‘’

  • title (str, optional) – The title of the plot, by default ‘’

  • stream_name (str, optional) – The name of the stream to be used for the plot. Default is ‘primary’

  • fits (List[Dict[str, Union[str, bool, List[str], Tuple[float, float], Dict[str, Union[str, float]]]]], optional) – The fits for the plot, by default None

  • do_plot (bool, optional) – Whether to show the plot, by default True

  • **kwargs (Any, optional) – Additional keyword arguments to pass to MultiLivePlot

ax

The matplotlib axes of the plot

Type:

Axes

x_name

The name of the x-axis variable

Type:

str

y_names

The name(s) of the y-axis variable(s)

Type:

List[str]

stream_name

The name of the stream

Type:

str

fits

The fits for the plot as they come from the fit/plot definer.

Type:

List[Dict[str, Union[str, bool, List[str], Tuple[float, float], Dict[str, Union[str, float]]]]]

liveFits

The live fit objects for the plot, handled by the liveFitPlots

Type:

List[LiveFit_Eva]

liveFitPlots

The live fit plots for the plot, used to display the fits

Type:

List[Fit_Plot_No_Init_Guess]

livePlot

The live plot, using the canvas etc.

Type:

MultiLivePlot

toolbar

The toolbar for the plot

Type:

NavigationToolbar2QT

pushButton_show_options

The push button to show the plot options

Type:

QPushButton

pushButton_autoscale

The push button to autoscale the plot

Type:

QPushButton

plot_options

The options widget for the plot

Type:

Plot_Options

options_open

Whether the options are currently open

Type:

bool

autoscale()

Autoscale the plot’s x and y axis.

change_maxlen()
clear_plot()

Clear the plot by removing the data from the plot and clearing all fit plots.

closeEvent(a0)

Overwrite the closeEvent to emit the closing signal before closing the window.

Parameters:

a0

closing
show_options()

Show or hide the options for the plot. Toggles between ‘Show Options’ and ‘Hide Options’ on the button press.

staticMetaObject = PySide6.QtCore.QMetaObject("PlotWidget" inherits "QWidget": Methods:   #33 type=Signal, signature=closing() )
class nomad_camels.main_classes.plot_widget.PlotWidget_NoBluesky(xlabel='', ylabel='', parent=None, title='', ylabel2='', y_axes=None, labels=(), first_hidden=None, show_plot=True, maxlen=inf)

Bases: QWidget

autoscale()
change_maxlen()
clear_plot()

Clear the plot by removing the data from the plot and clearing all fit plots.

show_options()
staticMetaObject = PySide6.QtCore.QMetaObject("PlotWidget_NoBluesky" inherits "QWidget": )
class nomad_camels.main_classes.plot_widget.Plot_Options(parent=None, ax=None, livePlot=None, ax2=None)

Bases: Ui_Plot_Options, QWidget

Widget for setting the options of a plot.

Parameters:
  • parent (QWidget, optional) – The parent widget.

  • ax (matplotlib.axes.Axes, optional) – The axes to plot on.

  • livePlot (LivePlot, optional) – The LivePlot to set the options for.

  • ax2 (matplotlib.axes.Axes, optional) – The second (y) axes to plot on.

change_color(row)
Parameters:

row

change_linestyle(row)

Changes the linestyle of the selected line in the plot.

Parameters:

row (int) – The row of the line in the table.

change_marker(row)
Parameters:

row

set_log()
setup_table(x=None, y=None)

Sets up the table with the current lines in the plot.

staticMetaObject = PySide6.QtCore.QMetaObject("Plot_Options" inherits "QWidget": )
nomad_camels.main_classes.plot_widget.activate_dark_mode()

Changes the plot-style to dark-mode.

nomad_camels.main_classes.protocol_class module

class nomad_camels.main_classes.protocol_class.General_Protocol_Settings(parent=None, protocol=<nomad_camels.main_classes.protocol_class.Measurement_Protocol object>)

Bases: Ui_Protocol_Settings, QWidget

Widget for the configuration of the general protocol settings. Here plots may be defined and variables added to the protocol.

add_variable()

Add a variable to the list, given a unique name, then updates the protocol.

adjust_text_edit_size_prot()

Adjusts the size of the textEdit_desc_protocol based on its content.

check_use_ending_steps()

If the checkBox_perform_at_end is checked, the ending_protocol_selection is enabled, otherwise disabled.

enable_disable_config()
name_change()
name_changed
remove_variable()

Removes the selected variable.

showEvent(event)

Called when the widget is shown.

staticMetaObject = PySide6.QtCore.QMetaObject("General_Protocol_Settings" inherits "QWidget": Methods:   #33 type=Signal, signature=name_changed() )
update_step_config()

Updates all the protocol settings.

update_variable_select()
class nomad_camels.main_classes.protocol_class.Measurement_Protocol(loop_steps=None, plots=None, channels=None, name='', use_nexus=True, **kwargs)

Bases: object

Class for the measurement protocols. It mainly contains loop_steps and plots.

description

A string describing the protocol.

Type:

str

export_csv

If True, the data will be exported to a csv file in the end.

Type:

bool

export_json

If True, the metadata will be exported to a json file in the end.

Type:

bool

session_name

This name is appended to the entry in the hdf5-file, or used for the filenames of csv / json to make it easier for the user to recognize their measurements

Type:

str

loop_steps

A list of the steps performed by the protocol. This list also represents the order, in which the steps should be performed. The step’s children steps are not included in this list.

Type:

list[Loop_Step]

loop_step_dict

Keys are the steps’ names with the steps being the value. The sub-steps are included here.

Type:

dict

plots

Contains the information for the protocol’s plots.

Type:

list[Plot_Info]

filename

The name of the produced datafile.

Type:

str

variables

Name-value pairs of the protocol variables

Type:

dict

loop_step_variables

Name-value pairs of the variables provided by the steps (e.g. for loop)

Type:

dict

channels

Dictionary of the channel-names and channels used inside the protocol

Type:

dict

name

The name of the protocol. This also appears in the main UI

Type:

str

use_nexus

Whether to write a NeXus-entry into the datafile as well.

Type:

bool

add_loop_step(loop_step, position=-1, parent_step_name=None, model=None)

Adds a loop_step to the protocol (or the parent_step)at the specified position. Also appends the loop_step to the given model. The loop_step is added to the list as well as the dictionary.

Parameters:
  • loop_step (Loop_Step) – The step that should be added

  • position (int) – (Default value = -1) Where in the list to add the step

  • parent_step_name (str, None) – (Default value = None) If the step is not in the outermost layer, its parent’s name. Then position will not be for the protocol’s list, but the parent’s children-list.

  • model (QAbstractItemModel, None) – (Default value = None) The item model that is used to display the steps.

add_loop_step_rec(loop_step, model=None, parent_step_name=None, position=-1)

Recursively adds the loop_step and all its children to the protocol. Steps are added to the list if they have no parent, otherwise to the parent. All are added to the dictionary.

Parameters:
  • loop_step (Loop_Step) – The step that should be added

  • model (QAbstractItemModel, None) – (Default value = None) The item model that is used to display the steps.

  • parent_step_name (str) – (Default value = None) If the step is not in the outermost layer, its parent’s name. Then position will not be for the protocol’s list, but the parent’s children-list.

  • position (int) – (Default value = -1) Where in the list to add the step

get_add_main_string()

Gets all the steps that should be executed in the protocol’s main function.

get_live_interaction_string()

Returns the string for the live interaction of the protocol.

get_outer_string()

Strings outside of all other functions of the script, e.g. more functions to create step-specific plots.

get_plan_string()

Get the string for the protocol-plan, including the loopsteps.

get_short_string()

Goes through all steps and creates an overview of what is happening in the protocol.

get_total_steps()

Returns the total number of steps (including repetitions for loops)

get_used_devices()

Get a list of all devices needed by any loopstep.

load_loop_steps(loop_steps, model=None)

Takes a list of loop_steps, creates them (with the input data of each step) and adds them to the specified model.

Parameters:
  • loop_steps (list) – A list containing all the information (as dictionary) for creating the single steps.

  • model (QAbstractItemModel, None) – (Default value = None) The item model that is used to display the steps.

make_step(step_info)

Creates the step specified with step_info (including the children), ‘step_type’ gives which subclass of Loop_Step shall be created.

Parameters:

step_info (dict) – This dictionary should hold all information needed to create the step. Specifically there should be “step_type” to decide on the class of step and “full_name” to give the step its name.

Returns:

st – The created step

Return type:

Loop_Step

rearrange_loop_steps(step_list)

Takes a list of loopsteps, each entry consisting of a tuple of the loopstep name and its children, which is recursively the same kind of list. Re-populates the loop_step_dict and then puts the loop_steps in the correct order.

Parameters:

step_list (list[(str, [list(str, ...)])]) – Contains tuples with the first entry being the names of the steps in the order they should be arranged to and the second entry being a list of the steps’ children. That list should be structured the same way as this step_list.

remove_loop_step(loop_step_name)

Removes the step with the given name from the sequence-list (or parent) and from the dictionary.

Parameters:

loop_step_name (str) – The name of the step that is to be removed.

update_variables()

Update all the variables provided by loopsteps.

nomad_camels.main_classes.protocol_class.append_all_children(child_list, step, step_dict)

Takes a list of the kind specified in rearrange_loop_steps, does the same as the other function, but recursively for all the (grand-)children.

Parameters:
  • child_list (list[(str, [list(str, ...)])]) – Contains tuples with the first entry being the names of the steps in the order they should be arranged to and the second entry being a list of the steps’ children. That list should be structured the same way as this child_list.

  • step (Loop_Step_Container) – The step to which the children should be appended.

  • step_dict (dict) – A dictionary containing (among others) the steps of child_list.

nomad_camels.main_classes.protocol_class.update_all_children(step_dict, step)

Similar to append_all_children, but only updating the step_dict with all the children, i.e. writing them into the dictionary.

Parameters:
  • step_dict (dict) – Dictionary, where to write all the steps

  • step (Loop_Step) – The step to be added to the dictionary. If it has child-steps, all of them will be added to the dictionary recursively.

Module contents