Skip to content

API documentation for kima

Data

Most analyses will start by using the RVData class to load data from a set of files or arrays. Gaia epoch astrometry can also be read with the GAIAdata class.

Example:

from kima import RVData

data = RVData('filename.txt', skip=1) #(1)!

data.plot() #(2)!
  1. With skip=1, the first line of the file will be ignored.
  2. A very simple plot of the dataset.
kima.RVData API

Load and store RV data

init(self, filenames: collections.abc.Sequence[str], units: str = 'ms', skip: int = 0, max_rows: int = 0, delimiter: str = ' \t,', indicators: collections.abc.Sequence[str] = [], double_lined: bool = False) -> None init(self, filename: str, units: str = 'ms', skip: int = 0, max_rows: int = 0, multi: bool = False, delimiter: str = ' \t,', indicators: collections.abc.Sequence[str] = [], double_lined: bool = False) -> None init(self, t: collections.abc.Sequence[float], y: collections.abc.Sequence[float], sig: collections.abc.Sequence[float], indicators: collections.abc.Sequence[collections.abc.Sequence[float]] = [], units: str = 'ms', instrument: str = '') -> None init(self, t: collections.abc.Sequence[collections.abc.Sequence[float]], y: collections.abc.Sequence[collections.abc.Sequence[float]], sig: collections.abc.Sequence[collections.abc.Sequence[float]], indicators: collections.abc.Sequence[collections.abc.Sequence[collections.abc.Sequence[float]]] = [], units: str = 'ms', instruments: collections.abc.Sequence[str] = []) -> None

Overloaded function.

  1. __init__(self, filenames: collections.abc.Sequence[str], units: str = 'ms', skip: int = 0, max_rows: int = 0, delimiter: str = ' \t,', indicators: collections.abc.Sequence[str] = [], double_lined: bool = False) -> None

Load RV data from a list of files.

Parameters:

Name Type Description Default
filenames list

List of filenames to load

required
units str

Units of the data ('ms' or 'kms')

required
skip int

Number of lines to skip at the top of the file

required
max_rows int

Maximum number of rows to read

required
delimiter str

Delimiter between columns

required
indicators list

List of names for the indicator columns (should be present in all files)

required
double_lined bool

Whether the data is for a double-lined binary

required
  1. __init__(self, filename: str, units: str = 'ms', skip: int = 0, max_rows: int = 0, multi: bool = False, delimiter: str = ' \t,', indicators: collections.abc.Sequence[str] = [], double_lined: bool = False) -> None

Load RV data from a file.

Parameters:

Name Type Description Default
filename str

Name of the file to read

required
units str

Units of the data ('ms' or 'kms')

required
skip int

Number of lines to skip at the top of the file

required
max_rows int

Maximum number of rows to read

required
delimiter str

Delimiter between columns

required
indicators list

List of names for the indicator columns

required
double_lined bool

Whether the data is for a double-lined binary

required
  1. __init__(self, t: collections.abc.Sequence[float], y: collections.abc.Sequence[float], sig: collections.abc.Sequence[float], indicators: collections.abc.Sequence[collections.abc.Sequence[float]] = [], units: str = 'ms', instrument: str = '') -> None

Load RV data from arrays for a single instrument.

Parameters:

Name Type Description Default
t (list, array)

List of observation times

required
y (list, array)

List of RV values

required
sig (list, array)

List of RV uncertainties

required
indicators list[list]

Lists of indicator values

required
units str

Units of the radial velocity data ('ms' or 'kms')

required
instrument str

Name of the instrument

required
  1. __init__(self, t: collections.abc.Sequence[collections.abc.Sequence[float]], y: collections.abc.Sequence[collections.abc.Sequence[float]], sig: collections.abc.Sequence[collections.abc.Sequence[float]], indicators: collections.abc.Sequence[collections.abc.Sequence[collections.abc.Sequence[float]]] = [], units: str = 'ms', instruments: collections.abc.Sequence[str] = []) -> None

Load RV data from arrays for multiple instruments.

Parameters:

Name Type Description Default
t (list[list], array[array])

Lists of observation times

required
y (list[list], array[array])

Lists of RV values

required
sig (list[list], array[array])

Lists of RV uncertainties

required
indicators list[list]

Lists of indicator values (3D array)

required
units str

Units of the radial velocity data ('ms' or 'kms')

required
instrument str

Name of the instrument

required

M0_epoch property

reference epoch for the mean anomaly

N property

Total number of observations

actind property

Activity indicators

datafile property

The file name

datafiles property

The list of file names

double_lined property

if the data is for a double-lined binary

indicator_names property

names of activity indicators

instrument property

instrument name

instruments property

instrument names

multi property

Data comes from multiple instruments

normalized_actind property

Activity indicators normalized to [0,1]

obsi property

The instrument identifier

sig property

The observed RV uncertainties

sig2 property

The observed secondary RV uncertainties (double-lined binary)

skip property

Lines skipped when reading data

t property

The times of observations

trend_epoch property

reference epoch for the trend

units property

Units of the RVs and uncertainties

y property

The observed radial velocities

y2 property

The observed secondary radial velocities (double-lined binary)

_inverse_time_indices() method descriptor

_inverse_time_indices(self) -> list[int]

get_RV_max() method descriptor

get_RV_max(self) -> float

Get the maximum RV

get_RV_mean() method descriptor

get_RV_mean(self) -> float

Get the mean RV

get_RV_min() method descriptor

get_RV_min(self) -> float

Get the minimum RV

get_RV_span() method descriptor

get_RV_span(self) -> float

Get the RV span

get_RV_std() method descriptor

get_RV_std(self) -> float

Get the standard deviation of RVs

get_RV_var() method descriptor

get_RV_var(self) -> float

Get the variance of RVs

get_actind_max() method descriptor

get_actind_max(self, arg: int, /) -> float

Get the maximum value of activity indicator i

get_actind_mean() method descriptor

get_actind_mean(self, arg: int, /) -> float

Get the mean of activity indicator i

get_actind_min() method descriptor

get_actind_min(self, arg: int, /) -> float

Get the minimum value of activity indicator i

get_actind_span() method descriptor

get_actind_span(self, arg: int, /) -> float

Get the span of activity indicator i

get_actind_std() method descriptor

get_actind_std(self, arg: int, /) -> float

Get the standard deviation of activity indicator i

get_actind_var() method descriptor

get_actind_var(self, arg: int, /) -> float

Get the variance of activity indicator i

get_max_RV_span() method descriptor

get_max_RV_span(self) -> float

Get the maximum RV span of individual instruments

get_t_max() method descriptor

get_t_max(self) -> float

Get the maximum time

