ggui package¶
Subpackages¶
Submodules¶
ggui.config module¶
ggui.ggui module¶
ggui.qtTabLayouts module¶
-
class
ggui.qtTabLayouts.
FuvToggleTool
(viewer)¶ Bases:
glue.viewers.common.tool.Tool
Glue data viewer tool that calls the FUV band visibility toggle method to corresponding ggui data viewer
-
activate
()¶ Calls the ggui data viewer’s data visibility toggle with the ‘FUV’ band
-
icon
= '/home/docs/checkouts/readthedocs.org/user_builds/ggui/checkouts/master/ggui/icons/FUV_transparent.png'¶
-
tool_id
= 'fuv_toggle'¶
-
tool_tip
= 'Toggle the FUV Dataset'¶
-
-
class
ggui.qtTabLayouts.
NuvToggleTool
(viewer)¶ Bases:
glue.viewers.common.tool.Tool
Glue data viewer tool that calls the NUV band visibility toggle method to corresponding ggui data viewer
-
activate
()¶ Calls the ggui data viewer’s data visibility toggle with the ‘FUV’ band
-
icon
= '/home/docs/checkouts/readthedocs.org/user_builds/ggui/checkouts/master/ggui/icons/NUV_transparent.png'¶
-
tool_id
= 'nuv_toggle'¶
-
tool_tip
= 'Toggle the NUV Dataset'¶
-
-
class
ggui.qtTabLayouts.
gGuiOverviewBaseViewer
(glue_session: <module 'glue.core.session' from '/home/docs/checkouts/readthedocs.org/user_builds/ggui/envs/master/lib/python3.7/site-packages/glue/core/session.py'>, data: dict)¶ Bases:
glue.viewers.matplotlib.qt.data_viewer.MatplotlibDataViewer
Base class for gGui data viewers Implements basic data import logic, band organizing, and UI methods Adds FUV/NUV band support and associated band toggle tools
-
mousePressEvent
(event)¶ Consume mouse press events, and prevent them from propagating down to the MDI area.
-
toggle_band_visibility
(band: str, value: str = None)¶ Toggles visibility of a dataset by band
Parameters: - band – Band to toggle (i.e. ‘NUV’ or ‘FUV’)
- value – Optional parameter to explicitly set the band’s visibility to a specific value. Absence will toggle the exising visibility
-
tools
= ['fuv_toggle', 'nuv_toggle']¶
-
-
class
ggui.qtTabLayouts.
ggui_image_viewer
(session: <module 'glue.core.session' from '/home/docs/checkouts/readthedocs.org/user_builds/ggui/envs/master/lib/python3.7/site-packages/glue/core/session.py'>, image_data: dict, x_att: str, y_att: str)¶ Bases:
ggui.qtTabLayouts.gGuiOverviewBaseViewer
,glue.viewers.image.qt.data_viewer.ImageViewer
Data Viewer class that handles gPhoton FITS images
-
class
ggui.qtTabLayouts.
ggui_lightcurve_viewer
(session: <module 'glue.core.session' from '/home/docs/checkouts/readthedocs.org/user_builds/ggui/envs/master/lib/python3.7/site-packages/glue/core/session.py'>, lightcurve_data: dict, x_att: str = None, y_att: str = None)¶ Bases:
ggui.qtTabLayouts.gGuiOverviewBaseViewer
,glue.viewers.scatter.qt.data_viewer.ScatterViewer
Data Viewer class that handles gPhoton lightcurve events
-
class
ggui.qtTabLayouts.
ggui_overview_tab
(session: <module 'glue.core.session' from '/home/docs/checkouts/readthedocs.org/user_builds/ggui/envs/master/lib/python3.7/site-packages/glue/core/session.py'> = None, target_name: str = 'Target', target_data: dict = None)¶ Bases:
PyQt5.QtWidgets.QMdiArea
Displays an overview of all gPhoton data products supplied to ggui
-
loadCoadd
(session: <module 'glue.core.session' from '/home/docs/checkouts/readthedocs.org/user_builds/ggui/envs/master/lib/python3.7/site-packages/glue/core/session.py'>, target_name: str, coadd_data: dict, x_att: str, y_att: str)¶ Constructs an image viewer for gPhoton Coadd FITS data
Parameters: - session – Corresponding Glue parent’s ‘session’ object that stores information about the current environment of glue.
- target_name – The name of the target we are “overviewing”
- coadd_data – The gPhoton Coadd to plot
- x_att – Label of attribute to assign to the x-axis
- y_att – Label of attribute to assign to the y-axis
Returns: Initialized coadd viewer
-
loadCube
(session: <module 'glue.core.session' from '/home/docs/checkouts/readthedocs.org/user_builds/ggui/envs/master/lib/python3.7/site-packages/glue/core/session.py'>, target_name: str, cube_data: dict, x_att: str, y_att: str)¶ Constructs an image viewer for gPhoton Cube FITS data
Parameters: - session – Corresponding Glue parent’s ‘session’ object that stores information about the current environment of glue.
- target_name – The name of the target we are “overviewing”
- cube_data – The gPhoton Cube to plot
- x_att – Label of attribute to assign to the x-axis
- y_att – Label of attribute to assign to the y-axis
Returns: Initialized cube viewer
-
loadLightcurve
(session: <module 'glue.core.session' from '/home/docs/checkouts/readthedocs.org/user_builds/ggui/envs/master/lib/python3.7/site-packages/glue/core/session.py'>, target_name: str, lightcurve_data: dict, x_att: str, y_att: str)¶ Constructs a lightcurve viewer for gPhoton Lightcurve data
Parameters: - session – Corresponding Glue parent’s ‘session’ object that stores information about the current environment of glue.
- target_name – The name of the target we are “overviewing”
- lightcurve_data – The gPhoton lightcurve to plot
- x_att – Label of attribute to assign to the x-axis
- y_att – Label of attribute to assign to the y-axis
Returns: Initialized lightcurve viewer
-
load_data
(session: <module 'glue.core.session' from '/home/docs/checkouts/readthedocs.org/user_builds/ggui/envs/master/lib/python3.7/site-packages/glue/core/session.py'>, target_name: str, target_data: dict)¶ Constructs the appropriate data viewer for any gPhoton data products provided
Parameters: - session – Corresponding Glue parent’s ‘session’ object that stores information about the current environment of glue.
- target_name – The name of the target we are “overviewing”
- target_data – The gPhoton data (lighcurves, coadds, cubes) we are “overviewing”
-
ggui.targetManager module¶
-
class
ggui.targetManager.
TargetManager
(glue_parent: glue.app.qt.application.GlueApplication, target_change_callback: Callable[[str], None] = None)¶ Bases:
PyQt5.QtWidgets.QToolBar
Class that handles the loading of gPhoton data and management of multiple gGui targets
-
close
()¶ Handles graceful exit housekeeping
-
flushSourceFile
(source_filename: str)¶ Force saves (flushes) the given source file Intended to be used for saving notes
Parameters: source_filename – Filename of source file to be flushed
-
getPrimaryData
() → dict¶ Returns currently loaded primary target’s data
Returns: dictionary of the current primary target’s data
-
getPrimaryName
() → dict¶ Returns the current primary target’s name
Returns: current primary target’s name as string
-
getPrimaryNotes
() → str¶ Returns any notes associated with the current target. Returns empty string if no notes found.
Returns: notes registered with the current target
-
getPrimaryTargetCatalog
() → str¶ Returns the current primary target’s parent gGui Target Catalog path If no target is selected, returns a blank string
Returns: primary target’s gGui Target Catalog path as string
-
getTargetFiles
(target_catalog: str, target_name: str) → dict¶ Returns the files and metadata of a specified target (Unloaded data, as per lazy evaluation principle)
Parameters: - target_catalog – gGui catalog file this target originated from
- target_name – Name of the target whose files to lookup
Returns: Unloaded metadata and filepaths of the corresponding target’s data
-
getTargetNames
() → list¶ Returns the names of all registered targets, in their registered order
Returns: list of all cached targets’ names
-
getTargetNotes
(target_catalog: str, target_name: str) → str¶ Returns the notes specified target, or blank string if no notes registered
Parameters: - target_catalog – gGui catalog this target originated from
- target_name – Name of the target whose notes to lookup
Returns: Notes of the specified target, or blank string if no notes
-
loadTargetDict
(target_catalog: str, target_files: dict)¶ Loads a single dictionary of targets and associated data product paths into internal cache
Parameters: - target_files – gGui compliant yaml dictionary of targets and paths to associated gPhoton data products
- target_catalog – Name/identifier of this dictionary of targets. Can be used to return data
-
next_target
()¶ Advances to next primary target
-
previous_target
()¶ Advances to previous primary target
-
register_target_change_callback
(callback)¶ Registers a callback function to call when primary target changes
Parameters: callback – Callback function
-
setPrimaryNotes
(new_notes: str)¶ ” Updates internal cache of target’s notes to given string
Parameters: new_notes – New notes for the primary target
-
setPrimaryTarget
(targIndex: int)¶ Changes primary target to target specified Unloads existing primary target’s data (internal cache and parent Glue session), loads the new primary target’s data, links their corresponding attributes together, and notifies all stakeholders of the new changed primary target
Parameters: targIndex – Index of desired new primary target
-
show_targ_info
()¶ Displays name and target catalog for the primary target
-
-
class
ggui.targetManager.
target_note_display
(parent)¶ Bases:
PyQt5.QtWidgets.QGroupBox
Subwidget to display notes of current target
-
closeEvent
(_)¶ When close is detected, prompts user to save notes if text has been modified
-
discard_note_changes
()¶ Discards any changes to notes and reverts to last saved notes
-
modificationChanged
(changed: bool)¶
-
primary_target_changed
(new_target: str)¶ When primary target has changed, retrieves notes for the new target
Parameters: new_target – Name of the new primary target
-
save_notes
(force_save: bool = False)¶ Checks if notes need to be saved. If so, saves the notes and flushes to disk
Parameters: force_save – If True, skips text modification checks and forces a save to disk
-