amoeba2
Submodules
amoeba2.absorption_model
absorption_model.py AbsorptionModel definition
Copyright(C) 2024 by Trey V. Wenger; tvwenger@gmail.com This code is licensed under MIT license (see LICENSE for details)
- class amoeba2.absorption_model.AbsorptionModel(*args, mol_data: dict | None = None, **kwargs)
Bases:
BaseModelDefinition of the AbsorptionModel. SpecData keys must be “absorption_1612”, “absorption_1665”, “absorption_1667”, and “absorption_1720”.
- Attributes:
baseline_deterministicsGet the deterministic baseline parameter names.
baseline_freeRVsGet the free baseline parameter names.
cloud_deterministicsGet the deterministic cloud parameter names.
cloud_freeRVsGet the free cloud parameter names.
hyper_deterministicsGet the deterministic hyper parameter names.
hyper_freeRVsGet the free hyper parameter names.
labellerGet the arviz labeller.
unique_solutionCheck if posterior samples suggest a unique solution.
Methods
add_baseline_priors([prior_baseline_coeffs])Add baseline priors to the model.
Add likelihood to the model.
add_priors([prior_tau, prior_log10_depth, ...])Add priors and deterministics to the model.
bic([chain, solution])Calculate the Bayesian information criterion at the mean point estimate.
fit([n, draws, rel_tolerance, ...])Approximate posterior distribution using Variational Inference (VI).
graph()Generate visualization of the model graph.
mean_lnlike([chain, solution])Evaluate mean log-likelihood over posterior samples.
null_bic()Evaluate the Bayesian Information Criterion for the null hypothesis (baseline only, no clouds)
Predict the absorption spectra from the model parameters.
predict_baseline([baseline_params])Predict the un-normalized baseline model.
reset_results()Reset results and convergence checks.
sample([init, n_init, chains, init_kwargs, ...])Sample posterior distribution using MCMC.
sample_posterior_predictive([solution, thin])Generate posterior predictive samples
sample_prior_predictive([samples])Generate prior predictive samples
sample_smc(**kwargs)Sample posterior distribution using Sequential Monte Carlo.
solve([num_gmm_samples, kl_div_threshold])Identify unique solutions and break the labeling degeneracy.
- add_likelihood()
Add likelihood to the model.
- add_priors(prior_tau: Iterable[float] = [0.1, 0.1], prior_log10_depth: Iterable[float] = [0.0, 0.25], prior_log10_Tkin: Iterable[float] = [2.0, 1.0], prior_velocity: Iterable[float] = [0.0, 10.0], prior_log10_nth_fwhm_1pc: Iterable[float] = [0.2, 0.1], prior_depth_nth_fwhm_power: Iterable[float] = [0.4, 0.1], prior_baseline_coeffs: dict[str, Iterable[float]] | None = None, ordered: bool = False, mainline_pos_tau: bool = False)
Add priors and deterministics to the model.
- Parameters:
- prior_taufloat, optional
Prior distribution on optical depth, by default [0.1, 0.1], where tau ~ Normal(mu=prior[0], sigma=prior[1])
- prior_log10_depthIterable[float], optional
Prior distribution on log10 depth (pc), by default [0.0, 0.25], where log10_depth ~ Normal(mu=prior[0], sigma=prior[1])
- prior_log10_TkinIterable[float], optional
Prior distribution on log10 kinetic temperature (K), by default [2.0, 1.0], where log10_Tkin ~ Normal(mu=prior[0], sigma=prior[1])
- prior_velocityIterable[float], optional
Prior distribution on centroid velocity (km s-1), by default [0.0, 10.0], where velocity ~ Normal(mu=prior[0], sigma=prior[1])
- prior_log10_nth_fwhm_1pcIterable[float], optional
Prior distribution on non-thermal line width at 1 pc, by default [0.2, 0.1], where log10_nth_fwhm_1pc ~ Normal(mu=prior[0], sigma=prior[1])
- prior_depth_nth_fwhm_powerIterable[float], optional
Prior distribution on depth vs. non-thermal line width power law index, by default [0.4, 0.1], where depth_nth_fwhm_power ~ Normal(mu=prior[0], sigma=prior[1])
- prior_baseline_coeffsOptional[dict[str, Iterable[float]]], optional
Width of normal prior distribution on the normalized baseline polynomial coefficients. Keys are dataset names and values are lists of length baseline_degree+1. If None, use [1.0]*(baseline_degree+1) for each dataset, by default None
- orderedbool, optional
If True, assume ordered velocities (optically thin assumption), by default False. If True, the prior distribution on the velocity becomes velocity(cloud = n) ~ prior[0] + sum_i(velocity[i < n]) + Gamma(alpha=2.0, beta=1.0/prior[1])
- mainline_pos_tau: bool, optional
If True, assume positive main line optical depths, by default False. If True, the prior distribution on the main line (1665 and 1667 MHz) optical depths becomes tau ~ HalfNormal(sigma=prior[1])
- predict_absorption() dict
Predict the absorption spectra from the model parameters.
- Returns:
- dict
Optical depth spectra for 1612, 1665, 1667, and 1720 MHz transitions
amoeba2.emission_absorption_model
emission_absorption_model.py EmissionAbsorptionModel definition
Copyright(C) 2024 by Trey V. Wenger; tvwenger@gmail.com This code is licensed under MIT license (see LICENSE for details)
- class amoeba2.emission_absorption_model.EmissionAbsorptionModel(*args, mol_data: dict | None = None, bg_temp: float = 3.77, **kwargs)
Bases:
BaseModelDefinition of the TBTauModel. SpecData keys must be “absorption_1612”, “absorption_1665”, “absorption_1667”, “absorption_1720”, “emission_1612”, “emission_1665”, “emission_1667”, and “emission_1720”.
- Attributes:
baseline_deterministicsGet the deterministic baseline parameter names.
baseline_freeRVsGet the free baseline parameter names.
cloud_deterministicsGet the deterministic cloud parameter names.
cloud_freeRVsGet the free cloud parameter names.
hyper_deterministicsGet the deterministic hyper parameter names.
hyper_freeRVsGet the free hyper parameter names.
labellerGet the arviz labeller.
unique_solutionCheck if posterior samples suggest a unique solution.
Methods
add_baseline_priors([prior_baseline_coeffs])Add baseline priors to the model.
Add likelihood to the model.
add_priors([prior_log10_N0, ...])Add priors and deterministics to the model.
bic([chain, solution])Calculate the Bayesian information criterion at the mean point estimate.
fit([n, draws, rel_tolerance, ...])Approximate posterior distribution using Variational Inference (VI).
graph()Generate visualization of the model graph.
mean_lnlike([chain, solution])Evaluate mean log-likelihood over posterior samples.
null_bic()Evaluate the Bayesian Information Criterion for the null hypothesis (baseline only, no clouds)
predict_baseline([baseline_params])Predict the un-normalized baseline model.
Predict the emission and absorption spectra from the model parameters.
reset_results()Reset results and convergence checks.
sample([init, n_init, chains, init_kwargs, ...])Sample posterior distribution using MCMC.
sample_posterior_predictive([solution, thin])Generate posterior predictive samples
sample_prior_predictive([samples])Generate prior predictive samples
sample_smc(**kwargs)Sample posterior distribution using Sequential Monte Carlo.
solve([num_gmm_samples, kl_div_threshold])Identify unique solutions and break the labeling degeneracy.
- add_likelihood()
Add likelihood to the model.
- add_priors(prior_log10_N0: Iterable[float] = [13.0, 1.0], prior_log_boltz_factor: Iterable[float] = [-0.1, 0.1], prior_log10_depth: Iterable[float] = [0.0, 0.25], prior_log10_Tkin: Iterable[float] = [2.0, 1.0], prior_velocity: Iterable[float] = [0.0, 10.0], prior_log10_nth_fwhm_1pc: Iterable[float] = [0.2, 0.1], prior_depth_nth_fwhm_power: Iterable[float] = [0.4, 0.1], prior_baseline_coeffs: dict[str, Iterable[float]] | None = None, ordered: bool = False, mainline_pos_tau: bool = False)
Add priors and deterministics to the model.
- Parameters:
- prior_log10_N0Iterable[float], optional
Prior distribution on log10 column density (cm-2) in lowest energy state, by default [13.0, 1.0], where log10_N0 ~ Normal(mu=prior[0], sigma=prior[1])
- prior_log_boltz_factorIterable[float], optional
Prior distribution on log Boltzmann factor = -h*freq/(k*Tex), by default [-0.1, 0.1], where log_boltz_factor ~ Normal(mu=prior[0], sigma=prior[1])
- prior_log10_depthIterable[float], optional
Prior distribution on log10 depth (pc), by default [0.0, 0.25], where log10_depth ~ Normal(mu=prior[0], sigma=prior[1])
- prior_log10_TkinIterable[float], optional
Prior distribution on log10 kinetic temperature (K), by default [2.0, 1.0], where log10_Tkin ~ Normal(mu=prior[0], sigma=prior[1])
- prior_velocityIterable[float], optional
Prior distribution on centroid velocity (km s-1), by default [0.0, 10.0], where velocity ~ Normal(mu=prior[0], sigma=prior[1])
- prior_log10_nth_fwhm_1pcIterable[float], optional
Prior distribution on non-thermal line width at 1 pc, by default [0.2, 0.1], where log10_nth_fwhm_1pc ~ Normal(mu=prior[0], sigma=prior[1])
- prior_depth_nth_fwhm_powerIterable[float], optional
Prior distribution on depth vs. non-thermal line width power law index, by default [0.4, 0.1], where depth_nth_fwhm_power ~ Normal(mu=prior[0], sigma=prior[1])
- prior_baseline_coeffsOptional[dict[str, Iterable[float]]], optional
Width of normal prior distribution on the normalized baseline polynomial coefficients. Keys are dataset names and values are lists of length baseline_degree+1. If None, use [1.0]*(baseline_degree+1) for each dataset, by default None
- orderedbool, optional
If True, assume ordered velocities (optically thin assumption), by default False. If True, the prior distribution on the velocity becomes velocity(cloud = n) ~ prior[0] + sum_i(velocity[i < n]) + Gamma(alpha=2.0, beta=1.0/prior[1])
- mainline_pos_tau: bool, optional
If True, assume positive main line excitation temperatures, by default False. If True, the prior distribution on the Boltzmann factor for the main lines (1665 and 1667) becomes log_boltz_factor ~ HalfNormal(sigma=prior[1])
- predict_emission_absorption() dict
Predict the emission and absorption spectra from the model parameters.
- Returns:
- dict
Emission spectra (brightness temp; K) for 1612, 1665, 1667, and 1720 MHz transitions
- dict
Absorption spectra (1 - exp(-tau)) for 1612, 1665, 1667, and 1720 MHz transitions
amoeba2.physics
physics.py Molecular spectroscopy physics utilities
Copyright(C) 2024 by Trey V. Wenger; tvwenger@gmail.com This code is licensed under MIT license (see LICENSE for details)
- amoeba2.physics.calc_Tex(freq: float, log_boltz_factor: float) float
Evaluate the excitation temperature from a given Boltzmann factor.
- Parameters:
- freqfloat
Frequency (MHz)
- log_boltz_factorfloat
log Boltzmann factor = -h*freq/(k*Tex)
- Returns:
- float
Excitation temperature
- amoeba2.physics.calc_line_profile(velo_axis: Iterable[float], velocity: Iterable[float], fwhm: Iterable[float]) Iterable[float]
Evaluate the Gaussian line profile, ensuring normalization.
- Parameters:
- velo_axisIterable[float]
Observed velocity axis (km s-1; length S)
- velocityIterable[float]
Cloud center velocities (km s-1; length C)
- fwhmIterable[float]
Cloud FWHM line widths (km s-1; length C)
- Returns:
- Iterable[float]
Line profile (km-1 s; shape S x C)
- amoeba2.physics.calc_nonthermal_fwhm(depth: float, nth_fwhm_1pc: float, depth_nth_fwhm_power: float) float
Calculate the non-thermal line broadening assuming a power-law size-linewidth relationship.
- Parameters:
- depthfloat
Line-of-sight depth (pc)
- nth_fwhm_1pcfloat
Non-thermal broadening at 1 pc (km s-1)
- depth_nth_fwhm_powerfloat
Power law index
- Returns:
- float
Non-thermal FWHM line width (km s-1)
- amoeba2.physics.calc_optical_depth(gu: int, gl: int, Nl: Iterable[float], boltz_factor: Iterable[float], line_profile: Iterable[float], freq: float, Aul: float) Iterable[float]
Evaluate the optical depth spectra, from Mangum & Shirley eq. 29
- Parameters:
- guint
Upper state degeneracy
- glint
Lower state degeneracy
- NlIterable[float]
Cloud lower state column densities (cm-2; length C)
- boltz_factorIterable[float]
Boltzmann factor = exp(-h*freq/(k*Tex)) (length C)
- line_profileIterable[float]
Line profile (km-1 s; shape S x C)
- freqfloat
Transition frequency (MHz)
- Aulfloat
Transition Einstein A coefficient (s-1)
- Returns:
- Iterable[float]
Optical depth spectral (shape S x C)
- amoeba2.physics.calc_thermal_fwhm(kinetic_temp: float, weight: float = 17.0) float
Calculate the thermal line broadening assuming a Maxwellian velocity distribution (Condon & Ransom eq. 7.35)
- Parameters:
- kinetic_tempfloat
Kinetic temperature (K)
- weightfloat
Molecular weight (number of protons). By default, 17 (OH molecule)
- Returns:
- float
Thermal FWHM line width (km s-1)
- amoeba2.physics.radiative_transfer(freq: float, tau: Iterable[float], Tex: Iterable[float], bg_temp: float) Iterable[float]
Evaluate the radiative transfer to predict the emission spectrum. The emission spectrum is ON - OFF, where ON includes the attenuated emission of the background and the clouds, and the OFF is the emission of the background. Order of N clouds is assumed to be [nearest, …, farthest].
- Parameters:
- freqfloat
Frequency (MHz)
- tauIterable[float]
Optical depth spectra (shape S x N)
- TexIterable[float]
Cloud excitation temperature (K; length N)
- bg_tempfloat
Assumed background temperature
- Returns:
- Iterable[float]
Predicted emission brightness temperature spectrum (K; length S)
- amoeba2.physics.rj_temperature(freq: float, temp: float) float
Calculate the Rayleigh-Jeans equivalent temperature (AKA the brightness temperature)
- Parameters:
- freqfloat
Frequency (MHz)
- tempfloat
Temperature (K)
- Returns:
- float
R-J equivalent temperature (K)
amoeba2.utils
utils.py Various utilities.
Copyright(C) 2024 by Trey V. Wenger; tvwenger@gmail.com This code is licensed under MIT license (see LICENSE for details)
- amoeba2.utils.get_molecule_data(molecule: str | None = 'OH', fmin: float = 1.0, fmax: float = 2.0, rot_state_lower: int | None = 0) dict
Get molecular transition data from the JPL database. By default fetches data for 1612, 1665, 1667, and 1720 MHz OH hyperfine transitions.
- Parameters:
- moleculestr, optional
Molecule name, by default “OH”
- fminfloat, optional
Minimum frequency (GHz), by default 0.0
- fmaxfloat, optional
Maximum frequency (GHz), by default 10000.0
- rot_state_lowerOptional[int], optional
For OH, if not None, then limit to this lower rotational state, which is assumed to be the second quantum number returned by JPLSpec, by default 0
- Returns:
- dict
Molecular transition data, with keys: “freq” (Iterable[float]) : Rest frequencies (MHz) “Aul” (Iterable[float]) : Einstein A coefficients (s-1) “degu” (Iterable[float]) : Upper state degeneracies “Eu” (Iterable[float]) : Upper state energies (erg) “relative_int” (Iterable[float]) : Relative intensities “log10_Q_terms” (Iterable[float]) : Polynomial coefficients for logQ vs. logT (K)
- Raises:
- ValueError
Molecule not found in JPLSpec database
Module contents
- class amoeba2.AbsorptionModel(*args, mol_data: dict | None = None, **kwargs)
Bases:
BaseModelDefinition of the AbsorptionModel. SpecData keys must be “absorption_1612”, “absorption_1665”, “absorption_1667”, and “absorption_1720”.
- Attributes:
baseline_deterministicsGet the deterministic baseline parameter names.
baseline_freeRVsGet the free baseline parameter names.
cloud_deterministicsGet the deterministic cloud parameter names.
cloud_freeRVsGet the free cloud parameter names.
hyper_deterministicsGet the deterministic hyper parameter names.
hyper_freeRVsGet the free hyper parameter names.
labellerGet the arviz labeller.
unique_solutionCheck if posterior samples suggest a unique solution.
Methods
add_baseline_priors([prior_baseline_coeffs])Add baseline priors to the model.
Add likelihood to the model.
add_priors([prior_tau, prior_log10_depth, ...])Add priors and deterministics to the model.
bic([chain, solution])Calculate the Bayesian information criterion at the mean point estimate.
fit([n, draws, rel_tolerance, ...])Approximate posterior distribution using Variational Inference (VI).
graph()Generate visualization of the model graph.
mean_lnlike([chain, solution])Evaluate mean log-likelihood over posterior samples.
null_bic()Evaluate the Bayesian Information Criterion for the null hypothesis (baseline only, no clouds)
Predict the absorption spectra from the model parameters.
predict_baseline([baseline_params])Predict the un-normalized baseline model.
reset_results()Reset results and convergence checks.
sample([init, n_init, chains, init_kwargs, ...])Sample posterior distribution using MCMC.
sample_posterior_predictive([solution, thin])Generate posterior predictive samples
sample_prior_predictive([samples])Generate prior predictive samples
sample_smc(**kwargs)Sample posterior distribution using Sequential Monte Carlo.
solve([num_gmm_samples, kl_div_threshold])Identify unique solutions and break the labeling degeneracy.
- add_likelihood()
Add likelihood to the model.
- add_priors(prior_tau: Iterable[float] = [0.1, 0.1], prior_log10_depth: Iterable[float] = [0.0, 0.25], prior_log10_Tkin: Iterable[float] = [2.0, 1.0], prior_velocity: Iterable[float] = [0.0, 10.0], prior_log10_nth_fwhm_1pc: Iterable[float] = [0.2, 0.1], prior_depth_nth_fwhm_power: Iterable[float] = [0.4, 0.1], prior_baseline_coeffs: dict[str, Iterable[float]] | None = None, ordered: bool = False, mainline_pos_tau: bool = False)
Add priors and deterministics to the model.
- Parameters:
- prior_taufloat, optional
Prior distribution on optical depth, by default [0.1, 0.1], where tau ~ Normal(mu=prior[0], sigma=prior[1])
- prior_log10_depthIterable[float], optional
Prior distribution on log10 depth (pc), by default [0.0, 0.25], where log10_depth ~ Normal(mu=prior[0], sigma=prior[1])
- prior_log10_TkinIterable[float], optional
Prior distribution on log10 kinetic temperature (K), by default [2.0, 1.0], where log10_Tkin ~ Normal(mu=prior[0], sigma=prior[1])
- prior_velocityIterable[float], optional
Prior distribution on centroid velocity (km s-1), by default [0.0, 10.0], where velocity ~ Normal(mu=prior[0], sigma=prior[1])
- prior_log10_nth_fwhm_1pcIterable[float], optional
Prior distribution on non-thermal line width at 1 pc, by default [0.2, 0.1], where log10_nth_fwhm_1pc ~ Normal(mu=prior[0], sigma=prior[1])
- prior_depth_nth_fwhm_powerIterable[float], optional
Prior distribution on depth vs. non-thermal line width power law index, by default [0.4, 0.1], where depth_nth_fwhm_power ~ Normal(mu=prior[0], sigma=prior[1])
- prior_baseline_coeffsOptional[dict[str, Iterable[float]]], optional
Width of normal prior distribution on the normalized baseline polynomial coefficients. Keys are dataset names and values are lists of length baseline_degree+1. If None, use [1.0]*(baseline_degree+1) for each dataset, by default None
- orderedbool, optional
If True, assume ordered velocities (optically thin assumption), by default False. If True, the prior distribution on the velocity becomes velocity(cloud = n) ~ prior[0] + sum_i(velocity[i < n]) + Gamma(alpha=2.0, beta=1.0/prior[1])
- mainline_pos_tau: bool, optional
If True, assume positive main line optical depths, by default False. If True, the prior distribution on the main line (1665 and 1667 MHz) optical depths becomes tau ~ HalfNormal(sigma=prior[1])
- predict_absorption() dict
Predict the absorption spectra from the model parameters.
- Returns:
- dict
Optical depth spectra for 1612, 1665, 1667, and 1720 MHz transitions
- class amoeba2.EmissionAbsorptionModel(*args, mol_data: dict | None = None, bg_temp: float = 3.77, **kwargs)
Bases:
BaseModelDefinition of the TBTauModel. SpecData keys must be “absorption_1612”, “absorption_1665”, “absorption_1667”, “absorption_1720”, “emission_1612”, “emission_1665”, “emission_1667”, and “emission_1720”.
- Attributes:
baseline_deterministicsGet the deterministic baseline parameter names.
baseline_freeRVsGet the free baseline parameter names.
cloud_deterministicsGet the deterministic cloud parameter names.
cloud_freeRVsGet the free cloud parameter names.
hyper_deterministicsGet the deterministic hyper parameter names.
hyper_freeRVsGet the free hyper parameter names.
labellerGet the arviz labeller.
unique_solutionCheck if posterior samples suggest a unique solution.
Methods
add_baseline_priors([prior_baseline_coeffs])Add baseline priors to the model.
Add likelihood to the model.
add_priors([prior_log10_N0, ...])Add priors and deterministics to the model.
bic([chain, solution])Calculate the Bayesian information criterion at the mean point estimate.
fit([n, draws, rel_tolerance, ...])Approximate posterior distribution using Variational Inference (VI).
graph()Generate visualization of the model graph.
mean_lnlike([chain, solution])Evaluate mean log-likelihood over posterior samples.
null_bic()Evaluate the Bayesian Information Criterion for the null hypothesis (baseline only, no clouds)
predict_baseline([baseline_params])Predict the un-normalized baseline model.
Predict the emission and absorption spectra from the model parameters.
reset_results()Reset results and convergence checks.
sample([init, n_init, chains, init_kwargs, ...])Sample posterior distribution using MCMC.
sample_posterior_predictive([solution, thin])Generate posterior predictive samples
sample_prior_predictive([samples])Generate prior predictive samples
sample_smc(**kwargs)Sample posterior distribution using Sequential Monte Carlo.
solve([num_gmm_samples, kl_div_threshold])Identify unique solutions and break the labeling degeneracy.
- add_likelihood()
Add likelihood to the model.
- add_priors(prior_log10_N0: Iterable[float] = [13.0, 1.0], prior_log_boltz_factor: Iterable[float] = [-0.1, 0.1], prior_log10_depth: Iterable[float] = [0.0, 0.25], prior_log10_Tkin: Iterable[float] = [2.0, 1.0], prior_velocity: Iterable[float] = [0.0, 10.0], prior_log10_nth_fwhm_1pc: Iterable[float] = [0.2, 0.1], prior_depth_nth_fwhm_power: Iterable[float] = [0.4, 0.1], prior_baseline_coeffs: dict[str, Iterable[float]] | None = None, ordered: bool = False, mainline_pos_tau: bool = False)
Add priors and deterministics to the model.
- Parameters:
- prior_log10_N0Iterable[float], optional
Prior distribution on log10 column density (cm-2) in lowest energy state, by default [13.0, 1.0], where log10_N0 ~ Normal(mu=prior[0], sigma=prior[1])
- prior_log_boltz_factorIterable[float], optional
Prior distribution on log Boltzmann factor = -h*freq/(k*Tex), by default [-0.1, 0.1], where log_boltz_factor ~ Normal(mu=prior[0], sigma=prior[1])
- prior_log10_depthIterable[float], optional
Prior distribution on log10 depth (pc), by default [0.0, 0.25], where log10_depth ~ Normal(mu=prior[0], sigma=prior[1])
- prior_log10_TkinIterable[float], optional
Prior distribution on log10 kinetic temperature (K), by default [2.0, 1.0], where log10_Tkin ~ Normal(mu=prior[0], sigma=prior[1])
- prior_velocityIterable[float], optional
Prior distribution on centroid velocity (km s-1), by default [0.0, 10.0], where velocity ~ Normal(mu=prior[0], sigma=prior[1])
- prior_log10_nth_fwhm_1pcIterable[float], optional
Prior distribution on non-thermal line width at 1 pc, by default [0.2, 0.1], where log10_nth_fwhm_1pc ~ Normal(mu=prior[0], sigma=prior[1])
- prior_depth_nth_fwhm_powerIterable[float], optional
Prior distribution on depth vs. non-thermal line width power law index, by default [0.4, 0.1], where depth_nth_fwhm_power ~ Normal(mu=prior[0], sigma=prior[1])
- prior_baseline_coeffsOptional[dict[str, Iterable[float]]], optional
Width of normal prior distribution on the normalized baseline polynomial coefficients. Keys are dataset names and values are lists of length baseline_degree+1. If None, use [1.0]*(baseline_degree+1) for each dataset, by default None
- orderedbool, optional
If True, assume ordered velocities (optically thin assumption), by default False. If True, the prior distribution on the velocity becomes velocity(cloud = n) ~ prior[0] + sum_i(velocity[i < n]) + Gamma(alpha=2.0, beta=1.0/prior[1])
- mainline_pos_tau: bool, optional
If True, assume positive main line excitation temperatures, by default False. If True, the prior distribution on the Boltzmann factor for the main lines (1665 and 1667) becomes log_boltz_factor ~ HalfNormal(sigma=prior[1])
- predict_emission_absorption() dict
Predict the emission and absorption spectra from the model parameters.
- Returns:
- dict
Emission spectra (brightness temp; K) for 1612, 1665, 1667, and 1720 MHz transitions
- dict
Absorption spectra (1 - exp(-tau)) for 1612, 1665, 1667, and 1720 MHz transitions