get_t_middle() method descriptor

get_t_middle(self) -> float

Get the middle time

get_t_min() method descriptor

get_t_min(self) -> float

Get the minimum time

get_timespan() method descriptor

get_timespan(self) -> float

Get the timespan

get_trend_magnitude() method descriptor

get_trend_magnitude(self, degree: int, i: int = -1) -> int

Order of magnitude for trend coefficient (of degree) given the data

get_unique_t() method descriptor

get_unique_t(self) -> list[float]

Get the unique times

topslope() method descriptor

topslope(self) -> float

Get the maximum slope allowed by the data

kima.GAIAdata API

Load and store Gaia astrometric data

init(self, filename: str, units: str = 'ms', skip: int = 0, max_rows: int = 0, delimiter: str = ' \t,') -> None

Load astrometric data from a file

Parameters:

Name Type Description Default
filename str

Name of the file to read

required
units str

Units of the data ('ms' or 'kms')

required
skip int

Number of lines to skip at the top of the file

required
max_rows int

Maximum number of rows to read

required
delimiter str

Delimiter between columns

required

M0_epoch property

reference epoch for the mean anomaly

N property

Total number of observations

datafile property

The file name

pf property

The parallax factors

psi property

The Gaia scan angles

t property

The times of observations

units property

Units of the Gaia data and uncertainties

w property

The observed centroid positions

wsig property

The observed centroid position uncertainties

Models

We can then create one of the several models currently implemented

Example:

from kima import RVmodel

model = RVmodel(fix=False, npmax=2, data=data)
kima.RVmodel API

RVmodel()

init(self, fix: bool, npmax: int, data: kima.Data.RVData) -> None

Implements a sum-of-Keplerians model where the number of Keplerians can be free.

Parameters:

Name Type Description Default
fix bool

whether the number of Keplerians should be fixed

required
npmax int

maximum number of Keplerians

required
data RVData

the RV data

required

AK_Kprior property

Prior for AK semi-amplitude

AK_Pprior property

Prior for AK orbital period

AK_eprior property

Prior for AK eccentricity

AK_phiprior property

Prior for AK mean anomaly(ies)

AK_t0prior property

Prior for AK center of apodizing windows (days)

AK_tauprior property

Prior for AK apodization widths τ (days)

AK_wprior property

Prior for AK argument of periastron

Cprior property

Prior for the systemic velocity

Jprior property

Prior for the extra white noise (jitter)

KO_Kprior property

Prior for KO semi-amplitude

KO_Pprior property

Prior for KO orbital period

KO_eprior property

Prior for KO eccentricity

KO_phiprior property

Prior for KO mean anomaly(ies)

KO_wprior property

Prior for KO argument of periastron

TR_Kprior property

Prior for TR semi-amplitude

TR_Pprior property

Prior for TR orbital period

TR_Tcprior property

Prior for TR mean anomaly(ies)

TR_eprior property

Prior for TR eccentricity

TR_wprior property

Prior for TR argument of periastron

apodized_keplerians property

whether the model includes apodized Keplerian(s)

beta_prior property

(Common) prior for the activity indicator coefficients

conditional property

(self) -> kima.RVmodel.KeplerianConditionalPrior

cubic_prior property

Prior for the cubic coefficient of the trend

data property

the data

degree property

degree of the polynomial trend

directory property

directory where the model ran

enforce_stability property

whether to enforce AMD-stability

fix property

whether the number of Keplerians is fixed

indicator_correlations property

include in the model linear correlations with indicators

individual_offset_prior property

Common prior for the between-instrument offsets

jitter_propto_indicator property

docs

jitter_propto_indicator_index property

docs

known_object property

whether the model includes (better) known extra Keplerian curve(s)

n_apodized_keplerians property

how many apodized Keplerians

n_known_object property

how many known objects

n_transiting_planet property

how many transiting planets

npmax property

maximum number of Keplerians

nu_prior property

Prior for the degrees of freedom of the Student-t likelihood

offsets_prior property

Common prior for the between-instrument offsets

optimize_equal_times property

docs

quadr_prior property

Prior for the quadratic coefficient of the trend

slope_prior property

Prior for the slope

star_mass property

stellar mass [Msun]

stellar_jitter_prior property

Prior for the stellar jitter (common to all instruments)

studentt property

use a Student-t distribution for the likelihood (instead of Gaussian)

transiting_planet property

whether the model includes transiting planet(s)

trend property

whether the model includes a polynomial trend

set_apodized_keplerians() method descriptor

set_apodized_keplerians(self, arg: int, /) -> None

set_known_object() method descriptor

set_known_object(self, arg: int, /) -> None

set_loguniform_prior_Np() method descriptor

set_loguniform_prior_Np(self) -> None

set_transiting_planet() method descriptor

set_transiting_planet(self, arg: int, /) -> None

kima.GPmodel API

GPmodel()

init(self, fix: bool, npmax: int, data: kima.Data.RVData) -> None

Implements a model for the RVs with a sum-of-Keplerians plus a correlated noise component given by a Gaussian process.

Parameters:

Name Type Description Default
fix bool

whether the number of Keplerians should be fixed

required
npmax int

maximum number of Keplerians

required
data RVData

the RV data

required

Cprior property

Prior for the systemic velocity

Jprior property

Prior for the extra white noise (jitter)

KO_Kprior property

Prior for KO semi-amplitude

KO_Pprior property

Prior for KO orbital period

KO_eprior property

Prior for KO eccentricity

KO_phiprior property

Prior for KO mean anomaly(ies)

KO_wprior property

Prior for KO argument of periastron

Q_prior property

Prior for Q, the quality factor in SHO kernels

TR_Kprior property

Prior for TR semi-amplitude

TR_Pprior property

Prior for TR orbital period

TR_Tcprior property

Prior for TR mean anomaly(ies)

TR_eprior property

Prior for TR eccentricity

TR_wprior property

Prior for TR argument of periastron

beta_prior property

(Common) prior for the activity indicator coefficients

conditional property

(self) -> kima.RVmodel.KeplerianConditionalPrior

cubic_prior property

Prior for the cubic coefficient of the trend

data property

the data

degree property

degree of the polynomial trend

directory property

directory where the model ran

enforce_stability property

whether to enforce AMD-stability

eta1_prior property

Prior for η1, the GP 'amplitude'

eta2_prior property

Prior for η2, the GP correlation timescale

eta3_prior property

Prior for η3, the GP period

eta4_prior property

Prior for η4, the recurrence timescale or (inverse) harmonic complexity

eta5_prior property

Prior for η5

eta6_prior property

Prior for η6

eta7_prior property

Prior for η7

fix property

whether the number of Keplerians is fixed

indicator_correlations property

include in the model linear correlations with indicators

individual_offset_prior property

Common prior for the between-instrument offsets

kernel property

GP kernel to use

known_object property

whether the model includes (better) known extra Keplerian curve(s)

magnetic_cycle_kernel property

whether to consider a (periodic) GP kernel for a magnetic cycle

n_known_object property

how many known objects

n_transiting_planet property

how many transiting planets

npmax property

maximum number of Keplerians

offsets_prior property

Common prior for the between-instrument offsets

quadr_prior property

Prior for the quadratic coefficient of the trend

slope_prior property

Prior for the slope

star_mass property

stellar mass [Msun]

transiting_planet property

whether the model includes transiting planet(s)

trend property

whether the model includes a polynomial trend

eta2_larger_eta3() method descriptor

eta2_larger_eta3(self, factor: float = 1.0) -> None

Constrain η2 to be larger than factor * η3

set_known_object() method descriptor

set_known_object(self, arg: int, /) -> None

set_transiting_planet() method descriptor

set_transiting_planet(self, arg: int, /) -> None

kima.RVFWHMmodel API

RVFWHMmodel()

init(self, fix: bool, npmax: int, data: kima.Data.RVData) -> None

Implements a joint model for RVs and FWHM with a GP component for activity signals.

Parameters:

Name Type Description Default
fix bool

whether the number of Keplerians should be fixed

required
npmax int

maximum number of Keplerians

required
data RVData

the RV data

required

Cfwhm_prior property

Prior for the 'systemic' FWHM

Cprior property

Prior for the systemic velocity

Jfwhm_prior property

Prior for the extra white noise (jitter) in the FWHM

Jprior property

Prior for the extra white noise (jitter)

KO_Kprior property

Prior for KO semi-amplitude

KO_Pprior property

Prior for KO orbital period

KO_eprior property

Prior for KO eccentricity

KO_phiprior property

Prior for KO mean anomaly(ies)

KO_wprior property

Prior for KO argument of periastron

TR_Kprior property

Prior for TR semi-amplitude

TR_Pprior property

Prior for TR orbital period

TR_Tcprior property

Prior for TR mean anomaly(ies)

TR_eprior property

Prior for TR eccentricity

TR_wprior property

Prior for TR argument of periastron

conditional property

(self) -> kima.RVmodel.KeplerianConditionalPrior

cubic_fwhm_prior property

Prior for the cubic coefficient of the trend in the FWHM (in the FWHM)

cubic_prior property

Prior for the cubic coefficient of the trend (in the RVs)

data property

the data

degree property

degree of the polynomial trend (in the RVs)

degree_fwhm property

degree of the polynomial trend (in the FWHM)

directory property

directory where the model ran

enforce_stability property

whether to enforce AMD-stability

eta1_fwhm_prior property

Prior for the GP 'amplitude' on the FWHM

eta1_prior property

Prior for the GP 'amplitude' on the RVs

eta2_fwhm_prior property

Prior for η2, the GP correlation timescale, on the FWHM

eta2_prior property

Prior for η2, the GP correlation timescale, on the RVs

eta3_fwhm_prior property

Prior for η3, the GP period, on the FWHM

eta3_prior property

Prior for η3, the GP period, on the RVs

eta4_fwhm_prior property

Prior for η4, the recurrence timescale or (inverse) harmonic complexity, on the FWHM

eta4_prior property

Prior for η4, the recurrence timescale or (inverse) harmonic complexity, on the RVs

fix property

whether the number of Keplerians is fixed

known_object property

whether the model includes (better) known extra Keplerian curve(s)

n_known_object property

how many known objects

n_transiting_planet property

how many transiting planets

npmax property

maximum number of Keplerians

quadr_fwhm_prior property

Prior for the quadratic coefficient of the trend in the FWHM (in the FWHM)

quadr_prior property

Prior for the quadratic coefficient of the trend (in the RVs)

share_eta2 property

whether the η2 parameter is shared between RVs and FWHM

share_eta3 property

whether the η3 parameter is shared between RVs and FWHM

share_eta4 property

whether the η4 parameter is shared between RVs and FWHM

slope_fwhm_prior property

Prior for the slope in the FWHM (in the FWHM)

slope_prior property

Prior for the slope (in the RVs)

star_mass property

stellar mass [Msun]

transiting_planet property

whether the model includes transiting planet(s)

trend property

whether the model includes a polynomial trend (in the RVs)

trend_fwhm property

whether the model includes a polynomial trend (in the FWHM)

set_known_object() method descriptor

set_known_object(self, arg: int, /) -> None

set_transiting_planet() method descriptor

set_transiting_planet(self, arg: int, /) -> None

kima.BINARIESmodel API

BINARIESmodel()

init(self, fix: bool, npmax: int, data: kima.Data.RVData) -> None

Implements a sum-of-Keplerians model where the number of Keplerians can be free. This model assumes white, uncorrelated noise. This modules is tailored for the analysis of stellar binaries through the known object mode (without it this defaults to the RVmodel) The binary can have one set of RVs or two (one on each star). This model adds apsidal precession as a free parameter and accounts for GR and Tidal effects on the radial velocities.

Parameters:

Name Type Description Default
fix bool, default=True

whether the number of Keplerians should be fixed

required
npmax int, default=0

maximum number of Keplerians

required
data RVData

the RV data

required

Cprior property

Prior for the systemic velocity

Jprior property

Prior for the extra white noise (jitter)

KO_Kprior property

Prior for Semi-amplitude of Binary orbit (+other known objects)

KO_Pprior property

Prior for Period of Binary orbit (+other known objects)

KO_cosiprior property

Prior for cosine of the inclination of Binary orbit (+other known objects) to the line-of-sight

KO_eprior property

Prior for eccentricity of Binary orbit (+other known objects)

KO_phiprior property

Prior for phase of Binary orbit at the reference time (+other known objects)

KO_qprior property

Prior for mass ratio of Binary (+other known objects), used if double lined

KO_wdotprior property

Prior for apsidal precession rate of Binary orbit (+other known objects)

KO_wprior property

Prior for argument of periastron of Binary orbit (+other known objects)

binary_mass property

secondary mass [Msun]

binary_radius property

secondary radius [Rsun]

conditional property

(self) -> kima.RVmodel.KeplerianConditionalPrior

correction_K_precision property

To what precision K2 is calculated for the relativistic and tidal corrections, (default is 50 m/s and unless the orbit is very close to face-on this gives sub cm/s precision on the corrections), increasing this may speed up the sampling

cubic_prior property

Prior for the cubic coefficient of the trend

data property

the data

degree property

degree of the polynomial trend

directory property

directory where the model ran

double_lined property

whether the data is for a double lined binary, and has two sets of RVs for each epoch

eclipsing property

whether binary is eclipsing and the inclination can be fixed to 90, defaults to true. If false, default prior is uniform in cosi

enforce_stability property

whether to enforce AMD-stability (Untested for binaries)

fix property

whether the number of Keplerians is fixed

known_object property

whether to include (better) known extra Keplerian curve(s), should be true for BINARIESmodel

n_known_object property

how many known objects, should be >=1 for BINARIESmodel

npmax property

maximum number of Keplerians

nu_prior property

Prior for the degrees of freedom of the Student-t likelihood

offsets_prior property

Common prior for the between-instrument offsets

quadr_prior property

Prior for the quadratic coefficient of the trend

relativistic_correction property

whether to perform the GR correction

slope_prior property

Prior for the slope

star_mass property

primary mass [Msun]

star_radius property

primary radius [Rsun]

studentt property

use a Student-t distribution for the likelihood (instead of Gaussian)

tidal_correction property

whether to perform the tidal correction

trend property

whether the model includes a polynomial trend

use_binary_longitude property

Whether to sample using the mean longitude rather than mean anomaly at epoch, for use when the binary is close to circular for better sampling

TODO: kima.RVHGPMmodel API
kima.GAIAmodel API

GAIAmodel()

init(self, fix: bool, npmax: int, data: kima.Data.GAIAdata) -> None

Analysis of Gaia epoch astrometry. Implements a sum-of-Keplerians model where the number of Keplerians can be free. This model assumes white, uncorrelated noise. Known objects are given priors for geometric elements, free planet search has the choice of geometric or Thiele-Innes elements. An option to fit for a scan-angle dependent signal is included.

Parameters:

Name Type Description Default
fix bool, default=True

whether the number of Keplerians should be fixed

required
npmax int, default=0

maximum number of Keplerians

required
data GAIAdata

the astrometric data

required

Ak_prior property

Prior for the amplitudes of scan-angle dependent signals

DEC property

Declination of the target star (degrees)

Jprior property

Prior for the extra white noise (jitter)

KO_Pprior property

Prior for KO orbital period(s)

KO_Wprior property

Prior for KO longitude(s) of ascending node

KO_aprior property

Prior for KO photocentre semi-major-axis(es)

KO_cosiprior property

Prior for cosine of KO inclination(s)

KO_eprior property

Prior for KO eccentricity(ies)

KO_phiprior property

Prior for KO mean anomaly(ies)

KO_wprior property

Prior for KO argument(s) of periastron

RA property

Right Ascension of the target star (degrees)

accela_prior property

Prior for the proper-acceleration in right-ascension (mas/yr^2)

acceld_prior property

Prior for the proper-acceleration in declination (mas/yr^2)

conditional property

(self) -> kima.GAIAmodel.GAIAConditionalPrior

da_prior property

Prior for the offset in right-ascension (mas)

data property

the data

dd_prior property

Prior for the the offset in declination (mas)

fix property

whether the number of Keplerians is fixed

jerka_prior property

Prior for the proper-jerk in right-ascension (mas/yr^3)

jerkd_prior property

Prior for the proper-jerk in declination (mas/yr^3)

known_object property

whether the model includes (better) known extra Keplerian curve(s)

mua_prior property

Prior for the proper-motion in right-ascension (mas/yr)

mud_prior property

Prior for the proper-motion in declination (mas/yr)

n_baseline_params property

how many baseline astrometric parameters are included the model

n_known_object property

how many known objects

n_scan_dep_components property

how many components of scan-angle harmonics are included

npmax property

maximum number of Keplerians

nu_prior property

Prior for the degrees of freedom of the Student-t likelihood

parallax_prior property

Prior for the parallax

scan_dep_signal property

whether the model includes a model for potential scan-angle dependent signals that could bias towards certain frequencies

star_mass property

the mass of the central star (Msun)

studentt property

use a Student-t distribution for the likelihood (instead of Gaussian)

thetak_prior property

Prior for the phase of scan-angle dependent signals

thiele_innes property

use the thiele-innes coefficients rather than geometric

set_baseline_model() method descriptor

set_baseline_model(self, arg: int, /) -> None

set the number of parameters for the baseline astrometric solution, either 5 (the default astrometric solution), 7, or 9 (which include acceleration and jerk terms)

set_known_object() method descriptor

set_known_object(self, arg: int, /) -> None

set how many known objects to include

set_scan_dep_signal() method descriptor

set_scan_dep_signal(self, arg: int, /) -> None

set whether the model includes a model for potential scan-angle dependent signals

kima.RVGAIAmodel API

RVGAIAmodel()

init(self, fix: bool, npmax: int, GAIAdata: kima.Data.GAIAdata, RVData: kima.Data.RVData) -> None

Combined analysis of Gaia epoch astrometry and radial velocity timeseries. Implements a sum-of-Keplerians model where the number of Keplerians can be free. This model assumes white, uncorrelated noise. Both the central star and potential planets are to be given Mass priors in Solar-Mass.

Parameters:

Name Type Description Default
fix bool, default=True

whether the number of Keplerians should be fixed

required
npmax int, default=0

maximum number of Keplerians

required
GAIAdata GAIAdata

the astrometric data

required
RVdata RVData

the radial velocity data

required

Ak_prior property

Prior for the amplitudes of scan-angle dependent signals

Cprior property

Prior for the systemic velocity

DEC property

Declination of the target star (degrees)

GAIAdata property

the data

J_GAIA_prior property

Prior for the extra white noise (jitter) for GAIA data

J_RV_prior property

Prior for the extra white noise (jitter) for RV data

KO_Pprior property

Prior for KO orbital period(s)

KO_Wprior property

Prior for KO longitude(s) of ascending node

KO_aprior property

Prior for KO mass(es) (M_sun)

KO_cosiprior property

Prior for cosine of KO inclination(s)

KO_eprior property

Prior for KO eccentricity(ies)

KO_phiprior property

Prior for KO mean anomaly(ies)

KO_wprior property

Prior for KO argument(s) of periastron

RA property

Right Ascension of the target star (degrees)

RVdata property

the data

accela_prior property

Prior for the proper-acceleration in right-ascension (mas/yr^2)

acceld_prior property

Prior for the proper-acceleration in declination (mas/yr^2)

conditional property

(self) -> kima.RVGAIAmodel.RVGAIAConditionalPrior

cubic_prior property

Prior for the cubic coefficient of the trend

da_prior property

Prior for the offset in right-ascension (mas)

dd_prior property

Prior for the the offset in declination (mas)

degree property

