{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Color-magnitude diagram: narrowband filters"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "In this tutorial, we compute synthetic photometry for the VLT/SPHERE H2 and H3 filters from the [SpeX Prism Spectral Library](http://pono.ucsd.edu/~adam/browndwarfs/spexprism/index_old.html). Also, synthetic photometry is calculated from the AMES-Cond and AMES-Dusty isochrones and atmospheric model spectra. These are compared in a color-magnitude diagram with the photometric data of directly imaged planets."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Getting started"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import urllib.request\n",
    "import numpy as np\n",
    "import species"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The isochrone will be extracted at an age of 20 Myr for 100 logarithmically spaced masses."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "age = 20.  # [Myr]\n",
    "masses = np.logspace(0., 4., 100)  # [Mjup]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Next, *species* is initiated by reading the configuration file from the working folder."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Initiating species v0.1.1... [DONE]\n",
      "Creating species_config.ini... [DONE]\n",
      "Database: /Users/tomasstolker/applications/species/docs/tutorials/species_database.hdf5\n",
      "Data folder: /Users/tomasstolker/applications/species/docs/tutorials/data\n",
      "Working folder: /Users/tomasstolker/applications/species/docs/tutorials\n",
      "Creating species_database.hdf5... [DONE]\n",
      "Creating data folder... [DONE]\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "<species.core.setup.SpeciesInit at 0x12bdedfd0>"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "species.SpeciesInit()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Adding data and models"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "A `Database` object is created which is used for adding data and models to the HDF5 database."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "database = species.Database()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The available [photometric data of directly imaged companions](https://github.com/tomasstolker/species/blob/master/species/data/companions.py) is added. Alternative, `add_object` can be used to manually add the properties of an object."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Adding filter: LCO/VisAO.Ys... [DONE]\n",
      "Downloading Vega spectrum (270 kB)... [DONE]\n",
      "Adding Vega spectrum... [DONE]\n",
      "Adding filter: Paranal/NACO.J... [DONE]\n",
      "Adding filter: Gemini/NICI.ED286... [DONE]\n",
      "Adding filter: Paranal/NACO.H... [DONE]\n",
      "Adding filter: Paranal/NACO.Ks... [DONE]\n",
      "Adding filter: Paranal/NACO.NB374... [DONE]\n",
      "Adding filter: Paranal/NACO.Lp... [DONE]\n",
      "Adding filter: Paranal/NACO.NB405... [DONE]\n",
      "Adding filter: Paranal/NACO.Mp... [DONE]\n",
      "Adding object: beta Pic b... [DONE]\n",
      "Adding filter: Paranal/SPHERE.IRDIS_D_H23_2... [DONE]\n",
      "Adding filter: Paranal/SPHERE.IRDIS_D_H23_3... [DONE]\n",
      "Adding filter: Paranal/SPHERE.IRDIS_D_K12_1... [DONE]\n",
      "Adding filter: Paranal/SPHERE.IRDIS_D_K12_2... [DONE]\n",
      "Adding object: HIP 65426 b... [DONE]\n",
      "Adding filter: MKO/NSFCam.J... [DONE]\n",
      "Adding filter: MKO/NSFCam.H... [DONE]\n",
      "Adding filter: MKO/NSFCam.K... [DONE]\n",
      "Adding filter: Keck/NIRC2.Lp... [DONE]\n",
      "Adding filter: Keck/NIRC2.Ms... [DONE]\n",
      "Adding object: 51 Eri b... [DONE]\n",
      "Adding filter: Subaru/CIAO.z... [DONE]\n",
      "Adding filter: Paranal/SPHERE.IRDIS_B_J... [DONE]\n",
      "Adding filter: Keck/NIRC2.H... [DONE]\n",
      "Adding filter: Keck/NIRC2.Ks... [DONE]\n",
      "Adding object: HR 8799 b... [DONE]\n",
      "Adding object: HR 8799 c... [DONE]\n",
      "Adding object: HR 8799 d... [DONE]\n",
      "Adding object: HR 8799 e... [DONE]\n",
      "Adding filter: Gemini/GPI.H... [DONE]\n",
      "Adding filter: Gemini/GPI.K1... [DONE]\n",
      "Adding object: HD 95086 b... [DONE]\n",
      "Adding object: PDS 70 b... [DONE]\n",
      "Adding object: PDS 70 c... [DONE]\n",
      "Adding filter: HST/NICMOS1.F090M... [DONE]\n",
      "Adding filter: HST/NICMOS1.F110M... [DONE]\n",
      "Adding filter: HST/NICMOS1.F145M... [DONE]\n",
      "Adding filter: HST/NICMOS1.F160W... [DONE]\n",
      "Adding object: 2M1207 b... [DONE]\n",
      "Adding object: AB Pic B... [DONE]\n",
      "Adding filter: Paranal/SPHERE.IRDIS_B_H... [DONE]\n",
      "Adding object: HD 206893 B... [DONE]\n",
      "Adding filter: HST/WFPC2.f606w... [DONE]\n",
      "Adding filter: HST/WFPC2.f814w... [DONE]\n",
      "Adding filter: HST/NICMOS2.F171M... [DONE]\n",
      "Adding filter: HST/NICMOS2.F190N... [DONE]\n",
      "Adding filter: HST/NICMOS2.F215N... [DONE]\n",
      "Adding filter: Subaru/CIAO.CH4s... [DONE]\n",
      "Adding filter: Subaru/CIAO.K... [DONE]\n",
      "Adding filter: Subaru/CIAO.Lp... [DONE]\n",
      "Adding object: GQ Lup B... [DONE]\n",
      "Adding filter: Paranal/SPHERE.ZIMPOL_R_PRIM... [DONE]\n",
      "Adding filter: Paranal/SPHERE.ZIMPOL_I_PRIM... [DONE]\n",
      "Adding filter: Gemini/NIRI.H2S1v2-1-G0220... [DONE]\n",
      "Adding object: PZ Tel B... [DONE]\n",
      "Adding filter: Subaru/CIAO.J... [DONE]\n",
      "Adding filter: Subaru/CIAO.H... [DONE]\n",
      "Adding filter: Subaru/CIAO.Ks... [DONE]\n",
      "Adding filter: LBT/LMIRCam.M_77K... [DONE]\n",
      "Adding object: kappa And b... [DONE]\n",
      "Adding filter: Keck/NIRC2.J... [DONE]\n",
      "Adding object: ROXs 42 Bb... [DONE]\n",
      "Adding filter: Paranal/SPHERE.IRDIS_D_Y23_2... [DONE]\n",
      "Adding filter: Paranal/SPHERE.IRDIS_D_Y23_3... [DONE]\n",
      "Adding filter: Paranal/SPHERE.IRDIS_D_J23_3... [DONE]\n",
      "Adding filter: Subaru/IRCS.Lp... [DONE]\n",
      "Adding object: GJ 504 b... [DONE]\n",
      "Adding filter: Gemini/GMOS-S.z... [DONE]\n",
      "Adding filter: CFHT/Wircam.Y... [DONE]\n",
      "Adding filter: CFHT/Wircam.J... [DONE]\n",
      "Adding filter: CFHT/Wircam.H... [DONE]\n",
      "Adding filter: CFHT/Wircam.Ks... [DONE]\n",
      "Adding filter: WISE/WISE.W1... [DONE]\n",
      "Adding filter: WISE/WISE.W2... [DONE]\n",
      "Adding object: GU Psc b... [DONE]\n",
      "Adding object: 2M0103 ABb... [DONE]\n",
      "Adding filter: Gemini/NIRI.J-G0202w... [DONE]\n",
      "Adding filter: Gemini/NIRI.H-G0203w... [DONE]\n",
      "Adding filter: Gemini/NIRI.K-G0204w... [DONE]\n",
      "Adding filter: Gemini/NIRI.Lprime-G0207w... [DONE]\n",
      "Adding object: 1RXS 1609 B... [DONE]\n",
      "Adding filter: MKO/NSFCam.Kp... [DONE]\n",
      "Adding filter: MKO/NSFCam.Lp... [DONE]\n",
      "Adding object: GSC 06214 B... [DONE]\n"
     ]
    }
   ],
   "source": [
    "database.add_companion(name=None)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The spectra from the SpeX Prism Spectral Library are downloaded and added to the database. For each spectrum, the [SIMBAD Astronomical Database](http://simbad.u-strasbg.fr/simbad/) is queried for the SIMBAD name and parallax of the object. If the parallax is not available then several VizieR cataloges with data of brown dwarfs are queried (see [get_distance](https://github.com/tomasstolker/species/blob/master/species/data/queries.py)). A NaN value is stored for the distance if the parallax is not found. Therefore, these objects are not used in the color-magnitude diagram."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Downloading SpeX Prism Spectral Library... [DONE]                               \n",
      "Adding filter: 2MASS/2MASS.H... [DONE]\n",
      "Adding SpeX Prism Spectral Library... 2MASS J13184794+1736117                   "
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/Users/tomasstolker/applications/species/species/data/queries.py:209: UserWarning: No parallax was found for 2MASS J13184794+1736117 so storing a NaN value.\n",
      "  warnings.warn(f'No parallax was found for {target} so storing a NaN value.')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Adding SpeX Prism Spectral Library... SDSS J213154.43-011939.3                  "
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/Users/tomasstolker/applications/species/species/data/queries.py:209: UserWarning: No parallax was found for 2MASS J21315444-0119374 so storing a NaN value.\n",
      "  warnings.warn(f'No parallax was found for {target} so storing a NaN value.')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Adding SpeX Prism Spectral Library... 2MASS J04070885+1514565                   "
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/Users/tomasstolker/applications/species/species/data/queries.py:209: UserWarning: No parallax was found for 2MASS J09293364+3429527 so storing a NaN value.\n",
      "  warnings.warn(f'No parallax was found for {target} so storing a NaN value.')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\r",
      "Adding SpeX Prism Spectral Library... 2MASSW J0929336+342952                    \r",
      "Adding SpeX Prism Spectral Library... 2MASSI J1807159+501531                    "
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/Users/tomasstolker/applications/species/species/data/queries.py:209: UserWarning: No parallax was found for 2MASS J14192618+5919047 so storing a NaN value.\n",
      "  warnings.warn(f'No parallax was found for {target} so storing a NaN value.')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\r",
      "Adding SpeX Prism Spectral Library... 2MASS J14192618+5919047                   \r",
      "Adding SpeX Prism Spectral Library... 2MASS J15412408+5425598                   "
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/Users/tomasstolker/applications/species/species/data/queries.py:209: UserWarning: No parallax was found for 2MASS J04062677-3812102 so storing a NaN value.\n",
      "  warnings.warn(f'No parallax was found for {target} so storing a NaN value.')\n",
      "/Users/tomasstolker/applications/species/species/data/queries.py:209: UserWarning: No parallax was found for 2MASS J03280716+3022432 so storing a NaN value.\n",
      "  warnings.warn(f'No parallax was found for {target} so storing a NaN value.')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Adding SpeX Prism Spectral Library... 2MASS J16452207+3004071                   "
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/Users/tomasstolker/applications/species/species/data/queries.py:209: UserWarning: No parallax was found for 2MASS J04574903+3015195 so storing a NaN value.\n",
      "  warnings.warn(f'No parallax was found for {target} so storing a NaN value.')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Adding SpeX Prism Spectral Library... 2MASS J00013044+1010146                   "
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/Users/tomasstolker/applications/species/species/data/queries.py:209: UserWarning: No parallax was found for 2MASS J01414839-1601196 so storing a NaN value.\n",
      "  warnings.warn(f'No parallax was found for {target} so storing a NaN value.')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Adding SpeX Prism Spectral Library... 2MASS J18212815+1414010                   "
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/Users/tomasstolker/applications/species/species/data/queries.py:209: UserWarning: No parallax was found for 2MASS J12425052+2357231 so storing a NaN value.\n",
      "  warnings.warn(f'No parallax was found for {target} so storing a NaN value.')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\r",
      "Adding SpeX Prism Spectral Library... 2MASS J12425052+2357231                   \r",
      "Adding SpeX Prism Spectral Library... 2MASS J22120703+3430351                   "
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/Users/tomasstolker/applications/species/species/data/queries.py:209: UserWarning: No parallax was found for 2MASS J03422594+3148496 so storing a NaN value.\n",
      "  warnings.warn(f'No parallax was found for {target} so storing a NaN value.')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Adding SpeX Prism Spectral Library... SDSS J121659.17+300306.3                  "
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/Users/tomasstolker/applications/species/species/data/queries.py:209: UserWarning: No parallax was found for 2MASS J18131803+5101246 so storing a NaN value.\n",
      "  warnings.warn(f'No parallax was found for {target} so storing a NaN value.')\n",
      "/Users/tomasstolker/applications/species/species/data/queries.py:209: UserWarning: No parallax was found for 2MASS J16382073+1327354 so storing a NaN value.\n",
      "  warnings.warn(f'No parallax was found for {target} so storing a NaN value.')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\r",
      "Adding SpeX Prism Spectral Library... 2MASS J18131803+5101246                   \r",
      "Adding SpeX Prism Spectral Library... 2MASS J16382073+1327354                   "
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/Users/tomasstolker/applications/species/species/data/queries.py:209: UserWarning: No parallax was found for 2MASS J05460407-0003228 so storing a NaN value.\n",
      "  warnings.warn(f'No parallax was found for {target} so storing a NaN value.')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Adding SpeX Prism Spectral Library... 2MASS J20261584-2943124                   "
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/Users/tomasstolker/applications/species/species/data/queries.py:209: UserWarning: No parallax was found for 2MASS J01151621+3130061 so storing a NaN value.\n",
      "  warnings.warn(f'No parallax was found for {target} so storing a NaN value.')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Adding SpeX Prism Spectral Library... SDSS J104335.08+121314.1                  "
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/Users/tomasstolker/applications/species/species/data/queries.py:209: UserWarning: No parallax was found for 2MASS J19495702+6222440 so storing a NaN value.\n",
      "  warnings.warn(f'No parallax was found for {target} so storing a NaN value.')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Adding SpeX Prism Spectral Library... 2MASS J14283132+5923354                   "
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/Users/tomasstolker/.pyenv/versions/3.6.0/envs/general3.6/lib/python3.6/site-packages/astroquery/simbad/core.py:138: UserWarning: Warning: The script line number 3 raised an error (recorded in the `errors` attribute of the result table): Identifier not found in the database : 2MASS J14162394+1348363\n",
      "  (error.line, error.msg))\n",
      "/Users/tomasstolker/applications/species/species/data/queries.py:209: UserWarning: No parallax was found for 2MASS J14162394+1348363 so storing a NaN value.\n",
      "  warnings.warn(f'No parallax was found for {target} so storing a NaN value.')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Adding SpeX Prism Spectral Library... SDSS J074201.41+205520.5                  "
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/Users/tomasstolker/applications/species/species/data/queries.py:209: UserWarning: No parallax was found for 2MASS J03023398-1028223 so storing a NaN value.\n",
      "  warnings.warn(f'No parallax was found for {target} so storing a NaN value.')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Adding SpeX Prism Spectral Library... 2MASS J12490872+4157286                   "
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/Users/tomasstolker/applications/species/species/data/queries.py:209: UserWarning: No parallax was found for 2MASS J13452562+5216337 so storing a NaN value.\n",
      "  warnings.warn(f'No parallax was found for {target} so storing a NaN value.')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\r",
      "Adding SpeX Prism Spectral Library... SDSS J134525.57+521634.0                  \r",
      "Adding SpeX Prism Spectral Library... 2MASS J11145133-2618235                   "
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/Users/tomasstolker/applications/species/species/data/queries.py:209: UserWarning: No parallax was found for 2MASS J11181292-0856106 so storing a NaN value.\n",
      "  warnings.warn(f'No parallax was found for {target} so storing a NaN value.')\n",
      "/Users/tomasstolker/applications/species/species/data/queries.py:209: UserWarning: No parallax was found for 2MASS J04382218+2553503 so storing a NaN value.\n",
      "  warnings.warn(f'No parallax was found for {target} so storing a NaN value.')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Adding SpeX Prism Spectral Library... SDSS J102109.69-030420.1                  "
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/Users/tomasstolker/applications/species/species/data/queries.py:209: UserWarning: No parallax was found for 2MASS J00150206+2959323 so storing a NaN value.\n",
      "  warnings.warn(f'No parallax was found for {target} so storing a NaN value.')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Adding SpeX Prism Spectral Library... SDSS J204317.69-155103.4                  "
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/Users/tomasstolker/applications/species/species/data/queries.py:209: UserWarning: No parallax was found for 2MASS J01340281+0508125 so storing a NaN value.\n",
      "  warnings.warn(f'No parallax was found for {target} so storing a NaN value.')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Adding SpeX Prism Spectral Library... 2MASS J13571237+1428398                   "
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/Users/tomasstolker/applications/species/species/data/queries.py:209: UserWarning: No parallax was found for 2MASS J21555848+2345307 so storing a NaN value.\n",
      "  warnings.warn(f'No parallax was found for {target} so storing a NaN value.')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Adding SpeX Prism Spectral Library... 2MASS J12373919+6526148                   "
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/Users/tomasstolker/applications/species/species/data/queries.py:209: UserWarning: No parallax was found for 2MASS J15575011-2952431 so storing a NaN value.\n",
      "  warnings.warn(f'No parallax was found for {target} so storing a NaN value.')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Adding SpeX Prism Spectral Library... SDSS J011912.22+240331.6                  "
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/Users/tomasstolker/applications/species/species/data/queries.py:209: UserWarning: No parallax was found for 2MASS J01191207+2403317 so storing a NaN value.\n",
      "  warnings.warn(f'No parallax was found for {target} so storing a NaN value.')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Adding SpeX Prism Spectral Library... SDSS J104842.84+011158.5                  "
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/Users/tomasstolker/applications/species/species/data/queries.py:209: UserWarning: No parallax was found for 2MASS J18282794+1453337 so storing a NaN value.\n",
      "  warnings.warn(f'No parallax was found for {target} so storing a NaN value.')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Adding SpeX Prism Spectral Library... 2MASS J23515044-2537367                   "
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/Users/tomasstolker/applications/species/species/data/queries.py:209: UserWarning: No parallax was found for 2MASS J02425693+2123204 so storing a NaN value.\n",
      "  warnings.warn(f'No parallax was found for {target} so storing a NaN value.')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Adding SpeX Prism Spectral Library... 2MASSW J1146345+223053                    "
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/Users/tomasstolker/applications/species/species/data/queries.py:209: UserWarning: No parallax was found for 2MASS J03431581+3210455 so storing a NaN value.\n",
      "  warnings.warn(f'No parallax was found for {target} so storing a NaN value.')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Adding SpeX Prism Spectral Library... 2MASS J09243114+2143536                   "
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/Users/tomasstolker/applications/species/species/data/queries.py:209: UserWarning: No parallax was found for 2MASS J10595185+3042059 so storing a NaN value.\n",
      "  warnings.warn(f'No parallax was found for {target} so storing a NaN value.')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Adding SpeX Prism Spectral Library... 2MASSI J2107316-030733                    "
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/Users/tomasstolker/applications/species/species/data/queries.py:209: UserWarning: No parallax was found for 2MASS J12474944-1117551 so storing a NaN value.\n",
      "  warnings.warn(f'No parallax was found for {target} so storing a NaN value.')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Adding SpeX Prism Spectral Library... 2MASS J13313310+3407583                   "
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/Users/tomasstolker/applications/species/species/data/queries.py:209: UserWarning: No parallax was found for 2MASS J02055138-0759253 so storing a NaN value.\n",
      "  warnings.warn(f'No parallax was found for {target} so storing a NaN value.')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Adding SpeX Prism Spectral Library... 2MASSW J0820299+450031                    "
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/Users/tomasstolker/applications/species/species/data/queries.py:209: UserWarning: No parallax was found for 2MASS J21513979+3402444 so storing a NaN value.\n",
      "  warnings.warn(f'No parallax was found for {target} so storing a NaN value.')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Adding SpeX Prism Spectral Library... 2MASS J12373441+3028596                   "
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/Users/tomasstolker/applications/species/species/data/queries.py:209: UserWarning: No parallax was found for 2MASS J12373441+3028596 so storing a NaN value.\n",
      "  warnings.warn(f'No parallax was found for {target} so storing a NaN value.')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Adding SpeX Prism Spectral Library... 2MASS J15561873+1300527                   "
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/Users/tomasstolker/applications/species/species/data/queries.py:209: UserWarning: No parallax was found for 2MASS J19163888-3700026 so storing a NaN value.\n",
      "  warnings.warn(f'No parallax was found for {target} so storing a NaN value.')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Adding SpeX Prism Spectral Library... DENIS-P J1228.2-1547                      "
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/Users/tomasstolker/applications/species/species/data/queries.py:209: UserWarning: No parallax was found for 2MASS J01472702+4731142 so storing a NaN value.\n",
      "  warnings.warn(f'No parallax was found for {target} so storing a NaN value.')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Adding SpeX Prism Spectral Library... 2MASS J05103520-4208140                   "
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/Users/tomasstolker/applications/species/species/data/queries.py:209: UserWarning: No parallax was found for 2MASS J13023811+5650212 so storing a NaN value.\n",
      "  warnings.warn(f'No parallax was found for {target} so storing a NaN value.')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Adding SpeX Prism Spectral Library... 2MASSW J1728114+394859                    "
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/Users/tomasstolker/applications/species/species/data/queries.py:209: UserWarning: No parallax was found for 2MASS J17451618-2903156 so storing a NaN value.\n",
      "  warnings.warn(f'No parallax was found for {target} so storing a NaN value.')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\r",
      "Adding SpeX Prism Spectral Library... LHS 217                                   "
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/Users/tomasstolker/applications/species/species/data/queries.py:209: UserWarning: No parallax was found for 2MASS J00025097+2454141 so storing a NaN value.\n",
      "  warnings.warn(f'No parallax was found for {target} so storing a NaN value.')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\r",
      "Adding SpeX Prism Spectral Library... SDSS J000250.98+245413.8                  "
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/Users/tomasstolker/applications/species/species/data/queries.py:209: UserWarning: No parallax was found for 2MASS J21210987+6557255 so storing a NaN value.\n",
      "  warnings.warn(f'No parallax was found for {target} so storing a NaN value.')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Adding SpeX Prism Spectral Library... SDSS J075840.33+324723.4                  "
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/Users/tomasstolker/applications/species/species/data/queries.py:209: UserWarning: No parallax was found for 2MASS J11582077+0435014 so storing a NaN value.\n",
      "  warnings.warn(f'No parallax was found for {target} so storing a NaN value.')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Adding SpeX Prism Spectral Library... 2MASS J18244344+2937133                   "
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/Users/tomasstolker/applications/species/species/data/queries.py:209: UserWarning: No parallax was found for 2MASS J20342948+6727398 so storing a NaN value.\n",
      "  warnings.warn(f'No parallax was found for {target} so storing a NaN value.')\n",
      "/Users/tomasstolker/applications/species/species/data/queries.py:209: UserWarning: No parallax was found for 2MASS J19415458+6826021 so storing a NaN value.\n",
      "  warnings.warn(f'No parallax was found for {target} so storing a NaN value.')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Adding SpeX Prism Spectral Library... 2MASS J21512543-2441000                   "
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/Users/tomasstolker/applications/species/species/data/queries.py:209: UserWarning: No parallax was found for 2MASS J05363776+1000232 so storing a NaN value.\n",
      "  warnings.warn(f'No parallax was found for {target} so storing a NaN value.')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Adding SpeX Prism Spectral Library... 2MASS J05341594-0631397                   "
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/Users/tomasstolker/applications/species/species/data/queries.py:209: UserWarning: No parallax was found for 2MASS J05341594-0631397 so storing a NaN value.\n",
      "  warnings.warn(f'No parallax was found for {target} so storing a NaN value.')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Adding SpeX Prism Spectral Library... 2MASSI J1047538+212423                    "
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/Users/tomasstolker/applications/species/species/data/queries.py:209: UserWarning: No parallax was found for 2MASS J14343616+2202463 so storing a NaN value.\n",
      "  warnings.warn(f'No parallax was found for {target} so storing a NaN value.')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Adding SpeX Prism Spectral Library... SDSS J003609.26+241343.3                  "
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/Users/tomasstolker/applications/species/species/data/queries.py:209: UserWarning: No parallax was found for 2MASS J00360925+2413434 so storing a NaN value.\n",
      "  warnings.warn(f'No parallax was found for {target} so storing a NaN value.')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Adding SpeX Prism Spectral Library... 2MASS J17220990-1158127AB                 "
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/Users/tomasstolker/applications/species/species/data/queries.py:209: UserWarning: No parallax was found for 2MASS J23512200+3010540 so storing a NaN value.\n",
      "  warnings.warn(f'No parallax was found for {target} so storing a NaN value.')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Adding SpeX Prism Spectral Library... 2MASS J15461461+4932114                   "
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/Users/tomasstolker/applications/species/species/data/queries.py:209: UserWarning: No parallax was found for 2MASS J15461461+4932114 so storing a NaN value.\n",
      "  warnings.warn(f'No parallax was found for {target} so storing a NaN value.')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Adding SpeX Prism Spectral Library... 2MASS J10461875+4441149                   "
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/Users/tomasstolker/applications/species/species/data/queries.py:209: UserWarning: No parallax was found for 2MASS J03001631+2130205 so storing a NaN value.\n",
      "  warnings.warn(f'No parallax was found for {target} so storing a NaN value.')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Adding SpeX Prism Spectral Library... SDSS J121951.45+312849.4                  "
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/Users/tomasstolker/applications/species/species/data/queries.py:209: UserWarning: No parallax was found for 2MASS J04190126+2802487 so storing a NaN value.\n",
      "  warnings.warn(f'No parallax was found for {target} so storing a NaN value.')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Adding SpeX Prism Spectral Library... HN Peg B                                  "
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/Users/tomasstolker/applications/species/species/data/queries.py:209: UserWarning: No parallax was found for 2MASS J10315064+3349595 so storing a NaN value.\n",
      "  warnings.warn(f'No parallax was found for {target} so storing a NaN value.')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Adding SpeX Prism Spectral Library... 2MASS J02271036-1624479                   "
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/Users/tomasstolker/applications/species/species/data/queries.py:209: UserWarning: No parallax was found for 2MASS J01481478+1202447 so storing a NaN value.\n",
      "  warnings.warn(f'No parallax was found for {target} so storing a NaN value.')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Adding SpeX Prism Spectral Library... DENIS-P J225210.73-173013.4               "
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/Users/tomasstolker/applications/species/species/data/queries.py:209: UserWarning: No parallax was found for 2MASS J04394748+2601407 so storing a NaN value.\n",
      "  warnings.warn(f'No parallax was found for {target} so storing a NaN value.')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Adding SpeX Prism Spectral Library... DENIS J124514.1-442907                    "
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/Users/tomasstolker/applications/species/species/data/queries.py:209: UserWarning: No parallax was found for 2MASS J04480182-0557254 so storing a NaN value.\n",
      "  warnings.warn(f'No parallax was found for {target} so storing a NaN value.')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\r",
      "Adding SpeX Prism Spectral Library... 2MASSI J1553022+153236                    "
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/Users/tomasstolker/applications/species/species/data/queries.py:209: UserWarning: No parallax was found for 2MASS J22274034+1753215 so storing a NaN value.\n",
      "  warnings.warn(f'No parallax was found for {target} so storing a NaN value.')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Adding SpeX Prism Spectral Library... [DONE]                                    \n"
     ]
    }
   ],
   "source": [
    "database.add_spectrum('spex')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The AMES-Cond en AMES-Dusty model spectra are also downloaded and included."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Downloading AMES-Cond model spectra (823 MB)... [DONE]\n",
      "Unpacking AMES-Cond model spectra (823 MB)... [DONE]\n",
      "Adding AMES-Cond model spectra... [DONE]                                        \n"
     ]
    }
   ],
   "source": [
    "database.add_model(model='ames-cond',\n",
    "                   wavel_range=(0.5, 10.),\n",
    "                   spec_res=1000.\n",
    "                   teff_range=(100., 4000.))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Downloading AMES-Dusty model spectra [Fe/H]=0.0 (106 MB)... [DONE]\n",
      "Unpacking AMES-Dusty model spectra [Fe/H]=0.0 (106 MB)... [DONE]\n",
      "Adding AMES-Dusty model spectra... [DONE]                                       \n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/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.\n",
      "  warnings.warn(f'Interpolation is not possible at the edge of the '\n"
     ]
    }
   ],
   "source": [
    "database.add_model(model='ames-dusty',\n",
    "                   wavel_range=(0.5, 10.),\n",
    "                   spec_res=1000.\n",
    "                   teff_range=(100., 4000.))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The AMES-Cond and AMES-Dusty isochones are downloaded."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'data/model.AMES-dusty.M-0.0.NaCo.Vega'"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "urllib.request.urlretrieve('https://phoenix.ens-lyon.fr/Grids/AMES-Cond/ISOCHRONES/model.AMES-Cond-2000.M-0.0.NaCo.Vega',\n",
    "                           'data/model.AMES-Cond-2000.M-0.0.NaCo.Vega')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "urllib.request.urlretrieve('https://phoenix.ens-lyon.fr/Grids/AMES-Dusty/ISOCHRONES/model.AMES-dusty.M-0.0.NaCo.Vega',\n",
    "                           'data/model.AMES-dusty.M-0.0.NaCo.Vega')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "And added to the database."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Adding isochrones: iso_ames-cond... [DONE]\n"
     ]
    }
   ],
   "source": [
    "database.add_isochrones(filename='data/model.AMES-Cond-2000.M-0.0.NaCo.Vega',\n",
    "                        isochrone_tag='iso_ames-cond')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Adding isochrones: iso_ames-dusty... [DONE]\n"
     ]
    }
   ],
   "source": [
    "database.add_isochrones(filename='data/model.AMES-dusty.M-0.0.NaCo.Vega',\n",
    "                        isochrone_tag='iso_ames-dusty')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Synthetic colors and magnitudes"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "For the narrowband filters of SPHERE, the synthetic colors and magnitudes are computed from the SpeX spectra. An object of `ReadColorMagnitude` is initiated."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [],
   "source": [
    "read_color = species.ReadColorMagnitude(library='spex',\n",
    "                                        filters_color=('Paranal/SPHERE.IRDIS_D_H23_2', 'Paranal/SPHERE.IRDIS_D_H23_3'),\n",
    "                                        filter_mag='Paranal/SPHERE.IRDIS_D_H23_2')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "All spectra are used and the colors and magnitudes are stored in a `ColorMagObject`."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [],
   "source": [
    "colorbox = read_color.get_color_magnitude(object_type=None)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Next, the isochrone data is selected with the functionalities of `ReadIsochrone`."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [],
   "source": [
    "read_iso_cond = species.ReadIsochrone(isochrone_tag='iso_ames-cond')\n",
    "read_iso_dusty = species.ReadIsochrone(isochrone_tag='iso_ames-dusty')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The atmospheric model for each of the isochrones is chosen together with an age and masses. The `get_color_magnitude` function will return a `ColorMagBox` object."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [],
   "source": [
    "modelcolor1 = read_iso_cond.get_color_magnitude(age=age,\n",
    "                                                masses=masses,\n",
    "                                                model='ames-cond',\n",
    "                                                filters_color=('Paranal/SPHERE.IRDIS_D_H23_2', 'Paranal/SPHERE.IRDIS_D_H23_3'),\n",
    "                                                filter_mag='Paranal/SPHERE.IRDIS_D_H23_2')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [],
   "source": [
    "modelcolor2 = read_iso_dusty.get_color_magnitude(age=age,\n",
    "                                                 masses=masses,\n",
    "                                                 model='ames-dusty',\n",
    "                                                 filters_color=('Paranal/SPHERE.IRDIS_D_H23_2', 'Paranal/SPHERE.IRDIS_D_H23_3'),\n",
    "                                                 filter_mag='Paranal/SPHERE.IRDIS_D_H23_2')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Selecting directly imaged planets"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The directly imaged planets and brown dwarfs are selected by their database tag. The filters for the colors and magnitudes have to be present in the database."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [],
   "source": [
    "objects = [('HIP 65426 b', 'Paranal/SPHERE.IRDIS_D_H23_2', 'Paranal/SPHERE.IRDIS_D_H23_3', 'Paranal/SPHERE.IRDIS_D_H23_2'),\n",
    "           ('HR 8799 b', 'Paranal/SPHERE.IRDIS_D_H23_2', 'Paranal/SPHERE.IRDIS_D_H23_3', 'Paranal/SPHERE.IRDIS_D_H23_2'),\n",
    "           ('HR 8799 d', 'Paranal/SPHERE.IRDIS_D_H23_2', 'Paranal/SPHERE.IRDIS_D_H23_3', 'Paranal/SPHERE.IRDIS_D_H23_2'),\n",
    "           ('PZ Tel B', 'Paranal/SPHERE.IRDIS_D_H23_2', 'Paranal/SPHERE.IRDIS_D_H23_3', 'Paranal/SPHERE.IRDIS_D_H23_2')]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Plotting a color-magnitude diagram"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The color-magnitude diagram is now created by providing the `ColorMagBox` objects, which will be interpreted by `plot_color_magnitude`."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Plotting color-magnitude diagram: color_mag.png... [DONE]\n"
     ]
    }
   ],
   "source": [
    "species.plot_color_magnitude(boxes=[colorbox, modelcolor1, modelcolor2],\n",
    "                             objects=objects,\n",
    "                             mass_labels=[3., 5., 10., 20., 50., 100., 200., 500.],\n",
    "                             companion_labels=True,\n",
    "                             field_range=('late M', 'late T'),\n",
    "                             label_x='H2 - H3 [mag]',\n",
    "                             label_y='M$_\\mathregular{H2}$ [mag]',\n",
    "                             xlim=(-2.7, 1.8),\n",
    "                             ylim=(17.3, 4),\n",
    "                             offset=(-0.07, -0.1),\n",
    "                             legend=(0.07, 0.82),\n",
    "                             output='color_mag.png')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Let's have a look at the plot. As expected, towards later type objects, the colors becomes blue due to CH<sub>4</sub> absorption across the H3 filter."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "[encoded data, 52360 characters]\n",
      "text/plain": [
       "<IPython.core.display.Image object>"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from IPython.display import Image\n",
    "Image('color_mag.png') "
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
