Saving Function
Function to allow the user to save any or all outputs from the mcmc
- src.magpy_rv.saving.save(folder_name, rv, time, rv_err, model_list=None, init_hparam=None, kernel=None, init_param=None, prior_list=[], fin_hparam_post=None, fin_param_post=None, logl_chain=None, masses=None, fin_param_values=None, fin_param_erru=None, fin_param_errd=None, flags=None, Mstar=None, fin_to_skck=False, burnin=0)[source]
Saves offset subtracted and combined RVs and times, rv_error, kernel name, model list, initial hyperparameters and parameters, initial LogL, priors, final hyperparameter and parameter posteriors as txt and pickle files, final LogL posterior as txt and pickle files, mass posteriors as txt and pickle, final hyperparameter, parameter and mass values along with errors in a readable form and as a latex table, final logL value
- Parameters
folder_name (string) – file destination of the folder to save to
rv (array of floats) – array of the rv values
time (array of floats) – array of the time values
rv_err (array of floats) – array of the rv error values
model_list (list of strings, optional) – list of the names of the model in use, defaults to None
init_hparam (dictionary, optional) – dictionary of the initial hyperparameters, defaults to None
kernel (string, optional) – name of the chosen kernel, defaults to None
init_param (dictionary, optional) – dictionary of the initial model parameters, defaults to None
prior_list (dictionary, optional) – dictionary of the priors, defaults to empty list
fin_hparam_post (array of floats, optional) – 3d array of the hypermarater posteriors, defaults to None
fin_param_post (array of floats, optional) – 3d array of the model parameter posteriors, defaults to None
logl_chain (array of floats, optional) – 3d array of the logL posteriors, defaults to None
masses (array of floats, optional) – 3d array of the mass posteriors, defaults to None
fin_param_values (list of floats, optional) – list of the final hyperparameter, parameter, and mass values from the posteriors, defaults to None
fin_param_erru (list of floats, optional) – list of the final hyperparameter, parameter, and mass upper errors from the posteriors, defaults to None
fin_param_errd (list of floats, optional) – list of the final hyperparameter, parameter, and mass lower errors form the posteriors, defaults to None
flags (array of floats, optional) – array of floats representing the offsets, defaults to None
Mstar (float, optional) – mass of the host star in solar masses
fin_to_skck (bool, optional) – if True, returns final keplerian parameters with Sk and Ck, if False returns final keplerian parameters with ecc and omega, defaults to False
burnin (integer, optional) – integer value to specify the length of the burn in, defaults to 0 for no burn in