degree of the polynomial trend

directory property

directory where the model ran

fix property

whether the number of Keplerians is fixed

indicator_correlations property

include in the model linear correlations with indicators

individual_offset_prior property

Common prior for the between-instrument offsets

jerka_prior property

Prior for the proper-jerk in right-ascension (mas/yr^3)

jerkd_prior property

Prior for the proper-jerk in declination (mas/yr^3)

known_object property

whether the model includes (better) known extra Keplerian curve(s)

mua_prior property

Prior for the proper-motion in right-ascension (mas/yr)

mud_prior property

Prior for the proper-motion in declination (mas/yr)

n_baseline_params property

how many baseline astrometric parameters are included the model

n_known_object property

how many known objects

n_scan_dep_components property

how many components of scan-angle harmonics are included

npmax property

maximum number of Keplerians

nu_GAIA_prior property

Prior for the degrees of freedom of the Student-t likelihood for GAIA data

nu_RV_prior property

Prior for the degrees of freedom of the Student-t likelihood for RV data

offsets_prior property

Common prior for the between-instrument offsets

parallax_prior property

Prior for the parallax

quadr_prior property

Prior for the quadratic coefficient of the trend

scan_dep_signal property

whether the model includes a model for potential scan-angle dependent signals that could bias towards certain frequencies

slope_prior property

Prior for the slope

star_mass property

the mass of the central star (Msun)

studentt property

use a Student-t distribution for the likelihood (instead of Gaussian)

thetak_prior property

Prior for the phase of scan-angle dependent signals

trend property

whether the model includes a polynomial trend

set_baseline_model() method descriptor

set_baseline_model(self, arg: int, /) -> None

set the number of parameters for the baseline astrometric solution, either 5 (the default astrometric solution), 7, or 9 (which include acceleration and jerk terms)

set_known_object() method descriptor

set_known_object(self, arg: int, /) -> None

set_scan_dep_signal() method descriptor

set_scan_dep_signal(self, arg: int, /) -> None

set whether the model includes a model for potential scan-angle dependent signals

The model.conditional object contained in each model can be used to define the priors for the orbital parameters. Different models may use different conditionals, depending on the specific parameterisation:

RVmodel / GPmodel / RVFWHMmodelKeplerianConditionalPrior

init(self) -> None

Kprior property

Prior for the semi-amplitude(s)

Pprior property

Prior for the orbital period(s)

eprior property

Prior for the orbital eccentricity(ies)

phiprior property

Prior for the mean anomaly(ies)

wprior property

Prior for the argument(s) of periastron

GAIAmodelGAIAConditionalPrior

init(self) -> None

Aprior property

Prior thiele_innes parameter(s) A

Bprior property

Prior thiele_innes parameter(s) B

Fprior property

Prior thiele_innes parameter(s) F

Gprior property

Prior thiele_innes parameter(s) G

Pprior property

Prior for the orbital period(s)

Wprior property

Prior for the longitude(s) of ascending node

aprior property

Prior for the photocentre semi-major-axis(es) (mas)

cosiprior property

Prior for cosine(s) of the orbital inclination

eprior property

Prior for the orbital eccentricity(ies)

phiprior property

Prior for the mean anomaly(ies)

thiele_innes property

use a Student-t distribution for the likelihood (instead of Gaussian)

wprior property

Prior for the argument(s) of periastron

TODO: RVHGPMmodelRVHGPMConditionalPrior

Run

To run the sampler and estimate the posterior for the model parameters just call kima.run

Example:

import kima

kima.run(model, steps=1000, num_threads=4)
kima.run API

Run the DNest4 sampler with the given model

Parameters:

Name Type Description Default
m (RVmodel, GPmodel, ...)

The model

required
steps int

How many steps to run. Default is 100.

required
num_threads int

How many threads to use for parallel processing. Default is 1.

required
num_particles int

Number of MCMC particles. Default is 1.

required
new_level_interval int

Number of steps required to create a new level. Default is 2000.

required
save_interval int

Number of steps between saves. Default is 100.

required
thread_steps int

Number of independent steps on each thread. Default is 10.

required
max_num_levels int

Maximum number of levels, or 0 if it should be determined automatically. Default is 0.

required
lambda_ int

Backtracking scale length, controls the degree to which particles are allowed to “backtrack” down in level during the first stage of DNS when levels are being built. Default is 10.

required
beta int

Equal weight enforcement, see Brewer et al. (2011). Default is 100.

required
compression int

Each subsequent level is expected to be compressed by this factor. Default is exp(1).

required
seed int

Random number seed value, or 0 to use current time. Default is 0.

required
print_thin int

Thinning steps for terminal output. Default is 50.

required

Distributions

The distributions sub-package contains the implementation of several probability distributions that can be used as priors for a model parameter. All distributions have standard parameterizations, as you would find e.g. in Wikipedia. Some distributions have a corresponding Truncated version which truncates the support of the distribution to an interval $ [{\rm lower}, {\rm upper} ]$.

Example:

from kima import distributions

parameter_prior = distributions.Gaussian(10, 1)

Here's a complete list of the implemented distributions:

kima.distributions API

BivariateGaussian()

Bivariate Gaussian distribution for X and Y

init(self, mean_x: float, mean_y: float, sigma_x: float, sigma_y: float, rho: float) -> None

docs

mean_x property

(self) -> float

mean_y property

(self) -> float

rho property

(self) -> float

sigma_x property

(self) -> float

sigma_y property

(self) -> float

logpdf() method descriptor

logpdf(self, x: float, y: float) -> float

Logarithm of the probability density function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the PDF

required

Cauchy()

init(self, loc: float, scale: float) -> None

Cauchy distribution

Parameters:

Name Type Description Default
loc float

location parameter

required
scale float

scale parameter

required

loc property

location parameter

scale property

scale parameter

cdf() method descriptor

cdf(self, x: float) -> float

Cumulative distribution function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the CDF

required

logpdf() method descriptor

logpdf(self, x: float) -> float

Logarithm of the probability density function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the PDF

required

ppf() method descriptor

ppf(self, q: float) -> float

Percent point function (inverse of cdf) evaluated at q

Parameters:

Name Type Description Default
q float

point at which to evaluate the PPF

required

Exponential()

init(self, scale: float) -> None

Exponential distribution

Parameters:

Name Type Description Default
scale float

scale parameter

required

scale property

(self) -> float

cdf() method descriptor

cdf(self, x: float) -> float

Cumulative distribution function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the CDF

required

logpdf() method descriptor

logpdf(self, x: float) -> float

Logarithm of the probability density function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the PDF

required

ppf() method descriptor

ppf(self, q: float) -> float

