Utils#

simppler.utils.bin_data(t, rv, erv, nbins=30)[source]#

Bin RV data

The data is binned using a weighted average. Bins with less than 3 points are discarded.

Parameters:
  • t (ndarray) – Times

  • rv (ndarray) – RVs

  • erv (ndarray) – RV uncertainties

  • nbins (int) – Number of bins to use

Return type:

tuple[ndarray]

simppler.utils.time_to_phase(p, t, planet, double=False)[source]#

Convert time to phase :param p: Dictionary mapping parameter names to values. Must contain a period per{planet} and time of conjunction tc{planet}. :param t: Array of times :param planet: Integer index of the planet (base 1) :param double: Wehther the phase array should be doubled. Useful for plotting.

Parameters:
  • p (dict)

  • t (ArrayLike)

  • planet (int)

  • double (bool)

Return type:

ndarray

simppler.utils.timeperi_to_timetrans(tp, per, ecc, omega, secondary=False)[source]#

Convert Time of Periastron to Time of Transit

Copied from RadVel (California-Planet-Search/radvel) License: California-Planet-Search/radvel

Args:

tp (float): time of periastron per (float): period [days] ecc (float): eccentricity omega (float): argument of peri (radians) secondary (bool): calculate time of secondary eclipse instead

Returns:

float: time of inferior conjunction (time of transit if system is transiting)

simppler.utils.timetrans_to_timeperi(tc, per, ecc, omega)[source]#

Convert Time of Transit to Time of Periastron Passage

Copied from RadVel (California-Planet-Search/radvel) License: California-Planet-Search/radvel

Args:

tc (float): time of transit per (float): period [days] ecc (float): eccentricity omega (float): longitude of periastron (radians)

Returns:

float: time of periastron passage