GUI#
- class astrolore.gui.main_gui[source]#
Bases:
objectTkinter-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
pywebviewwindow pointing the Aladin Sky Atlas at the nearest sci-fi object’s coordinates.
- dataset#
The catalog instance shared across the session.
- Type:
- 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
pywebviewwindow. This call blocks until the webview window is closed becausewebview.start()runs its own event loop.- Parameters:
close_object (pandas.Series) – A row from
scifi_dataframecontaining at minimumraanddeccolumns (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.pngand 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
Entryand a pair of RA/DEC entry groups (each with three sub-fields for h/m/s and °/′/″).An output
Labelthat 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 aToplevelpopup embedding the matplotlib figure returned byget_fig_funcinto aFigureCanvasTkAgg.handle_click()— main search handler. Reads input based on the current mode, callsfind_closest_objectandoutput_lore, updates the output label, and reveals the post-search buttons.
The
<Return>key is bound tohandle_clickso keyboard-only users can trigger searches without reaching for the mouse.- Side effects:
Sets
self.windowto the constructedtk.Tkroot window.