Percent point function (inverse of cdf) evaluated at q

Parameters:

Name Type Description Default
q float

point at which to evaluate the PPF

required

ExponentialRayleighMixture()

init(self, weight: float, scale: float, sigma: float) -> None

Mixture of Exponential and Rayleigh distributions

Parameters:

Name Type Description Default
weight float

weight parameter

required
scale float

scale parameter

required
sigma float

sigma parameter

required

scale property

(self) -> float

sigma property

(self) -> float

weight property

(self) -> float

cdf() method descriptor

cdf(self, x: float) -> float

Cumulative distribution function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the CDF

required

logpdf() method descriptor

logpdf(self, x: float) -> float

Logarithm of the probability density function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the PDF

required

ppf() method descriptor

ppf(self, q: float) -> float

Percent point function (inverse of cdf) evaluated at q

Parameters:

Name Type Description Default
q float

point at which to evaluate the PPF

required

Fixed()

init(self, value: float) -> None

A 'Fixed' distribution (akin to a Dirac delta distribution)

Parameters:

Name Type Description Default
value float

fixed value

required

val property

fixed value of the parameter

cdf() method descriptor

cdf(self, x: float) -> float

Cumulative distribution function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the CDF

required

logpdf() method descriptor

logpdf(self, x: float) -> float

Logarithm of the probability density function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the PDF

required

ppf() method descriptor

ppf(self, q: float) -> float

Percent point function (inverse of cdf) evaluated at q

Parameters:

Name Type Description Default
q float

point at which to evaluate the PPF

required

Gaussian()

init(self, loc: float, scale: float) -> None

Gaussian distribution

Parameters:

Name Type Description Default
loc float

location parameter (mean)

required
scale float

scale parameter (standard deviation)

required

loc property

location parameter

scale property

scale parameter

cdf() method descriptor

cdf(self, x: float) -> float

Cumulative distribution function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the CDF

required

logpdf() method descriptor

logpdf(self, x: float) -> float

Logarithm of the probability density function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the PDF

required

ppf() method descriptor

ppf(self, q: float) -> float

Percent point function (inverse of cdf) evaluated at q

Parameters:

Name Type Description Default
q float

point at which to evaluate the PPF

required

GaussianMixture()

GaussianMixture(means: collections.abc.Sequence[float], sigmas: collections.abc.Sequence[float])
GaussianMixture(means: collections.abc.Sequence[float], sigmas: collections.abc.Sequence[float], lower: float, upper: float)
GaussianMixture(means: collections.abc.Sequence[float], sigmas: collections.abc.Sequence[float], weights: collections.abc.Sequence[float], lower: float, upper: float)

Mixture of Gaussian distributions

init(self, means: collections.abc.Sequence[float], sigmas: collections.abc.Sequence[float]) -> None init(self, means: collections.abc.Sequence[float], sigmas: collections.abc.Sequence[float], lower: float, upper: float) -> None init(self, means: collections.abc.Sequence[float], sigmas: collections.abc.Sequence[float], weights: collections.abc.Sequence[float], lower: float, upper: float) -> None

Overloaded function.

  1. __init__(self, means: collections.abc.Sequence[float], sigmas: collections.abc.Sequence[float]) -> None

Instantiates a mixture of Gaussian distributions from lists of means and sigmas, with equal weights

  1. __init__(self, means: collections.abc.Sequence[float], sigmas: collections.abc.Sequence[float], lower: float, upper: float) -> None

Instantiates a mixture of Gaussian distributions from lists of means and sigmas, with equal weights, truncated to [lower, upper]

  1. __init__(self, means: collections.abc.Sequence[float], sigmas: collections.abc.Sequence[float], weights: collections.abc.Sequence[float], lower: float, upper: float) -> None

Instantiates a mixture of Gaussian distributions from lists of means, sigmas, and weights, truncated to [lower, upper]

cdf() method descriptor

cdf(self, x: float) -> float

Cumulative distribution function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the CDF

required

logpdf() method descriptor

logpdf(self, x: float) -> float

Logarithm of the probability density function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the PDF

required

ppf() method descriptor

ppf(self, q: float) -> float

Percent point function (inverse of cdf) evaluated at q

Parameters:

Name Type Description Default
q float

point at which to evaluate the PPF

required

HalfGaussian()

init(self, scale: float) -> None

Half-Gaussian distribution, with support in [0, inf)

Parameters:

Name Type Description Default
scale float

scale parameter (standard deviation)

required

scale property

scale parameter

cdf() method descriptor

cdf(self, x: float) -> float

Cumulative distribution function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the CDF

required

logpdf() method descriptor

logpdf(self, x: float) -> float

Logarithm of the probability density function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the PDF

required

ppf() method descriptor

ppf(self, q: float) -> float

Percent point function (inverse of cdf) evaluated at q

Parameters:

Name Type Description Default
q float

point at which to evaluate the PPF

required

InverseGamma()

Inverse gamma distribution

init(self, alpha: float, beta: float) -> None

Inverse gamma distribution

alpha property

Shape parameter α

beta property

scale parameter β

cdf() method descriptor

cdf(self, x: float) -> float

Cumulative distribution function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the CDF

required

logpdf() method descriptor

logpdf(self, x: float) -> float

Logarithm of the probability density function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the PDF

required

ppf() method descriptor

ppf(self, q: float) -> float

Percent point function (inverse of cdf) evaluated at q

Parameters:

Name Type Description Default
q float

point at which to evaluate the PPF

required

InverseMoment()

InverseMoment prior

init(self, tau: float, kmax: float) -> None

kmax property

(self) -> float

tau property

(self) -> float

cdf() method descriptor

cdf(self, x: float) -> float

Cumulative distribution function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the CDF

required

logpdf() method descriptor

logpdf(self, x: float) -> float

Logarithm of the probability density function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the PDF

required

ppf() method descriptor

ppf(self, q: float) -> float

Percent point function (inverse of cdf) evaluated at q

Parameters:

Name Type Description Default
q float

point at which to evaluate the PPF

required

Kumaraswamy()

init(self, a: float, b: float) -> None

"Kumaraswamy distribution (similar to a Beta distribution)

Parameters:

Name Type Description Default
a float

first shape parameter

required
b float

second shape parameter

required

a property

(self) -> float

b property

(self) -> float

cdf() method descriptor

cdf(self, x: float) -> float

Cumulative distribution function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the CDF

required

logpdf() method descriptor

logpdf(self, x: float) -> float

Logarithm of the probability density function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the PDF

required

ppf() method descriptor

ppf(self, q: float) -> float

Percent point function (inverse of cdf) evaluated at q

Parameters:

Name Type Description Default
q float

point at which to evaluate the PPF

