GUI#

class astrolore.gui.main_gui[source]#

Bases: object

Tkinter-based graphical interface for the Astrolore package.

On construction the GUI window is fully built and is ready to display. Call start_gui() to hand control to the Tk event loop.

Typical usage:

from astrolore import gui
gui.main_gui().start_gui()

The window lets the user search by either:

  • Name — any resolvable astronomical identifier (Simbad/NED via astropy).

  • Coordinates — ICRS RA (h m s) and DEC (° ′ ″) entered field-by-field.

After a successful search the window reveals two extra buttons:

  • Full Sky Plot — opens a popup with the Aitoff full-sky map.

  • View in Aladin — launches a pywebview window pointing the Aladin Sky Atlas at the nearest sci-fi object’s coordinates.

dataset#

The catalog instance shared across the session.

Type:

astrolore_dataset

window#

The root Tkinter window.

Type:

tk.Tk

static aladin_webview(close_object)[source]#

Open the Aladin Sky Atlas in an embedded webview for the given catalog object.

Builds the Aladin Lite URL using the object’s ICRS RA/DEC (in decimal degrees) and a fixed field-of-view of 1.5°, then launches a pywebview window. This call blocks until the webview window is closed because webview.start() runs its own event loop.

Parameters:

close_object (pandas.Series) – A row from scifi_dataframe containing at minimum ra and dec columns (decimal degrees).

setup_main_gui()[source]#

Build all Tkinter widgets and wire up event handlers.

Creates and configures the following UI hierarchy:

  • Root window (800×600, non-resizable) with a starfield background.png and a semi-transparent overlay rectangle for contrast.

  • Frame (centered on the canvas) containing:
    • Title and subtitle labels.

    • A StringVar-backed radio group to choose Name vs Coordinates mode.

    • An input frame that swaps between a single name Entry and a pair of RA/DEC entry groups (each with three sub-fields for h/m/s and °/′/″).

    • An output Label that shows lore text after a search.

    • A buttons frame with: Search/Search Again, Reset, Full Sky Plot (hidden until after first search), and View in Aladin (hidden until after first search).

Inner functions defined here (not exposed as methods because they close over the local Tk widget references):

  • reset_all() — clears all inputs, hides post-search buttons, resets mode.

  • update_input_mode() — swaps the visible input widgets when the radio selection changes.

  • show_plot(get_fig_func) — opens a Toplevel popup embedding the matplotlib figure returned by get_fig_func into a FigureCanvasTkAgg.

  • handle_click() — main search handler. Reads input based on the current mode, calls find_closest_object and output_lore, updates the output label, and reveals the post-search buttons.

The <Return> key is bound to handle_click so keyboard-only users can trigger searches without reaching for the mouse.

Side effects:

Sets self.window to the constructed tk.Tk root window.

start_gui()[source]#

Enter the Tkinter main event loop and display the GUI window.

Blocks until the user closes the window. The WM_DELETE_WINDOW protocol handler calls both window.destroy() and window.quit() to ensure the process exits cleanly rather than hanging after the window is dismissed.