cometspec.config

Optional configuration dataclasses for high-level entry points.

These dataclasses provide a structured alternative to passing many keyword arguments. They are additive and fully backward compatible:

  • Every field defaults to a sentinel (UNSET) meaning “not provided”.

  • When a config is passed to a function that accepts one, only fields whose value is not UNSET override the corresponding individual keyword argument; all other behavior is unchanged.

  • Existing call sites that pass individual keyword arguments continue to work but if they are in the config class they will be overridden by the config values.

Two configs can be used:

Check their respective docstrings for details on the parameters, outputs or attributes. .. rubric:: Examples

from cometspec.config import MCMCFitConfig
from cometspec.mcmc import mcmc_fitting

cfg = MCMCFitConfig(nwalkers=80, nsteps=2000)
mcmc_fitting(data, window, pumping=p, priors=pr, config=cfg)
from cometspec.config import FluorescenceModelConfig
from cometspec.fluorescence import FluorescenceModel

cfg = FluorescenceModelConfig(
    isotopologues=["12C14N", "13C14N"],
    systems="bx",
    T=200.0,
    logN=11.5,
)
FluorescenceModel(pumping=p, config=cfg)
class cometspec.config.FluorescenceModelConfig(data=UNSET, window=UNSET, pumping=UNSET, isotopologues=UNSET, systems=UNSET, linelists=UNSET, line_path=UNSET, lsf=UNSET, lsf_method=UNSET, sigma=UNSET, sigma1=UNSET, sigma2=UNSET, sigma_G=UNSET, fwhm_L=UNSET, ratio=UNSET, A_min=UNSET, a=UNSET, name=UNSET, logN=UNSET, logN_by_iso=UNSET, logQ=UNSET, logQ_by_iso=UNSET, T=UNSET, T_by_iso=UNSET, v_kms=UNSET, v_kms_by_iso=UNSET, dlam=UNSET, dlam_by_iso=UNSET, wave_col=UNSET, flux_col=UNSET, error_col=UNSET, continuum_col=UNSET, omega=UNSET, include_rotations=UNSET, pumping_v_kms=UNSET, pumping_dlam_A=UNSET, model_wave=UNSET, n_cores=UNSET)[source]

Bases: object

Optional grouped configuration for FluorescenceModel.

Each field mirrors the corresponding constructor keyword argument. Any field left at UNSET (the default) is ignored, so the constructor keeps its existing default. Fields explicitly set on this object override the individual keyword arguments.

data = UNSET
window = UNSET
pumping = UNSET
isotopologues = UNSET
systems = UNSET
linelists = UNSET
line_path = UNSET
lsf = UNSET
lsf_method = UNSET
sigma = UNSET
sigma1 = UNSET
sigma2 = UNSET
sigma_G = UNSET
fwhm_L = UNSET
ratio = UNSET
A_min = UNSET
a = UNSET
name = UNSET
logN = UNSET
logN_by_iso = UNSET
logQ = UNSET
logQ_by_iso = UNSET
T = UNSET
T_by_iso = UNSET
v_kms = UNSET
v_kms_by_iso = UNSET
dlam = UNSET
dlam_by_iso = UNSET
wave_col = UNSET
flux_col = UNSET
error_col = UNSET
continuum_col = UNSET
omega = UNSET
include_rotations = UNSET
pumping_v_kms = UNSET
pumping_dlam_A = UNSET
model_wave = UNSET
n_cores = UNSET
class cometspec.config.MCMCFitConfig(data=UNSET, window=UNSET, pumping=UNSET, priors=UNSET, isotopologues=UNSET, systems=UNSET, linelists=UNSET, include_rotations=UNSET, include_deltaJ0_parity_mix=UNSET, require_X_only_for_rot=UNSET, nwalkers=UNSET, nsteps=UNSET, n_cores=UNSET, lsf=UNSET, lsf_method=UNSET, make_plots=UNSET, progress=UNSET, A_min=UNSET, a=UNSET, velocity_kms=UNSET, delta_lambda_A=UNSET, init_logQ=UNSET, init_logQ_by_iso=UNSET, init_T=UNSET, init_T_by_iso=UNSET, init_v_kms=UNSET, init_v_kms_by_iso=UNSET, init_dlam=UNSET, init_dlam_by_iso=UNSET, init_logN=UNSET, init_logN_by_iso=UNSET, init_sigma=UNSET, init_sigma1=UNSET, init_sigma2=UNSET, init_sigma_G=UNSET, init_fwhm_L=UNSET, init_ratio=UNSET, fig_file=UNSET, wave_col=UNSET, flux_col=UNSET, error_col=UNSET, continuum_col=UNSET, omega=UNSET, verbose=UNSET, pruning=UNSET, N_Model=UNSET)[source]

Bases: object

Optional grouped configuration for cometspec.mcmc.mcmc_fitting().

Each field mirrors the corresponding keyword argument of mcmc_fitting(). Any field left at UNSET is ignored. Fields explicitly set override the individual keyword arguments passed at the call site.

data = UNSET
window = UNSET
pumping = UNSET
priors = UNSET
isotopologues = UNSET
systems = UNSET
linelists = UNSET
include_rotations = UNSET
include_deltaJ0_parity_mix = UNSET
require_X_only_for_rot = UNSET
nwalkers = UNSET
nsteps = UNSET
n_cores = UNSET
lsf = UNSET
lsf_method = UNSET
make_plots = UNSET
progress = UNSET
A_min = UNSET
a = UNSET
velocity_kms = UNSET
delta_lambda_A = UNSET
init_logQ = UNSET
init_logQ_by_iso = UNSET
init_T = UNSET
init_T_by_iso = UNSET
init_v_kms = UNSET
init_v_kms_by_iso = UNSET
init_dlam = UNSET
init_dlam_by_iso = UNSET
init_logN = UNSET
init_logN_by_iso = UNSET
init_sigma = UNSET
init_sigma1 = UNSET
init_sigma2 = UNSET
init_sigma_G = UNSET
init_fwhm_L = UNSET
init_ratio = UNSET
fig_file = UNSET
wave_col = UNSET
flux_col = UNSET
error_col = UNSET
continuum_col = UNSET
omega = UNSET
verbose = UNSET
pruning = UNSET
N_Model = UNSET