diff --git a/docs/_images/color_mag.png b/docs/_images/color_mag.png index 80dbb794..fe302a70 100644 Binary files a/docs/_images/color_mag.png and b/docs/_images/color_mag.png differ diff --git a/docs/examples.rst b/docs/examples.rst index a940410d..b0a3223c 100644 --- a/docs/examples.rst +++ b/docs/examples.rst @@ -100,7 +100,8 @@ Here photometric data of 51 Eri b (Rajan et al. 2017) is added to the database. database = species.Database() database.add_companion(name=None) - object_cmd = ('51 Eri b', 'MKO/NSFCam.J', 'MKO/NSFCam.H', 'MKO/NSFCam.J') + object1 = ('beta Pic b', 'Paranal/NACO.J', 'Paranal/NACO.H', 'Paranal/NACO.J') + object2 = ('51 Eri b', 'MKO/NSFCam.J', 'MKO/NSFCam.H', 'MKO/NSFCam.J') colormag = species.ReadColorMagnitude(library=('vlm-plx', ), filters_color=('MKO/NSFCam.J', 'MKO/NSFCam.H'), @@ -109,11 +110,11 @@ Here photometric data of 51 Eri b (Rajan et al. 2017) is added to the database. colorbox = colormag.get_color_magnitude(object_type='field') species.plot_color_magnitude(colorbox=colorbox, - objects=(object_cmd, ), + objects=(object1, object2), label_x='J - H [mag]', label_y='M$_\mathregular{J}$ [mag]', - output='color_mag.pdf') - + output='color_mag.pdf', + legend='upper left') .. image:: _images/color_mag.png :width: 70% diff --git a/docs/species.read.rst b/docs/species.read.rst index e3b4aa5d..7fc68b3b 100644 --- a/docs/species.read.rst +++ b/docs/species.read.rst @@ -4,10 +4,10 @@ species.read package Submodules ---------- -species.read.read\_colormag module ----------------------------------- +species.read.read\_color module +------------------------------- -.. automodule:: species.read.read_colormag +.. automodule:: species.read.read_color :members: :undoc-members: :show-inheritance: diff --git a/species/analysis/fit.py b/species/analysis/fit.py index 913be929..899549e3 100644 --- a/species/analysis/fit.py +++ b/species/analysis/fit.py @@ -51,13 +51,13 @@ def lnprior(param, if bounds[item][0] <= param[i] <= bounds[item][1]: - if prior[0] == 'mass': + if prior is None: + ln_prior = 0. + + elif prior[0] == 'mass': mass = read_model.get_mass(modeldict) ln_prior = -0.5*(mass-prior[1])**2/prior[2]**2 - else: - ln_prior = 0. - else: ln_prior = -np.inf break diff --git a/species/data/companions.py b/species/data/companions.py index f922263e..bc39eeb3 100644 --- a/species/data/companions.py +++ b/species/data/companions.py @@ -36,59 +36,70 @@ def get_data(): 'Keck/NIRC2.Lp':(16.20, 0.11), # Rajan et al. 2017 'Keck/NIRC2.Ms':(16.1, 0.5)}}, # Rajan et al. 2017 - # 'HR 8799 b':{'distance':41.29, - # 'app_mag':{'':(), - # '':(), - # '':(), - # '':(), - # '':(), - # '':(), - # '':()}}, - - # 'HR 8799 c':{'distance':41.29, - # 'app_mag':{'':(), - # '':(), - # '':(), - # '':(), - # '':(), - # '':(), - # '':()}}, - - # 'HR 8799 d':{'distance':41.29, - # 'app_mag':{'':(), - # '':(), - # '':(), - # '':(), - # '':(), - # '':(), - # '':()}}, - - # 'HR 8799 e':{'distance':41.29, - # 'app_mag':{'':(), - # '':(), - # '':(), - # '':(), - # '':(), - # '':(), - # '':()}}, - - # 'HD 95086 b':{'distance':86.44, - # 'app_mag':{'':(), - # '':(), - # '':(), - # '':(), - # '':(), - # '':(), - # '':()}}, - - # '2M1207 B':{'distance':64.42, - # 'app_mag':{'':(), - # '':(), - # '':(), - # '':(), - # '':(), - # '':(), - # '':()}}, + 'HR 8799 b':{'distance':41.29, + 'app_mag':{'Subaru/CIAO.z':(21.22, 0.29), # Currie et al. 2011 + 'Paranal/SPHERE.IRDIS_B_J':(19.78, 0.09), # Zurlo et al. 2016 + 'Keck/NIRC2.H':(18.05, 0.09), # Currie et al. 2012 + 'Paranal/SPHERE.IRDIS_D_H23_2':(18.08, 0.14), # Zurlo et al. 2016 + 'Paranal/SPHERE.IRDIS_D_H23_3':(17.78, 0.10), # Zurlo et al. 2016 + 'Keck/NIRC2.Ks':(17.03, 0.08), # Marois et al. 2010 + 'Paranal/SPHERE.IRDIS_D_K12_1':(17.15, 0.06), # Zurlo et al. 2016 + 'Paranal/SPHERE.IRDIS_D_K12_2':(16.97, 0.09), # Zurlo et al. 2016 + 'Keck/NIRC2.Lp':(15.58, 0.10), # Currie et al. 2014 + 'Keck/NIRC2.Ms':(16.05, 0.30)}}, # Galicher et al. 2011 + + 'HR 8799 c':{'distance':41.29, + 'app_mag':{'Paranal/SPHERE.IRDIS_B_J':(18.60, 0.13), # Zurlo et al. 2016 + 'Keck/NIRC2.H':(17.06, 0.13), # Currie et al. 2012 + 'Paranal/SPHERE.IRDIS_D_H23_2':(17.09, 0.12), # Zurlo et al. 2016 + 'Paranal/SPHERE.IRDIS_D_H23_3':(16.78, 0.10), # Zurlo et al. 2016 + 'Keck/NIRC2.Ks':(16.11, 0.08), # Marois et al. 2010 + 'Paranal/SPHERE.IRDIS_D_K12_1':(16.19, 0.05), # Zurlo et al. 2016 + 'Paranal/SPHERE.IRDIS_D_K12_2':(15.86, 0.07), # Zurlo et al. 2016 + 'Keck/NIRC2.Lp':(15.72, 0.08), # Currie et al. 2014 + 'Keck/NIRC2.Ms':(15.03, 0.14)}}, # Galicher et al. 2011 + + 'HR 8799 d':{'distance':41.29, + 'app_mag':{'Paranal/SPHERE.IRDIS_B_J':(18.59, 0.37), # Zurlo et al. 2016 + 'Keck/NIRC2.H':(16.71, 0.24), # Currie et al. 2012 + 'Paranal/SPHERE.IRDIS_D_H23_2':(17.02, 0.17), # Zurlo et al. 2016 + 'Paranal/SPHERE.IRDIS_D_H23_3':(16.68, 0.21), # Zurlo et al. 2016 + 'Keck/NIRC2.Ks':(16.09, 0.12), # Marois et al. 2010 + 'Paranal/SPHERE.IRDIS_D_K12_1':(16.20, 0.07), # Zurlo et al. 2016 + 'Paranal/SPHERE.IRDIS_D_K12_2':(15.84, 0.10), # Zurlo et al. 2016 + 'Keck/NIRC2.Lp':(14.56, 0.09), # Currie et al. 2014 + 'Keck/NIRC2.Ms':(14.65, 0.35)}}, # Galicher et al. 2011 + + 'HR 8799 e':{'distance':41.29, + 'app_mag':{'Paranal/SPHERE.IRDIS_B_J':(18.40, 0.21), # Zurlo et al. 2016 + 'Paranal/SPHERE.IRDIS_D_H23_2':(16.91, 0.20), # Zurlo et al. 2016 + 'Paranal/SPHERE.IRDIS_D_H23_3':(16.85, 0.16), # Zurlo et al. 2016 + 'Keck/NIRC2.Ks':(15.91, 0.22), # Marois et al. 2010 + 'Paranal/SPHERE.IRDIS_D_K12_1':(16.12, 0.10), # Zurlo et al. 2016 + 'Paranal/SPHERE.IRDIS_D_K12_2':(15.82, 0.11), # Zurlo et al. 2016 + 'Keck/NIRC2.Lp':(14.55, 0.12)}}, # Currie et al. 2014 + + 'HD 95086 b':{'distance':86.44, + 'app_mag':{'Gemini/GPI.H':(20.51, 0.25), # De Rosa et al. 2016 + 'Gemini/GPI.K1':(18.99, 0.20), # De Rosa et al. 2016 + 'Paranal/NACO.Lp':(16.27, 0.19)}}, # De Rosa et al. 2016 + + 'PDS 70 b':{'distance':113.43, + 'app_mag':{'Paranal/SPHERE.IRDIS_D_H23_2':(17.94, 0.24), # Keppler et al. 2018 + 'Paranal/SPHERE.IRDIS_D_H23_3':(17.95, 0.17), # Keppler et al. 2018 + 'Paranal/SPHERE.IRDIS_D_K12_1':(16.65, 0.06), # Müller et al. 2018 + 'Paranal/SPHERE.IRDIS_D_K12_2':(16.44, 0.05), # Müller et al. 2018 + 'Paranal/NACO.Lp':(14.75, 0.62)}}, # Keppler et al. 2018 + + '2M1207 b':{'distance':64.42, + 'app_mag':{'HST/NICMOS1.F090M':(22.58, 0.35), # Song et al. 2006 + 'HST/NICMOS1.F145M':(19.05, 0.03), # Song et al. 2006 + 'HST/NICMOS1.F160W':(18.27, 0.02), # Song et al. 2006 + 'Paranal/NACO.J':(20.0, 0.20), # Mohanty et al. 200z + 'Paranal/NACO.H':(18.09, 0.21), # Chauvin et al. 2004 + 'Paranal/NACO.Ks':(16.93, 0.11), # Chauvin et al. 2004 + # 'Magellan/MagAO.3.3':(15.46, 0.10), # Skemer et al. 2014 + 'Paranal/NACO.Lp':(15.28, 0.14)}}, # Chauvin et al. 2004 'AB Pic B':{'distance':50.12, 'app_mag':{'Paranal/NACO.J':(16.18, 0.10), # Chauvin et al. 2005 @@ -99,20 +110,22 @@ def get_data(): 'app_mag':{'Paranal/SPHERE.IRDIS_B_H':(16.79, 0.06), # Milli et al. 2016 'Paranal/SPHERE.IRDIS_D_K12_1':(15.2, 0.10), # Chauvin et al. 2017 'Paranal/SPHERE.IRDIS_D_K12_2':(14.88, 0.09), # Chauvin et al. 2017 - 'Paranal/NACO.Lp':(13.43, 0.16)}}, # Milli et al. 2016, error is +0.17, -0.15? + # 'Paranal/NACO.NB405':(), # Stolker et al. in prep. # 'Paranal/NACO.Mp':(), # Stolker et al. in prep. - - # 'GQ Lup B':{'distance':151.82, - # 'app_mag':{'':(), - # '':(), - # '':(), - # '':(), - # '':(), - # '':(), - # '':()}}, + 'Paranal/NACO.Lp':(13.43, 0.16)}}, # Milli et al. 2016, error is +0.17, -0.15 + + 'GQ Lup B':{'distance':151.82, + 'app_mag':{'HST/WFPC2.f606w':(19.19, 0.07), # Marois et al. 2006 + 'HST/WFPC2.f814w':(17.67, 0.05), # Marois et al. 2006 + 'HST/NICMOS2.F171M':(13.84, 0.13), # Marois et al. 2006 + 'HST/NICMOS2.F190N':(14.08, 0.20), # Marois et al. 2006 + 'HST/NICMOS2.F215N':(13.40, 0.15), # Marois et al. 2006 + 'Subaru/CIAO.CH4s':(13.76, 0.26), # Marois et al. 2006 + 'Subaru/CIAO.K':(13.37, 0.12), # Marois et al. 2006 + 'Subaru/CIAO.Lp':(12.44, 0.22)}}, # Marois et al. 2006 'PZ Tel B':{'distance':47.13, - 'app_mag':{'Paranal/SPHERE.ZIMPOL_R_PRIM':(17.84, 0.3), # Maire et al. 2015, error is +0.22, −0.31? + 'app_mag':{'Paranal/SPHERE.ZIMPOL_R_PRIM':(17.84, 0.3), # Maire et al. 2015, error is +0.22, −0.31 'Paranal/SPHERE.ZIMPOL_I_PRIM':(15.16, 0.12), # Maire et al. 2015 'Paranal/SPHERE.IRDIS_D_H23_2':(11.78, 0.19), # Maire et al. 2015 'Paranal/SPHERE.IRDIS_D_H23_3':(11.65, 0.19), # Maire et al. 2015 @@ -127,51 +140,49 @@ def get_data(): 'Gemini/NICI.ED286':(11.68, 0.14), # Biller et al. 2010 'Gemini/NIRI.H2S1v2-1-G0220':(11.39, 0.14)}}, # Biller et al. 2010 - # 'kappa And B':{'distance':50.06, - # 'app_mag':{'':(), - # '':(), - # '':(), - # '':(), - # '':(), - # '':(), - # '':()}}, + 'kappa And b':{'distance':50.06, + 'app_mag':{'Subaru/CIAO.J':(15.86, 0.21), # Bonnefoy et al. 2014 + 'Subaru/CIAO.H':(14.95, 0.13), # Bonnefoy et al. 2014 + 'Subaru/CIAO.Ks':(14.32, 0.09), # Bonnefoy et al. 2014 + 'Keck/NIRC2.Lp':(13.12, 0.1), # Bonnefoy et al. 2014 + # 'Keck/NIRC2.NB_4.05':(13.0, 0.2), # Bonnefoy et al. 2014 + 'LBT/LMIRCam.M_77K':(13.3, 0.3)}}, # Bonnefoy et al. 2014 'GJ 504 b':{'distance':17.54, - 'app_mag':{'Paranal/SPHERE.IRDIS_D_Y23_2':(20.98, 0.20), - 'Paranal/SPHERE.IRDIS_D_Y23_3':(20.14, 0.09), - # 'Paranal/SPHERE.IRDIS_D_J23_2':(>21.28, ), - 'Paranal/SPHERE.IRDIS_D_J23_3':(19.01, 0.17), - 'Paranal/SPHERE.IRDIS_D_H23_2':(18.95, 0.30), - 'Paranal/SPHERE.IRDIS_D_H23_3':(21.81, 0.35), - 'Paranal/SPHERE.IRDIS_D_K12_1':(18.77, 0.20), - # 'Paranal/SPHERE.IRDIS_D_K12_2':(>19.96, ), - 'Subaru/CIAO.J':(19.78, 0.10), - 'Subaru/CIAO.H':(20.01, 0.14), - 'Subaru/CIAO.Ks':(19.38, 0.11), - 'Subaru/CIAO.CH4s':(19.58, 0.13), - # 'Subaru/CIAO.CH4l':(>20.63, ), - # 'LBTI/LMIRcam.L_NB6':(17.59, 0.17), - # 'LBTI/LMIRcam.L_NB7':(16.47, 0.19), - # 'LBTI/LMIRcam.L_NB8':(15.85, 0.17), - 'Subaru/IRCS.Lp':(16.70, 0.17)}}, - - # 'GU Psc B':{'distance':47.61, - # 'app_mag':{'':(), - # '':(), - # '':(), - # '':(), - # '':(), - # '':(), - # '':()}}, - - # '1RXS 1609 B':{'distance':139.67, - # 'app_mag':{'':(), - # '':(), - # '':(), - # '':(), - # '':(), - # '':(), - # '':()}}, + 'app_mag':{'Paranal/SPHERE.IRDIS_D_Y23_2':(20.98, 0.20), # Bonnefoy et al. 2018 + 'Paranal/SPHERE.IRDIS_D_Y23_3':(20.14, 0.09), # Bonnefoy et al. 2018 + # 'Paranal/SPHERE.IRDIS_D_J23_2':(>21.28, ), # Bonnefoy et al. 2018 + 'Paranal/SPHERE.IRDIS_D_J23_3':(19.01, 0.17), # Bonnefoy et al. 2018 + 'Paranal/SPHERE.IRDIS_D_H23_2':(18.95, 0.30), # Bonnefoy et al. 2018 + 'Paranal/SPHERE.IRDIS_D_H23_3':(21.81, 0.35), # Bonnefoy et al. 2018 + 'Paranal/SPHERE.IRDIS_D_K12_1':(18.77, 0.20), # Bonnefoy et al. 2018 + # 'Paranal/SPHERE.IRDIS_D_K12_2':(>19.96, ), # Bonnefoy et al. 2018 + 'Subaru/CIAO.J':(19.78, 0.10), # Janson et al. 2013 + 'Subaru/CIAO.H':(20.01, 0.14), # Janson et al. 2013 + 'Subaru/CIAO.Ks':(19.38, 0.11), # Janson et al. 2013 + 'Subaru/CIAO.CH4s':(19.58, 0.13), # Janson et al. 2013 + # 'Subaru/CIAO.CH4l':(>20.63, ), # Janson et al. 2013 + # 'LBTI/LMIRcam.L_NB6':(17.59, 0.17), # Skemer et al. 2016 + # 'LBTI/LMIRcam.L_NB7':(16.47, 0.19), # Skemer et al. 2016 + # 'LBTI/LMIRcam.L_NB8':(15.85, 0.17), # Skemer et al. 2016 + 'Subaru/IRCS.Lp':(16.70, 0.17)}}, # Kuzuhara et al. 2013 + + 'GU Psc b':{'distance':47.61, + 'app_mag':{'Gemini/GMOS-S.z':(21.75, 0.07), # Naud et al. 2014 + 'CFHT/Wircam.Y':(19.4, 0.05), # Naud et al. 2014 + 'CFHT/Wircam.J':(18.12, 0.03), # Naud et al. 2014 + 'CFHT/Wircam.H':(17.70, 0.03), # Naud et al. 2014 + 'CFHT/Wircam.Ks':(17.40, 0.03), # Naud et al. 2014 + 'WISE/WISE.W1':(17.17, 0.33), # Naud et al. 2014 + 'WISE/WISE.W2':(15.41, 0.22)}}, # Naud et al. 2014 + + '1RXS 1609 B':{'distance':139.67, + 'app_mag':{'Gemini/NIRI.J-G0202w':(17.90, 0.12), # Lafreniere et al. 2008 + 'Gemini/NIRI.H-G0203w':(16.87, 0.07), # Lafreniere et al. 2008 + 'Gemini/NIRI.K-G0204w':(16.17, 0.18), # Lafreniere et al. 2008 + # 'MMT/Clio.3.1':(15.65, 0.21), # Bailey et al. 2013 + # 'MMT/Clio.3.3':(15.2, 0.16), # Bailey et al. 2013 + 'Gemini/NIRI.Lprime-G0207w':(14.8, 0.3)}}, # Lafreniere et al. 2010 'GSC 06214 B':{'distance':108.84, 'app_mag':{'MKO/NSFCam.J':(16.24, 0.04), # Ireland et al. 2011 diff --git a/species/plot/plot_color.py b/species/plot/plot_color.py index eda68c5e..f3a28e76 100644 --- a/species/plot/plot_color.py +++ b/species/plot/plot_color.py @@ -22,6 +22,7 @@ plt.rc('axes', edgecolor='black', linewidth=2) +marker = itertools.cycle(('o', 's', 'p', '<', '>', 'p', 'v', '^', '*', 'd', 'x', '+', '1', '2', '3', '4')) def plot_color_magnitude(colorbox, objects, @@ -58,8 +59,6 @@ def plot_color_magnitude(colorbox, sys.stdout.write('Plotting color-magnitude diagram: '+output+'... ') sys.stdout.flush() - marker = itertools.cycle(('o', 's', 'p', '<', '>', 'P', 'v', '^', '*')) - plt.figure(1, figsize=(4, 4.8)) gridsp = mpl.gridspec.GridSpec(3, 1, height_ratios=[0.2, 0.1, 4.5]) gridsp.update(wspace=0., hspace=0., left=0, right=1, bottom=0, top=1) @@ -192,8 +191,6 @@ def plot_color_color(colorbox, sys.stdout.write('Plotting color-color diagram: '+output+'... ') sys.stdout.flush() - marker = itertools.cycle(('o', 's', 'p', '<', '>', 'P', 'v', '^', '*')) - plt.figure(1, figsize=(4, 4.3)) gridsp = mpl.gridspec.GridSpec(3, 1, height_ratios=[0.2, 0.1, 4.]) gridsp.update(wspace=0., hspace=0., left=0, right=1, bottom=0, top=1)