In [302]:
try:
reload(gaia_rc)
except NameError:
import gaia_rc
import numpy
from apogee.samples import rc
figsize(8,6)
Compare to Girardi & Salaris using $G-i= 0.4$, $I-i= -0.45$ (Jordi et al. 2006) $\rightarrow$ $G-I= 0.85$ $\rightarrow$ $G = I+0.85$; seems to agree for solar at least
In [171]:
iso= gaia_rc.load_iso()
In [156]:
ages= iso.logages()
ages= ages[ages >= 9.]
plot(10.**(ages-9.),[gaia_rc.G(a,0.017,iso)[0] for a in ages])
plot(10.**(ages-9.),[gaia_rc.G(a,0.0035,iso)[0] for a in ages])
plot(10.**(ages-9.),[gaia_rc.G(a,0.035,iso)[0] for a in ages])
Out[156]:
In [267]:
Zs= iso.Zs()
tage= iso.logages()[62]
plot(Zs,[gaia_rc.G(tage,z,iso)[0] for z in Zs],'-')
plot(gaia_rc.load_ZG(iso,s=0.00005)(numpy.linspace(0.1,0.9,101)),numpy.linspace(0.1,0.9,101),'r-')
plot(Zs,[gaia_rc.G(tage,z,iso)[1]*10. for z in Zs],'-')
ylim(2,-2)
xlim(0.,0.06)
Out[267]:
In [301]:
Gs= numpy.linspace(0.1,1.9,201)
ZG= gaia_rc.load_ZG(iso)
pG= numpy.array([gaia_rc.Gdist(g,ZG) for g in Gs])
m,s= numpy.sum(Gs*pG)/numpy.sum(pG), numpy.sqrt(numpy.sum(Gs**2.*pG)/numpy.sum(pG)-(numpy.sum(Gs*pG)/numpy.sum(pG))**2.)
plot(Gs,pG/numpy.sum(pG)/(Gs[1]-Gs[0]))
#plot(Gs,1./numpy.sqrt(2.*numpy.pi)/s*numpy.exp(-0.5*(Gs-m)**2./s**2.))
xlim(0.,1.)
Gmax= Gs[numpy.argmax(pG)]
sGs= Gs[Gs < Gmax]
spG= pG[Gs < Gmax]
lGs= Gs[Gs > Gmax]
lpG= pG[Gs > Gmax]
f= (lGs[numpy.argmin(numpy.fabs(lpG-numpy.nanmax(pG)/2.))]-sGs[numpy.argmin(numpy.fabs(spG-numpy.nanmax(pG)/2.))])/2.355
print "mean = %f, std. dev. = %f, std.dev from fwhm = %f" % (m,s,f)
In [305]:
Gs= numpy.linspace(0.1,1.9,201)
ZG= gaia_rc.load_ZG(iso)
pG= numpy.array([gaia_rc.Gdist(g,ZG) for g in Gs])
plot(Gs,pG/numpy.sum(pG)/(Gs[1]-Gs[0]))
xlim(0.,1.)
Gsamples= gaia_rc.sample_Gdist(iso,n=100000)
hist(Gsamples,bins=101,histtype='step',normed=True)
Out[305]:
In [307]:
Gs[numpy.argmax(pG/numpy.sum(pG)/(Gs[1]-Gs[0]))]
Out[307]:
In [280]:
In [280]:
In [280]:
In [280]:
In [ ]: