src.gui package

Submodules

src.gui.canvasManager module

class src.gui.canvasManager.CanvasManager(parent=None, wid=8, hgt=8, dpi=100, plotName='', log='', cursorState='off')[source]

Bases: FigureCanvasQTAgg

Manages the plot canvas for the GUI.

clear_canvas()[source]

Clear the figure on the Canvas.

clear_dual_canvas()[source]

Clear the figure on the Canvas.

clear_figure(ax)[source]

Clear the current figure of the given axis.

delete_canvas()[source]
init_dual_fig_canvas()[source]

Initiate layout for the canvases.

init_fig_canvas()[source]

Initiate layout for the canvases.

label_dual_res()[source]

Add labels to the residuals

label_res()[source]

Add labels to the residuals

onmove(event)[source]

Track the cursor movement within the figure canvas

onpick(event)[source]

Pick points on the x-axis where you want to fit your data.

plot_dual_peaks(xpA, ypA, peakA, rmsA, xpB, ypB, peakB, rmsB, x=[], y=[], title='Peak fitted data')[source]

plot peak fits overlayed on drift scans.

plot_dual_residuals(x1, x2, title='Residuals', label='')[source]

Plot the residuals

plot_figure(x=[], y=[], title='Main plot window', label='')[source]

Create a figure.

plot_peak(xp, yp, peak, rms, x=[], y=[], title='Peak fitted data')[source]

Pleat peak fit overlayed on drift scan.

plot_residual(x=[], title='Residuals', label='')[source]

Plot the residuals

reset_lists()[source]

Setup/reset lists to store data for the click_index and fit_points.

Parameters:
  • click_index – the indeces of the points clicked on the figure.

  • fit_points – the values of the click_index

set_labels(ax, title='My title', xlabel='Dist [Deg]', ylabel='Ta [K]')[source]

Set labels for basic plot.

src.gui.edit_driftscan_window module

class src.gui.edit_driftscan_window.Ui_DriftscanWindow[source]

Bases: object

retranslateUi(DriftscanWindow)[source]
setupUi(DriftscanWindow)[source]

src.gui.edit_driftscan_window1 module

class src.gui.edit_driftscan_window1.Ui_DriftscanWindow[source]

Bases: object

retranslateUi(DriftscanWindow)[source]
setupUi(DriftscanWindow)[source]

src.gui.edit_timeseries_window module

class src.gui.edit_timeseries_window.Ui_TimeSeriesWindow[source]

Bases: object

retranslateUi(TimeSeriesWindow)[source]
setupUi(TimeSeriesWindow)[source]

src.gui.mainGuiLogic module

class src.gui.mainGuiLogic.Main(log)[source]

Bases: QMainWindow, Ui_MainWindow

The main class that handles all gui operations.

add_items_to_combobox()[source]

Refresh the list of folders containing plots to be displayed.

checkKeysFound(pol, option, img, path, images, keys)[source]
choose_plot()[source]

Select the plot to work with.

clear_selection()[source]

Clear selections made for current scan.

connect_buttons()[source]

Connect button key presses to widgets.

connect_time_buttons()[source]

connect button key press to widgets.

create_tag(ind)[source]

Create a tag for the plots according to the current scan being processed. e.g. ONRCP

delete_obs()[source]

Delete an observation.

enable_time_buttons()[source]

Enable time buttons.

enable_widgets()[source]

Enable the widgets.

filter_data()[source]

Filter/smooth the data

filter_timeseries_data()[source]

Filter the data

fit_base(order, plotIndex)[source]

Fit the baseline.

fit_data()[source]

Fit the drift scan.

fit_dual_peak(order, plotIndex)[source]

Fit dual peaks.

fit_p1(locs)[source]

Fitting peak 1.

fit_p2(locs)[source]

Fitting peak 2.

fit_peak(order, plotIndex)[source]

Fit peak

fit_timeseries()[source]
get_data_from_db(folderName)[source]
get_fit_loc()[source]

Get fit location from combobox.

get_fit_order()[source]

Get order for fitting polynomial.

get_fit_type()[source]

Get fit type from combobox.

get_plot_index()[source]

Get the current plot index. Deliberately set to ind+1 to account for offset.

on_checkbox_changed()[source]

Update the cursor depending on checkbox status (on/off)

on_combo_changed()[source]
on_filter_changed()[source]
on_filter_type_combobox_changed()[source]

Handle events related to the filter type combobox option change.

on_fit_changed()[source]

Toggle labels and edit boxes on or off when fit type is changed.

on_fit_combobox_changed()[source]

Handle events related to the combobox option change.

on_fit_type_combobox_changed()[source]

Handle events related to the combobox option change.

on_table_name_changed()[source]

update combobox when table name changes.

open_db()[source]

Open the database.

open_db_path()[source]
open_drift_window()[source]

Connect the edit drift scan window to the main window.

open_file()[source]

Open file for processing.

open_file_name_dialog(ext)[source]

Open file. Had to use this to avoid segmentation fault: 11 error

open_plots_window()[source]

Connect the plots window to the main window.

open_timeseries_window()[source]

Connect the edit timeseries window.

plot_cols(col='', xcol='', ycol='', yerr='')[source]

Plot database columns.

plot_cols_df()[source]

Plot database columns.

plot_new_fig()[source]

Plot a new figure from the recently fit data.

populate_cols()[source]

Populate x and y columns with data from tables.

populate_widgets()[source]

Populate the gui widgets.

popup_msg_dict()[source]

Message dictionary for popups.

refresh_db()[source]

refresh the database entries. Check for updates.

refresh_list()[source]

Refresh list if database updated

reset_dict(filter_key1, filter_key2='')[source]

Reset the data dictionary containing the driftscan keys

reset_dual_plot_fit_a()[source]

Reset all previously fit parameters of the A beam to zreo.

reset_dual_plot_fit_b()[source]

Reset all previously fit parameters of the B beam to zero.

reset_peak(plotIndex)[source]

Reset previous peak fits.

reset_plot()[source]

Reset figure to default settings.

reset_plot_fit()[source]

Reset all previously fit parameters to zero.

reset_previous_fits()[source]

Reset previous fits.

reset_status()[source]
reset_timeseries()[source]
reset_xy(ind)[source]

Set X and Y values to current plot.

save_fit()[source]

Save the fit. If the data has been previously saved overwrite the previous fit.

save_time_db(filen='')[source]

Save the analysis results of the time series to a csv file

save_to_DB()[source]

Save fit to database.

set_dual_data(data_update)[source]

Set the estimated values in the data dictionary.

set_fit_parmeters(bf=0, pf=0, ps=0)[source]

Initialize fit status parameters. These are parameters that tell us wether a certain part of the scan has been fit or not. The status of the fit can be either 0 (data not fit yet) or 1 (data fitting has been done) for the current scan. A smoothing parameter is also included to let us know if smoothing has been done on the original data.

By default, all the parameters are set to zero.

set_flags(flag=100)[source]

Set base flags. FLAGS = 100 # Source was manually edited/reduced by user This becomes the default for all flags if you save to DB while using the GUI.

set_nb_data(data_update)[source]

Set the estimated values in the data dictionary.

set_title()[source]

Set the plot title.

setup_flags()[source]

Setup flag parameters, default =100. These flags tell us whether a scan has been fit manually or not. see set_flags()

show_plot_browser()[source]

Open a webrowser containg the plots to be displayed.

toggle_range_filter(filter)[source]
update_base_fit(plotIndex)[source]

Updates figure on Canvas

update_db()[source]
update_db_all()[source]
update_dual_peak_fit(plotIndex)[source]

Updates figure on Canvas

update_fit_parmeters()[source]

Update fit parameters.

update_peak_fit(plotIndex)[source]

Updates figure on Canvas

update_plot(x, y, title, res, label='', label2='')[source]

Update the current figure.

update_point()[source]
update_smoothing_params()[source]

Update that plot has been smoothed

view_fit()[source]

View current fit info

view_status()[source]
write(msg, logType='')[source]

Write to screen and gui

src.gui.main_window module

class src.gui.main_window.Ui_MainWindow[source]

Bases: object

retranslateUi(MainWindow)[source]
setupUi(MainWindow)[source]

src.gui.main_window1 module

class src.gui.main_window1.Ui_MainWindow[source]

Bases: object

retranslateUi(MainWindow)[source]
setupUi(MainWindow)[source]

src.gui.secondaryCanvasManager module

class src.gui.secondaryCanvasManager.SecondaryCanvasManager(parent=None, wid=5, hgt=6, dpi=100, plotName='', log='')[source]

Bases: FigureCanvasQTAgg

Manages the plot canvas for the GUI.

clear_canvas()[source]

Clear the figure on the Canvas.

clear_figure()[source]

Clear the current figure of the given axis.

delete_canvas()[source]
init_canvas()[source]

Initiate layout for the canvases.

plot_figure(x=[], y=[], y1=[], label1='', label2='')[source]

Create a figure.

reset_lists()[source]

Setup/reset lists to store data for the click_index and fit_points.

Parameters:
  • click_index – the indeces of the points clicked on the figure.

  • fit_points – the values of the click_index

set_labels()[source]

Set labels for basic plot.

src.gui.secondaryCanvasManager.fxn()[source]

src.gui.timeseries_canvas module

class src.gui.timeseries_canvas.TimeCanvas(parent=None, wid=10, hgt=8, dpi=100, plotName='', log='')[source]

Bases: FigureCanvasQTAgg

clear_figure()[source]

Clear the current figure

dday(x, y)[source]

Date handler

onclick(event)[source]
onpick(event)[source]

Click event handler.

plot_dual_fig(x=[], y=[], x1=[], y1=[], xlab='', ylab='', title='Main database plot window', col='C0.', data='')[source]

Plot a figure.

A helper function to make a graph

axAxes

The axes to draw to

data1 : array The x data

data2 : array The y data

param_dict : dict Dictionary of kwargs to pass to ax.plot

outlist

list of artists added

plot_fig(x=[], y=[], xlab='', ylab='', title='Main database plot window', col='C0.', data='', yerr=[])[source]

Plot a figure.

A helper function to make a graph

axAxes

The axes to draw to

data1 : array The x data

data2 : array The y data

param_dict : dict Dictionary of kwargs to pass to ax.plot

outlist

list of artists added

plot_fig_errs(x=[], y=[], xlab='', ylab='', title='Main database plot window', col='C0.', errs=[], data='')[source]

Plot a figure with errorbars.

A helper function to make a graph

axAxes

The axes to draw to

data1 : array The x data

data2 : array The y data

param_dict : dict Dictionary of kwargs to pass to ax.plot

outlist

list of artists added

pop()[source]
replaceDateItem(x)[source]

replace an item in a list of items

replaceitem(x)[source]

replace an item in a list of items

reset_lists()[source]

Setup lists to store data for the click_index and fit_points. click_index : the indeces of the points clicked on the figure. fit_points: the values of the click_index

setLabels(ax, xlab, ylab, title='My title')[source]

Set labels for basic plot.

setLabelsNoLegend(ax, title='My title')[source]

Set labels for basic plot.

show_plots(ind)[source]

Show plots on click event in html browser.

src.gui.view_plots_window module

class src.gui.view_plots_window.Ui_PlotViewer[source]

Bases: object

retranslateUi(PlotViewer)[source]
setupUi(PlotViewer)[source]

Module contents