required

Laplace()

init(self, loc: float, scale: float) -> None

"Laplace distribution

Parameters:

Name Type Description Default
loc float

location parameter

required
scale float

scale parameter

required

loc property

location parameter

scale property

scale parameter

cdf() method descriptor

cdf(self, x: float) -> float

Cumulative distribution function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the CDF

required

logpdf() method descriptor

logpdf(self, x: float) -> float

Logarithm of the probability density function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the PDF

required

ppf() method descriptor

ppf(self, q: float) -> float

Percent point function (inverse of cdf) evaluated at q

Parameters:

Name Type Description Default
q float

point at which to evaluate the PPF

required

LogUniform()

init(self, lower: float, upper: float) -> None

"LogUniform distribution (sometimes called reciprocal or Jeffrey's distribution)

Parameters:

Name Type Description Default
lower float

lower limit (> 0)

required
upper float

upper limit (> lower)

required

lower property

(self) -> float

upper property

(self) -> float

cdf() method descriptor

cdf(self, x: float) -> float

Cumulative distribution function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the CDF

required

logpdf() method descriptor

logpdf(self, x: float) -> float

Logarithm of the probability density function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the PDF

required

ppf() method descriptor

ppf(self, q: float) -> float

Percent point function (inverse of cdf) evaluated at q

Parameters:

Name Type Description Default
q float

point at which to evaluate the PPF

required

ModifiedLogUniform()

init(self, knee: float, upper: float) -> None

"Modified Log-Uniform distribution, with support [0, upper]

Parameters:

Name Type Description Default
knee float

knee parameter

required
upper float

upper limit

required

knee property

(self) -> float

upper property

(self) -> float

cdf() method descriptor

cdf(self, x: float) -> float

Cumulative distribution function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the CDF

required

logpdf() method descriptor

logpdf(self, x: float) -> float

Logarithm of the probability density function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the PDF

required

ppf() method descriptor

ppf(self, q: float) -> float

Percent point function (inverse of cdf) evaluated at q

Parameters:

Name Type Description Default
q float

point at which to evaluate the PPF

required

Pareto()

Pareto distribution

init(self, min: float, alpha: float) -> None

cdf() method descriptor

cdf(self, x: float) -> float

Cumulative distribution function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the CDF

required

logpdf() method descriptor

logpdf(self, x: float) -> float

Logarithm of the probability density function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the PDF

required

ppf() method descriptor

ppf(self, q: float) -> float

Percent point function (inverse of cdf) evaluated at q

Parameters:

Name Type Description Default
q float

point at which to evaluate the PPF

required

RNG()

init(self, seed: int) -> None

rand() method descriptor

rand(self) -> float

Uniform(0, 1)

rand_int() method descriptor

rand_int(self, arg: int, /) -> int

IntegerUniform(0, N)

randh() method descriptor

randh(self) -> float

Brendon's heavy-tailed distribution

wrap(*args, **kwargs)

wrap(arg0: float, arg1: float, arg2: float, /) -> float

Wrap a number to the range [a, b]

Rayleigh()

init(self, scale: float) -> None

Rayleigh distribution

Parameters:

Name Type Description Default
scale float

scale parameter

required

scale property

(self) -> float

cdf() method descriptor

cdf(self, x: float) -> float

Cumulative distribution function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the CDF

required

logpdf() method descriptor

logpdf(self, x: float) -> float

Logarithm of the probability density function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the PDF

required

ppf() method descriptor

ppf(self, q: float) -> float

Percent point function (inverse of cdf) evaluated at q

Parameters:

Name Type Description Default
q float

point at which to evaluate the PPF

required

Sine()

docs

init(self) -> None

A Sine distribution with support in [0, pi]

cdf() method descriptor

cdf(self, x: float) -> float

Cumulative distribution function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the CDF

required

logpdf() method descriptor

logpdf(self, x: float) -> float

Logarithm of the probability density function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the PDF

required

ppf() method descriptor

ppf(self, q: float) -> float

Percent point function (inverse of cdf) evaluated at q

Parameters:

Name Type Description Default
q float

point at which to evaluate the PPF

required

SingleTransitPeriodPrior()

Prior for the orbital period when a single planet transit was observed

init(self, W: float, L: float, Pmax: float) -> None

L property

Mid-transit time minus the start of the observational window

Pmax property

Maximum orbital period

W property

Observational window

cdf() method descriptor

cdf(self, x: float) -> float

Cumulative distribution function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the CDF

required

logpdf() method descriptor

logpdf(self, x: float) -> float

Logarithm of the probability density function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the PDF

required

ppf() method descriptor

ppf(self, q: float) -> float

Percent point function (inverse of cdf) evaluated at q

Parameters:

Name Type Description Default
q float

point at which to evaluate the PPF

required

Triangular()

init(self, lower: float, center: float, upper: float) -> None

Triangular distribution

Parameters:

Name Type Description Default
lower float

lower bound

required
center float

center

required
upper float

upper bound

required

center property

(self) -> float

lower property

(self) -> float

upper property

(self) -> float

cdf() method descriptor

cdf(self, x: float) -> float

Cumulative distribution function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the CDF

required

logpdf() method descriptor

logpdf(self, x: float) -> float

Logarithm of the probability density function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the PDF

required

ppf() method descriptor

ppf(self, q: float) -> float

Percent point function (inverse of cdf) evaluated at q

Parameters:

Name Type Description Default
q float

point at which to evaluate the PPF

required

TruncatedCauchy()

init(self, loc: float, scale: float, lower: float, upper: float) -> None

Truncated Cauchy distribution

Parameters:

Name Type Description Default
loc float

location parameter

required
scale float

scale parameter

required
lower float

lower truncation limit

required
upper float

upper truncation limit

required

loc property

location parameter

lower property

(self) -> float

scale property

scale parameter

upper property

(self) -> float

cdf() method descriptor

cdf(self, x: float) -> float

Cumulative distribution function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the CDF

required

logpdf() method descriptor

logpdf(self, x: float) -> float

Logarithm of the probability density function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the PDF

required

ppf() method descriptor

ppf(self, q: float) -> float

Percent point function (inverse of cdf) evaluated at q

Parameters:

Name Type Description Default
q float

point at which to evaluate the PPF

required

TruncatedExponential()

init(self, scale: float, lower: float, upper: float) -> None

Truncated Exponential distribution

Parameters:

Name Type Description Default
scale float

scale parameter

required
lower float

lower truncation limit

required
upper float

upper truncation limit

required

lower property

(self) -> float

scale property

(self) -> float

upper property

(self) -> float

cdf() method descriptor

cdf(self, x: float) -> float

