In [2]:
%pylab inline
from astropy.io import fits


Populating the interactive namespace from numpy and matplotlib

In [21]:
print('## Local normalisation, compare to Czekaj+14 table 7 ##')
outputDir = '../output/more_bulge_100pc'
#outputDir = '../output/mockcat_new_SFR_new_IMF_100pc_more_thick'
x = fits.getdata(outputDir + '/' + 'GDR2mock_20.7Gmag.fits')
smaller_sphere = 50
sphere = (4/3)*np.pi*smaller_sphere**3
for popid in np.arange(9):
    selection = (x.popid==popid) & (x.logg < 7) & (np.divide(1,x.parallax)<smaller_sphere/1000)
    if (popid!=8):
        print('popid=',popid,' %.1f Msun/pc^3*10^-3' %(sum(x.smass[selection])/sphere*1000))
    else:
        print('popid=',popid,' %.1f Msun/pc^3*10^-6' %(sum(x.smass[selection])/sphere*1e6))

selection = (x.popid<=6) & (x.logg > 7)& (np.divide(1,x.parallax)<smaller_sphere/1000)
print('thindisc WD',' %.1f Msun/pc^3*10^-3 %.1f mact' %(sum(x.smass[selection])/sphere*1000,sum(x.mact[selection])/sphere*1000))
selection = (x.popid==7) & (x.logg > 7)& (np.divide(1,x.parallax)<smaller_sphere/1000)
print('thick disc WD',' %.1f Msun/pc^3*10^-3 %.1f mact' %(sum(x.smass[selection])/sphere*1000,sum(x.mact[selection])/sphere*1000))


## Local normalisation, compare to Czekaj+14 table 7 ##
popid= 0  2.0 Msun/pc^3*10^-3
popid= 1  5.6 Msun/pc^3*10^-3
popid= 2  4.3 Msun/pc^3*10^-3
popid= 3  3.5 Msun/pc^3*10^-3
popid= 4  6.1 Msun/pc^3*10^-3
popid= 5  5.9 Msun/pc^3*10^-3
popid= 6  11.1 Msun/pc^3*10^-3
popid= 7  2.5 Msun/pc^3*10^-3
popid= 8  8.2 Msun/pc^3*10^-6
thindisc WD  13.2 Msun/pc^3*10^-3 4.4 mact
thick disc WD  5.9 Msun/pc^3*10^-3 2.0 mact

In [3]:
# Galaxia parametrization
sfrv = np.array([1.60552043, 1.79400035, 2.02272975, 2.42164718,3.07851692, 4.15556317])
#thindisk0
hr1=5.0;
hr2=3.0;
rho0=1.5120222/(5.5683282*(hr1*hr1*hr1-hr2*hr2*hr2))
print(rho0)
rho0=2.37/(5.5683282*(hr1*hr1*hr1-hr2*hr2*hr2))
print(rho0)

#thindisk1        
hr1=2.400#the value now is used in Czekaj+2014, 2.200; used in Reyle+2009//2.530; used in Robin+ 2003, Galaxia original 
hr2=1.320#;
for i,sfr in enumerate(sfrv):
    rho0=sfr/(23.719602*(hr1*hr1*hr1-hr2*hr2*hr2))
    print(i+1, rho0)
#thickdisc        
hr1=2.5;
hr2=0.8;
xl=0.4;
c1=1/((hr2*xl)*(2+xl/hr2));
c2=np.exp(xl/hr2)/(1+0.5*xl/hr2);
rho0=1.34e6*4.4634;
print(rho0)
#Halo:
ac=0.5;
rho0=9.32e3*6.4159*1.1;

        
        
#Bulge:
rho0=0.255*13.7e9;
a=78.9 ; b=3.5; g=91.3;
x0=1.59; y0=0.424; z0=0.424;
Rc=2.54;


0.0027708133222434112
0.004343076162318837
1 0.005873594806356947
2 0.006563124916674242
3 0.007399902693398728
4 0.008859291998717789
5 0.011262367425990327
6 0.015202605832178794
5980956.0

In [4]:
agev = np.array([0.075e9, 0.575e9 ,1.5e9, 2.5e9, 4e9,   6e9,   8.5e9])
agev = np.divide(agev,1e9)
dagev = np.array([0.075e9, 0.425e9, 0.5e9, 0.5e9, 1e9,   1e9,   1.5e9])
dagev = np.divide(dagev,1e9)

In [5]:
print('## Local normalisation, compare to Czekaj+14 table 7 ##')
outputDir = '../output/GDR2mock_207'
#outputDir = '../output/mockcat_new_SFR_new_IMF_100pc_more_thick'
x = fits.getdata(outputDir + '/' + 'GDR2mock_50pc.fits')
smaller_sphere = 50
sphere = (4/3)*np.pi*smaller_sphere**3
for i in np.arange(7):
    selection = (x.age<agev[i]+dagev[i]) & (x.age > agev[i]-dagev[i]) 
    print('popid=',i,' %.1f Msun/pc^3*10^-3' %(sum(x.mass[selection])/sphere*1e3))

selection = (x.age>=10) & (x.age <= 11)
print('thick disc',' %.1f Msun/pc^3*10^-3' %(sum(x.mass[selection])/sphere*1000))
selection = (x.age>11)
print('halo',' %.1f Msun/pc^3*10^-6' %(sum(x.mass[selection])/sphere*1e6))


## Local normalisation, compare to Czekaj+14 table 7 ##
popid= 0  2.9 Msun/pc^3*10^-3
popid= 1  7.6 Msun/pc^3*10^-3
popid= 2  5.3 Msun/pc^3*10^-3
popid= 3  3.8 Msun/pc^3*10^-3
popid= 4  5.7 Msun/pc^3*10^-3
popid= 5  4.6 Msun/pc^3*10^-3
popid= 6  5.0 Msun/pc^3*10^-3
thick disc  1.2 Msun/pc^3*10^-3
halo  10.2 Msun/pc^3*10^-6

In [ ]: