meafs_code package
Subpackages
- meafs_code.scripts package
- Submodules
- meafs_code.scripts.abundance_plot module
- meafs_code.scripts.abundance_fit module
- meafs_code.scripts.bisec_interpol module
- meafs_code.scripts.fit_functions module
- meafs_code.scripts.turbospec_functions module
- meafs_code.scripts.unify_plots module
- meafs_code.scripts.voigt_functions module
- Module contents
Submodules
meafs_code.gui module
- class meafs_code.gui.MEAFS(parent=None)[source]
Bases:
QMainWindow,Ui_MEAFSMain class that define the properties of the GUI.
- LineAddRemove(uiobject, add, islinelist=False)[source]
Add new or removes lines from a QT table.
- Parameters:
uiobject – the QT table widget to change.
add – true: add a line; false: remove a line.
islinelist – if it is a line-list table, also calls the function to generate the checkboxes.
- argument_resolve(fastcheck=False)[source]
Resolve the arguments passed in the commandline.
- Parameters:
fastcheck – if true, only check for the help and version arguments.
- auto_save()[source]
Save the session by the auto_save.plk file name or the name previously chosen by the user.
- auto_set_output()[source]
Try to find the synthetic spectrum output file name automatic by looking in the configuration file
- static browse(uiobject, caption, direc=None)[source]
Show a File Dialog to select some file.
- Parameters:
uiobject – the QT widget that shows the file path.
caption – the caption in File Dialog.
direc – the first directory that File Dialog should show.
- static browse_dir_out(uiobject, caption, direc=None)[source]
Show a File Dialog to select some directory.
- Parameters:
uiobject – the QT widget that shows the file path.
caption – the caption in File Dialog.
direc – the first directory that File Dialog should show.
- centralize_child_window(wind)[source]
Centralize child windows in respect of the main window.
- Parameters:
wind – the new window widget to be centralized.
- checkLineliststate()[source]
Count the number of checked checkboxes in the line-list table, update the progress total value accordingly and also check or uncheck the “Select All” element.
- check_output_folder()[source]
Check if the output folder location is written.
- Returns:
true if it is present, otherwise false.
- checktabshels()[source]
Modify the behaviour of some UI elements to guide the user through the creation of the final plots for the abundances.
- clear_scale(show_msg=True)[source]
Resets the fixed scale to show images in the final plots area, allowing resizing the GUI into smaller sizes.
- Parameters:
show_msg – Option to pop up a message saying that the scale was cleared.
- clear_spectrum_plot()[source]
Clear all plots in the Spectrum Plot tab, except the spectra themselves.
- closeEvent(event)[source]
Handles the close button event and trigger an “are you sure?” message.
- Parameters:
event – the event itself.
- datatableconfig(load=False, loaddata=None)[source]
Configure the button to show the spectrum file name and the tooltip to show the full path in the data QT table.
- Parameters:
load – if it is to load or to clear the spectrum data.
loaddata – the data containing the file names.
- datatableselect()[source]
Configure the data QT table with the buttons to select spectra or clear them.
- dict_to_qtable(qtable, dict_table, checkboxes=None, tooltip=False)[source]
Transform a QT Table in a dictionary.
- Parameters:
qtable – the QT Table to be written.
dict_table – the dictionary to read the data.
checkboxes – the index of checkboxes, if exists.
tooltip – write the item or the tooltip (for spectrum data table)
- enable_auto_save()[source]
Enable or disable the timed auto-save and the close auto-save capability and write this setting in to the settings file.
- full_spec_plot_range()[source]
Apply the total maximum and minimum values of the current plot and change the range to it.
- get_delimiter(error_msg=None)[source]
Get the current set delimiter type in MEAFS GUI.
- Parameters:
error_msg – Custom error message to show.
- Returns:
the delimiter, None (for auto-detect) or -1 (for error).
- graymethods(metharray)[source]
Gray the tabs of the methods that are not selected.
- Parameters:
metharray – the pattern that should be grayed.
- gui_hold(value)[source]
Froozen some widgets in the GUI so they can not be modified while running the fit.
- Parameters:
value – if it is to hold or not the GUI
- loadData()[source]
Load the data present in the QT table and call the function to plot the spectra in the GUI.
- loadRefer()[source]
Load the abundance reference file containing the elements and their abundances in the QT table.
- load_session(direc=None, list_save=None, loadprev=False)[source]
Load a previously saved session, or a list with all session-variables.
- Parameters:
direc – the directory where the File Dialog should first open.
list_save – a list with all session-variable. If it is different from None, the prompt to choose a file will not be shown.
loadprev – if true, the path of the file needs to be written in the
self.filepathvariable.
- static make_jupyter_widget_with_kernel()[source]
Create and configure the Jupyter QT Widget.
- Returns:
the widget itself.
- open_prev_results()[source]
Open CSV files with previous runs and load the results, including the available plots (if any).
- static qtable_to_dict(qtable, checkboxes=None, tooltip=False)[source]
Transform a QT Table in a dictionary.
- Parameters:
qtable – the QT Table to be read.
checkboxes – the index of checkboxes, if exists.
tooltip – get the item or the tooltip (for spectrum data table)
- Returns:
the dictionary
- results_show_tab()[source]
Show the results of the selected line in the results table in the results tab and focus the plot in the current line.
- run_final_plots(plot_type, single=False)[source]
Run the subroutines to create the final plots.
- Parameters:
plot_type – type of the final plot to create.
single – create a final plot to a single line or for all of them.
- run_fit_nopars()[source]
Call the fit algorithm only for the abundance, without fitting the Wavelength Shift, Continuum and Convolution.
- run_nofit()[source]
Call the fit algorithm without any fit at all, only to generate the plots with the selected values.
- save_session(saveas=False, direc=None, flname=None, getdill=False)[source]
Save a session using dill.
- Parameters:
saveas – if true, ignore the self.filepath variable.
direc – the directory where the File Dialog should first open.
flname – file name to save the session. If present, the File Dialog will not be shown.
getdill – if true, does not save the session and return the list to be saved.
- Returns:
the list to be saved (if
getdillis true), true if the session is saved or false if the self.filepath was not properly filled.
- show_error(msg)[source]
Show a QT window for some user-input-error message.
- Parameters:
msg – the message to be shown.
- static show_question(parent, title, message)[source]
Pop-up a question message.
- Parameters:
parent – the parent window.
title – the box title.
message – the message.
- Returns:
True or False.
- show_quit()[source]
Shows the quit message “are you sure?”
- Returns:
true or false, depending on the clicked button.
- class meafs_code.gui.Stdredirect(edit, color=None, out=None, showtab=None)[source]
Bases:
objectClass that redirect the stdout (outputs) and the stderr (errors) to the GUI and to the terminal, if available.
Bases:
NavigationToolbar2QTClass to create a vertical toolbar for the plot in the matplotlib package.
Write the mouse pointer coordinates in the toolbar.
- Parameters:
s – the message to write (coordinates)