GUIBRUSHR.GUI.Input_Output_Panels.Input_Panels.TabPanels.FrameGenerationHRData.FrameGenerationHRData module¶
High-Resolution Spectroscopy generation GUI Panel
This module provides a comprehensive graphical user interface for configuring and executing synthetic high-resolution spectroscopic observations of exoplanets.
The GUI panel allows users to: - Configure target parameters and observational setup - Set atmospheric conditions and instrumental parameters - Control PWV (precipitable water vapor) modeling - Select radiation transfer modes and cross-correlation models - Execute dataset generations with real-time progress monitoring - View diagnostic plots and results
- Classes:
UpdatableImage: Dynamic image widget for displaying generation results FrameGenerationHRData: Main GUI panel for HR generation configuration
- Functions:
ask_stellar_params: Convenience wrapper for stellar parameter dialog
- class GUIBRUSHR.GUI.Input_Output_Panels.Input_Panels.TabPanels.FrameGenerationHRData.FrameGenerationHRData.UpdatableImage(parent: Widget, row: int, column: int, width: int, height: int, initial_path: str, **kwargs)[source]¶
Bases:
MyImageA specialized image widget that supports dynamic updating of displayed images.
This class extends MyImage to provide the ability to change the displayed image at runtime, which is useful for showing updated plots, diagnostic images, or simulation results without recreating the widget.
Inherits from MyImage and maintains all its functionality while adding dynamic update capabilities through PIL/Pillow image processing.
- __init__(parent: Widget, row: int, column: int, width: int, height: int, initial_path: str, **kwargs) None[source]¶
Initialize the updatable image widget.
- Parameters:
parent (tk.Widget) – Parent widget container
row (int) – Row position in the parent’s grid layout
column (int) – Column position in the parent’s grid layout
width (int) – Desired image width in pixels
height (int) – Desired image height in pixels
initial_path (str) – Path to the initial image file to display
**kwargs – Additional keyword arguments passed to MyImage parent class
Notes
The widget automatically resizes images to fit the specified dimensions while maintaining aspect ratio handling as configured in the parent class.
- update_image(new_path: str) None[source]¶
Update the displayed image with a new image file.
Dynamically loads and displays a new image while preserving the widget’s position and configuration. The new image is automatically resized to match the widget’s dimensions.
- Parameters:
new_path (str) – Path to the new image file to display. Supports common formats including PNG, JPEG, GIF, BMP, and TIFF.
- Raises:
FileNotFoundError – If the specified image file cannot be found
PIL.UnidentifiedImageError – If the file is not a valid image format
Exception – For other image loading or display errors
Notes
The method handles both canvas-based and label-based image display mechanisms automatically. A reference to the new image is maintained to prevent garbage collection.
- class GUIBRUSHR.GUI.Input_Output_Panels.Input_Panels.TabPanels.FrameGenerationHRData.FrameGenerationHRData.FrameGenerationHRData(parent: Widget, color: str, row: int, column: int, path_default: str, frame_input, window: Toplevel, width_GUI: int, height_frame: int, **kwargs)[source]¶
Bases:
MyPanelComprehensive GUI panel for configuring and executing high-resolution spectroscopy generations.
This panel provides a complete user interface for setting up synthetic exoplanet observations with full control over:
Core Configuration: - Target selection and orbital parameters - Instrument selection and spectral orders - Radiation transfer modes (transmission/emission) - Cross-correlation model selection
Atmospheric Modeling: - PWV (precipitable water vapor) functions and time series - Observatory parameters and atmospheric conditions - Telluric absorption modeling with SkyCalc integration - Airmass calculations and observational coordinates
Advanced Options: - Wavelength coverage and resolution settings - Stellar parameter configuration via dialogs - Discontinuous vs continuous PWV modeling - Real-time simulation monitoring and progress tracking
Output Management: - FITS file generation with proper headers - Diagnostic plot creation and PDF viewing - Result visualization and quality assessment - Background process management for long generations
The panel integrates with the broader GUIBRUSHR framework and maintains compatibility with standard astronomical data reduction pipelines.
- synthetic_process¶
Background process handle for running generations
- Type:
subprocess.Popen or None
- synthetic_running¶
Flag indicating if a generation is currently executing
- Type:
bool
- math_functions¶
Utility class for PWV and atmospheric function calculations
- Type:
- __init__(parent: Widget, color: str, row: int, column: int, path_default: str, frame_input, window: Toplevel, width_GUI: int, height_frame: int, **kwargs) None[source]¶
Initialize the FrameGenerationHRData panel with all UI components and configurations.
- Parameters:
parent (tk.Widget) – Parent widget container for this panel
color (str) – Background color for the panel (hex color code or named color)
row (int) – Row position in the parent widget’s grid layout
column (int) – Column position in the parent widget’s grid layout
path_default (str) – Root path to GUIBRUSHR directory structure containing models, telluric grids, and configuration files
frame_input (FrameInput) – Input frame object containing target folder path and related configuration information
window (tk.Toplevel) – Main application window for parent references and modal dialogs
width_GUI (int) – Total width of the GUI in pixels for layout calculations
height_frame (int) – Height allocated for this frame in pixels
**kwargs (dict) – Additional keyword arguments passed to MyPanel parent class
Notes
The initialization process: 1. Sets up all UI component references and instance variables 2. Loads initial target list from the specified folder 3. Initializes dropdown menus with available options 4. Creates atmospheric parameter panels and controls 5. Sets up background process monitoring 6. Configures mathematical function utilities
The panel automatically adapts to available targets and instruments found in the specified data directory structure.
- update_observatory_coordinates()[source]¶
Update observatory coordinates when dropdown selection changes.
Retrieves the selected observatory’s coordinates from the database and updates the latitude, longitude, and altitude entry fields.
- update_observatory_list(observatories)[source]¶
Update the observatory dropdown with a new list of observatories.
Recreates the observatory dropdown widget with new observatory options and maintains the callback function.
- Parameters:
observatories (list) – List of observatory names to populate the dropdown
- get_atmospheric_parameters()[source]¶
Get all atmospheric parameters as a dictionary.
Collects all atmospheric, observational, wavelength, and observatory parameters from the GUI widgets. Parameters with value -999 are excluded from the final dictionary as they indicate values to be retrieved automatically.
- Returns:
Dictionary containing all atmospheric parameter values with -999 values excluded
- Return type:
dict
- get_almanac_parameters()[source]¶
Get coordinate parameters as an almanac dictionary.
Collects equatorial coordinates and observatory position parameters needed for astronomical calculations and almanac computations.
- Returns:
Dictionary containing coordinate parameters including RA, Dec, observatory latitude, longitude, and altitude
- Return type:
dict
- get_pwv_parameters()[source]¶
Get PWV parameters from the first tab entry widgets.
Collects PWV (precipitable water vapor) modeling parameters used for atmospheric simulation and telluric absorption calculations.
- Returns:
Dictionary containing PWV parameters including dt, pace, s, scale, tExp, and seed values
- Return type:
dict
- get_row()[source]¶
Get the currently selected row information from the filter table.
Retrieves target information and array values from the currently selected row in the filter table interface.
- Returns:
(target, array_values, selected_name) or (None, None, None) if no row is selected or an error occurs
- Return type:
tuple
- update_from_target_or_rad_mode()[source]¶
Update night information for the current target and instrument configuration.
Called when the target selection or radiation transfer mode changes. Updates the available nights, instruments, and cross-correlation models to match the new selection.
- update_nights()[source]¶
Update HR instrument settings and available nights.
Called when the HR instrument selection changes. Updates the nights text field with available observation nights for the selected target and instrument combination.
- update_nights_instrument()[source]¶
Update the HR instrument dropdown based on current target and mode.
Refreshes the list of available HR instruments for the selected target and radiation transfer mode. Recreates the dropdown widget with updated options.
- update_CC_model()[source]¶
Update the cross-correlation model dropdown.
Refreshes the list of available cross-correlation models based on the current target and radiation transfer mode selection.
- run_selected_generation()[source]¶
Run the selected generation based on dropdown choice.
Checks the generation mode dropdown and calls the appropriate generation function. Supports synthetic generations with continuous or discontinuous PWV, and shuffle generations.
- modify_target_list(target_list)[source]¶
Update the target dropdown with a new list of targets.
Recreates the target dropdown widget with new target options and updates the callback function.
- Parameters:
target_list (list) – List of target names to populate the dropdown
- run_shuffle()[source]¶
Run the HR data shuffle with the current configuration.
Collects all current settings and parameters from the GUI and executes the HR data shuffle using the shuffle_HR function. This method runs synchronously and blocks until completion.
- run_synthetic(discontinuos=True)[source]¶
Run the synthetic HR data generation in background with the current configuration.
Handles stellar spectrum download if needed and runs the synthetic generation in a background subprocess. Manages parameter collection, stellar spectrum acquisition, and background process monitoring.
- Parameters:
discontinuos (bool, optional) – Whether to use discontinuous PWV modeling, by default True