GUIBRUSHR.GUI.Input_Output_Panels.Input_Panels.TabPanels.Frame_Parameters.PanelStart module¶
PanelStart module: Provides the PanelStart class for initializing and managing the retrieval process in the GUI.
This module handles parameter validation, database operations, and process management for the retrieval workflow.
- class GUIBRUSHR.GUI.Input_Output_Panels.Input_Panels.TabPanels.Frame_Parameters.PanelStart.PanelStart(parent, row: int, column: int, color: str, path_main: str, path_default: str, **kwargs)[source]¶
Bases:
MyPanelPanel for starting the retrieval process in the GUI.
Handles initialization and execution of the retrieval process, including parameter validation, database operations, and process management.
- __init__(parent, row: int, column: int, color: str, path_main: str, path_default: str, **kwargs)[source]¶
Initialize the PanelStart class.
- Parameters:
parent – Parent widget
row (int) – Row position in the grid
column (int) – Column position in the grid
color (str) – Background color
path_main (str) – Path to the main script
path_default (str) – Path to default configuration
**kwargs – Additional keyword arguments
- divide_instrument(inst_str: str, resolution: str) tuple[str, bool, str][source]¶
Divide instrument string into components and validate paths.
- Parameters:
inst_str (str) – String containing instrument information
resolution (str) – Resolution type (‘HR’ or ‘LR’)
- Returns:
(processed instrument string, error flag, error message)
- Return type:
tuple
- create_df_general_inf() tuple[bool, str][source]¶
Create and validate the general information DataFrame for the retrieval process.
- Returns:
(error flag, error message)
- Return type:
tuple
- create_df_parameters() tuple[bool, str][source]¶
Create and validate the parameters DataFrame for the retrieval process.
This function processes parameters from the GUI, including non-molecular parameters, molecular parameters, and condensed molecular parameters if applicable. It populates the DataFrame with parameter details and prepares database strings for best parameters, fixed parameters, molecular equilibrium, and sigma priors.
- Returns:
(error flag, error message)
- Return type:
tuple
- add_to_df_parameters(name: str, present_var: int, molec_var: int, value: float, scale: float, range_min: float, range_max: float, rayleigh_var: int, in_bestpars_var: int, mass: float, sigma_prior: float, chemical_formula: str, constant_vmr: int, isotope: [<class 'str'>, None], opacity_name_low_resolution: [<class 'str'>, None] = None) None[source]¶
Add a parameter to the parameters DataFrame.
- Parameters:
name (str) – Parameter name
present_var (int) – Whether the parameter is present
molec_var (int) – Whether the parameter is molecular
value (float) – Parameter value
scale (float) – Scale factor
range_min (float) – Minimum range
range_max (float) – Maximum range
rayleigh_var (int) – Rayleigh variable
in_bestpars_var (int) – Whether the parameter is in best parameters
mass (float) – Mass of the parameter
sigma_prior (float) – Sigma prior
chemical_formula (str) – Chemical formula
constant_vmr (int) – Constant VMR flag
isotope (str) – Isotope information
opacity_name_low_resolution (str, optional) – Opacity name for low resolution. Defaults to None.
- start_retrieval() None[source]¶
Start the retrieval process by validating parameters and initializing the database.
This function creates and validates the general information and parameters DataFrames, prepares the output file, and inserts retrieval data into the database. It then starts the main retrieval process as a subprocess.
- start_main(path_df_parameters: str, path_df_general_info: str, path_file_output: str, target_name: str, dt_string: str, resume: str = 'False', checkbox_taskset: bool = False, end_core: int = 255, priority_proc: int = 19, n_best_pars: int = 10, chains_multiplier: int = 2, multiplier_cores: int = 1) None[source]¶
Start the main retrieval process as a subprocess.
- Parameters:
path_df_parameters (str) – Path to parameters DataFrame
path_df_general_info (str) – Path to general info DataFrame
path_file_output (str) – Path to output file
target_name (str) – Name of the target
dt_string (str) – Datetime string
resume (str) – Whether to resume a previous process
checkbox_taskset (bool) – Whether to use taskset
end_core (int) – End core for taskset
priority_proc (int) – Priority for the process
n_best_pars (int) – Number of best parameters
chains_multiplier – Multiplier for the number of chains
multiplier_cores – Multiplier for the number of cores