Exploring

An exoplanet Population is designed to be a (hopefully!) relatively easy way to interact with data for a group of exoplanet systems. Here we step through the basics of how we can explore a population of planets, access standardized planet properties, and filter subsets of planet populations.

Getting started

The exoatlas package contains the tools we will use. All planet properties inside a population have astropy units associated with them, so we make also want to have access to those units for our calculations.

In [1]:
import exoatlas as ea
import astropy.units as u

We can always check what version of exoatlas we’re using with its hidden .__version__.

In [2]:
ea.__version__
Out[2]:
'0.2.4'

Create a Population

Now, to get started, we’ll make a population that contains all confirmed transiting exoplanets. We can read more about the different populations we can create over one the Creating page. When we create this population, the code will download a table of the latest data from the NASA Exoplanet Archive.

In [3]:
pop = ea.TransitingExoplanets()
/Users/zkbt/.exoatlas/data/standardized-TransitingExoplanets.txt is 0.009 days old.
Should it be updated? [y/N]
[transitingexoplanets] Loaded standardized table from /Users/zkbt/.exoatlas/data/standardized-TransitingExoplanets.txt

(The code will let you know how long ago your local dataset was updated, and ask if you’d like to update it now.)

What’s inside a Population?

The core ingredient to an exoplanet Population is a table of planet properties that have been standardized and populated with astropy units. This pop.standard table is an astropy Table, so its contents can be accessed or modified as any other astropy Table.

In [4]:
pop.standard
Out[4]:
Table length=3135
nameradecperiodsemimajoraxiseomegainclinationtransit_epochtransit_durationtransit_depthstellar_teffstellar_radiusstellar_massUJmagVJmagBJmagRCmagICmagJmagHmagKmagWISE1magWISE2magWISE3magWISE4magradiusradius_uncertainty_upperradius_uncertainty_lowertransit_artransit_brv_semiamplitudemassmass_uncertainty_uppermass_uncertainty_lowerdistancedistance_uncertainty_upperdistance_uncertainty_lowerdiscoverer
degdegdAUdegdegddKsolRadsolMassearthRadearthRadearthRadearthMassearthMassearthMasspcpcpc
str17float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64str44
55Cnce133.14921628.3308180.7365390.01544nannan83.32455733.013nannan5196.00.940.91nan5.966.83nannan4.7684.2654.0154.0013.2964.0514.0141.910.08-0.08nan0.41nan8.080.31-0.3112.590.01-0.01McDonald Observatory
BD+20594b53.65096720.59923241.6855nan0.0nan89.55nannan0.000495766.01.081.67nan11.03811.728nannan9.779.4329.3689.319.3449.3328.9762.5780.112-0.11255.8nan3.122.24819.5349-9.5349180.391.25-1.25K2
CoRoT-10b291.0637080.74614313.24060.10550.53218.988.552454273.34360.12420.01610365075.00.790.89nan15.2216.68nannan12.52711.92911.78211.6411.75211.3968.92310.870.78-0.7831.330.85301.0874.050.85-50.85345.070.0-70.0CoRoT
CoRoT-11b280.6872635.9376882.994330.04360.0nan83.172454597.6790.10420.0114496440.01.371.27nan12.93913.596nannan11.58911.41611.24811.17311.26511.479.19816.030.34-0.346.890.818280.0740.51108.06-108.06560.030.0-30.0CoRoT
CoRoT-12b100.765677-1.2964392.8280420.040160.07105.085.482454398.627070.107260.017445675.01.121.08nan15.51516.343nannan14.02413.6313.55713.4713.4712.538.6116.141.46-1.46nan0.573125.5291.43822.247-20.6581150.085.0-85.0CoRoT
CoRoT-13b102.721137-5.0864454.035190.0510.0nan88.022454790.80910.1308nan5945.01.011.09nan15.03915.777nannan13.7113.40613.37613.1713.21712.6158.9469.920.157-0.15710.810.374157.8415.70420.976-20.9761060.0100.0-100.0CoRoT
CoRoT-14b103.424211-5.5360371.512140.0270.0nan79.62454787.66940.0693nan6035.01.211.13nan16.03316.891nannan14.32114.00713.80613.67913.72912.039.1412.220.78-0.784.780.861230.02415.4190.7-190.71340.0110.0-110.0CoRoT
CoRoT-16b278.524691-6.0025955.352270.06180.33168.4185.012454923.91380.09960.01025650.01.191.1nan15.6316.68nannan13.49612.9812.847nannannannan13.111.79-1.5711.20.82561.96170.03227.014-26.379840.090.0-90.0CoRoT
CoRoT-17b278.699254-6.6122343.76810.04610.00.088.342454923.30930.1966670.00445740.01.591.04nan15.46nannannan13.17412.61512.472nannannannan11.430.78-0.786.230.18312.4772.2995.34-95.34920.050.0-50.0CoRoT
.....................................................................................................................
WTS-1b293.993236.2903253.3520570.0470.1nan85.52454318.7472nan0.0176366250.01.151.2nan16.13nannannan15.37515.18715.271nannannannan16.71.79-2.02nan0.69nan1274.44111.24-111.243200.0900.0-400.0United Kingdom Infrared Telescope
WTS-2b293.73279636.8154911.01870680.018550.0nan83.552454317.81333nannan5000.00.750.82nan15.916.8nannan13.92813.46413.41413.29913.36712.1079.17615.2780.684-0.684nan0.584256.0355.969650.8528-50.85281000.0nannanUnited Kingdom Infrared Telescope
Wolf503b206.847687-6.1368756.001180.0571nannannan2458185.360870.0550417nan4716.00.690.69nan10.2611.27nan9.098.3247.7747.617nannannannan2.030.076-0.073nan0.387nannaninfinf44.580.1-0.1K2
XO-1b240.5493528.1695863.94153nan0.0nan88.81nannan0.0180000000000000025750.00.880.88nan11.1911.8510.8110.439.9399.6019.5279.4959.5189.5079.24812.7780.785-0.78511.37nan116.0263.798941.3179-41.3179164.330.62-0.62XO
XO-2Nb117.02696850.22582.615861780.0368nannan88.012454508.738290.1118292nan5307.00.990.97nan11.13812.00210.66910.2439.7449.349.3089.249.319.2368.83311.1310.135-0.1357.9860.28nan179.891787.94575-7.94575154.941.45-1.45XO
XO-3b65.46958157.8171813.19154nan0.29nan79.32nannan0.00896429.01.540.58nan9.810.25nannan9.0138.8458.7918.7548.7658.7368.37215.8051.345-1.3454.95nan1488.02316.9807378.2177-378.2177214.312.7-2.7XO
XO-4b110.38822358.2681084.12508nan0.0nan88.8nannan0.00780000000000000056397.01.451.1nan10.67411.24nannan9.6679.4769.4069.3739.3989.3788.71614.0110.897-0.8977.68nan168.6451.318660.3877-60.3877274.792.91-2.91XO
XO-5b116.71652739.0945784.18775580.05150.0nan86.82456864.31290.12990.01085430.01.131.04nan12.13nannannan10.77410.44310.34510.33310.38110.2928.35412.780.34-0.34nan0.55146.0378.29.53-9.53278.373.9-3.9XO
XO-6b94.79328273.8276823.76500070.08150.0nan86.02456652.712450.1208333nan6720.01.931.47nan10.25nannannan9.4719.2669.2469.2139.2329.348.70923.2032.466-2.4669.080.633450.01398.452infinf237.062.43-2.43XO
piMenc84.291214-80.4691246.26790.068390.0nan87.4562458325.5040.12304170.00036037.01.11.096.365.676.25nannan4.8694.4244.2414.2693.9724.1994.2192.0420.05-0.0513.380.591.584.820.84-0.8618.280.02-0.02Transiting Exoplanet Survey Satellite (TESS)

If desired, columns could be added to this standardized table:

In [5]:
import numpy as np
N = len(pop)
pop.standard['something'] = np.arange(N) + 5

How do we access planet properties?

The main way to access planet properties within a Populatoin is with its attributes. That is, we can access an array of the values for some property x by calling pop.x. Behind the scenes, the population will look to see if there is a column called "x" in the standardized table and return that column. For example, we can get an array of planet names with:

In [6]:
pop.name
Out[6]:
array(['55Cnce', 'BD+20594b', 'CoRoT-10b', ..., 'XO-5b', 'XO-6b',
       'piMenc'], dtype='<U17')

Even columns that we separately added to the standardized table can be accessed as attributes:

In [7]:
pop.something
Out[7]:
$[ 5,~ 6,~ 7,~\dots,~3137,~3138,~3139] \; \mathrm{}$

We also have access to quantities that are not directly included in the table itself but can be calculated from them. For example, we can get an array of the amount of insolation that the planets receive from their stars as:

In [8]:
pop.insolation
[transitingexoplanets] 1626/3135 semimajoraxes are missing
[transitingexoplanets] 0/3135 are still missing after NVK3L
Out[8]:
$[3313157.1,~20290.402,~45613.962,~\dots,~513270.26,~1402428.9,~421394.84] \; \mathrm{\frac{W}{m^{2}}}$

In this case, the insolation is calculated from the planet’s orbital separation and the luminosity of the star (which is itself calculated from the stellar effective temperature and radius).

If information needed to do a calculation is missing, exoatlas will try to estimate them from other available information. In the .insolation case, some planets had no semimajor axes defined in the .standard table, but we were able to calculate this quantity from the orbital period, the stellar mass, and Newton’s Version of Kepler’s 3rd Law.

Short descriptions of some common attributes can printed with the describe_columns() function.

In [9]:
ea.describe_columns()
               name = name of the planet
                 ra = Right Ascension of the system
                dec = Declination of the system
           distance = distance to the system
   distance_modulus = apparent magnitude - absolute magnitude
         discoverer = telescope/project that found this planet
       stellar_teff = stellar effective temperature
       stellar_mass = stellar mass
     stellar_radius = stellar radius
 stellar_luminosity = luminosity of the star
 stellar_brightness = photon flux from the star at Earth (a function of wavelength)
             period = orbital period of the planet
      semimajoraxis = the semimajor axis of the planet's orbit
          a_over_rs = scaled orbital distance a/R*
                  b = impact parameter b
                  e = eccentricity
              omega = argument of periastron
             radius = planet radius
               mass = planet mass
            density = density of the planet
         insolation = bolometric energy flux the planet receives from its star
relative_insolation = insolation relative to Earth
                teq = equilibrium temperature of the planet (assuming 0 albedo)
    surface_gravity = surface gravity of the planet
       scale_height = scale height of an H2-rich atmosphere
    escape_velocity = escape velocity of the planet
   escape_parameter = ratio of gravitational potential to thermal energy for an H atom
      transit_epoch = a transit midpoint
   transit_duration = duration of the transit
      transit_depth = fraction of starlight the planet blocks
         transit_ar = (transit-derived) scaled orbital distance a/R*
          transit_b = (transit-derived) impact parameter b
transmission_signal = transit depth of one scale height of atmosphere
    emission_signal = thermal-emission eclipse depth (a function of wavelength)
  reflection_signal = reflected-light eclipse depth (for an albedo of 1)

With this toolkit, you can now access the data you need to make some pretty fundamental plots in exoplanetary science. For example:

In [10]:
import matplotlib.pyplot as plt
plt.loglog(pop.relative_insolation, pop.radius, '.')
plt.xlabel('Flux Received (relative to Earth)')
plt.ylabel('Planet Radius (Earth radii)');
[transitingexoplanets] 1626/3135 semimajoraxes are missing
[transitingexoplanets] 0/3135 are still missing after NVK3L
_images/exploring_22_1.png

How do we access some sub-population of planets?

Often we’ll want to pull out some subset of a population. We might want a smaller sample of planets, or all the planets that meet some particular criterion, or maybe the properties of one individual planet. In our experience with numpy arrays or astropy tables, we’ve often done this by indexing (x[0] or x[[0, 1, 5]]), slicing (x[3:30]), or masking (x[some_array > some_other_array]).

We can apply the same methods to a Population, creating smaller populations by indexing, slicing, or masking. Anything we can do with a Population we can do with one of these sub-Populations that we create.

In [11]:
pop
Out[11]:
<Transiting Exoplanets | population of 3135 planets>
In [12]:
one_planet = pop[0]
one_planet
Out[12]:
<ExoplanetSubsets of Transiting Exoplanets | population of 1 planets>
In [13]:
one_planet.name, one_planet.radius, one_planet.insolation
   [population] 0/1 semimajoraxes are missing
   [population] 0/1 are still missing after NVK3L
Out[13]:
(array(['55Cnce'], dtype='<U17'),
 <Quantity [1.91] earthRad>,
 <Quantity [3313157.14969688] W / m2>)
In [14]:
prime_planets = pop[[2, 3, 5, 7, 11, 13, 17, 19, 23]]
prime_planets
Out[14]:
<ExoplanetSubsets of Transiting Exoplanets | population of 9 planets>
In [15]:
first_ten = pop[:10]
first_ten
Out[15]:
<ExoplanetSubsets of Transiting Exoplanets | population of 10 planets>
In [16]:
every_other_exoplanet = pop[::2]
every_other_exoplanet
Out[16]:
<ExoplanetSubsets of Transiting Exoplanets | population of 1568 planets>
In [17]:
small = pop[pop.radius < 4*u.Rearth]
small
Out[17]:
<ExoplanetSubsets of Transiting Exoplanets | population of 2433 planets>

Additionally, we can extract an individual planet or a list of planets by indexing the population with planet name(s). This is using astropy tables’ .loc functionality, with "name" being used as an index.

In [18]:
cute_planet = pop['GJ 1214b']
cute_planet
Out[18]:
<ExoplanetSubsets of Transiting Exoplanets | population of 1 planets>
In [19]:
cute_planets = pop[['LHS 1140b', 'GJ 1214b', 'GJ 436b']]
cute_planets
Out[19]:
<ExoplanetSubsets of Transiting Exoplanets | population of 3 planets>

Explore!

That’s about it. For more information about different pre-defined populations see Creating, and for more about pre-packaged visualizations see Visualizing.