POSEIDON.retrieval

Functions related to atmospheric retrieval.

Attributes

comm

rank

allowed_simplex

allowed_simplex_surfaces

Functions

run_retrieval(planet, star, model, opac, data, priors, ...)

ADD DOCSTRING (will hopefully be done before the heat death of the Universe)

forward_model(param_vector, planet, star, model, opac, ...)

ADD DOCSTRING

CLR_Prior(chem_params_drawn[, limit])

Implements the centred-log-ratio (CLR) prior for chemical mixing ratios.

PyMultiNest_retrieval(planet, star, model, opac, data, ...)

Main function for conducting atmospheric retrievals with PyMultiNest.

retrieved_samples(planet, star, model, opac, data, ...)

ADD DOCSTRING

get_retrieved_atmosphere(planet, model, P[, ...])

Creates the atmosphere dictionary for the median or best fit spectrum of a retrieval.

Z_to_sigma(ln_Z1, ln_Z2)

Convert the log-evidences of two models to a sigma confidence level.

Bayesian_model_comparison(planet_name, model_1, model_2)

Conduct Bayesian model comparison between the outputs of two retrievals.

Module Contents

POSEIDON.retrieval.comm
POSEIDON.retrieval.rank
POSEIDON.retrieval.allowed_simplex = 1
POSEIDON.retrieval.allowed_simplex_surfaces = 1
POSEIDON.retrieval.run_retrieval(planet, star, model, opac, data, priors, wl, P, P_ref=None, R_p_ref=None, P_param_set=0.01, R=None, retrieval_name=None, He_fraction=0.17, N_slice_EM=2, N_slice_DN=4, constant_gravity=False, spectrum_type='transmission', y_p=np.array([0.0]), stellar_T_step=20, stellar_log_g_step=0.1, N_live=400, ev_tol=0.5, sampling_algorithm='MultiNest', resume=False, verbose=True, sampling_target='parameter', chem_grid='fastchem', N_output_samples=1000, save_ymodel=False)

ADD DOCSTRING (will hopefully be done before the heat death of the Universe)

POSEIDON.retrieval.forward_model(param_vector, planet, star, model, opac, data, wl, P, P_ref_set, R_p_ref_set, P_param_set, He_fraction, N_slice_EM, N_slice_DN, spectrum_type, T_phot_grid, T_het_grid, log_g_phot_grid, log_g_het_grid, I_phot_grid, I_het_grid, y_p, F_s_obs, constant_gravity, chemistry_grid)

ADD DOCSTRING

POSEIDON.retrieval.CLR_Prior(chem_params_drawn, limit=-12.0)

Implements the centred-log-ratio (CLR) prior for chemical mixing ratios.

CLR[i] here is the centred log-ratio transform of the mixing ratio, X[i]

POSEIDON.retrieval.PyMultiNest_retrieval(planet, star, model, opac, data, prior_types, prior_ranges, spectrum_type, wl, P, P_ref_set, R_p_ref_set, P_param_set, He_fraction, N_slice_EM, N_slice_DN, N_params, T_phot_grid, T_het_grid, log_g_phot_grid, log_g_het_grid, I_phot_grid, I_het_grid, y_p, F_s_obs, constant_gravity, chemistry_grid, **kwargs)

Main function for conducting atmospheric retrievals with PyMultiNest.

POSEIDON.retrieval.retrieved_samples(planet, star, model, opac, data, retrieval_name, wl, P, P_ref_set, R_p_ref_set, P_param_set, He_fraction, N_slice_EM, N_slice_DN, spectrum_type, T_phot_grid, T_het_grid, log_g_phot_grid, log_g_het_grid, I_phot_grid, I_het_grid, y_p, F_s_obs, constant_gravity, chemistry_grid, N_output_samples, comm=None)

ADD DOCSTRING

POSEIDON.retrieval.get_retrieved_atmosphere(planet, model, P, P_ref_set=10, R_p_ref_set=None, median=False, best_fit=True, P_param_set=0.01, He_fraction=0.17, N_slice_EM=2, N_slice_DN=4, constant_gravity=False, chemistry_grid=None, specific_param_values=[], verbose=False)

Creates the atmosphere dictionary for the median or best fit spectrum of a retrieval.

Parameters:
  • planet (dict) – Collection of planetary properties used POSEIDON.

  • model (dict) – A specific description of a given POSEIDON model.

  • P (np.array of float) – Model pressure grid (bar).

  • P_ref (float) – Reference pressure (bar).

  • R_p_ref (float) – Planet radius corresponding to reference pressure (m).

  • median (optional, bool) – Option to create an atmosphere from the median retrieved spectrum.

  • best_fit (optional, bool) –

    Option to create an atmosphere from the best fit retrieved spectrum

    He_fraction (float):

    Assumed H2/He ratio (0.17 default corresponds to the solar ratio).

  • N_slice_EM (even int) – Number of azimuthal slices in the evening-morning transition region.

  • N_slice_DN (even int) – Number of zenith slices in the day-night transition region.

  • constant_gravity (bool) – If True, disable inverse square law gravity (only for testing).

  • chemistry_grid (dict) – For models with a pre-computed chemistry grid only, this dictionary is produced in chemistry.py.

  • specific_param_values (list) – If a specific parameter combination is provided, this will be used instead of the median or best fit parameters.

Returns:

Collection of atmospheric properties required to compute the resultant spectrum of the planet.

Return type:

atmosphere (dict)

POSEIDON.retrieval.Z_to_sigma(ln_Z1, ln_Z2)

Convert the log-evidences of two models to a sigma confidence level.

POSEIDON.retrieval.Bayesian_model_comparison(planet_name, model_1, model_2, ln_Z_format='{:.2f}', B_format='{:.2e}', ln_B_format='{:.2f}', sigma_format='{:.1f}')

Conduct Bayesian model comparison between the outputs of two retrievals. This function outputs the Bayes factor and equivalent sigma significance comparing the two models.