Utils
Created on Wed Jun 24 13:35 2024
@author: MCR
Miscellaneous tools.
- exouprf.utils.fancyprint(message, msg_type='INFO')
Fancy printing statement mimicking logging. Basically a hack to get around complications with the STScI pipeline logging.
- Parameters:
message (str) – Message to print.
msg_type (str) – Type of message. Mirrors the jwst pipeline logging.
- exouprf.utils.get_param_dict_from_fit(filename, method='median', mcmc_burnin=None, mcmc_thin=15, silent=False, drop_chains=None)
Reformat fit outputs from MCMC or NS into the parameter dictionary format expected by Model.
- Parameters:
filename (str) – Path to file with MCMC fit outputs.
method (str) – Method via which to get best fitting parameters from MCMC chains. Either “median” or “maxlike”.
mcmc_burnin (int) – Number of steps to discard as burn in. Defaults to 75% of chain length. Only for MCMC.
mcmc_thin (int) – Increment by which to thin chains. Only for MCMC.
silent (bool) – If False, print messages.
drop_chains (list(int), None) – Indices of chains to drop.
- Returns:
param_dict – Dictionary of light curve model parameters.
- Return type:
dict
- exouprf.utils.get_results_from_fit(filename, mcmc_burnin=None, mcmc_thin=15, silent=False, drop_chains=None)
Extract posterior sample statistics (median and 1 sigma bounds) for each fitted parameter.
- Parameters:
filename (str) – Path to file with MCMC fit outputs.
mcmc_burnin (int) – Number of steps to discard as burn in. Defaults to 75% of chain length. Only for MCMC.
mcmc_thin (int) – Increment by which to thin chains. Only for MCMC.
silent (bool) – If False, print messages.
drop_chains (list(int), None) – Indices of chains to drop.
- Returns:
results_dict – Dictionary of posterior medians and 1 sigma bounds for each fitted parameter.
- Return type:
dict
- exouprf.utils.ld_q2u(q1, q2)
Convert from Kipping to normal limb darkening parameters.
- exouprf.utils.ld_u2q(u1, u2)
Convert from normal to Kipping limb darkening parameters.