madgui.online.diagnostic module

Widgets for online beam diagnostic tasks, such as emittance estimation, adding monitor readouts to plot.

Classes

MonitorWidget(session)

MonitorWidgetBase(session)

Dialog for selecting SD monitor values to be imported.

PlotMonitorWidget(session)

OffsetsWidget(*args)

OrbitWidget(session)

EmittanceDialog(session)

Functions

solve_emit_sys(Ms, XCs)

Solve for S the linear system of equations:

twiss_from_sigma(sigma)

Compute 1D twiss parameters from 2x2 sigma matrix.

class madgui.online.diagnostic.EmittanceDialog(session)[source]

Bases: madgui.online.diagnostic._FitWidget

Methods

apply()

export_to(filename)

match_values()

on_update()

showEvent(self, QShowEvent)

apply()[source]
export_to(filename)[source]
match_values()[source]
on_update()[source]
showEvent(self, QShowEvent)[source]
class madgui.online.diagnostic.MonitorWidget(session)[source]

Bases: PyQt5.QtWidgets.QDialog

class madgui.online.diagnostic.MonitorWidgetBase(session)[source]

Bases: PyQt5.QtWidgets.QWidget

Dialog for selecting SD monitor values to be imported.

Methods

accept()

deselect(index)

draw()

export()

get_monitor_row(i, m)

num_selected()

remove()

select(index)

selected(monitor)

set_monitor_show(i, mon, show)

update(self)

update(self, QRect)

Attributes

exportFilters

list() -> new empty list

headline

str(object=’’) -> str

title

str(object=’’) -> str

accept()[source]
deselect(index)[source]
draw()[source]
export()[source]
exportFilters = [('YAML file', '*.yml')]
folder = None
get_monitor_row(i, m)[source]
headline = 'Select for which monitors to plot measurements:'
num_selected()[source]
remove()[source]
select(index)[source]
selected(monitor)[source]
set_monitor_show(i, mon, show)[source]
title = 'Set values in ACS from current sequence'
update(self)[source]

update(self, QRect) update(self, QRegion) update(self, int, int, int, int)

class madgui.online.diagnostic.OffsetsWidget(*args)[source]

Bases: madgui.online.diagnostic.MonitorWidgetBase

Methods

calibrate_offsets()

discard()

export_to(filename)

get_monitor_row(i, m)

load()

load_from(filename)

save_offsets()

showEvent(self, QShowEvent)

Attributes

ui_file

str(object=’’) -> str

calibrate_offsets()[source]
discard()[source]
export_to(filename)[source]
get_monitor_row(i, m)[source]
load()[source]
load_from(filename)[source]
save_offsets()[source]
showEvent(self, QShowEvent)[source]
ui_file = 'offsetswidget.ui'
class madgui.online.diagnostic.OrbitWidget(session)[source]

Bases: madgui.online.diagnostic._FitWidget

Methods

apply()

export_to(filename)

fit_particle_orbit()

on_update()

showEvent(self, QShowEvent)

apply()[source]
export_to(filename)[source]
fit_particle_orbit()[source]
on_update()[source]
showEvent(self, QShowEvent)[source]
class madgui.online.diagnostic.PlotMonitorWidget(session)[source]

Bases: madgui.online.diagnostic.MonitorWidgetBase

Attributes

exportFilters

list() -> new empty list

ui_file

str(object=’’) -> str

Methods

export_to(filename)

showEvent(self, QShowEvent)

exportFilters = [('YAML file', '*.yml'), ('TEXT file (numpy compatible)', '*.txt')]
export_to(filename)[source]
showEvent(self, QShowEvent)[source]
ui_file = 'monitorwidget.ui'
madgui.online.diagnostic.solve_emit_sys(Ms, XCs)[source]

Solve for S the linear system of equations:

(M S Mᵀ)ₓₓ = C

For some M, x and C.

M can be coupled, but S is assumed to be block diagonal, i.e. decoupled:

S = (X 0 0

0 Y 0 0 0 T)

Returns S as numpy array.

madgui.online.diagnostic.twiss_from_sigma(sigma)[source]

Compute 1D twiss parameters from 2x2 sigma matrix.