Cumulative distribution function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the CDF

required

logpdf() method descriptor

logpdf(self, x: float) -> float

Logarithm of the probability density function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the PDF

required

ppf() method descriptor

ppf(self, q: float) -> float

Percent point function (inverse of cdf) evaluated at q

Parameters:

Name Type Description Default
q float

point at which to evaluate the PPF

required

TruncatedGaussian()

init(self, loc: float, scale: float, lower: float, upper: float) -> None

"Gaussian distribution truncated to [lower, upper] interval

Parameters:

Name Type Description Default
loc float

location parameter (mean)

required
scale float

scale parameter (standard deviation)

required
lower float

lower truncation limit

required
upper float

upper truncation limit

required

loc property

location parameter

lower property

lower truncation limit

scale property

scale parameter

upper property

upper truncation limit

cdf() method descriptor

cdf(self, x: float) -> float

Cumulative distribution function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the CDF

required

logpdf() method descriptor

logpdf(self, x: float) -> float

Logarithm of the probability density function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the PDF

required

ppf() method descriptor

ppf(self, q: float) -> float

Percent point function (inverse of cdf) evaluated at q

Parameters:

Name Type Description Default
q float

point at which to evaluate the PPF

required

TruncatedPareto()

Pareto distribution truncated to [lower, upper] interval

init(self, min: float, alpha: float, lower: float, upper: float) -> None

alpha property

scale parameter

lower property

(self) -> float

min property

location parameter

upper property

(self) -> float

cdf() method descriptor

cdf(self, x: float) -> float

Cumulative distribution function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the CDF

required

logpdf() method descriptor

logpdf(self, x: float) -> float

Logarithm of the probability density function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the PDF

required

ppf() method descriptor

ppf(self, q: float) -> float

Percent point function (inverse of cdf) evaluated at q

Parameters:

Name Type Description Default
q float

point at which to evaluate the PPF

required

TruncatedRayleigh()

Rayleigh distribution truncated to [lower, upper] interval

init(self, scale: float, lower: float, upper: float) -> None

lower property

(self) -> float

scale property

(self) -> float

upper property

(self) -> float

cdf() method descriptor

cdf(self, x: float) -> float

Cumulative distribution function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the CDF

required

logpdf() method descriptor

logpdf(self, x: float) -> float

Logarithm of the probability density function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the PDF

required

ppf() method descriptor

ppf(self, q: float) -> float

Percent point function (inverse of cdf) evaluated at q

Parameters:

Name Type Description Default
q float

point at which to evaluate the PPF

required

Uniform()

init(self, lower: float, upper: float) -> None

Uniform distribution in [lower, upper]

Parameters:

Name Type Description Default
lower float

lower bound

required
upper float

upper bound

required

lower property

lower bound

upper property

upper bound

cdf() method descriptor

cdf(self, x: float) -> float

Cumulative distribution function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the CDF

required

logpdf() method descriptor

logpdf(self, x: float) -> float

Logarithm of the probability density function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the PDF

required

ppf() method descriptor

ppf(self, q: float) -> float

Percent point function (inverse of cdf) evaluated at q

Parameters:

Name Type Description Default
q float

point at which to evaluate the PPF

required

UniformAngle()

init(self) -> None

Uniform distribution in [0, 2*PI]

cdf() method descriptor

cdf(self, x: float) -> float

Cumulative distribution function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the CDF

required

logpdf() method descriptor

logpdf(self, x: float) -> float

Logarithm of the probability density function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the PDF

required

ppf() method descriptor

ppf(self, q: float) -> float

Percent point function (inverse of cdf) evaluated at q

Parameters:

Name Type Description Default
q float

point at which to evaluate the PPF

required

Keplerian

Finally, even though it sits at the core of what kima does, there is the kima.keplerian function:

kima.keplerian API

Calculate the Keplerian curve of one planet at times t

Parameters:

Name Type Description Default
t array

Times at which to calculate the Keplerian function

required
P float

Orbital period [days]

required
K float

Semi-amplitude

required
ecc float

Orbital eccentricity

required
w float

Argument of periastron [rad]

required
M0 float

Mean anomaly at the epoch [rad]

required
M0_epoch float

Reference epoch for the mean anomaly (M=0 at this time) [days]

required

Returns:

Name Type Description
v array

Keplerian function evaluated at input times t

This is the default Keplerian function producing radial velocities, while other functions are specialized for Gaia astrometry:

kima.kepler.keplerian_gaia API

Calculate the Keplerian curve of one planet at times t

Parameters:

Name Type Description Default
t array

Times at which to calculate the Keplerian function

required
psi array

Scan angle of the Gaia satellite at time t [rad]

required
A float

Thiele-innes parameter A [mas]

required
B float

Thiele-innes parameter B [mas]

required
F float

Thiele-innes parameter F [mas]

required
G float

Thiele-innes parameter G [mas]

required
ecc float

Orbital eccentricity

required
P float

Orbital period P [days]

required
M0 float

Mean anomaly at the epoch [rad]

required
M0_epoch float

Reference epoch for the mean anomaly (M=0 at this time) [days]

required

Returns:

Name Type Description
wk array

Gaia along-scan 'abscissa' function for a keplerian orbit evaluated at input times t

or for use with the BINARIESmodel including post-Keplerian corrections and apsidal precession:

kima.post_keplerian API

Calculate the Keplerian curve of the orbit of a dark companion around a star at times t with post-Keplerian additions. Suited to the orbit of a close binary star.

Parameters:

Name Type Description Default
t array

Times at which to calculate the Keplerian function

required
P float

Orbital period [days]

required
K float

Semi-amplitude

required
ecc float

Orbital eccentricity

required
w float

Argument of pericentre [rad]

required
wdot float

Pericentre precession rate [arcsecs/year]

required
M0 float

Mean anomaly at the epoch [rad]

required
M0_epoch float

Reference epoch for the mean anomaly (M=0 at this time) [days]

required
cosi float

Cosine of the inclination angle of the orbit (=0 for an edge-on orbit)

required
M1 float

Mass of primary star [Msun]

required
M2 float

Mass of secondary star [Msun]

required
R1 float

Radius of primary star [Rsun] If not specfied and tidal correction included the relation R = M^0.8 will be used.

required
GR bool

Whether to include the radial velocity corrections from General Relativity (Transverse Doppler, Light Travel-Time, and Graviatational Redshift)

required
Tid bool

Whether to include the radial velocity correction from Tides (only suitable for circular orbits)

required
Kprec float

What precision in m/s to calculate K2 to for the relativistic correction (defaults to 50 m/s)

required

Returns:

Name Type Description
v array

Keplerian function with potential corrections evaluated at input times t