structs.py ¶
Contains the BODY
and SETTINGS
classes that are passed to C
as structs, which are for internal use only. All bodies should be instantiated
via the Planet
, Moon
, and Star
subclasses.
Settings should be passed directly to the planetplanet.photo.System
class.
-
class
planetplanet.photo.structs.
BODY
(name, **kwargs)¶ The class containing all the input planet/star parameters. This is a
ctypes
interface to the CBODY
struct. Users should instantiate these via theStar
,Planet
, andMoon
classes.Parameters: -
M
(t)¶ The mean anomaly at a time t.
-
-
class
planetplanet.photo.structs.
SETTINGS
(**kwargs)¶ The class that contains the model settings. This class is used internally; settings should be specified as
kwargs
toSystem
or by assignment once aSystem
object has been instantiated.Parameters: - nbody (bool) – Uses the
REBOUND
N-body code to compute orbits. DefaultTrue
- keptol (float) – Kepler solver tolerance. Default 1.e-15
- maxkepiter (int) – Maximum number of Kepler solver iterations. Default 100
- kepsolver (str) – Kepler solver (newton | mdfast). Default newton
- timestep (float) – Timestep in days for the N-body solver. Default 0.01
- adaptive (bool) – Adaptive grid for limb-darkened bodies? Default
True
- quiet (bool) – Suppress output? Default
False
- mintheta (float) – Absolute value of the minimum phase angle in degrees. Below this angle, elliptical boundaries of constant surface brightness on the planet surface are treated as vertical lines. Default 0.01
- maxvertices (int) – Maximum number of vertices allowed in the area computation. Default 999
- maxfunctions (int) – Maximum number of functions allowed in the area computation. Default 999
- oversample (int) – Oversampling factor for each exposure. Default 1
- distance (float) – Distance to the system in parsecs. Default 10.
- circleopt (bool) – Solve the simpler quadratic problem for circle-ellipse intersections when the axes of the ellipse are equal to within \(10^{-10}\)? Default
True
- batmanopt (bool) – Use the
batman
algorithm to compute light curves of radially symmetric bodies? This can significantly speed up the code. DefaultTrue
- integrator (str) – The N-body integrator (
whfast
|ias15
) to use. Defaultias15
- nbody (bool) – Uses the
-
class
planetplanet.photo.structs.
CM
(*bodies)¶ A class corresponding to a dummy center of mass particle. Used internally.
-
class
planetplanet.photo.structs.
Star
(*args, **kwargs)¶ A star
BODY
class.Parameters: - name (str) – A unique identifier for this star
- host (str) – The name of the body’s host. Default
None
(host is the center of mass of all bodies that come earlier in the arguments list passed toplanetplanet.ppo.System
). - m (float) – Mass in solar masses. Default 1.
- r (float) – Radius in solar radii. Default 1.
- per (float) – Orbital period in days. Default 0.
- inc (float) – Orbital inclination in degrees. Default 90.
- ecc (float) – Orbital eccentricity. Default 0.
- w (float) – Longitude of pericenter in degrees. 0.
- Omega (float) – Longitude of ascending node in degrees. 0.
- t0 (float) – Time of primary eclipse in days. Default 0.
- teff (float) – The effective temperature of the star in Kelvin. Default 5577.
- limbdark (array_like) – The limb darkening coefficients (thick atmosphere limit). These are the coefficients in the Taylor expansion of (1 - mu), starting with the first order (linear) coefficient, where mu = cos(theta) is the radial coordinate on the surface of the star. Each coefficient may either be a scalar, in which case limb darkening is assumed to be grey (the same at all wavelengths), or a callable whose single argument is the wavelength in microns. Default is [1.0], a grey linear limb darkening law.
- radiancemap – A surface radiance map function. This function must be decorated with a
numba
cfunc()
statement. Seeplanetplanet.photo.maps
for more info. Defaultplanetplanet.photo.maps.RadiativeEquilibriumMap()
- nz (int) – Number of zenith angle slices. Default 31
- color (str) – Object color (for plotting). Default k
-
class
planetplanet.photo.structs.
Planet
(*args, **kwargs)¶ A planet
BODY
class.Parameters: - name (str) – A unique identifier for this body
- host (str) – The name of the body’s host. Default
0
(host is the central star). - m (float) – Mass in Earth masses. Default 1.
- r (float) – Radius in Earth radii. Default 1.
- per (float) – Orbital period in days. Default 3.
- inc (float) – Orbital inclination in degrees. Default 90.
- ecc (float) – Orbital eccentricity. Default 0.
- w (float) – Longitude of pericenter in degrees. 0.
- Omega (float) – Longitude of ascending node in degrees. 0.
- t0 (float) – Time of transit in days. Default 0.
- phasecurve (bool) – Compute the phasecurve for this body? Default
False
- albedo (float) – Body’s albedo (airless limit). Default 0.3
- tnight (float) – Nightside temperature in Kelvin (airless limit). Default 40
- limbdark (array_like) – The limb darkening coefficients (thick atmosphere limit). These are the coefficients in the Taylor expansion of (1 - mu), starting with the first order (linear) coefficient, where mu = cos(theta) is the radial coordinate on the surface of the star. Each coefficient may either be a scalar, in which case limb darkening is assumed to be grey (the same at all wavelengths), or a callable whose single argument is the wavelength in microns. Default is [], corresponding to no limb darkening.
- Lambda (float) – Longitudinal hotspot offset in degrees, with positive values corresponding to a northward shift. Airless bodies only. Default 0.
- Phi (float) – Latitudinal hotspot offset in degrees, with positive values corresponding to an eastward shift. Airless bodies only. Default 0.
- radiancemap (
function
) – A surface radiance map function. This function must be decorated with anumba
cfunc()
statement. Seeplanetplanet.photo.maps
for more info. Defaultplanetplanet.photo.maps.RadiativeEquilibriumMap()
- nz (int) – Number of zenith angle slices. Default 11
- color (str) – Object color (for plotting). Default r
-
draw_orbit
(**kwargs)¶ Draws the orbit of the body on the sky. Accepts the keyword arguments taken by
planetplanet.photo.eyeball.DrawOrbit()
.