In [1]:
%matplotlib inline
%reload_ext autoreload
%autoreload 2
import os
import h5py
import numpy as np
import astropy.units as units
from isoclassify import DATADIR
from isoclassify.direct import classify as classify_direct
from isoclassify.extinction import query_dustmodel_coords
In [2]:
fn = os.path.join(DATADIR,'bcgrid.h5')
bcmodel = h5py.File(fn,'r', driver='core', backing_store=False)
In [3]:
x = classify_direct.obsdata()
x.addcoords(292.0826387546914, 37.05987401545169)
We then specify the reddening (dust) map to use. Here, we choose Green et al. (2019), a.k.a. Bayestar19 (see here for more information).
If we don't want to use a reddening map, isoclassify fits for Av. In this case specify dustmap = 'none'
. Alternatively, if you want to assume no reddening, use dustmap = 'zero'
. In both cases, the Cardelli et al. (1989) reddening law is assumed.
In [4]:
dustmap = 'green19'
dustmodel, ext = query_dustmodel_coords(x.ra, x.dec, dustmap)
In [5]:
# SPECTROSCOPY
# [Teff, logg, FeH] and [sigma_Teff, sigma_logg, sigma_FeH]
x.addspec([5777.,4.44,0.0],[60.,0.07,0.04])
# PARALLAX
x.addplx(0.07,0.007)
# 2MASS PHOTOMETRY
x.addjhk([4.38,4.04,4.00],[0.03,0.03,0.03])
# MAGNITUDE
# To use for the distance modulus
x.addmag([4.38],[0.03])
In [6]:
paras = classify_direct.stparas(x, bcmodel=bcmodel, dustmodel=dustmodel, band='jmag', ext=ext, plot=1)
NB: currently, spread on the Av posterior is only due to its variation within the distance uncertainty. It appears Bayestar19 varies very little with distance, hence the extremely narrow posterior. An assumed uncertainty of 0.02 is made in the code for the propagation of uncertainty.
In [ ]: