Color-magnitude diagram: broadband filters#

This tutorial shows how to create a color-magnitude diagram that includes data of field and young/low-gravity objects, synthetic photometry computed from isochrones and model spectra, and data of directly imaged objects.

Initiating species#

We start by importing the required modules.

[1]:
import numpy as np
import species

Next, we initiate the species workflow and create an instance of Database.

[2]:
species.SpeciesInit()
database = species.Database()
Initiating species v0.5.1... [DONE]
Creating species_config.ini... [DONE]
Database: /Users/tomasstolker/applications/species/docs/tutorials/species_database.hdf5
Data folder: /Users/tomasstolker/applications/species/docs/tutorials/data
Working folder: /Users/tomasstolker/applications/species/docs/tutorials
Creating species_database.hdf5... [DONE]
Creating data folder... [DONE]

Adding data to the database#

Available magnitudes and spectra of directly imaged planets and brown dwarfs are added to the database with add_companion by setting name=None. These data are extracted from the two dictionaries in the data.companions module.

[3]:
database.add_companion(name=None, verbose=False)
Downloading Vega spectrum (270 kB)... [DONE]
Adding Vega spectrum... [DONE]
Adding object: beta Pic b [DONE]
/Users/tomasstolker/applications/species/species/data/database.py:1058: UserWarning: Found 33 fluxes with NaN in the data of GPI_YJHK. Removing the spectral fluxes that contain a NaN.
  warnings.warn(
Adding object: beta Pic c [DONE]
Adding object: HIP 65426 b [DONE]
Adding object: 51 Eri b [DONE]
/Users/tomasstolker/applications/species/species/data/filters.py:214: UserWarning: The minimum transmission value of Subaru/CIAO.z is smaller than zero (-1.80e-03). Wavelengths with negative transmission values will be removed.
  warnings.warn(
Adding object: HR 8799 b [DONE]
Adding object: HR 8799 c [DONE]
Adding object: HR 8799 d [DONE]
Adding object: HR 8799 e [DONE]
Adding object: HD 95086 b [DONE]
Adding object: PDS 70 b [DONE]
Adding object: PDS 70 c [DONE]
Adding object: 2M 1207 B [DONE]
Adding object: AB Pic B [DONE]
Adding object: HD 206893 B [DONE]
Adding object: RZ Psc B [DONE]
Adding object: GQ Lup B [DONE]
Adding object: PZ Tel B [DONE]
Adding object: kappa And b [DONE]
Adding object: HD 1160 B [DONE]
Adding object: ROXs 12 B [DONE]
Adding object: ROXs 42 Bb [DONE]
Adding object: GJ 504 b [DONE]
Adding object: GU Psc b [DONE]
Adding object: 2M0103 ABb [DONE]
Adding object: 1RXS 1609 B [DONE]
Adding object: GSC 06214 B [DONE]
Adding object: HD 72946 B [DONE]
Adding object: HIP 64892 B [DONE]
Adding object: HD 13724 B [DONE]
Adding object: TYC 8988 b [DONE]
Adding object: TYC 8988 c [DONE]
Adding object: HD 142527 B [DONE]
Adding object: CS Cha B [DONE]
Adding object: CT Cha B [DONE]
Adding object: SR 12 C [DONE]
Adding object: DH Tau B [DONE]
Adding object: HD 4747 B [DONE]
Adding object: HR 3549 B [DONE]
Adding object: CHXR 73 B [DONE]
Adding object: HD 19467 B [DONE]
Adding object: b Cen (AB)b [DONE]

We also add the photometry and parallaxes of the Database of Ultracool Parallaxes.

[4]:
database.add_photometry('vlm-plx')
Downloading Database of Ultracool Parallaxes (307 kB)... [DONE]
Adding Database of Ultracool Parallaxes... [DONE]

Next, we add the isochrones from AMES-Cond and AMES-Dusty, which have been retrieved from https://phoenix.ens-lyon.fr/Grids/.

[5]:
database.add_isochrones('ames')
Downloading AMES-Cond isochrones (235 kB)... [DONE]
Adding isochrones: ames-cond... [DONE]
Database tag: ames-cond
Downloading AMES-Dusty isochrones (182 kB)... [DONE]
Adding isochrones: ames-dusty... [DONE]
Database tag: ames-dusty

Finally, we need to add the grid with AMES-Cond model spectra. The full grid of spectra is downloaded but spectra with a \(T_\mathrm{eff}\) outside the chosen teff_range are not added to the database.

[6]:
database.add_model(model='ames-cond',
                   teff_range=(100., 4000.))
Downloading AMES-Cond model spectra (150 MB)... [DONE]
Unpacking AMES-Cond model spectra (150 MB)... [DONE]
Wavelength range (um) = 0.5 - 40
Spectral resolution = 4000
Teff range (K) = 100.0 - 4000.0
Adding AMES-Cond model spectra... [DONE]
Grid points stored in the database:
   - Teff = [ 100.  200.  300.  400.  500.  600.  700.  800.  900. 1000. 1100. 1200.
 1300. 1400. 1500. 1600. 1700. 1800. 1900. 2000. 2100. 2200. 2300. 2400.
 2500. 2600. 2700. 2800. 2900. 3000. 3100. 3200. 3300. 3400. 3500. 3600.
 3700. 3800. 3900. 4000.]
   - log(g) = [2.5 3.  3.5 4.  4.5 5.  5.5]

Also the AMES-Dusty spectra are downloaded and imported into the database.

[7]:
database.add_model(model='ames-dusty',
                   teff_range=(100., 4000.))
Downloading AMES-Dusty model spectra (59 MB)... [DONE]
Unpacking AMES-Dusty model spectra (59 MB)... [DONE]
Wavelength range (um) = 0.5 - 40
Spectral resolution = 4000
Teff range (K) = 100.0 - 4000.0
Adding AMES-Dusty model spectra... [DONE]
Grid points stored in the database:
   - Teff = [ 500.  600.  700.  800.  900. 1000. 1100. 1200. 1300. 1400. 1500. 1600.
 1700. 1800. 1900. 2000. 2100. 2200. 2300. 2400. 2500. 2600. 2700. 2800.
 2900. 3000. 3100. 3200. 3300. 3400. 3500. 3600. 3700. 3800. 3900. 4000.]
   - log(g) = [3.5 4.  4.5 5.  5.5 6. ]

We are now ready with preparing the HDF5 database. The list_content method of the Database object can be used for printing an overview of all the data that are stored in the database.

Synthetic photometry from isochrones#

Magnitudes from the isochrone data can be extracted with the get_isochrone function of ReadIsochrone. However, in this example, we consistently recompute the synthetic photometry by making use of both the evolutionary tracks and the synthetic spectra.

The isochrones will be iterpolated for three different ages and the synthetic photometry is computed at 100 logarithmically-spaced masses.

[8]:
ages = [20., 100.]  # (Myr)
masses = np.logspace(0., 3., 100)  # (Mjup)

We create instances of ReadIsochrone for both the AMES-Cond and AMES-Dusty isochrones. We note though that the evolutionary data of these two models are actually the same. Only the magnitudes of the isochrones (which we do not use) are different.

[9]:
read_iso_cond = species.ReadIsochrone(tag='ames-cond')
read_iso_dusty = species.ReadIsochrone(tag='ames-dusty')

The colors and magnitudes are computed by chosing the corresponding model grids from the database. The output is stored in ColorMagBox objects for the three different ages.

[10]:
boxes = []

for item in ages:

    modelcolor1 = read_iso_cond.get_color_magnitude(age=item,
                                                    masses=masses,
                                                    model='ames-cond',
                                                    filters_color=('MKO/NSFCam.H', 'MKO/NSFCam.Lp'),
                                                    filter_mag='MKO/NSFCam.Lp')

    modelcolor2 = read_iso_dusty.get_color_magnitude(age=item,
                                                     masses=masses,
                                                     model='ames-dusty',
                                                     filters_color=('MKO/NSFCam.H', 'MKO/NSFCam.Lp'),
                                                     filter_mag='MKO/NSFCam.Lp')

    boxes.append(modelcolor1)
    boxes.append(modelcolor2)
/Users/tomasstolker/applications/species/species/read/read_isochrone.py:326: UserWarning: The value of teff is 4018.701890028295, which is above the upper bound of the model grid (4000.0). Setting the magnitudes to NaN for the following isochrone sample: {'teff': 4018.701890028295, 'logg': 4.3520097138585845, 'mass': 932.60334688322, 'distance': 10.0}.
  warnings.warn(
/Users/tomasstolker/applications/species/species/read/read_isochrone.py:326: UserWarning: The value of teff is 4163.517520486652, which is above the upper bound of the model grid (4000.0). Setting the magnitudes to NaN for the following isochrone sample: {'teff': 4163.517520486652, 'logg': 4.329146850334322, 'mass': 1000.0, 'distance': 10.0}.
  warnings.warn(
/Users/tomasstolker/applications/species/species/read/read_isochrone.py:301: UserWarning: The value of logg is 2.917784581524866, which is below the lower bound of the model grid (3.5). Setting the magnitudes to NaN for the following isochrone sample: {'teff': 501.3728693602355, 'logg': 2.917784581524866, 'mass': 1.0, 'distance': 10.0}.
  warnings.warn(
/Users/tomasstolker/applications/species/species/read/read_isochrone.py:301: UserWarning: The value of logg is 2.972779343287681, which is below the lower bound of the model grid (3.5). Setting the magnitudes to NaN for the following isochrone sample: {'teff': 502.51561905255875, 'logg': 2.972779343287681, 'mass': 1.0722672220103233, 'distance': 10.0}.
  warnings.warn(
/Users/tomasstolker/applications/species/species/read/read_isochrone.py:301: UserWarning: The value of logg is 3.035244115774989, which is below the lower bound of the model grid (3.5). Setting the magnitudes to NaN for the following isochrone sample: {'teff': 504.9110749694396, 'logg': 3.035244115774989, 'mass': 1.1497569953977358, 'distance': 10.0}.
  warnings.warn(
/Users/tomasstolker/applications/species/species/read/read_isochrone.py:301: UserWarning: The value of logg is 3.1022230438434617, which is below the lower bound of the model grid (3.5). Setting the magnitudes to NaN for the following isochrone sample: {'teff': 507.4796438308816, 'logg': 3.1022230438434617, 'mass': 1.2328467394420661, 'distance': 10.0}.
  warnings.warn(
/Users/tomasstolker/applications/species/species/read/read_isochrone.py:301: UserWarning: The value of logg is 3.2067743991749165, which is below the lower bound of the model grid (3.5). Setting the magnitudes to NaN for the following isochrone sample: {'teff': 519.9830583907551, 'logg': 3.2067743991749165, 'mass': 1.321941148466029, 'distance': 10.0}.
  warnings.warn(
/Users/tomasstolker/applications/species/species/read/read_isochrone.py:301: UserWarning: The value of logg is 3.3063735241310974, which is below the lower bound of the model grid (3.5). Setting the magnitudes to NaN for the following isochrone sample: {'teff': 533.9699983677936, 'logg': 3.3063735241310974, 'mass': 1.4174741629268053, 'distance': 10.0}.
  warnings.warn(
/Users/tomasstolker/applications/species/species/read/read_isochrone.py:301: UserWarning: The value of logg is 3.338631698699009, which is below the lower bound of the model grid (3.5). Setting the magnitudes to NaN for the following isochrone sample: {'teff': 543.9407068706029, 'logg': 3.338631698699009, 'mass': 1.5199110829529336, 'distance': 10.0}.
  warnings.warn(
/Users/tomasstolker/applications/species/species/read/read_isochrone.py:301: UserWarning: The value of logg is 3.3721167739343065, which is below the lower bound of the model grid (3.5). Setting the magnitudes to NaN for the following isochrone sample: {'teff': 556.1780019724513, 'logg': 3.3721167739343065, 'mass': 1.6297508346206442, 'distance': 10.0}.
  warnings.warn(
/Users/tomasstolker/applications/species/species/read/read_isochrone.py:301: UserWarning: The value of logg is 3.406958013871118, which is below the lower bound of the model grid (3.5). Setting the magnitudes to NaN for the following isochrone sample: {'teff': 570.788844526598, 'logg': 3.406958013871118, 'mass': 1.7475284000076838, 'distance': 10.0}.
  warnings.warn(
/Users/tomasstolker/applications/species/species/read/read_isochrone.py:301: UserWarning: The value of logg is 3.444317133429558, which is below the lower bound of the model grid (3.5). Setting the magnitudes to NaN for the following isochrone sample: {'teff': 586.455572083363, 'logg': 3.444317133429558, 'mass': 1.8738174228603839, 'distance': 10.0}.
  warnings.warn(
/Users/tomasstolker/applications/species/species/read/read_isochrone.py:301: UserWarning: The value of logg is 3.484376092775238, which is below the lower bound of the model grid (3.5). Setting the magnitudes to NaN for the following isochrone sample: {'teff': 603.2544905186481, 'logg': 3.484376092775238, 'mass': 2.0092330025650473, 'distance': 10.0}.
  warnings.warn(
/Users/tomasstolker/applications/species/species/read/read_isochrone.py:326: UserWarning: The value of teff is 4080.941184987095, which is above the upper bound of the model grid (4000.0). Setting the magnitudes to NaN for the following isochrone sample: {'teff': 4080.941184987095, 'logg': 4.668039214755509, 'mass': 657.9332246575682, 'distance': 10.0}.
  warnings.warn(
/Users/tomasstolker/applications/species/species/read/read_isochrone.py:326: UserWarning: The value of teff is 4184.730732201826, which is above the upper bound of the model grid (4000.0). Setting the magnitudes to NaN for the following isochrone sample: {'teff': 4184.730732201826, 'logg': 4.6566960948413305, 'mass': 705.4802310718645, 'distance': 10.0}.
  warnings.warn(
/Users/tomasstolker/applications/species/species/read/read_isochrone.py:326: UserWarning: The value of teff is 4324.721356066847, which is above the upper bound of the model grid (4000.0). Setting the magnitudes to NaN for the following isochrone sample: {'teff': 4324.721356066847, 'logg': 4.64125318265924, 'mass': 756.463327554629, 'distance': 10.0}.
  warnings.warn(
/Users/tomasstolker/applications/species/species/read/read_isochrone.py:326: UserWarning: The value of teff is 4511.081667094552, which is above the upper bound of the model grid (4000.0). Setting the magnitudes to NaN for the following isochrone sample: {'teff': 4511.081667094552, 'logg': 4.6107725046114005, 'mass': 811.1308307896873, 'distance': 10.0}.
  warnings.warn(
/Users/tomasstolker/applications/species/species/read/read_isochrone.py:326: UserWarning: The value of teff is 4703.704854345524, which is above the upper bound of the model grid (4000.0). Setting the magnitudes to NaN for the following isochrone sample: {'teff': 4703.704854345524, 'logg': 4.572016990295442, 'mass': 869.7490026177834, 'distance': 10.0}.
  warnings.warn(
/Users/tomasstolker/applications/species/species/read/read_isochrone.py:326: UserWarning: The value of teff is 4914.026121931334, which is above the upper bound of the model grid (4000.0). Setting the magnitudes to NaN for the following isochrone sample: {'teff': 4914.026121931334, 'logg': 4.528038855434338, 'mass': 932.60334688322, 'distance': 10.0}.
  warnings.warn(
/Users/tomasstolker/applications/species/species/read/read_isochrone.py:326: UserWarning: The value of teff is 5128.711930018601, which is above the upper bound of the model grid (4000.0). Setting the magnitudes to NaN for the following isochrone sample: {'teff': 5128.711930018601, 'logg': 4.487440551002966, 'mass': 1000.0, 'distance': 10.0}.
  warnings.warn(
/Users/tomasstolker/applications/species/species/read/read_isochrone.py:301: UserWarning: The value of logg is 2.7961643169092065, which is below the lower bound of the model grid (3.5). Setting the magnitudes to NaN for the following isochrone sample: {'teff': 501.58228263626506, 'logg': 2.7961643169092065, 'mass': 1.0, 'distance': 10.0}.
  warnings.warn(
/Users/tomasstolker/applications/species/species/read/read_isochrone.py:301: UserWarning: The value of logg is 2.807202282142855, which is below the lower bound of the model grid (3.5). Setting the magnitudes to NaN for the following isochrone sample: {'teff': 501.6881276697485, 'logg': 2.807202282142855, 'mass': 1.0722672220103233, 'distance': 10.0}.
  warnings.warn(
/Users/tomasstolker/applications/species/species/read/read_isochrone.py:301: UserWarning: The value of logg is 2.8207367618605548, which is below the lower bound of the model grid (3.5). Setting the magnitudes to NaN for the following isochrone sample: {'teff': 501.66498143680707, 'logg': 2.8207367618605548, 'mass': 1.1497569953977358, 'distance': 10.0}.
  warnings.warn(
/Users/tomasstolker/applications/species/species/read/read_isochrone.py:301: UserWarning: The value of logg is 2.835249340828809, which is below the lower bound of the model grid (3.5). Setting the magnitudes to NaN for the following isochrone sample: {'teff': 501.6401624899111, 'logg': 2.835249340828809, 'mass': 1.2328467394420661, 'distance': 10.0}.
  warnings.warn(
/Users/tomasstolker/applications/species/species/read/read_isochrone.py:301: UserWarning: The value of logg is 2.855554520370349, which is below the lower bound of the model grid (3.5). Setting the magnitudes to NaN for the following isochrone sample: {'teff': 501.6536660458051, 'logg': 2.855554520370349, 'mass': 1.321941148466029, 'distance': 10.0}.
  warnings.warn(
/Users/tomasstolker/applications/species/species/read/read_isochrone.py:301: UserWarning: The value of logg is 2.8798041133905197, which is below the lower bound of the model grid (3.5). Setting the magnitudes to NaN for the following isochrone sample: {'teff': 501.6890923462297, 'logg': 2.8798041133905197, 'mass': 1.4174741629268053, 'distance': 10.0}.
  warnings.warn(
/Users/tomasstolker/applications/species/species/read/read_isochrone.py:301: UserWarning: The value of logg is 2.9058061571331404, which is below the lower bound of the model grid (3.5). Setting the magnitudes to NaN for the following isochrone sample: {'teff': 501.72707880697214, 'logg': 2.9058061571331404, 'mass': 1.5199110829529336, 'distance': 10.0}.
  warnings.warn(
/Users/tomasstolker/applications/species/species/read/read_isochrone.py:301: UserWarning: The value of logg is 2.933837016464927, which is below the lower bound of the model grid (3.5). Setting the magnitudes to NaN for the following isochrone sample: {'teff': 501.8458205253471, 'logg': 2.933837016464927, 'mass': 1.6297508346206442, 'distance': 10.0}.
  warnings.warn(
/Users/tomasstolker/applications/species/species/read/read_isochrone.py:301: UserWarning: The value of logg is 2.9643361277954554, which is below the lower bound of the model grid (3.5). Setting the magnitudes to NaN for the following isochrone sample: {'teff': 502.20372397743654, 'logg': 2.9643361277954554, 'mass': 1.7475284000076838, 'distance': 10.0}.
  warnings.warn(
/Users/tomasstolker/applications/species/species/read/read_isochrone.py:301: UserWarning: The value of logg is 3.0024737804589394, which is below the lower bound of the model grid (3.5). Setting the magnitudes to NaN for the following isochrone sample: {'teff': 503.0056049678062, 'logg': 3.0024737804589394, 'mass': 1.8738174228603839, 'distance': 10.0}.
  warnings.warn(
/Users/tomasstolker/applications/species/species/read/read_isochrone.py:301: UserWarning: The value of logg is 3.044216208740176, which is below the lower bound of the model grid (3.5). Setting the magnitudes to NaN for the following isochrone sample: {'teff': 503.93073039348104, 'logg': 3.044216208740176, 'mass': 2.0092330025650473, 'distance': 10.0}.
  warnings.warn(
/Users/tomasstolker/applications/species/species/read/read_isochrone.py:301: UserWarning: The value of logg is 3.088975246353262, which is below the lower bound of the model grid (3.5). Setting the magnitudes to NaN for the following isochrone sample: {'teff': 504.92271206368054, 'logg': 3.088975246353262, 'mass': 2.154434690031884, 'distance': 10.0}.
  warnings.warn(
/Users/tomasstolker/applications/species/species/read/read_isochrone.py:301: UserWarning: The value of logg is 3.1487127161744426, which is below the lower bound of the model grid (3.5). Setting the magnitudes to NaN for the following isochrone sample: {'teff': 506.11774555623947, 'logg': 3.1487127161744426, 'mass': 2.3101297000831598, 'distance': 10.0}.
  warnings.warn(
/Users/tomasstolker/applications/species/species/read/read_isochrone.py:301: UserWarning: The value of logg is 3.2281475586776205, which is below the lower bound of the model grid (3.5). Setting the magnitudes to NaN for the following isochrone sample: {'teff': 506.36601770555274, 'logg': 3.2281475586776205, 'mass': 2.4770763559917106, 'distance': 10.0}.
  warnings.warn(
/Users/tomasstolker/applications/species/species/read/read_isochrone.py:301: UserWarning: The value of logg is 3.3306644276556674, which is below the lower bound of the model grid (3.5). Setting the magnitudes to NaN for the following isochrone sample: {'teff': 505.0681954083842, 'logg': 3.3306644276556674, 'mass': 2.6560877829466865, 'distance': 10.0}.
  warnings.warn(
/Users/tomasstolker/applications/species/species/read/read_isochrone.py:301: UserWarning: The value of logg is 3.4405899059639538, which is below the lower bound of the model grid (3.5). Setting the magnitudes to NaN for the following isochrone sample: {'teff': 503.6765830991362, 'logg': 3.4405899059639538, 'mass': 2.848035868435802, 'distance': 10.0}.
  warnings.warn(

Some warnings are printed when \(T_\mathrm{eff}\) or \(\log(g)\) from the evolutionary tracks are outside the parameter boundaries of the grid with spectra. Also, some of the chosen masses are below the lowest masses that are available in the evolutionary tracks. Therefore these colors and magnitudes are set to NaN and will be ignored when plotting the isochrones later one.

Synthetic photometry from blackbody spectra#

In addition to the isochrones, we also calculate colors and magnitudes for blackbody radiation. We start by creating an instance of ReadPlanck for a wavelength range between 0.5 and 10 \(\mu\)m.

[11]:
read_planck = species.ReadPlanck(wavel_range=(0.5, 10.))

Next, we use the get_color_magnitude methode to calculate the synthetic photometry for the same filters from before. Here we chose 100 logarithmically-spaced temperatures between 100 and 10000 K. The radius, which only impacts the absolute magnitude, is set to 1 \(R_\mathrm{J}\).

[12]:
color_planck = read_planck.get_color_magnitude(temperatures=np.logspace(2, 4, 100),
                                               radius=1.,
                                               filters_color=('MKO/NSFCam.H', 'MKO/NSFCam.Lp'),
                                               filter_mag='MKO/NSFCam.Lp')

The returned ColorMagBox is added to the list of boxes.

[13]:
boxes.append(color_planck)

Photometry of directly imaged objects#

We will also create a list with names and filters of the directly imaged planets and brown dwarfs that we want to show. The list_companions method of Database can be used to get an overview of all available photometric data in the database. We create a list with object names and filters for the colors and magnitudes that we want to include in the color-magnitude diagram.

[14]:
objects = [('HR 8799 b', 'Keck/NIRC2.H', 'Paranal/NACO.Lp', 'Paranal/NACO.Lp'),
           ('HR 8799 c', 'Keck/NIRC2.H', 'Paranal/NACO.Lp', 'Paranal/NACO.Lp'),
           ('HR 8799 d', 'Keck/NIRC2.H', 'Paranal/NACO.Lp', 'Paranal/NACO.Lp'),
           ('HR 8799 e', 'Paranal/SPHERE.IRDIS_D_H23_2', 'Paranal/NACO.Lp', 'Paranal/NACO.Lp'),
           ('kappa And b', 'Subaru/CIAO.H', 'Keck/NIRC2.Lp', 'Keck/NIRC2.Lp'),
           ('GSC 06214 B', 'MKO/NSFCam.H', 'MKO/NSFCam.Lp', 'MKO/NSFCam.Lp'),
           ('ROXs 42 Bb', 'Keck/NIRC2.H', 'Keck/NIRC2.Lp', 'Keck/NIRC2.Lp'),
           ('51 Eri b', 'MKO/NSFCam.H', 'Keck/NIRC2.Lp', 'Keck/NIRC2.Lp'),
           ('2M 1207 B', 'Paranal/NACO.H', 'Paranal/NACO.Lp', 'Paranal/NACO.Lp'),
           ('2M0103 ABb', 'Paranal/NACO.H', 'Paranal/NACO.Lp', 'Paranal/NACO.Lp'),
           ('1RXS 1609 B', 'Gemini/NIRI.H-G0203w', 'Gemini/NIRI.Lprime-G0207w', 'Gemini/NIRI.Lprime-G0207w'),
           ('beta Pic b', 'Paranal/NACO.H', 'Paranal/NACO.Lp', 'Paranal/NACO.Lp'),
           ('HIP 65426 b', 'Paranal/SPHERE.IRDIS_D_H23_2', 'Paranal/NACO.Lp', 'Paranal/NACO.Lp'),
           ('PZ Tel B', 'Paranal/NACO.H', 'Paranal/NACO.Lp', 'Paranal/NACO.Lp'),
           ('HD 206893 B', 'Paranal/SPHERE.IRDIS_B_H', 'Paranal/NACO.Lp', 'Paranal/NACO.Lp')]

Reading color-magnitude data#

The colors and magnitude of the Database of Ultracool Parallaxes are read from the database by creating an object of ReadColorMagnitude.

[15]:
colormag = species.ReadColorMagnitude(library='vlm-plx',
                                      filters_color=('MKO/NSFCam.H', 'MKO/NSFCam.Lp'),
                                      filter_mag='MKO/NSFCam.Lp')

And then extracting the ColorMagBox objects for field and young/low-gravity objects separately.

[16]:
color_field = colormag.get_color_magnitude(object_type='field')
color_young = colormag.get_color_magnitude(object_type='young')

Also these ColorMagBox objects are added to the list of boxes.

[17]:
boxes.append(color_field)
boxes.append(color_young)

Plotting a color-magnitude diagram#

The color-magnitude diagram is now plotted with the plot_color_magnitude function. The list with boxes is provided as argument of the boxes parameter. The list with objects is provided separately as argument of objects. See the API documentation of plot_color_magnitude for further details on the various parameters.

[18]:
species.plot_color_magnitude(boxes=boxes,
                             objects=objects,
                             mass_labels={'ames-cond': [(3., 'right'), (5., 'right'), (10., 'left'), (20., 'right')],
                                          'ames-dusty': [(10., 'right'), (15., 'left'), (20., 'left')]},
                             teff_labels=[(1500., 'right'), (2000., 'right'), (3000., 'left')],
                             companion_labels=False,
                             field_range=('late M', 'late T'),
                             label_x=r'H $-$ L$^\prime$',
                             label_y=r'M$_\mathregular{L\prime}$',
                             xlim=(0.3, 4.),
                             ylim=(15., 7.1),
                             offset=(-0.08, -0.09),
                             legend=(0.04, 0.04),
                             output=None)
Plotting color-magnitude diagram... [DONE]
../_images/tutorials_color_magnitude_broadband_47_1.png