The RV Model

class radvel.model.GeneralRVModel(params: Parameters, forward_model: Callable, time_base: float = 0)[source]

A generalized Model

Parameters:
  • params (radvel.Parameters) – The parameters upon which the RV model depends.

  • forward_model (callable) –

    The function that defines the signal as a function of time and parameters. The forward model is called as

    forward_model(time, params, *args, **kwargs) -> float

  • time_base (float) – time relative to which ‘dvdt’ and ‘curv’ terms are computed.

Examples

>>> import radvel
#  In this example, we'll assume a function called 'my_rv_function' that
#  computes RV values has been defined elsewhere. We'll assume that
#  'my_rv_function' depends on planets' usual RV parameters
#  contained in radvel.Parameters as well as some additional
#  parameter, 'my_param'.
>>> params = radvel.Parameters(2)
>>> params['my_param'] = rv.Parameter(my_param_value,vary=True)
>>> rvmodel = radvel.GeneralRVModel(myparams,my_rv_function)
>>> rv = rvmodel(10)
__call__(t: ndarray, *args: object, **kwargs: object) ndarray[source]

Compute the signal

Parameters:

t (array of floats) – Timestamps to calculate the model

Returns:

model at each time in t

Return type:

vel (array of floats)

__init__(params: Parameters, forward_model: Callable, time_base: float = 0) None[source]
__weakref__

list of weak references to the object

class radvel.model.Parameter(value: float | None = None, vary: bool = True, mcmcscale: float | None = None, linear: bool = False)[source]

Object to store attributes of each orbital parameter .. attribute:: value

value of parameter.

type:

float

vary

True if parameter is allowed to vary in MCMC or max likelihood fits, false if fixed

Type:

Bool

mcmcscale

step size to be used for MCMC fitting

Type:

float

linear

if vary=False and linear=True for gamma parameters then they will be calculated analytically using the trick. derived by Timothy Brandt.

Type:

bool

__init__(value: float | None = None, vary: bool = True, mcmcscale: float | None = None, linear: bool = False) None[source]
__repr__() str[source]

Return repr(self).

__weakref__

list of weak references to the object

class radvel.model.Parameters(num_planets: int, basis: str = 'per tc secosw sesinw logk', planet_letters: dict[int, str] | None = None)[source]

Object to store the model parameters.

Parameters to describe a radial velocity orbit stored as an OrderedDict.

Parameters:
  • num_planets (int) – Number of planets in model

  • basis (string) – parameterization of orbital parameters. See radvel.basis.Basis for a list of valid basis strings.

  • planet_letters (dict [optional) – custom map to match the planet numbers in the Parameter object to planet letters. Default {1: ‘b’, 2: ‘c’, etc.}. The keys of this dictionary must all be integers.

basis

Basis object

Type:

radvel.Basis

planet_parameters

orbital parameters contained within the specified basis

Type:

list

num_planets

number of planets in the model

Type:

int

Examples

>>> import radvel
# create a Parameters object for a 2-planet system with
# custom planet number to letter mapping
>>> params = radvel.Parameters(2, planet_letters={1:'d', 2:'e'})
__init__(num_planets: int, basis: str = 'per tc secosw sesinw logk', planet_letters: dict[int, str] | None = None) None[source]
__reduce__() tuple[source]

Return state information for pickling

tex_labels(param_list: list[str] | None = None) dict[str, str][source]

Map Parameters keys to pretty TeX code representations.

Parameters:

param_list (list [optional]) – Manually pass a list of parameter labels

Returns:

dictionary mapping Parameters keys to TeX code

Return type:

dict

class radvel.model.RVModel(params: Parameters, time_base: float = 0)[source]

Generic RV Model

This class defines the methods common to all RV modeling classes. The different RV models, with different parameterizations, all inherit from this class.

__init__(params: Parameters, time_base: float = 0) None[source]