Commit faeade71 authored by Doerr, Kevin's avatar Doerr, Kevin
Browse files

Added draw ellipse function into

parent be92f1da
......@@ -14,6 +14,7 @@ Show the available templates:
>>> makeBasePyQtApp -l
from import draw_beam_ellipse_with_params
from PyQt5.QtCore import pyqtSlot
from PyQt5.QtWidgets import QMainWindow
......@@ -119,8 +120,20 @@ class MyAppWindow(BaseAppForm, Ui_MainWindow):
def draw_ellipse(self):
raise NotImplementedError
#raise NotImplementedError
"""Draw beam ellipse onto the figure area.
_, fm =
r, s ='all')
keys = [i.format(u='x') for i in ('{u}_cen', '{u}p_cen', '{u}_rms', '{u}p_rms', 'emit_{u}', 'emitn_{u}','alpha_{u}', 'beta_{u}', 'gamma_{u}', 'total_intensity')]
vals = (s.xcen, s.xpcen, s.xrms, s.xprms, s.xemittance, s.xnemittance,
s.xtwiss_alpha, s.xtwiss_beta, (s.xtwiss_alpha**2+1)/s.xtwiss_beta, 1)
params = dict(zip(keys, vals))
draw_beam_ellipse_with_params(params, color='b', factor=4, ax=self.matplotlibbaseWidget.axes, xoy='x', fill='g', anote=True)
if __name__ == "__main__":
from PyQt5.QtWidgets import QApplication
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment