API

This generates the API, showing some documented functions

(this is a link to EPOS.epos)

The epos class

class EPOS.epos(name, Debug=False, seed=True, title=None, RV=False, Norm=False, MC=True, Msini=False, survey=None)

The epos class

Description:
Initialize
Parameters:
  • name (str) – name to use for directories
  • survey (str) – Survey data to load. [‘Kepler’, ‘RV’]. Default None
  • RV (bool) – Compare to radial velocity instead of transits
  • MC (bool) – Generate planet population by random draws
  • Msini (bool) – Convert the planet mass distribution into an Msini distribution
  • Debug (bool) – Log more output for debugging
  • seed (int) – Same random number for each simulation? True, None, or int
  • Norm (bool) – normalize pdf (deprecated?)
name

name

Type:str
plotdir

plot directory

Type:str
RV

Compare to Radial Velocity instead of transit data

Type:bool
Multi

Do multi-planet statistics

Type:bool
RandomPairing

multis are randomly paired

Type:bool
Parametric

parametric planet population?

Type:bool
Debug

Verbose logging

Type:bool
seed

Random seed, can be any of int, True, or None

jsondir = None

EPOS mode

plotpars = None

Load Default Settings for each Survey

set_bins(xbins=[[1, 10]], ybins=[[1, 10]], xgrid=None, ygrid=None, Grid=False, MassRadius=False)

Initialize period-radius (or mass) bins for occurrence rate calculations

Description:
Bins can be generated from a grid, f.e. xgrid=[1,10,100], or from a list of bin edges, f.e. xbins= [[1,10],[10,100]]
Parameters:
  • xbins (list) – (list of) period bin edges
  • ybins (list) – (list of) radius/mass bin edges
  • xgrid (list) – period bin in interfaces
  • ygrid (list) – radius/mas bin interfaces
  • Grid (bool) – If true, create a 2D grid from bins: nbins = nx * ny. If false, pair x and y bins: nbins == nx == ny
set_bins_poly(polys, labels=None)

Initialize polygonic bins for occurrence rate calculations

Description:
each polygone is a Nx2 numpy array of (x,y) coordinates
Parameters:polys (list) – (list of) polygones
set_observation(xvar, yvar, starID, nstars=168620.0, radiusError=0.1, score=None, tdur=None, reliability=None, Verbose=True)

Observed planet population

Parameters:
  • xvar – planet orbital period [list]
  • yvar – planet radius or M sin i [list]
  • ID – planet ID [list]
  • nstars – number of stars surveyed

Note

Some pre-defined planet populations from Kepler can be generated from EPOS.kepler.dr25()

set_parametric(func)

Define a parametric function to generate the planet size-period distribution

Description:
Function should be callable as func(X, Y, *fitpars2d) with X(np.array): period Y(np.array): size (radius or mass) The list of fit parameters fitpars2d will be constructed from parameters added using EPOS.fitparameters.add() with is2D=True

Note

Some pre-defined functions can be found in EPOS.fitfunctions

Parameters:func (function) – callable function
set_survey(xvar, yvar, eff_2D, Rstar=1.0, Mstar=1.0, vet_2D=None)

Survey detection efficiency (completeness) :param xvar: planet orbital period grid [list]’ :param yvar: planet radius or M sin i grid [list] :param eff_2D: 2D matrix of detection efficiency :param Rstar: stellar radius, for calculating transit probability :param Mstar: stellar mass, for period-semimajor axis conversion

Note

Some pre-defined detection efficiencies from Kepler can be generated from EPOS.kepler

class EPOS.fitparameters

Holds the fit parameters. Usually initialized in epos.fitpars

add(key, value, fixed=False, min=-inf, max=inf, dx=None, text=None, is2D=False, isnorm=False)

Add a fit parameter

Parameters:
  • key (str) – fit parameter dictionary key
  • value (float) – starting guess
  • fixed (bool) – keep this parameter fixed
  • min (float) – lower bound
  • max (float) – upper bound
  • dx (float) – initial dispersion for MCMC
  • text (str) – plot safe name?
  • is2D (bool) – use this parameter in the 2D parametric EPOS.fitfunctions()
  • isnorm (bool) – this parameter is the normalization factor for the number of planet per star EPOS.fitfunctions()

Fit parameters

class EPOS.fitparameters

Holds the fit parameters. Usually initialized in epos.fitpars

add(key, value, fixed=False, min=-inf, max=inf, dx=None, text=None, is2D=False, isnorm=False)

Add a fit parameter

Parameters:
  • key (str) – fit parameter dictionary key
  • value (float) – starting guess
  • fixed (bool) – keep this parameter fixed
  • min (float) – lower bound
  • max (float) – upper bound
  • dx (float) – initial dispersion for MCMC
  • text (str) – plot safe name?
  • is2D (bool) – use this parameter in the 2D parametric EPOS.fitfunctions()
  • isnorm (bool) – this parameter is the normalization factor for the number of planet per star EPOS.fitfunctions()