Color-magnitude diagram: broadband filters — species 0.1.2 documentation

# Color-magnitude diagram: broadband filters

The tutorial shows how to create a color-magnitude diagram which combines the photometry from field and young/low-gravity objects, synthetic photometry computed from isochrones and model spectra, and photometry from directly imaged objects.

## Initiating species

    [1]:

    import urllib.request
    import numpy as np
    import species

    [2]:

    species.SpeciesInit()
    database = species.Database()

    Initiating species v0.1.0... [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

All available photometric data of directly imaged planets and brown dwarfs is added with `add_companion` by setting `name=None`. These data are extracted from the dictionary with apparent magnitudes in the `data.companions` module.

    [3]:

    database.add_companion(name=None)

    Adding filter: LCO/VisAO.Ys... [DONE]
    Downloading Vega spectrum (270 kB)... [DONE]
    Adding Vega spectrum... [DONE]
    Adding filter: Paranal/NACO.J... [DONE]
    Adding filter: Gemini/NICI.ED286... [DONE]
    Adding filter: Paranal/NACO.H... [DONE]
    Adding filter: Paranal/NACO.Ks... [DONE]
    Adding filter: Paranal/NACO.NB374... [DONE]
    Adding filter: Paranal/NACO.Lp... [DONE]
    Adding filter: Paranal/NACO.NB405... [DONE]
    Adding filter: Paranal/NACO.Mp... [DONE]
    Adding object: beta Pic b... [DONE]
    Adding filter: Paranal/SPHERE.IRDIS_D_H23_2... [DONE]
    Adding filter: Paranal/SPHERE.IRDIS_D_H23_3... [DONE]
    Adding filter: Paranal/SPHERE.IRDIS_D_K12_1... [DONE]
    Adding filter: Paranal/SPHERE.IRDIS_D_K12_2... [DONE]
    Adding object: HIP 65426 b... [DONE]
    Adding filter: MKO/NSFCam.J... [DONE]
    Adding filter: MKO/NSFCam.H... [DONE]
    Adding filter: MKO/NSFCam.K... [DONE]
    Adding filter: Keck/NIRC2.Lp... [DONE]
    Adding filter: Keck/NIRC2.Ms... [DONE]
    Adding object: 51 Eri b... [DONE]
    Adding filter: Subaru/CIAO.z... [DONE]
    Adding filter: Paranal/SPHERE.IRDIS_B_J... [DONE]
    Adding filter: Keck/NIRC2.H... [DONE]
    Adding filter: Keck/NIRC2.Ks... [DONE]
    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 filter: Gemini/GPI.H... [DONE]
    Adding filter: Gemini/GPI.K1... [DONE]
    Adding object: HD 95086 b... [DONE]
    Adding object: PDS 70 b... [DONE]
    Adding object: PDS 70 c... [DONE]
    Adding filter: HST/NICMOS1.F090M... [DONE]
    Adding filter: HST/NICMOS1.F110M... [DONE]
    Adding filter: HST/NICMOS1.F145M... [DONE]
    Adding filter: HST/NICMOS1.F160W... [DONE]
    Adding object: 2M1207 b... [DONE]
    Adding object: AB Pic B... [DONE]
    Adding filter: Paranal/SPHERE.IRDIS_B_H... [DONE]
    Adding object: HD 206893 B... [DONE]
    Adding filter: HST/WFPC2.f606w... [DONE]
    Adding filter: HST/WFPC2.f814w... [DONE]
    Adding filter: HST/NICMOS2.F171M... [DONE]
    Adding filter: HST/NICMOS2.F190N... [DONE]
    Adding filter: HST/NICMOS2.F215N... [DONE]
    Adding filter: Subaru/CIAO.CH4s... [DONE]
    Adding filter: Subaru/CIAO.K... [DONE]
    Adding filter: Subaru/CIAO.Lp... [DONE]
    Adding object: GQ Lup B... [DONE]
    Adding filter: Paranal/SPHERE.ZIMPOL_R_PRIM... [DONE]
    Adding filter: Paranal/SPHERE.ZIMPOL_I_PRIM... [DONE]
    Adding filter: Gemini/NIRI.H2S1v2-1-G0220... [DONE]
    Adding object: PZ Tel B... [DONE]
    Adding filter: Subaru/CIAO.J... [DONE]
    Adding filter: Subaru/CIAO.H... [DONE]
    Adding filter: Subaru/CIAO.Ks... [DONE]
    Adding filter: LBT/LMIRCam.M_77K... [DONE]
    Adding object: kappa And b... [DONE]
    Adding filter: Keck/NIRC2.J... [DONE]
    Adding object: ROXs 42 Bb... [DONE]
    Adding filter: Paranal/SPHERE.IRDIS_D_Y23_2... [DONE]
    Adding filter: Paranal/SPHERE.IRDIS_D_Y23_3... [DONE]
    Adding filter: Paranal/SPHERE.IRDIS_D_J23_3... [DONE]
    Adding filter: Subaru/IRCS.Lp... [DONE]
    Adding object: GJ 504 b... [DONE]
    Adding filter: Gemini/GMOS-S.z... [DONE]
    Adding filter: CFHT/Wircam.Y... [DONE]
    Adding filter: CFHT/Wircam.J... [DONE]
    Adding filter: CFHT/Wircam.H... [DONE]
    Adding filter: CFHT/Wircam.Ks... [DONE]
    Adding filter: WISE/WISE.W1... [DONE]
    Adding filter: WISE/WISE.W2... [DONE]
    Adding object: GU Psc b... [DONE]
    Adding object: 2M0103 ABb... [DONE]
    Adding filter: Gemini/NIRI.J-G0202w... [DONE]
    Adding filter: Gemini/NIRI.H-G0203w... [DONE]
    Adding filter: Gemini/NIRI.K-G0204w... [DONE]
    Adding filter: Gemini/NIRI.Lprime-G0207w... [DONE]
    Adding object: 1RXS 1609 B... [DONE]
    Adding filter: MKO/NSFCam.Kp... [DONE]
    Adding filter: MKO/NSFCam.Lp... [DONE]
    Adding object: GSC 06214 B... [DONE]

The broadband photometry and parallaxes of the Database of Ultracool Parallaxes is added.

    [4]:

    database.add_photometry(phot_library='vlm-plx')

    Downloading Database of Ultracool Parallaxes (307 kB)... [DONE]
    Adding Database of Ultracool Parallaxes... [DONE]

The isochrones from the AMES-Cond and AMES-Dusty evolutionary models are downloaded with `urllib.request`.

    [5]:

    urllib.request.urlretrieve('https://phoenix.ens-lyon.fr/Grids/AMES-Cond/ISOCHRONES/model.AMES-Cond-2000.M-0.0.NaCo.Vega',
                               'data/model.AMES-Cond-2000.M-0.0.NaCo.Vega')

    [5]:

    'data/model.AMES-dusty.M-0.0.NaCo.Vega'

    [ ]:

    urllib.request.urlretrieve('https://phoenix.ens-lyon.fr/Grids/AMES-Dusty/ISOCHRONES/model.AMES-dusty.M-0.0.NaCo.Vega',
                               'data/model.AMES-dusty.M-0.0.NaCo.Vega')

And added to the HDF5 database.

    [6]:

    database.add_isochrones(filename='data/model.AMES-Cond-2000.M-0.0.NaCo.Vega',
                            tag='iso_cond',
                            model='baraffe')

    database.add_isochrones(filename='data/model.AMES-dusty.M-0.0.NaCo.Vega',
                            tag='iso_dusty',
                            model='baraffe')

    Adding isochrones: iso_cond... [DONE]
    Adding isochrones: iso_dusty... [DONE]

Also the synthetic spectra from the AMES-Cond and AMES-Dusty atmospheric models are dowloaded and added to the database.

    [7]:

    database.add_model(model='ames-cond',
                       wavel_range=(0.5, 10.),
                       spec_res=1000.,
                       teff_range=(100., 4000.))

    database.add_model(model='ames-dusty',
                       wavel_range=(0.5, 10.),
                       spec_res=1000.,
                       teff_range=(100., 4000.))

    Downloading AMES-Cond model spectra (823 MB)... [DONE]
    Unpacking AMES-Cond model spectra (823 MB)... [DONE]
    Adding AMES-Cond model spectra... [DONE]
    Downloading AMES-Dusty model spectra [Fe/H]=0.0 (106 MB)... [DONE]
    Unpacking AMES-Dusty model spectra [Fe/H]=0.0 (106 MB)... [DONE]
    Adding AMES-Dusty model spectra... [DONE]

    /Users/tomasstolker/applications/species/species/util/data_util.py:268: UserWarning: Interpolation is not possible at the edge of the parameter grid. A NaN value is stored for Teff = 4000.0 K.
      warnings.warn(f'Interpolation is not possible at the edge of the '

## Database content

Let’s have a look at all the data that is stored in the database.

    [8]:

    database.list_content()

    Database content:
    - filters: <HDF5 group "/filters" (10 members)>
            - CFHT: <HDF5 group "/filters/CFHT" (4 members)>
                    - Wircam.H: <HDF5 dataset "Wircam.H": shape (2, 747), type "<f4">
                    - Wircam.J: <HDF5 dataset "Wircam.J": shape (2, 1077), type "<f4">
                    - Wircam.Ks: <HDF5 dataset "Wircam.Ks": shape (2, 791), type "<f4">
                    - Wircam.Y: <HDF5 dataset "Wircam.Y": shape (2, 875), type "<f4">
            - Gemini: <HDF5 group "/filters/Gemini" (9 members)>
                    - GMOS-S.z: <HDF5 dataset "GMOS-S.z": shape (2, 928), type "<f4">
                    - GPI.H: <HDF5 dataset "GPI.H": shape (2, 1895), type "<f4">
                    - GPI.K1: <HDF5 dataset "GPI.K1": shape (2, 2128), type "<f4">
                    - NICI.ED286: <HDF5 dataset "NICI.ED286": shape (2, 387), type "<f4">
                    - NIRI.H-G0203w: <HDF5 dataset "NIRI.H-G0203w": shape (2, 368), type "<f4">
                    - NIRI.H2S1v2-1-G0220: <HDF5 dataset "NIRI.H2S1v2-1-G0220": shape (2, 129), type "<f4">
                    - NIRI.J-G0202w: <HDF5 dataset "NIRI.J-G0202w": shape (2, 213), type "<f4">
                    - NIRI.K-G0204w: <HDF5 dataset "NIRI.K-G0204w": shape (2, 423), type "<f4">
                    - NIRI.Lprime-G0207w: <HDF5 dataset "NIRI.Lprime-G0207w": shape (2, 933), type "<f4">
            - HST: <HDF5 group "/filters/HST" (9 members)>
                    - NICMOS1.F090M: <HDF5 dataset "NICMOS1.F090M": shape (2, 633), type "<f4">
                    - NICMOS1.F110M: <HDF5 dataset "NICMOS1.F110M": shape (2, 768), type "<f4">
                    - NICMOS1.F145M: <HDF5 dataset "NICMOS1.F145M": shape (2, 829), type "<f4">
                    - NICMOS1.F160W: <HDF5 dataset "NICMOS1.F160W": shape (2, 1319), type "<f4">
                    - NICMOS2.F171M: <HDF5 dataset "NICMOS2.F171M": shape (2, 1226), type "<f4">
                    - NICMOS2.F190N: <HDF5 dataset "NICMOS2.F190N": shape (2, 375), type "<f4">
                    - NICMOS2.F215N: <HDF5 dataset "NICMOS2.F215N": shape (2, 506), type "<f4">
                    - WFPC2.f606w: <HDF5 dataset "WFPC2.f606w": shape (2, 1300), type "<f4">
                    - WFPC2.f814w: <HDF5 dataset "WFPC2.f814w": shape (2, 1513), type "<f4">
            - Keck: <HDF5 group "/filters/Keck" (5 members)>
                    - NIRC2.H: <HDF5 dataset "NIRC2.H": shape (2, 1506), type "<f4">
                    - NIRC2.J: <HDF5 dataset "NIRC2.J": shape (2, 1149), type "<f4">
                    - NIRC2.Ks: <HDF5 dataset "NIRC2.Ks": shape (2, 1399), type "<f4">
                    - NIRC2.Lp: <HDF5 dataset "NIRC2.Lp": shape (2, 1694), type "<f4">
                    - NIRC2.Ms: <HDF5 dataset "NIRC2.Ms": shape (2, 627), type "<f4">
            - LBT: <HDF5 group "/filters/LBT" (1 members)>
                    - LMIRCam.M_77K: <HDF5 dataset "LMIRCam.M_77K": shape (2, 626), type "<f4">
            - LCO: <HDF5 group "/filters/LCO" (1 members)>
                    - VisAO.Ys: <HDF5 dataset "VisAO.Ys": shape (2, 27), type "<f4">
            - MKO: <HDF5 group "/filters/MKO" (5 members)>
                    - NSFCam.H: <HDF5 dataset "NSFCam.H": shape (2, 970), type "<f4">
                    - NSFCam.J: <HDF5 dataset "NSFCam.J": shape (2, 1253), type "<f4">
                    - NSFCam.K: <HDF5 dataset "NSFCam.K": shape (2, 971), type "<f4">
                    - NSFCam.Kp: <HDF5 dataset "NSFCam.Kp": shape (2, 998), type "<f4">
                    - NSFCam.Lp: <HDF5 dataset "NSFCam.Lp": shape (2, 1242), type "<f4">
            - Paranal: <HDF5 group "/filters/Paranal" (18 members)>
                    - NACO.H: <HDF5 dataset "NACO.H": shape (2, 23), type "<f4">
                    - NACO.J: <HDF5 dataset "NACO.J": shape (2, 20), type "<f4">
                    - NACO.Ks: <HDF5 dataset "NACO.Ks": shape (2, 27), type "<f4">
                    - NACO.Lp: <HDF5 dataset "NACO.Lp": shape (2, 31), type "<f4">
                    - NACO.Mp: <HDF5 dataset "NACO.Mp": shape (2, 18), type "<f4">
                    - NACO.NB374: <HDF5 dataset "NACO.NB374": shape (2, 46), type "<f4">
                    - NACO.NB405: <HDF5 dataset "NACO.NB405": shape (2, 67), type "<f4">
                    - SPHERE.IRDIS_B_H: <HDF5 dataset "SPHERE.IRDIS_B_H": shape (2, 481), type "<f4">
                    - SPHERE.IRDIS_B_J: <HDF5 dataset "SPHERE.IRDIS_B_J": shape (2, 393), type "<f4">
                    - SPHERE.IRDIS_D_H23_2: <HDF5 dataset "SPHERE.IRDIS_D_H23_2": shape (2, 113), type "<f4">
                    - SPHERE.IRDIS_D_H23_3: <HDF5 dataset "SPHERE.IRDIS_D_H23_3": shape (2, 180), type "<f4">
                    - SPHERE.IRDIS_D_J23_3: <HDF5 dataset "SPHERE.IRDIS_D_J23_3": shape (2, 129), type "<f4">
                    - SPHERE.IRDIS_D_K12_1: <HDF5 dataset "SPHERE.IRDIS_D_K12_1": shape (2, 175), type "<f4">
                    - SPHERE.IRDIS_D_K12_2: <HDF5 dataset "SPHERE.IRDIS_D_K12_2": shape (2, 191), type "<f4">
                    - SPHERE.IRDIS_D_Y23_2: <HDF5 dataset "SPHERE.IRDIS_D_Y23_2": shape (2, 94), type "<f4">
                    - SPHERE.IRDIS_D_Y23_3: <HDF5 dataset "SPHERE.IRDIS_D_Y23_3": shape (2, 89), type "<f4">
                    - SPHERE.ZIMPOL_I_PRIM: <HDF5 dataset "SPHERE.ZIMPOL_I_PRIM": shape (2, 189), type "<f4">
                    - SPHERE.ZIMPOL_R_PRIM: <HDF5 dataset "SPHERE.ZIMPOL_R_PRIM": shape (2, 169), type "<f4">
            - Subaru: <HDF5 group "/filters/Subaru" (8 members)>
                    - CIAO.CH4s: <HDF5 dataset "CIAO.CH4s": shape (2, 150), type "<f4">
                    - CIAO.H: <HDF5 dataset "CIAO.H": shape (2, 967), type "<f4">
                    - CIAO.J: <HDF5 dataset "CIAO.J": shape (2, 1253), type "<f4">
                    - CIAO.K: <HDF5 dataset "CIAO.K": shape (2, 958), type "<f4">
                    - CIAO.Ks: <HDF5 dataset "CIAO.Ks": shape (2, 200), type "<f4">
                    - CIAO.Lp: <HDF5 dataset "CIAO.Lp": shape (2, 1242), type "<f4">
                    - CIAO.z: <HDF5 dataset "CIAO.z": shape (2, 200), type "<f4">
                    - IRCS.Lp: <HDF5 dataset "IRCS.Lp": shape (2, 1224), type "<f4">
            - WISE: <HDF5 group "/filters/WISE" (2 members)>
                    - WISE.W1: <HDF5 dataset "WISE.W1": shape (2, 141), type "<f4">
                    - WISE.W2: <HDF5 dataset "WISE.W2": shape (2, 168), type "<f4">
    - isochrones: <HDF5 group "/isochrones" (2 members)>
            - iso_cond: <HDF5 group "/isochrones/iso_cond" (3 members)>
                    - evolution: <HDF5 dataset "evolution": shape (1940, 8), type "<f4">
                            - model: baraffe
                    - filters: <HDF5 dataset "filters": shape (38,), type "|O">
                    - magnitudes: <HDF5 dataset "magnitudes": shape (1940, 38), type "<f4">
            - iso_dusty: <HDF5 group "/isochrones/iso_dusty" (3 members)>
                    - evolution: <HDF5 dataset "evolution": shape (1459, 8), type "<f4">
                            - model: baraffe
                    - filters: <HDF5 dataset "filters": shape (38,), type "|O">
                    - magnitudes: <HDF5 dataset "magnitudes": shape (1459, 38), type "<f4">
    - models: <HDF5 group "/models" (2 members)>
            - ames-cond: <HDF5 group "/models/ames-cond" (4 members)>
                    - flux: <HDF5 dataset "flux": shape (40, 13, 2998), type "<f4">
                    - logg: <HDF5 dataset "logg": shape (13,), type "<f4">
                    - teff: <HDF5 dataset "teff": shape (40,), type "<f4">
                    - wavelength: <HDF5 dataset "wavelength": shape (2998,), type "<f4">
            - ames-dusty: <HDF5 group "/models/ames-dusty" (4 members)>
                    - flux: <HDF5 dataset "flux": shape (36, 6, 2998), type "<f4">
                    - logg: <HDF5 dataset "logg": shape (6,), type "<f4">
                    - teff: <HDF5 dataset "teff": shape (36,), type "<f4">
                    - wavelength: <HDF5 dataset "wavelength": shape (2998,), type "<f4">
    - objects: <HDF5 group "/objects" (22 members)>
            - 1RXS 1609 B: <HDF5 group "/objects/1RXS 1609 B" (2 members)>
                    - Gemini: <HDF5 group "/objects/1RXS 1609 B/Gemini" (4 members)>
                            - NIRI.H-G0203w: <HDF5 dataset "NIRI.H-G0203w": shape (4,), type "<f4">
                            - NIRI.J-G0202w: <HDF5 dataset "NIRI.J-G0202w": shape (4,), type "<f4">
                            - NIRI.K-G0204w: <HDF5 dataset "NIRI.K-G0204w": shape (4,), type "<f4">
                            - NIRI.Lprime-G0207w: <HDF5 dataset "NIRI.Lprime-G0207w": shape (4,), type "<f4">
                    - distance: <HDF5 dataset "distance": shape (2,), type "<f4">
            - 2M0103 ABb: <HDF5 group "/objects/2M0103 ABb" (2 members)>
                    - Paranal: <HDF5 group "/objects/2M0103 ABb/Paranal" (4 members)>
                            - NACO.H: <HDF5 dataset "NACO.H": shape (4,), type "<f4">
                            - NACO.J: <HDF5 dataset "NACO.J": shape (4,), type "<f4">
                            - NACO.Ks: <HDF5 dataset "NACO.Ks": shape (4,), type "<f4">
                            - NACO.Lp: <HDF5 dataset "NACO.Lp": shape (4,), type "<f4">
                    - distance: <HDF5 dataset "distance": shape (2,), type "<f4">
            - 2M1207 b: <HDF5 group "/objects/2M1207 b" (3 members)>
                    - HST: <HDF5 group "/objects/2M1207 b/HST" (4 members)>
                            - NICMOS1.F090M: <HDF5 dataset "NICMOS1.F090M": shape (4,), type "<f4">
                            - NICMOS1.F110M: <HDF5 dataset "NICMOS1.F110M": shape (4,), type "<f4">
                            - NICMOS1.F145M: <HDF5 dataset "NICMOS1.F145M": shape (4,), type "<f4">
                            - NICMOS1.F160W: <HDF5 dataset "NICMOS1.F160W": shape (4,), type "<f4">
                    - Paranal: <HDF5 group "/objects/2M1207 b/Paranal" (4 members)>
                            - NACO.H: <HDF5 dataset "NACO.H": shape (4,), type "<f4">
                            - NACO.J: <HDF5 dataset "NACO.J": shape (4,), type "<f4">
                            - NACO.Ks: <HDF5 dataset "NACO.Ks": shape (4,), type "<f4">
                            - NACO.Lp: <HDF5 dataset "NACO.Lp": shape (4,), type "<f4">
                    - distance: <HDF5 dataset "distance": shape (2,), type "<f4">
            - 51 Eri b: <HDF5 group "/objects/51 Eri b" (4 members)>
                    - Keck: <HDF5 group "/objects/51 Eri b/Keck" (2 members)>
                            - NIRC2.Lp: <HDF5 dataset "NIRC2.Lp": shape (4,), type "<f4">
                            - NIRC2.Ms: <HDF5 dataset "NIRC2.Ms": shape (4,), type "<f4">
                    - MKO: <HDF5 group "/objects/51 Eri b/MKO" (3 members)>
                            - NSFCam.H: <HDF5 dataset "NSFCam.H": shape (4,), type "<f4">
                            - NSFCam.J: <HDF5 dataset "NSFCam.J": shape (4,), type "<f4">
                            - NSFCam.K: <HDF5 dataset "NSFCam.K": shape (4,), type "<f4">
                    - Paranal: <HDF5 group "/objects/51 Eri b/Paranal" (2 members)>
                            - SPHERE.IRDIS_D_H23_2: <HDF5 dataset "SPHERE.IRDIS_D_H23_2": shape (4,), type "<f4">
                            - SPHERE.IRDIS_D_K12_1: <HDF5 dataset "SPHERE.IRDIS_D_K12_1": shape (4,), type "<f4">
                    - distance: <HDF5 dataset "distance": shape (2,), type "<f4">
            - AB Pic B: <HDF5 group "/objects/AB Pic B" (2 members)>
                    - Paranal: <HDF5 group "/objects/AB Pic B/Paranal" (3 members)>
                            - NACO.H: <HDF5 dataset "NACO.H": shape (4,), type "<f4">
                            - NACO.J: <HDF5 dataset "NACO.J": shape (4,), type "<f4">
                            - NACO.Ks: <HDF5 dataset "NACO.Ks": shape (4,), type "<f4">
                    - distance: <HDF5 dataset "distance": shape (2,), type "<f4">
            - GJ 504 b: <HDF5 group "/objects/GJ 504 b" (3 members)>
                    - Paranal: <HDF5 group "/objects/GJ 504 b/Paranal" (6 members)>
                            - SPHERE.IRDIS_D_H23_2: <HDF5 dataset "SPHERE.IRDIS_D_H23_2": shape (4,), type "<f4">
                            - SPHERE.IRDIS_D_H23_3: <HDF5 dataset "SPHERE.IRDIS_D_H23_3": shape (4,), type "<f4">
                            - SPHERE.IRDIS_D_J23_3: <HDF5 dataset "SPHERE.IRDIS_D_J23_3": shape (4,), type "<f4">
                            - SPHERE.IRDIS_D_K12_1: <HDF5 dataset "SPHERE.IRDIS_D_K12_1": shape (4,), type "<f4">
                            - SPHERE.IRDIS_D_Y23_2: <HDF5 dataset "SPHERE.IRDIS_D_Y23_2": shape (4,), type "<f4">
                            - SPHERE.IRDIS_D_Y23_3: <HDF5 dataset "SPHERE.IRDIS_D_Y23_3": shape (4,), type "<f4">
                    - Subaru: <HDF5 group "/objects/GJ 504 b/Subaru" (5 members)>
                            - CIAO.CH4s: <HDF5 dataset "CIAO.CH4s": shape (4,), type "<f4">
                            - CIAO.H: <HDF5 dataset "CIAO.H": shape (4,), type "<f4">
                            - CIAO.J: <HDF5 dataset "CIAO.J": shape (4,), type "<f4">
                            - CIAO.Ks: <HDF5 dataset "CIAO.Ks": shape (4,), type "<f4">
                            - IRCS.Lp: <HDF5 dataset "IRCS.Lp": shape (4,), type "<f4">
                    - distance: <HDF5 dataset "distance": shape (2,), type "<f4">
            - GQ Lup B: <HDF5 group "/objects/GQ Lup B" (3 members)>
                    - HST: <HDF5 group "/objects/GQ Lup B/HST" (5 members)>
                            - NICMOS2.F171M: <HDF5 dataset "NICMOS2.F171M": shape (4,), type "<f4">
                            - NICMOS2.F190N: <HDF5 dataset "NICMOS2.F190N": shape (4,), type "<f4">
                            - NICMOS2.F215N: <HDF5 dataset "NICMOS2.F215N": shape (4,), type "<f4">
                            - WFPC2.f606w: <HDF5 dataset "WFPC2.f606w": shape (4,), type "<f4">
                            - WFPC2.f814w: <HDF5 dataset "WFPC2.f814w": shape (4,), type "<f4">
                    - Subaru: <HDF5 group "/objects/GQ Lup B/Subaru" (3 members)>
                            - CIAO.CH4s: <HDF5 dataset "CIAO.CH4s": shape (4,), type "<f4">
                            - CIAO.K: <HDF5 dataset "CIAO.K": shape (4,), type "<f4">
                            - CIAO.Lp: <HDF5 dataset "CIAO.Lp": shape (4,), type "<f4">
                    - distance: <HDF5 dataset "distance": shape (2,), type "<f4">
            - GSC 06214 B: <HDF5 group "/objects/GSC 06214 B" (3 members)>
                    - LBT: <HDF5 group "/objects/GSC 06214 B/LBT" (1 members)>
                            - LMIRCam.M_77K: <HDF5 dataset "LMIRCam.M_77K": shape (4,), type "<f4">
                    - MKO: <HDF5 group "/objects/GSC 06214 B/MKO" (4 members)>
                            - NSFCam.H: <HDF5 dataset "NSFCam.H": shape (4,), type "<f4">
                            - NSFCam.J: <HDF5 dataset "NSFCam.J": shape (4,), type "<f4">
                            - NSFCam.Kp: <HDF5 dataset "NSFCam.Kp": shape (4,), type "<f4">
                            - NSFCam.Lp: <HDF5 dataset "NSFCam.Lp": shape (4,), type "<f4">
                    - distance: <HDF5 dataset "distance": shape (2,), type "<f4">
            - GU Psc b: <HDF5 group "/objects/GU Psc b" (4 members)>
                    - CFHT: <HDF5 group "/objects/GU Psc b/CFHT" (4 members)>
                            - Wircam.H: <HDF5 dataset "Wircam.H": shape (4,), type "<f4">
                            - Wircam.J: <HDF5 dataset "Wircam.J": shape (4,), type "<f4">
                            - Wircam.Ks: <HDF5 dataset "Wircam.Ks": shape (4,), type "<f4">
                            - Wircam.Y: <HDF5 dataset "Wircam.Y": shape (4,), type "<f4">
                    - Gemini: <HDF5 group "/objects/GU Psc b/Gemini" (1 members)>
                            - GMOS-S.z: <HDF5 dataset "GMOS-S.z": shape (4,), type "<f4">
                    - WISE: <HDF5 group "/objects/GU Psc b/WISE" (2 members)>
                            - WISE.W1: <HDF5 dataset "WISE.W1": shape (4,), type "<f4">
                            - WISE.W2: <HDF5 dataset "WISE.W2": shape (4,), type "<f4">
                    - distance: <HDF5 dataset "distance": shape (2,), type "<f4">
            - HD 206893 B: <HDF5 group "/objects/HD 206893 B" (2 members)>
                    - Paranal: <HDF5 group "/objects/HD 206893 B/Paranal" (6 members)>
                            - NACO.Lp: <HDF5 dataset "NACO.Lp": shape (4,), type "<f4">
                            - NACO.Mp: <HDF5 dataset "NACO.Mp": shape (4,), type "<f4">
                            - NACO.NB405: <HDF5 dataset "NACO.NB405": shape (4,), type "<f4">
                            - SPHERE.IRDIS_B_H: <HDF5 dataset "SPHERE.IRDIS_B_H": shape (4,), type "<f4">
                            - SPHERE.IRDIS_D_K12_1: <HDF5 dataset "SPHERE.IRDIS_D_K12_1": shape (4,), type "<f4">
                            - SPHERE.IRDIS_D_K12_2: <HDF5 dataset "SPHERE.IRDIS_D_K12_2": shape (4,), type "<f4">
                    - distance: <HDF5 dataset "distance": shape (2,), type "<f4">
            - HD 95086 b: <HDF5 group "/objects/HD 95086 b" (3 members)>
                    - Gemini: <HDF5 group "/objects/HD 95086 b/Gemini" (2 members)>
                            - GPI.H: <HDF5 dataset "GPI.H": shape (4,), type "<f4">
                            - GPI.K1: <HDF5 dataset "GPI.K1": shape (4,), type "<f4">
                    - Paranal: <HDF5 group "/objects/HD 95086 b/Paranal" (1 members)>
                            - NACO.Lp: <HDF5 dataset "NACO.Lp": shape (4,), type "<f4">
                    - distance: <HDF5 dataset "distance": shape (2,), type "<f4">
            - HIP 65426 b: <HDF5 group "/objects/HIP 65426 b" (2 members)>
                    - Paranal: <HDF5 group "/objects/HIP 65426 b/Paranal" (7 members)>
                            - NACO.Lp: <HDF5 dataset "NACO.Lp": shape (4,), type "<f4">
                            - NACO.Mp: <HDF5 dataset "NACO.Mp": shape (4,), type "<f4">
                            - NACO.NB405: <HDF5 dataset "NACO.NB405": shape (4,), type "<f4">
                            - SPHERE.IRDIS_D_H23_2: <HDF5 dataset "SPHERE.IRDIS_D_H23_2": shape (4,), type "<f4">
                            - SPHERE.IRDIS_D_H23_3: <HDF5 dataset "SPHERE.IRDIS_D_H23_3": shape (4,), type "<f4">
                            - SPHERE.IRDIS_D_K12_1: <HDF5 dataset "SPHERE.IRDIS_D_K12_1": shape (4,), type "<f4">
                            - SPHERE.IRDIS_D_K12_2: <HDF5 dataset "SPHERE.IRDIS_D_K12_2": shape (4,), type "<f4">
                    - distance: <HDF5 dataset "distance": shape (2,), type "<f4">
            - HR 8799 b: <HDF5 group "/objects/HR 8799 b" (4 members)>
                    - Keck: <HDF5 group "/objects/HR 8799 b/Keck" (3 members)>
                            - NIRC2.H: <HDF5 dataset "NIRC2.H": shape (4,), type "<f4">
                            - NIRC2.Ks: <HDF5 dataset "NIRC2.Ks": shape (4,), type "<f4">
                            - NIRC2.Ms: <HDF5 dataset "NIRC2.Ms": shape (4,), type "<f4">
                    - Paranal: <HDF5 group "/objects/HR 8799 b/Paranal" (7 members)>
                            - NACO.Lp: <HDF5 dataset "NACO.Lp": shape (4,), type "<f4">
                            - NACO.NB405: <HDF5 dataset "NACO.NB405": shape (4,), type "<f4">
                            - SPHERE.IRDIS_B_J: <HDF5 dataset "SPHERE.IRDIS_B_J": shape (4,), type "<f4">
                            - SPHERE.IRDIS_D_H23_2: <HDF5 dataset "SPHERE.IRDIS_D_H23_2": shape (4,), type "<f4">
                            - SPHERE.IRDIS_D_H23_3: <HDF5 dataset "SPHERE.IRDIS_D_H23_3": shape (4,), type "<f4">
                            - SPHERE.IRDIS_D_K12_1: <HDF5 dataset "SPHERE.IRDIS_D_K12_1": shape (4,), type "<f4">
                            - SPHERE.IRDIS_D_K12_2: <HDF5 dataset "SPHERE.IRDIS_D_K12_2": shape (4,), type "<f4">
                    - Subaru: <HDF5 group "/objects/HR 8799 b/Subaru" (1 members)>
                            - CIAO.z: <HDF5 dataset "CIAO.z": shape (4,), type "<f4">
                    - distance: <HDF5 dataset "distance": shape (2,), type "<f4">
            - HR 8799 c: <HDF5 group "/objects/HR 8799 c" (3 members)>
                    - Keck: <HDF5 group "/objects/HR 8799 c/Keck" (3 members)>
                            - NIRC2.H: <HDF5 dataset "NIRC2.H": shape (4,), type "<f4">
                            - NIRC2.Ks: <HDF5 dataset "NIRC2.Ks": shape (4,), type "<f4">
                            - NIRC2.Ms: <HDF5 dataset "NIRC2.Ms": shape (4,), type "<f4">
                    - Paranal: <HDF5 group "/objects/HR 8799 c/Paranal" (7 members)>
                            - NACO.Lp: <HDF5 dataset "NACO.Lp": shape (4,), type "<f4">
                            - NACO.NB405: <HDF5 dataset "NACO.NB405": shape (4,), type "<f4">
                            - SPHERE.IRDIS_B_J: <HDF5 dataset "SPHERE.IRDIS_B_J": shape (4,), type "<f4">
                            - SPHERE.IRDIS_D_H23_2: <HDF5 dataset "SPHERE.IRDIS_D_H23_2": shape (4,), type "<f4">
                            - SPHERE.IRDIS_D_H23_3: <HDF5 dataset "SPHERE.IRDIS_D_H23_3": shape (4,), type "<f4">
                            - SPHERE.IRDIS_D_K12_1: <HDF5 dataset "SPHERE.IRDIS_D_K12_1": shape (4,), type "<f4">
                            - SPHERE.IRDIS_D_K12_2: <HDF5 dataset "SPHERE.IRDIS_D_K12_2": shape (4,), type "<f4">
                    - distance: <HDF5 dataset "distance": shape (2,), type "<f4">
            - HR 8799 d: <HDF5 group "/objects/HR 8799 d" (3 members)>
                    - Keck: <HDF5 group "/objects/HR 8799 d/Keck" (3 members)>
                            - NIRC2.H: <HDF5 dataset "NIRC2.H": shape (4,), type "<f4">
                            - NIRC2.Ks: <HDF5 dataset "NIRC2.Ks": shape (4,), type "<f4">
                            - NIRC2.Ms: <HDF5 dataset "NIRC2.Ms": shape (4,), type "<f4">
                    - Paranal: <HDF5 group "/objects/HR 8799 d/Paranal" (7 members)>
                            - NACO.Lp: <HDF5 dataset "NACO.Lp": shape (4,), type "<f4">
                            - NACO.NB405: <HDF5 dataset "NACO.NB405": shape (4,), type "<f4">
                            - SPHERE.IRDIS_B_J: <HDF5 dataset "SPHERE.IRDIS_B_J": shape (4,), type "<f4">
                            - SPHERE.IRDIS_D_H23_2: <HDF5 dataset "SPHERE.IRDIS_D_H23_2": shape (4,), type "<f4">
                            - SPHERE.IRDIS_D_H23_3: <HDF5 dataset "SPHERE.IRDIS_D_H23_3": shape (4,), type "<f4">
                            - SPHERE.IRDIS_D_K12_1: <HDF5 dataset "SPHERE.IRDIS_D_K12_1": shape (4,), type "<f4">
                            - SPHERE.IRDIS_D_K12_2: <HDF5 dataset "SPHERE.IRDIS_D_K12_2": shape (4,), type "<f4">
                    - distance: <HDF5 dataset "distance": shape (2,), type "<f4">
            - HR 8799 e: <HDF5 group "/objects/HR 8799 e" (3 members)>
                    - Keck: <HDF5 group "/objects/HR 8799 e/Keck" (1 members)>
                            - NIRC2.Ks: <HDF5 dataset "NIRC2.Ks": shape (4,), type "<f4">
                    - Paranal: <HDF5 group "/objects/HR 8799 e/Paranal" (7 members)>
                            - NACO.Lp: <HDF5 dataset "NACO.Lp": shape (4,), type "<f4">
                            - NACO.NB405: <HDF5 dataset "NACO.NB405": shape (4,), type "<f4">
                            - SPHERE.IRDIS_B_J: <HDF5 dataset "SPHERE.IRDIS_B_J": shape (4,), type "<f4">
                            - SPHERE.IRDIS_D_H23_2: <HDF5 dataset "SPHERE.IRDIS_D_H23_2": shape (4,), type "<f4">
                            - SPHERE.IRDIS_D_H23_3: <HDF5 dataset "SPHERE.IRDIS_D_H23_3": shape (4,), type "<f4">
                            - SPHERE.IRDIS_D_K12_1: <HDF5 dataset "SPHERE.IRDIS_D_K12_1": shape (4,), type "<f4">
                            - SPHERE.IRDIS_D_K12_2: <HDF5 dataset "SPHERE.IRDIS_D_K12_2": shape (4,), type "<f4">
                    - distance: <HDF5 dataset "distance": shape (2,), type "<f4">
            - PDS 70 b: <HDF5 group "/objects/PDS 70 b" (2 members)>
                    - Paranal: <HDF5 group "/objects/PDS 70 b/Paranal" (4 members)>
                            - SPHERE.IRDIS_D_H23_2: <HDF5 dataset "SPHERE.IRDIS_D_H23_2": shape (4,), type "<f4">
                            - SPHERE.IRDIS_D_H23_3: <HDF5 dataset "SPHERE.IRDIS_D_H23_3": shape (4,), type "<f4">
                            - SPHERE.IRDIS_D_K12_1: <HDF5 dataset "SPHERE.IRDIS_D_K12_1": shape (4,), type "<f4">
                            - SPHERE.IRDIS_D_K12_2: <HDF5 dataset "SPHERE.IRDIS_D_K12_2": shape (4,), type "<f4">
                    - distance: <HDF5 dataset "distance": shape (2,), type "<f4">
            - PDS 70 c: <HDF5 group "/objects/PDS 70 c" (2 members)>
                    - Paranal: <HDF5 group "/objects/PDS 70 c/Paranal" (1 members)>
                            - NACO.NB405: <HDF5 dataset "NACO.NB405": shape (4,), type "<f4">
                    - distance: <HDF5 dataset "distance": shape (2,), type "<f4">
            - PZ Tel B: <HDF5 group "/objects/PZ Tel B" (3 members)>
                    - Gemini: <HDF5 group "/objects/PZ Tel B/Gemini" (2 members)>
                            - NICI.ED286: <HDF5 dataset "NICI.ED286": shape (4,), type "<f4">
                            - NIRI.H2S1v2-1-G0220: <HDF5 dataset "NIRI.H2S1v2-1-G0220": shape (4,), type "<f4">
                    - Paranal: <HDF5 group "/objects/PZ Tel B/Paranal" (12 members)>
                            - NACO.H: <HDF5 dataset "NACO.H": shape (4,), type "<f4">
                            - NACO.J: <HDF5 dataset "NACO.J": shape (4,), type "<f4">
                            - NACO.Ks: <HDF5 dataset "NACO.Ks": shape (4,), type "<f4">
                            - NACO.Lp: <HDF5 dataset "NACO.Lp": shape (4,), type "<f4">
                            - NACO.Mp: <HDF5 dataset "NACO.Mp": shape (4,), type "<f4">
                            - NACO.NB405: <HDF5 dataset "NACO.NB405": shape (4,), type "<f4">
                            - SPHERE.IRDIS_D_H23_2: <HDF5 dataset "SPHERE.IRDIS_D_H23_2": shape (4,), type "<f4">
                            - SPHERE.IRDIS_D_H23_3: <HDF5 dataset "SPHERE.IRDIS_D_H23_3": shape (4,), type "<f4">
                            - SPHERE.IRDIS_D_K12_1: <HDF5 dataset "SPHERE.IRDIS_D_K12_1": shape (4,), type "<f4">
                            - SPHERE.IRDIS_D_K12_2: <HDF5 dataset "SPHERE.IRDIS_D_K12_2": shape (4,), type "<f4">
                            - SPHERE.ZIMPOL_I_PRIM: <HDF5 dataset "SPHERE.ZIMPOL_I_PRIM": shape (4,), type "<f4">
                            - SPHERE.ZIMPOL_R_PRIM: <HDF5 dataset "SPHERE.ZIMPOL_R_PRIM": shape (4,), type "<f4">
                    - distance: <HDF5 dataset "distance": shape (2,), type "<f4">
            - ROXs 42 Bb: <HDF5 group "/objects/ROXs 42 Bb" (2 members)>
                    - Keck: <HDF5 group "/objects/ROXs 42 Bb/Keck" (5 members)>
                            - NIRC2.H: <HDF5 dataset "NIRC2.H": shape (4,), type "<f4">
                            - NIRC2.J: <HDF5 dataset "NIRC2.J": shape (4,), type "<f4">
                            - NIRC2.Ks: <HDF5 dataset "NIRC2.Ks": shape (4,), type "<f4">
                            - NIRC2.Lp: <HDF5 dataset "NIRC2.Lp": shape (4,), type "<f4">
                            - NIRC2.Ms: <HDF5 dataset "NIRC2.Ms": shape (4,), type "<f4">
                    - distance: <HDF5 dataset "distance": shape (2,), type "<f4">
            - beta Pic b: <HDF5 group "/objects/beta Pic b" (4 members)>
                    - Gemini: <HDF5 group "/objects/beta Pic b/Gemini" (1 members)>
                            - NICI.ED286: <HDF5 dataset "NICI.ED286": shape (4,), type "<f4">
                    - LCO: <HDF5 group "/objects/beta Pic b/LCO" (1 members)>
                            - VisAO.Ys: <HDF5 dataset "VisAO.Ys": shape (4,), type "<f4">
                    - Paranal: <HDF5 group "/objects/beta Pic b/Paranal" (7 members)>
                            - NACO.H: <HDF5 dataset "NACO.H": shape (4,), type "<f4">
                            - NACO.J: <HDF5 dataset "NACO.J": shape (4,), type "<f4">
                            - NACO.Ks: <HDF5 dataset "NACO.Ks": shape (4,), type "<f4">
                            - NACO.Lp: <HDF5 dataset "NACO.Lp": shape (4,), type "<f4">
                            - NACO.Mp: <HDF5 dataset "NACO.Mp": shape (4,), type "<f4">
                            - NACO.NB374: <HDF5 dataset "NACO.NB374": shape (4,), type "<f4">
                            - NACO.NB405: <HDF5 dataset "NACO.NB405": shape (4,), type "<f4">
                    - distance: <HDF5 dataset "distance": shape (2,), type "<f4">
            - kappa And b: <HDF5 group "/objects/kappa And b" (4 members)>
                    - Keck: <HDF5 group "/objects/kappa And b/Keck" (1 members)>
                            - NIRC2.Lp: <HDF5 dataset "NIRC2.Lp": shape (4,), type "<f4">
                    - LBT: <HDF5 group "/objects/kappa And b/LBT" (1 members)>
                            - LMIRCam.M_77K: <HDF5 dataset "LMIRCam.M_77K": shape (4,), type "<f4">
                    - Subaru: <HDF5 group "/objects/kappa And b/Subaru" (3 members)>
                            - CIAO.H: <HDF5 dataset "CIAO.H": shape (4,), type "<f4">
                            - CIAO.J: <HDF5 dataset "CIAO.J": shape (4,), type "<f4">
                            - CIAO.Ks: <HDF5 dataset "CIAO.Ks": shape (4,), type "<f4">
                    - distance: <HDF5 dataset "distance": shape (2,), type "<f4">
    - photometry: <HDF5 group "/photometry" (1 members)>
            - vlm-plx: <HDF5 group "/photometry/vlm-plx" (6 members)>
                    - 2MASS: <HDF5 group "/photometry/vlm-plx/2MASS" (3 members)>
                            - 2MASS.H: <HDF5 dataset "2MASS.H": shape (618,), type "<f4">
                            - 2MASS.J: <HDF5 dataset "2MASS.J": shape (618,), type "<f4">
                            - 2MASS.Ks: <HDF5 dataset "2MASS.Ks": shape (618,), type "<f4">
                    - MKO: <HDF5 group "/photometry/vlm-plx/MKO" (6 members)>
                            - NSFCam.H: <HDF5 dataset "NSFCam.H": shape (618,), type "<f4">
                            - NSFCam.J: <HDF5 dataset "NSFCam.J": shape (618,), type "<f4">
                            - NSFCam.K: <HDF5 dataset "NSFCam.K": shape (618,), type "<f4">
                            - NSFCam.Lp: <HDF5 dataset "NSFCam.Lp": shape (618,), type "<f4">
                            - NSFCam.Mp: <HDF5 dataset "NSFCam.Mp": shape (618,), type "<f4">
                            - NSFCam.Y: <HDF5 dataset "NSFCam.Y": shape (618,), type "<f4">
                    - distance: <HDF5 dataset "distance": shape (618,), type "<f4">
                    - flag: <HDF5 dataset "flag": shape (618,), type "|O">
                    - name: <HDF5 dataset "name": shape (618,), type "|O">
                    - sptype: <HDF5 dataset "sptype": shape (618,), type "|O">
    - spectra: <HDF5 group "/spectra" (1 members)>
            - calibration: <HDF5 group "/spectra/calibration" (1 members)>
                    - vega: <HDF5 dataset "vega": shape (3, 8827), type "<f4">

## Synthetic photometry from isochrones

Magnitudes are available in the isochrone data which 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 isochrones and the model spectra.

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

    [9]:

    ages = [20., 100., 1000.]  # [Myr]
    masses = np.logspace(-1., 4., 100)  # [Mjup]

Object of `ReadIsochones` are initiated for both the AMES-Cond and AMES-Dusty isochrones.

    [10]:

    read_iso_cond = species.ReadIsochrone(tag='iso_cond')
    read_iso_dusty = species.ReadIsochrone(tag='iso_dusty')

The colors and magnitudes are computed by chosing the corresponding model spectra that are stored in the database. The results of two models are stored in `ColorMagBox` objects for the three different ages.

    [11]:

    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)

## Photometry of directly imaged objects

Before selecting the photometric data of the directly imaged planets and brown dwarfs, let’s see which objects and magnitudes are stored in the database.

    [12]:

    database.list_companions()

    Object name = beta Pic b
    Distance [pc] = 19.75 +/- 0.13
    LCO/VisAO.Ys [mag] = 15.53 +/- 0.34
    Paranal/NACO.J [mag] = 14.11 +/- 0.21
    Gemini/NICI.ED286 [mag] = 13.18 +/- 0.15
    Paranal/NACO.H [mag] = 13.32 +/- 0.14
    Paranal/NACO.Ks [mag] = 12.64 +/- 0.11
    Paranal/NACO.NB374 [mag] = 11.25 +/- 0.23
    Paranal/NACO.Lp [mag] = 11.3 +/- 0.06
    Paranal/NACO.NB405 [mag] = 10.98 +/- 0.05
    Paranal/NACO.Mp [mag] = 11.1 +/- 0.12

    Object name = HIP 65426 b
    Distance [pc] = 109.21 +/- 0.75
    Paranal/SPHERE.IRDIS_D_H23_2 [mag] = 17.94 +/- 0.05
    Paranal/SPHERE.IRDIS_D_H23_3 [mag] = 17.58 +/- 0.06
    Paranal/SPHERE.IRDIS_D_K12_1 [mag] = 17.01 +/- 0.09
    Paranal/SPHERE.IRDIS_D_K12_2 [mag] = 16.79 +/- 0.09
    Paranal/NACO.Lp [mag] = 15.33 +/- 0.12
    Paranal/NACO.NB405 [mag] = 15.23 +/- 0.22
    Paranal/NACO.Mp [mag] = 14.65 +/- 0.29

    Object name = 51 Eri b
    Distance [pc] = 29.78 +/- 0.12
    MKO/NSFCam.J [mag] = 19.04 +/- 0.4
    MKO/NSFCam.H [mag] = 18.99 +/- 0.21
    MKO/NSFCam.K [mag] = 18.67 +/- 0.19
    Paranal/SPHERE.IRDIS_D_H23_2 [mag] = 18.41 +/- 0.26
    Paranal/SPHERE.IRDIS_D_K12_1 [mag] = 17.55 +/- 0.14
    Keck/NIRC2.Lp [mag] = 16.2 +/- 0.11
    Keck/NIRC2.Ms [mag] = 16.1 +/- 0.5

    Object name = HR 8799 b
    Distance [pc] = 41.29 +/- 0.15
    Subaru/CIAO.z [mag] = 21.22 +/- 0.29
    Paranal/SPHERE.IRDIS_B_J [mag] = 19.78 +/- 0.09
    Keck/NIRC2.H [mag] = 18.05 +/- 0.09
    Paranal/SPHERE.IRDIS_D_H23_2 [mag] = 18.08 +/- 0.14
    Paranal/SPHERE.IRDIS_D_H23_3 [mag] = 17.78 +/- 0.1
    Keck/NIRC2.Ks [mag] = 17.03 +/- 0.08
    Paranal/SPHERE.IRDIS_D_K12_1 [mag] = 17.15 +/- 0.06
    Paranal/SPHERE.IRDIS_D_K12_2 [mag] = 16.97 +/- 0.09
    Paranal/NACO.Lp [mag] = 15.52 +/- 0.1
    Paranal/NACO.NB405 [mag] = 14.82 +/- 0.18
    Keck/NIRC2.Ms [mag] = 16.05 +/- 0.3

    Object name = HR 8799 c
    Distance [pc] = 41.29 +/- 0.15
    Paranal/SPHERE.IRDIS_B_J [mag] = 18.6 +/- 0.13
    Keck/NIRC2.H [mag] = 17.06 +/- 0.13
    Paranal/SPHERE.IRDIS_D_H23_2 [mag] = 17.09 +/- 0.12
    Paranal/SPHERE.IRDIS_D_H23_3 [mag] = 16.78 +/- 0.1
    Keck/NIRC2.Ks [mag] = 16.11 +/- 0.08
    Paranal/SPHERE.IRDIS_D_K12_1 [mag] = 16.19 +/- 0.05
    Paranal/SPHERE.IRDIS_D_K12_2 [mag] = 15.86 +/- 0.07
    Paranal/NACO.Lp [mag] = 14.65 +/- 0.11
    Paranal/NACO.NB405 [mag] = 13.97 +/- 0.11
    Keck/NIRC2.Ms [mag] = 15.03 +/- 0.14

    Object name = HR 8799 d
    Distance [pc] = 41.29 +/- 0.15
    Paranal/SPHERE.IRDIS_B_J [mag] = 18.59 +/- 0.37
    Keck/NIRC2.H [mag] = 16.71 +/- 0.24
    Paranal/SPHERE.IRDIS_D_H23_2 [mag] = 17.02 +/- 0.17
    Paranal/SPHERE.IRDIS_D_H23_3 [mag] = 16.85 +/- 0.16
    Keck/NIRC2.Ks [mag] = 16.09 +/- 0.12
    Paranal/SPHERE.IRDIS_D_K12_1 [mag] = 16.2 +/- 0.07
    Paranal/SPHERE.IRDIS_D_K12_2 [mag] = 15.84 +/- 0.1
    Paranal/NACO.Lp [mag] = 14.55 +/- 0.14
    Paranal/NACO.NB405 [mag] = 13.87 +/- 0.15
    Keck/NIRC2.Ms [mag] = 14.65 +/- 0.35

    Object name = HR 8799 e
    Distance [pc] = 41.29 +/- 0.15
    Paranal/SPHERE.IRDIS_B_J [mag] = 18.4 +/- 0.21
    Paranal/SPHERE.IRDIS_D_H23_2 [mag] = 16.91 +/- 0.2
    Paranal/SPHERE.IRDIS_D_H23_3 [mag] = 16.68 +/- 0.21
    Keck/NIRC2.Ks [mag] = 15.91 +/- 0.22
    Paranal/SPHERE.IRDIS_D_K12_1 [mag] = 16.12 +/- 0.1
    Paranal/SPHERE.IRDIS_D_K12_2 [mag] = 15.82 +/- 0.11
    Paranal/NACO.Lp [mag] = 14.49 +/- 0.21
    Paranal/NACO.NB405 [mag] = 13.72 +/- 0.2

    Object name = HD 95086 b
    Distance [pc] = 86.44 +/- 0.24
    Gemini/GPI.H [mag] = 20.51 +/- 0.25
    Gemini/GPI.K1 [mag] = 18.99 +/- 0.2
    Paranal/NACO.Lp [mag] = 16.27 +/- 0.19

    Object name = PDS 70 b
    Distance [pc] = 113.43 +/- 0.52
    Paranal/SPHERE.IRDIS_D_H23_2 [mag] = 17.94 +/- 0.24
    Paranal/SPHERE.IRDIS_D_H23_3 [mag] = 17.95 +/- 0.17
    Paranal/SPHERE.IRDIS_D_K12_1 [mag] = 16.65 +/- 0.06
    Paranal/SPHERE.IRDIS_D_K12_2 [mag] = 16.44 +/- 0.05

    Object name = PDS 70 c
    Distance [pc] = 113.43 +/- 0.52
    Paranal/NACO.NB405 [mag] = 15.05 +/- 0.59

    Object name = 2M1207 b
    Distance [pc] = 64.42 +/- 0.65
    HST/NICMOS1.F090M [mag] = 22.58 +/- 0.35
    HST/NICMOS1.F110M [mag] = 20.61 +/- 0.15
    HST/NICMOS1.F145M [mag] = 19.05 +/- 0.03
    HST/NICMOS1.F160W [mag] = 18.27 +/- 0.02
    Paranal/NACO.J [mag] = 20.0 +/- 0.2
    Paranal/NACO.H [mag] = 18.09 +/- 0.21
    Paranal/NACO.Ks [mag] = 16.93 +/- 0.11
    Paranal/NACO.Lp [mag] = 15.28 +/- 0.14

    Object name = AB Pic B
    Distance [pc] = 50.12 +/- 0.07
    Paranal/NACO.J [mag] = 16.18 +/- 0.1
    Paranal/NACO.H [mag] = 14.69 +/- 0.1
    Paranal/NACO.Ks [mag] = 14.14 +/- 0.08

    Object name = HD 206893 B
    Distance [pc] = 40.81 +/- 0.11
    Paranal/SPHERE.IRDIS_B_H [mag] = 16.79 +/- 0.06
    Paranal/SPHERE.IRDIS_D_K12_1 [mag] = 15.2 +/- 0.1
    Paranal/SPHERE.IRDIS_D_K12_2 [mag] = 14.88 +/- 0.09
    Paranal/NACO.Lp [mag] = 13.79 +/- 0.31
    Paranal/NACO.NB405 [mag] = 13.16 +/- 0.34
    Paranal/NACO.Mp [mag] = 12.77 +/- 0.27

    Object name = GQ Lup B
    Distance [pc] = 151.82 +/- 1.1
    HST/WFPC2.f606w [mag] = 19.19 +/- 0.07
    HST/WFPC2.f814w [mag] = 17.67 +/- 0.05
    HST/NICMOS2.F171M [mag] = 13.84 +/- 0.13
    HST/NICMOS2.F190N [mag] = 14.08 +/- 0.2
    HST/NICMOS2.F215N [mag] = 13.4 +/- 0.15
    Subaru/CIAO.CH4s [mag] = 13.76 +/- 0.26
    Subaru/CIAO.K [mag] = 13.37 +/- 0.12
    Subaru/CIAO.Lp [mag] = 12.44 +/- 0.22

    Object name = PZ Tel B
    Distance [pc] = 47.13 +/- 0.13
    Paranal/SPHERE.ZIMPOL_R_PRIM [mag] = 17.84 +/- 0.31
    Paranal/SPHERE.ZIMPOL_I_PRIM [mag] = 15.16 +/- 0.12
    Paranal/SPHERE.IRDIS_D_H23_2 [mag] = 11.78 +/- 0.19
    Paranal/SPHERE.IRDIS_D_H23_3 [mag] = 11.65 +/- 0.19
    Paranal/SPHERE.IRDIS_D_K12_1 [mag] = 11.56 +/- 0.09
    Paranal/SPHERE.IRDIS_D_K12_2 [mag] = 11.29 +/- 0.1
    Paranal/NACO.J [mag] = 12.47 +/- 0.2
    Paranal/NACO.H [mag] = 11.93 +/- 0.14
    Paranal/NACO.Ks [mag] = 11.53 +/- 0.07
    Paranal/NACO.Lp [mag] = 11.04 +/- 0.22
    Paranal/NACO.NB405 [mag] = 10.94 +/- 0.07
    Paranal/NACO.Mp [mag] = 10.93 +/- 0.03
    Gemini/NICI.ED286 [mag] = 11.68 +/- 0.14
    Gemini/NIRI.H2S1v2-1-G0220 [mag] = 11.39 +/- 0.14

    Object name = kappa And b
    Distance [pc] = 50.06 +/- 0.87
    Subaru/CIAO.J [mag] = 15.86 +/- 0.21
    Subaru/CIAO.H [mag] = 14.95 +/- 0.13
    Subaru/CIAO.Ks [mag] = 14.32 +/- 0.09
    Keck/NIRC2.Lp [mag] = 13.12 +/- 0.1
    LBT/LMIRCam.M_77K [mag] = 13.3 +/- 0.3

    Object name = ROXs 42 Bb
    Distance [pc] = 144.16 +/- 1.54
    Keck/NIRC2.J [mag] = 16.91 +/- 0.11
    Keck/NIRC2.H [mag] = 15.88 +/- 0.05
    Keck/NIRC2.Ks [mag] = 15.01 +/- 0.06
    Keck/NIRC2.Lp [mag] = 13.97 +/- 0.06
    Keck/NIRC2.Ms [mag] = 14.01 +/- 0.23

    Object name = GJ 504 b
    Distance [pc] = 17.54 +/- 0.08
    Paranal/SPHERE.IRDIS_D_Y23_2 [mag] = 20.98 +/- 0.2
    Paranal/SPHERE.IRDIS_D_Y23_3 [mag] = 20.14 +/- 0.09
    Paranal/SPHERE.IRDIS_D_J23_3 [mag] = 19.01 +/- 0.17
    Paranal/SPHERE.IRDIS_D_H23_2 [mag] = 18.95 +/- 0.3
    Paranal/SPHERE.IRDIS_D_H23_3 [mag] = 21.81 +/- 0.35
    Paranal/SPHERE.IRDIS_D_K12_1 [mag] = 18.77 +/- 0.2
    Subaru/CIAO.J [mag] = 19.78 +/- 0.1
    Subaru/CIAO.H [mag] = 20.01 +/- 0.14
    Subaru/CIAO.Ks [mag] = 19.38 +/- 0.11
    Subaru/CIAO.CH4s [mag] = 19.58 +/- 0.13
    Subaru/IRCS.Lp [mag] = 16.7 +/- 0.17

    Object name = GU Psc b
    Distance [pc] = 47.61 +/- 0.16
    Gemini/GMOS-S.z [mag] = 21.75 +/- 0.07
    CFHT/Wircam.Y [mag] = 19.4 +/- 0.05
    CFHT/Wircam.J [mag] = 18.12 +/- 0.03
    CFHT/Wircam.H [mag] = 17.7 +/- 0.03
    CFHT/Wircam.Ks [mag] = 17.4 +/- 0.03
    WISE/WISE.W1 [mag] = 17.17 +/- 0.33
    WISE/WISE.W2 [mag] = 15.41 +/- 0.22

    Object name = 2M0103 ABb
    Distance [pc] = 47.2 +/- 3.1
    Paranal/NACO.J [mag] = 15.47 +/- 0.3
    Paranal/NACO.H [mag] = 14.27 +/- 0.2
    Paranal/NACO.Ks [mag] = 13.67 +/- 0.2
    Paranal/NACO.Lp [mag] = 12.67 +/- 0.1

    Object name = 1RXS 1609 B
    Distance [pc] = 139.67 +/- 1.33
    Gemini/NIRI.J-G0202w [mag] = 17.9 +/- 0.12
    Gemini/NIRI.H-G0203w [mag] = 16.87 +/- 0.07
    Gemini/NIRI.K-G0204w [mag] = 16.17 +/- 0.18
    Gemini/NIRI.Lprime-G0207w [mag] = 14.8 +/- 0.3

    Object name = GSC 06214 B
    Distance [pc] = 108.84 +/- 0.51
    MKO/NSFCam.J [mag] = 16.24 +/- 0.04
    MKO/NSFCam.H [mag] = 15.55 +/- 0.04
    MKO/NSFCam.Kp [mag] = 14.95 +/- 0.05
    MKO/NSFCam.Lp [mag] = 13.75 +/- 0.07
    LBT/LMIRCam.M_77K [mag] = 13.75 +/- 0.3

A list with object names and filters for the colors and magnitudes is created.

    [13]:

    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'),
               ('2M1207 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 HDF5 database by first creating an object of `ReadColorMagnitude`.

    [14]:

    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.

    [15]:

    color_field = colormag.get_color_magnitude(object_type='field')
    color_young = colormag.get_color_magnitude(object_type='young')

## Plotting a color-magnitude diagram

The color-magnitude diagram is plotted with the `plot_color_magnitude` function. The boxes with photometric data are provided as list to the `colorbox` parameter. The boxes with synthetic photometry are provided to the `models` parameter.

    [16]:

    species.plot_color_magnitude(colorbox=[color_field, color_young],
                                 objects=objects,
                                 models=boxes,
                                 mass_labels=[1., 3., 5., 10., 20., 50., 100., 200.],
                                 companion_labels=False,
                                 field_range=('late M', 'late T'),
                                 label_x='H - L$^\prime$ [mag]',
                                 label_y='M$_\mathregular{L\prime}$ [mag]',
                                 xlim=(0.3, 4.),
                                 ylim=(15., 7.1),
                                 offset=(-0.08, -0.09),
                                 legend=(0.04, 0.04),
                                 output='color_mag.png')

    Plotting color-magnitude diagram: color_mag.png... [DONE]

    [17]:

    from IPython.display import Image
    Image('color_mag.png')

    [17]: