Access the “NASA Exoplanet Archive”¶
- class PyAstronomy.pyasl.NasaExoplanetArchive¶
Easy access to NASA’s exoplanet archive.
This class downloads a table of exoplanet data from the “NASA Exoplanet Archive” (http://exoplanetarchive.ipac.caltech.edu/index.html) and provides access to these data. By default, the data will be re-downloaded every seven days.
The following data are provided:
Column
Description
Unit
pl_hostname
Name of host star
pl_name
Name of the planet
pl_letter
Planet letter (e.g., b, c, d, etc.)
ra
Right ascension
deg
dec
Declination
deg
pl_orbper
Planetary orbital period
d
pl_massj
Planetary mass
MJ
pl_radj
Planetary radius
RJ
pl_trandep
Central depth of transit
%
pl_trandur
Transit duration
d
pl_tranmid
Transit midpoint
BJD
pl_orbsmax
Semi-major-axis
AU
pl_orbincl
Orbital inclination of planet
deg
st_rad
Stellar radii
Solar
st_dist
Distance to star
pc
st_mass
Stellar mass
Solar
st_teff
Effective temperature of star
K
st_vsin
Stellar vsin(i)
km/s
st_logg
Stellar surface gravity
cm/s**2
sy_vmag
Stellar V-band brightness
mag
sy_kmag
Stellar Ks-band brightness
mag
Methods
availableColumns
([verbose])Shows a list of available data columns.
Change the time after which the data are updated.
dataAge
()Determine the "age" of the data.
Trigger download of data.
Get all available data.
Determine whether data need to be updated.
selectByPlanetName
(planetName[, caseSensitive])Get entry by planet name.
- availableColumns(verbose=True)¶
Shows a list of available data columns.
- Parameters
- verboseboolean, optional
If True (default), prints information to screen.
- Returns
- columnslist of strings
The names of the available data 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.
- downloadData()¶
Trigger download of data.
- getAllData()¶
Get all available data.
- Returns
- Datanumpy recarray
All data stored in the table as a numpy recarray.
- needsUpdate()¶
Determine whether data need to be updated.
- Returns
- Update flagboolean
True if data need update and False otherwise.
- selectByPlanetName(planetName, 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.
- Returns
- Data entrydictionary
A dictionary with a key for every data column holding the associated value from the data table.
Example of usage¶
from __future__ import print_function, division
from PyAstronomy import pyasl
import matplotlib.pylab as plt
nexa = pyasl.NasaExoplanetArchive()
# See what information is available
cols = nexa.availableColumns()
print()
# Get all information for planet 'wasp-12 b'
# By default, the search is case-insensitive
print("Entry of Wasp-12 b")
print(nexa.selectByPlanetName("Wasp-12 b"))
print()
# Get all data and plot ra vs. dec
dat = nexa.getAllData()
plt.plot(dat.ra, dat.dec, 'b.')
plt.show()