In [1]:
import numpy as np
from astropy.io import fits
# -- centralms --
from centralms import util as UT
In [2]:
import matplotlib as mpl
import matplotlib.pyplot as pl
mpl.rcParams['text.usetex'] = True
mpl.rcParams['font.family'] = 'serif'
mpl.rcParams['axes.linewidth'] = 1.5
mpl.rcParams['axes.xmargin'] = 1
mpl.rcParams['xtick.labelsize'] = 'x-large'
mpl.rcParams['xtick.major.size'] = 5
mpl.rcParams['xtick.major.width'] = 1.5
mpl.rcParams['ytick.labelsize'] = 'x-large'
mpl.rcParams['ytick.major.size'] = 5
mpl.rcParams['ytick.major.width'] = 1.5
mpl.rcParams['legend.frameon'] = False
%matplotlib inline
Read in Louis Abramson's data:
In [3]:
la_dir = ''.join([UT.dat_dir(), 'labramson/'])
In [8]:
fmgb = fits.open(''.join([la_dir, 'mikeGenBasic.fits']))
mgb = fmgb[1].data
In [9]:
mgb.names
Out[9]:
In [19]:
plt.hist(mgb['REDSHIFT'][0][mgb['SNAP'][0]], density=True)
Out[19]:
In [50]:
sfr_z0 = np.log10(mgb['SFR_T'][0][:,-5]) - 9.
ms_z0 = np.log10(mgb['MSTEL_T'][0][:,-5])
In [51]:
fig = plt.figure()
sub = fig.add_subplot(111)
sub.scatter(ms_z0, sfr_z0, c='k', s=1)
sub.set_xlim([10., 12.])
sub.set_ylim([-2., 2.])
Out[51]:
In [52]:
fig = plt.figure()
sub = fig.add_subplot(111)
sub.scatter(np.log10(mgb['MSTEL_OBS']), np.log10(mgb['SFR_OBS']), c='k', s=1)
sub.set_xlim([10., 12.])
sub.set_ylim([-3., 2])
Out[52]:
In [74]:
ms_z0, sfr_z0 = [], []
for i in range(mgb['SFR_OBS'].shape[1]):
ms_z0.append(np.log10(mgb['MSTEL_T'][0][i,mgb['SNAP'][0][i]]))
sfr_z0.append(np.log10(mgb['SFR_T'][0][i,mgb['SNAP'][0][i]])-9.)
#print np.log10(mgb['SFR_OBS'][0][i]), (np.log10(mgb['SFR_MOD_SNAP'][0][i])-9.), (np.log10(mgb['SFR_T'][0][i,mgb['SNAP'][0][i]])-9.)
In [77]:
fig = plt.figure()
sub = fig.add_subplot(111)
sub.scatter(np.log10(mgb['MSTEL_OBS']), np.log10(mgb['SFR_OBS']), c='k', s=2)
sub.scatter(ms_z0, sfr_z0, c='C1', s=2)
sub.set_xlim([10., 12.])
sub.set_ylim([-3., 2.])
Out[77]:
In [80]:
i_z1 = np.argmin(np.abs(mgb['REDSHIFT'][0] - 1.))
In [83]:
fig = plt.figure()
sub = fig.add_subplot(111)
sub.scatter(np.log10(mgb['MSTEL_T'][0][:,i_z1]), np.log10(mgb['SFR_T'][0][:,i_z1]) - 9., c='k', s=2)
sub.scatter(ms_z0, sfr_z0, c='C1', s=2)
sub.set_xlim([10., 12.])
sub.set_ylim([-3., 3.])
Out[83]:
In [85]:
plt.hist(np.log10(mgb['MSTEL_T'][0][:,i_z1]), range=(9., 11.))
Out[85]:
In [ ]: