gui module

Define a GUI.

Todo

Export/Import settings

Todo

logging module

Todo

Add measurables at bottom

class MainWindow(default_model: str = 'Vaughan', default_loader: str = 'PandasLoader', default_plotter: str = 'PandasPlotter')

Bases: QMainWindow

This object holds the GUI.

autofill_data_to_plot = True

If selecting Model in dropdown should automatically fill the appopriate data to plot checkbox

autofill_nature_to_plot = True

If selecting Model in dropdown should automatically fill the appopriate emission data checkbox

autofill_plotting_ranges = True

If loading data should automatically fill the energy/angle ranges with their maximum values

__init__(default_model: str = 'Vaughan', default_loader: str = 'PandasLoader', default_plotter: str = 'PandasPlotter') None

Create the GUI.

setup_file_selection_matrix() list[list[None | QListWidget]]

Create the 4 * 3 matrix to select the files to load.

_deactivate_unnecessary_file_widgets() None

Grey out the files not needed by current model.

setup_loader_dropdown() None

Set the Loader related interface.

_setup_loader() None

Setup new loader whenever the dropdown menu is changed.

load_data() None

Load all the files set in GUI.

setup_model_dropdown() None

Set the Model related interface.

Assign the model_classes and model_dropdown.

setup_model_configuration() QTableWidget

Set the interface related to the model specific parameters.

_setup_model() None

Instantiate Model when it is selected in dropdown menu.

_populate_parameters_table_constants() None

Print out the model parameters in dedicated table.

_update_parameter_value_from_table(item: QTableWidgetItem) None

Update Parameter value based on user input in table.

fit_model() None

Perform the fit on the loaded data.

_populate_parameters_table_values() None

Print out the values of the model parameters in dedicated table.

_fill_plot_nature_and_population() None

Check emission data type and population.

When model is updated, check the Data to plot and Population to plot checkboxes in the Plot section that are concerned by current model.

setup_energy_angle_inputs() None

Set the energy and angle inputs for the model plot.

setup_plotter_dropdowns() None

Set the Plotter related interface.

_set_up_data_to_plot_checkboxes() None

Add checkbox to select which data should be plotted.

_set_up_population_to_plot_checkboxes() None

Add checkbox to select which population should be plotted.

plot_measured() None

Plot the desired data, as imported.

plot_model() None

Plot the desired data, as modelled.

_get_emission_data_type_to_plot() tuple[bool, Literal['Emission Yield', 'Emission Energy', 'Emission Angle'] | None]

Read input to determine the emission data type to plot.

_get_populations_to_plot() tuple[bool, list[Literal['SE', 'EBE', 'IBE', 'all']]]

Read input to determine the populations to plot.

_gen_linspace(variable: Literal['energy', 'angle']) tuple[bool, ndarray]

Take the desired input, check validity, create array of values.

_fill_plotting_ranges() None

Fill energy and angle plotting ranges to match data files values.

This method is called when the button Load is pressed.

_dropdown_to_class(name: Literal['Loader', 'Model', 'Plotter']) ABCMeta

Convert dropdown entry to class.

_set_list_widget_state(widget: QListWidget, enabled: bool) None

Enable or disable a QListWidget based on enabled.

_set_default_dropdown() None

Set dropdowns to their default values.

We call this method at the end of the GUI initialization rather than at the creation of the dropdowns to ensure that every side effects is executed.

main()