ReferenceWindow

class sofia_redux.visualization.display.reference_window.ReferenceWindow(parent: Any)[source]

Bases: QDialog, Ui_Dialog

GUI framework for displaying spectral reference lines.

Creates a Reference Data window for user interaction. It includes the following buttons:

  • Load List: allows loading reference data files, one at a time.

  • Clear Lists: removes all loaded files as well lines and labels from plots.

Each loaded file can be examined by double-clicking on its listing in the display window.

There are also two check boxes to control display preferences:

  • Show labels: shows or hides text labels for the lines

  • Show lines: shows or hides lines and any associated labels

Attributes:
signals: sofia_redux.visualization.signals.Signals

Custom signals recognized by the Eye interface, used to trigger callbacks from user events.

ref_models: reference_model.ReferenceData

The line list data.

visibility: dict

Keys are ref_line and ref_label. Values are boolean flags matching the current visibility of lines and labels, respectively.

textview: sofia_redux.visualization.display.text_view.TextView

Text viewer widget.

Methods Summary

clear_lists()

Remove all lines and labels from display.

clear_status()

Reset the status bar.

connections()

Establish connections to callbacks.

load_lines()

Load reference lines from a file.

set_status(message)

Set a status message.

show_text(item)

Show the text of the loaded reference data file.

toggle_visibility(target)

Toggle the visibility for lines or labels.

Methods Documentation

clear_lists()[source]

Remove all lines and labels from display.

clear_status()[source]

Reset the status bar.

connections()[source]

Establish connections to callbacks.

The buttons connect to load_lines and clear_lists. The checkboxes connect to toggle_visibility. Items in the file list connect to show_text.

load_lines() bool[source]

Load reference lines from a file.

Returns:
resultbool

True if the file is successfully read in; otherwise False.

set_status(message)[source]

Set a status message.

Parameters:
messagestr

The message to display.

show_text(item)[source]

Show the text of the loaded reference data file.

Parameters:
itemQtWidgets.QListWidgetItem

The selected file in the list.

toggle_visibility(target)[source]

Toggle the visibility for lines or labels.

Parameters:
target{‘ref_line’, ‘ref_label’}

The specific target for which the visibility should be toggled. Use ‘ref_line’ for the reference data lines and ‘ref_label’ for the reference data labels.