GUIBRUSHR.General_Constants.Classes.Night module¶
- exception GUIBRUSHR.General_Constants.Classes.Night.NightError[source]¶
Bases:
ExceptionBase exception class for Night-related errors.
- exception GUIBRUSHR.General_Constants.Classes.Night.FileNotFoundErrorPers[source]¶
Bases:
NightErrorRaised when a required file is not found.
- exception GUIBRUSHR.General_Constants.Classes.Night.DataValidationError[source]¶
Bases:
NightErrorRaised when data validation fails.
- GUIBRUSHR.General_Constants.Classes.Night.sigma_calc(spectra, simulation=False, err_substitute=50, sigma_floor=1e-05, mean_floor=1e-30)[source]¶
Calculate sigma values for spectral data.
err_substitute(sigma assigned to bad/degenerate pixels) andsigma_floor(the threshold below which a sigma is treated as degenerate) are tied to the SPACE ofspectra. Log-space residuals have sigma ~ a few x 1e-3; linear-space residuals (10**spectra, data ~ 1) have sigma ~ ln(10) larger. Callers working in linear space must pass the log thresholds scaled by ln(10) so that “huge” and “degenerate” keep the same meaning relative to the data. The defaults reproduce the original log-space behaviour.
- class GUIBRUSHR.General_Constants.Classes.Night.Night(chosen_limit_phase: float, path_instrument: str | Path, date: str, rad_mode: str, path_good_order: str | Path, path_order_tell: str | Path, path_order_test: str | Path, table_output_file: str | Path | None = None, CC: bool = False, simulation: bool = False, synthetic: bool = False, retrieval_standardize: str = 'From pkl')[source]¶
Bases:
objectA class to manage and process astronomical night observation data.
This class handles the processing of spectroscopic data, including phase calculations, spectral order management, and various data transformations.
- Variables:
intransit (NDArray) – Indices of spectra within transit
maskinvm (NDArray) – Mask inversion data
wlen_list_overplot (NDArray) – Wavelength list for overplotting
sigma_spectra (NDArray) – Spectral sigma values
lambdas (NDArray) – Wavelength data
spectra (NDArray) – Spectral data
n_good_orders (int) – Number of spectral orders
n_pixels (int) – Number of pixels
n_phases_considered (int) – Number of in-transit phases considered
good_order (NDArray) – Good order indices
n_tot_phases (int) – Total number of phases
barycentric_velocity (NDArray) – Barycentric velocity corrections
phases (NDArray) – Phase values
- __init__(chosen_limit_phase: float, path_instrument: str | Path, date: str, rad_mode: str, path_good_order: str | Path, path_order_tell: str | Path, path_order_test: str | Path, table_output_file: str | Path | None = None, CC: bool = False, simulation: bool = False, synthetic: bool = False, retrieval_standardize: str = 'From pkl') None[source]¶
Initialize the Night object with observation parameters.
- Parameters:
chosen_limit_phase – Phase limit for transit
path_instrument – Path to instrument data
date – Observation date
rad_mode – Radiation mode
path_good_order – Path to good order data
path_order_tell – Path to telluric order data
path_order_test – Path to test order data
table_output_file – Optional path for output table
CC – Cross-correlation flag
simulation – If True, simulate data
synthetic – If True, synthetic data
retrieval_standardize – Standardize option for retrieval data
- Raises:
NightError – If initialization of any data processing step fails
- load_aligned_and_spAb_pca(synthetic) None[source]¶
Load additional data files required for processing.
- fase_operation(chosen_limit_phase: float, CC: bool) None[source]¶
Process phase data and determine transit status.
- Parameters:
chosen_limit_phase – Phase limit for transit determination
CC – Cross-correlation flag
- Raises:
FileNotFoundErrorPers – If phase file is not found
- good_order_operation(synthetic) None[source]¶
Load good order data from pickle file.
- Parameters:
synthetic – If True, skip loading good order data.
- Raises:
FileNotFoundErrorPers – If good order file is not found
- management_spAbi(synthetic) None[source]¶
Process spectral data and set dimensional attributes. :param synthetic: If True, skip loading spectral data.
- Raises:
FileNotFoundErrorPers – If spectral data file is not found
- read_maskinv(synthetic) None[source]¶
Load and process mask inversion data. :param synthetic: If True, skip loading mask inversion data.
- Raises:
FileNotFoundErrorPers – If mask inversion file is not found
- read_wlen_sp(synthetic) None[source]¶
Read and process wavelength data.
- Parameters:
synthetic – If True, skip some loading wavelength data.
- Raises:
FileNotFoundErrorPers – If wavelength file is not found
- sigma_spectra_calc(simulation=False, synthetic=False)[source]¶
Calculate sigma (uncertainty) arrays for the spectral data.
- Parameters:
simulation – If True, use simulation-specific error handling.
synthetic – If True, skip calculation entirely.
- smooth_management(synthetic) None[source]¶
Load smoothing parameters from either smooth_file.pkl or temp_params_tell.pkl. :param synthetic: If True, skip loading smoothing parameters.
- Raises:
FileNotFoundErrorPers – If smoothing parameter file is not found