Access the exoplanet.eu data base¶
PyA provides the ExoplanetEU2()
to access the data provided by
exoplanet.eu. The class download the data as a Virtual Observatory (VO)
table to provide access to it.
Note
PyA also provides the ExoplanetEU()
(note the missing ‘2’), which
is the predecessor of the above implementation. Although functional,
this implementation should
be considered deprecated.
ExoplanetEU2¶
Example: Usage of ExoplanetEU2¶
from __future__ import print_function, division
from PyAstronomy import pyasl
import matplotlib.pylab as plt
# Instantiate exoplanetEU2 object
v = pyasl.ExoplanetEU2()
# Show the available data
v.showAvailableData()
print()
# Get a list of all available column names
acs = v.getColnames()
print("Available column names: " + ", ".join(acs))
print()
# Select data by planet name (returns a dictionary)
print(v.selectByPlanetName("CoRoT-2 b"))
print()
# Get all data as an astropy table
at = v.getAllDataAPT()
# Export all data as a pandas DataFrame
pd = v.getAllDataPandas()
# Plot mass vs. SMA
plt.title("Mass vs. SMA")
plt.xlabel("[" + v.getUnitOf("mass") + "]")
plt.ylabel("[" + v.getUnitOf("semi_major_axis") + "]")
plt.loglog(at["mass"], at["semi_major_axis"], 'b.')
plt.show()
API documentation (ExoplanetEU2)¶
- class PyAstronomy.pyasl.ExoplanetEU2(skipUpdate=False, forceUpdate=False)¶
Provides access to exoplanet.eu data base.
This class downloads the data base as a VO table. By default, the data are re-downloaded every 7 days.
The class provides access to the entire data base offered by exoplanet.eu as shown below. Use showAvailableData to view the table of available data, including potential updates.
name
dtype
unit
description
name
object
Name of a planet
mass
float64
jovMass
Planetary Mass
mass_err_min
float64
jovMass
Planetary Mass error
mass_err_max
float64
jovMass
Planetary Mass error
mass_sini
float64
jovMass
Planetary Mass*sin(i)
mass_sini_error_min
float64
jovMass
Planetary Mass*sin(i) error
mass_sini_error_max
float64
jovMass
Planetary Mass*sin(i) error
radius
float64
Rjup
Planetary Radius
radius_error_min
float64
Rjup
Planetary Radius error
radius_error_max
float64
Rjup
Planetary Radius error
orbital_period
float64
d
Orbital Period
orbital_period_err_min
float64
d
Orbital Period error
orbital_period_err_max
float64
d
Orbital Period error
semi_major_axis
float64
AU
Semi-Major Axis
semi_major_axis_error_min
float64
AU
Semi-Major Axis error
semi_major_axis_error_max
float64
AU
Semi-Major Axis error
eccentricity
float64
Orbital Eccentricity
eccentricity_error_min
float64
Orbital Eccentricity error
eccentricity_error_max
float64
Orbital Eccentricity error
inclination
float64
deg
Orbital Inclination
inclination_error_min
float64
deg
Orbital Inclination error
inclination_error_max
float64
deg
Orbital Inclination error
angular_distance
float64
arcs
Angular Distance
discovered
int32
yr
Year of Discovery
updated
object
Last Update
omega
float64
deg
Argument of Periastron
omega_error_min
float64
deg
Argument of Periastron error
omega_error_max
float64
deg
Argument of Periastron error
tperi
float64
d
Epoch of Periastron
tperi_error_min
float64
d
Epoch of Periastron error
tperi_error_max
float64
d
Epoch of Periastron error
tconj
float64
d
Conjonction Date
tconj_error_min
float64
d
Conjonction Date error
tconj_error_max
float64
d
Conjonction Date error
tzero_tr
float64
d
Primary Transit
tzero_tr_error_min
float64
d
Primary Transit error
tzero_tr_error_max
float64
d
Primary Transit error
tzero_tr_sec
float64
d
Secondary Transit
tzero_tr_sec_error_min
float64
d
Secondary transit error
tzero_tr_sec_error_max
float64
d
Secondary transit error
lambda_angle
float64
deg
Sky-projected angle between the planetary orbital spin and the stellar rotational spin
lambda_angle_error_min
float64
deg
Sky-projected angle between the planetary orbital spin and the stellar rotational spin error
lambda_angle_error_max
float64
deg
Sky-projected angle between the planetary orbital spin and the stellar rotational spin error
impact_parameter
float64
Impact Parameter b
impact_parameter_error_min
float64
Impact Parameter b error
impact_parameter_error_max
float64
Impact Parameter b error
tzero_vr
float64
d
Zero Radial Speed time
tzero_vr_error_min
float64
d
Zero Radial Speed time error
tzero_vr_error_max
float64
d
Zero Radial Speed time error
k
float64
m / s
Velocity Semiamplitude K
k_error_min
float64
m / s
Velocity Semiamplitude K error
k_error_max
float64
m / s
Velocity Semiamplitude K error
temp_calculated
float64
K
Calculated temperature
temp_measured
float64
K
Measured temperature
hot_point_lon
float64
deg
Hottest point longitude
geometric_albedo
float64
Geometric albedo
geometric_albedo_error_min
float64
Geometric albedo error
geometric_albedo_error_max
float64
Geometric albedo error
log_g
float64
log(g)
publication_status
object
Publication Status
detection_type
object
Detection type
mass_detection_type
object
Mass Measurement Method
radius_detection_type
object
Radius Measurement Method
alternate_names
object
List of planet alternative names
molecules
object
List of detected molecules
star_name
object
Name of a host star
ra
float64
deg
RA (J2000) of a star
dec
float64
deg
Dec (J2000) of a star
mag_v
float64
mag
V magnitude of a host star
mag_i
float64
mag
I magnitude of a host star
mag_j
float64
mag
J magnitude of a host star
mag_h
float64
mag
H magnitude of a host star
mag_k
float64
mag
K magnitude of a host star
star_distance
float64
pc
Distance to a host star
star_distance_error_min
float64
pc
Distance to a host star error
star_distance_error_max
float64
pc
Distance to a host star error
star_metallicity
float64
Metallicity of a host star
star_metallicity_error_min
float64
Metallicity of a host star error
star_metallicity_error_max
float64
Metallicity of a host star error
star_mass
float64
Msun
Mass of a host star
star_mass_error_min
float64
Msun
Mass of a host star error
star_mass_error_max
float64
Msun
Mass of a host star error
star_radius
float64
Rsun
Radius of a host star
star_radius_error_min
float64
Rsun
Radius of a host star error
star_radius_error_max
float64
Rsun
Radius of a host star error
star_sp_type
object
Spectral type of a host star
star_age
float64
Gyr
Age of a host star
star_age_error_min
float64
Gyr
Age of a host star error
star_age_error_max
float64
Gyr
Age of a host star error
star_teff
float64
K
Effective temperature of a host star
star_teff_error_min
float64
K
Effective temperature of a host star error
star_teff_error_max
float64
K
Effective temperature of a host star error
star_detected_disc
object
Star Detected Disc
star_magnetic_field
bool
Star magnetic field
star_alternate_names
object
List of star alternative names
- Parameters
- skipUpdateBoolean, optional
If True, update of data will be skipped (default is False).
- forceUpdateBoolean, optional
If True, udpate of data will be forced (independent of value if skipUpdate, default is False)
Methods
Change the time after which the data are updated.
dataAge
()Determine the "age" of the data.
Force a fresh download of the data and read the data.
Get all data as astropy table object.
Get all data as pandas DataFrame.
Get all column names.
getUnitOf
(col)Get unit of column.
Determine whether data need to be updated.
selectByPlanetName
(planetName[, toScreen, ...])Get entry by planet name.
Show available data.
- changeDownloadCycle(c)¶
Change the time after which the data are updated.
By default, the data will be updated if they are older than the given update cycle. This method allows you to change that cycle.
- Parameters
- cfloat or None
The new update cycle in days. If None is provided, updating is switched off.
- dataAge()¶
Determine the “age” of the data.
- Returns
- agefloat
The time since last data update in days. None, if no age can be determined, e.g., if data have never been downloaded.
- forceUpdate()¶
Force a fresh download of the data and read the data.
By default, the data will be updated every 7 days.
- getAllDataAPT()¶
Get all data as astropy table object.
- Returns
- votableastropy.table.table.Table
All tabulated data as an astropy table
- getAllDataPandas()¶
Get all data as pandas DataFrame.
- Returns
- tableDataFrame
All available data in pandas format.
- getColnames()¶
Get all column names.
- Returns
- Columns nameslist
All column names.
- getUnitOf(col)¶
Get unit of column.
- Parameters
- colstring
The name of of column.
- Returns
- unitstring
The unit used for this column.
- needsUpdate()¶
Determine whether data need to be updated.
- Returns
- Update flagboolean
True if data need update and False otherwise.
- selectByPlanetName(planetName, toScreen=True, caseSensitive=False)¶
Get entry by planet name.
- Parameters
- planetNamestring
The name of the planet (includes planet letter, e.g., “corot-2 b”
- caseSensitiveboolean, optional
If False (default), the search will be case-insensitive.
- toScreenboolean, optional
If True (default), the information on the system is printed to screen in human-readable format.
- Returns
- Data entrydictionary
A dictionary with a key for every data column holding the associated value from the data table.
- showAvailableData()¶
Show available data.
Displays the available column names and associated data types, units, and descriptions.
ExoplanetEU (deprecated)¶
Example: Using ExoplanetEU¶
from __future__ import print_function, division
from PyAstronomy import pyasl
import matplotlib.pylab as plt
eu = pyasl.ExoplanetEU()
# See what information is available
cols = eu.availableColumns()
print(cols)
print()
# Get all data and plot planet Mass vs.
# semi-major axis in log-log plot
dat = eu.getAllData()
plt.xlabel("Planet Mass [RJ]")
plt.ylabel("Semi-major axis [AU]")
plt.loglog(dat.plMass, dat.sma, 'b.')
plt.show()
API documentation (ExoplanetEU)¶
- class PyAstronomy.pyasl.ExoplanetEU(skipUpdate=False)¶
Provides access to exoplanet.eu data base.
This class downloads the data base as a csv file and converts it into a numpy recarray. By default, the data are re-downloaded every 7 days.
The available columns are:
Column Name
Description
Unit
plName
Name of planet
plMass
Mass of planet
MJ
plRadius
Radius of planet
RJ
period
Orbital period
d
sma
Semi-major axis
AU
eccentricity
Orbital eccentricity
inclination
Orbital inclination
deg
angDistance
Angular Distance
arcsec
pubStatus
Publication status
discovered
Year of discovery
yr
updated
Date of data update
omega
Argument of Periastron
deg
tperi
Epoch of Periastron
d
detType
Detection type
molecules
List of detected molecules
stName
Name of star
ra
Right ascension (J2000)
hms
dec
Declination (J2000)
dms
mag_v
V magnitude of a host star
mag
mag_i
I magnitude of a host star
mag
mag_j
J magnitude of a host star
mag
mag_h
H magnitude of a host star
mag
mag_k
K magnitude of a host star
mag
dist
Distance to host star
pc
mh
Metallicity of host star
dex
stMass
Stellar mass
solar
stRadius
Radius of star
solar
SpT
Spectral type of host star
stAge
Stellar age
Ga
stTeff
Stellar effective temperature
K
plRadMM
Measuring method of Rpl
- Parameters
- skipUpdateboolean, optional
If True, no re-download of the data will be initiated no matter how old they are.
Methods
Show a summary of the available columns.
Change the time after which the data are updated.
dataAge
()Determine the "age" of the data.
Force a fresh download of the data.
Provides all data as a numpy recarray.
Determine whether data need to be updated.
- availableColumns()¶
Show a summary of the available columns.
- Returns
- Column nameslist of strings
The names of the columns.
- changeDownloadCycle(c)¶
Change the time after which the data are updated.
By default, the data will be updated if they are older than the given update cycle. This method allows you to change that cycle.
- Parameters
- cfloat or None
The new update cycle in days. If None is provided, updating is switched off.
- dataAge()¶
Determine the “age” of the data.
- Returns
- agefloat
The time since last data update in days. None, if no age can be determined, e.g., if data have never been downloaded.
- forceUpdate()¶
Force a fresh download of the data.
By default, the data will be updated every 7 days.
- getAllData()¶
Provides all data as a numpy recarray.
- Returns
- Datanumpy recarray
All available data. Use, e.g., availableColumns to get an overview of the available information.
- needsUpdate()¶
Determine whether data need to be updated.
- Returns
- Update flagboolean
True if data need update and False otherwise.