MCMC Auxiliary Functions

Auxiliary functions for the MCMC code

src.magpy_rv.mcmc_aux.get_model(model_name, time, model_par, to_ecc=False, flags=None)[source]
Parameters
  • model_name (list of strings) – Name of model used

  • time (array, floats) – Time array over which to calculate the model

  • model_par (dictionary) – Set of parameters (within the parameter object) with which to compute the model

Returns

model_y – Radial velocity of the model

Return type

array, floats

src.magpy_rv.mcmc_aux.initial_pos_creator(param, param_err, numb_chains, allow_neg=False, param_names=None)[source]
Parameters
  • param (list, floats) – List of the initial guess parameters

  • param_err (list, floats) – List of the errors on the initial guess parameters

  • numb_chains (int) – Number of chains

  • allow_neg (boolean) – Allow negative starting values. Default is False

Returns

chains_param – 2D array of

Return type

2D list, floats

src.magpy_rv.mcmc_aux.numb_param_per_model(model_name)[source]

Function to give the number of expected parameters per model

Parameters

model_name (string) – Name of the model

Returns

model_param_number – number of parameter required in the model

Return type

int

src.magpy_rv.mcmc_aux.parameter_check(parameters, names, Rstar=None, Mstar=None)[source]

Function to check if the parameters are within the bounds

Parameters
  • parameters (array, floats) – Array of parameters for all models

  • names (list of strings) – Names of all the models used, can be one or more

  • Rstar (float, optional) – Radius of the star in solar radii. Default is None. Needed for the orbit check

  • Mstar (float, optional) – Mass of the star in solar masses. Default is None. Needed for the orbit check

Returns

check – Are all paramaters physically possible?

Return type

bool

src.magpy_rv.mcmc_aux.star_cross(Sk, Ck, Rstar, P, Mstar)[source]
Parameters
  • Sk (float) – Sk value from MCMC

  • Ck (float) – Ck value from MCMC

  • Rstar (float) – Radius of the host star, in Solar Radii

  • P (float) – Period of planet, in days

  • Mstar (float) – Mass of the star, in Solar Masses

Returns

If True, the semi-major orbit axes does never fall into the star If False, the orbit falls into the star and the step should be dismissed

Return type

bool