In [1]:
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib as mt
import seaborn as sns
from matplotlib.gridspec import GridSpec
from mpl_toolkits.mplot3d import Axes3D
from __future__ import unicode_literals
from astropy.cosmology import FlatLambdaCDM
In [2]:
# %matplotlib notebook
In [3]:
my_data = np.loadtxt('../Catalogue/Match07_smalldoubleclean_emlines.csv', delimiter=',', dtype=str)
In [4]:
my_dictionary = {}
for i in range(len(my_data[0, :])): # Converting numpy array into dictionary
my_dictionary[my_data[0, i]] = np.array(my_data[0 + 1:, i], dtype=str)
In [5]:
print my_data.shape
print my_data.size
print my_data[0,:]
In [6]:
redshift = my_dictionary['Z'].astype(float)
cataid = my_dictionary['CATAID'].astype(str)
fuv_band = my_dictionary['MAG_AB_FUV'].astype(float)
nuv_band = my_dictionary['MAG_AB_NUV'].astype(float)
u_band = my_dictionary['MAG_AB_U'].astype(float)
g_band = my_dictionary['MAG_AB_G'].astype(float)
r_band = my_dictionary['MAG_AB_R'].astype(float)
mag_abs_r = my_dictionary['MAG_ABSOLUTE_R'].astype(float)
mag_abs_nuv = my_dictionary['MAG_ABSOLUTE_NUV'].astype(float)
mag_abs_fuv = my_dictionary['MAG_ABSOLUTE_FUV'].astype(float)
stellar_mass = my_dictionary['logmstar'].astype(float) # stellar mass from sed fitting - log scale
stellar_age = my_dictionary['logage'].astype(float) # stellar age - log scale
stellar_met = my_dictionary['metal'].astype(float) # stellar metallicity
dn4000 = my_dictionary['D4000N'].astype(float)
h_alpha_flux = my_dictionary['HA_FLUX_COMP'].astype(float) # taken from the COMPLEX table
survey = my_dictionary['SURVEY'].astype(str)
uv_class = my_dictionary['UV_CLASS_YI2011'].astype(str)
bpt_class = my_dictionary['BPT_CLASS'].astype(str)
whan_class = my_dictionary['WHAN_CLASS'].astype(str)
In [7]:
idx_sf = np.where(whan_class=='SF')
idx_rp = np.where(whan_class=='Retired/Passive')
idx_wa = np.where(whan_class=='wAGN')
idx_sa = np.where(whan_class=='sAGN')
idx_na = np.where(whan_class=='NA')
See warning here: http://www.gama-survey.org/dr3/schema/dmu.php?id=8
Only AAOmega and SDSS spectra are flux calibrated. DO NOT USE THE LINE FLUXES DERIVED FOR SPECTRA FROM SURVEYS OTHER THAN SDSS AND GAMA!
SDSS spectra have been scaled by the ratio of the petrosian to 3" aperture flux. This places them on a similar absolute flux scale cf. the GAMA AAOmega spectra (although note that BOSS spectra are taken through 2" apertures so the absolute flux calibration for BOSS spectra will be systematically underestimated). The FSCALE parameter gives the scaling factor used.
Again, only EWs should be used for 2dFGRS, 2QZ, WiggleZ, MGC, 2SLAQ spectra.
In [8]:
survey_safe_idx = []
for i in range (survey.size):
if survey[i] == 'GAMA':
survey_safe_idx.append(i)
elif survey[i] == 'SDSS':
survey_safe_idx.append(i)
else:
continue
survey_safe_idx = np.array(survey_safe_idx)
survey_safe = survey[survey_safe_idx]
print np.unique(survey_safe)
print survey_safe.size
print survey.size
print np.unique(survey)
In [9]:
adopted_cosmology = FlatLambdaCDM(H0=70, Om0=0.3)
In [10]:
luminosity_distance = adopted_cosmology.luminosity_distance(redshift).value
In [11]:
adopted_cosmology.luminosity_distance(redshift)
Out[11]:
In [12]:
mpc_to_cm = 3.086E24
In [13]:
h_alpha_wl = 6.563E-5 # in cm = 6563A
idx_clean = np.where((h_alpha_flux!=-99999.0)*(stellar_mass!=-99.))
h_alpha_clean = h_alpha_flux[idx_clean]
uv_clean = uv_class[idx_clean]
mass_clean = stellar_mass[idx_clean]
stellar_age_clean = stellar_age[idx_clean]
stellar_met_clean = stellar_met[idx_clean]
dn4000_clean = dn4000[idx_clean]
In [14]:
idx_d4k_clean = np.where((dn4000_clean>=0)*(dn4000_clean<3))
print idx_d4k_clean
In [15]:
# plt.hist(dn4000_clean, bins=50)
plt.hist(dn4000_clean[idx_d4k_clean], bins=50)
plt.yscale('log')
plt.show()
In [16]:
luminosity = 4*np.pi*((luminosity_distance[idx_clean]/h_alpha_wl)**2)*(h_alpha_clean)
In [17]:
luminosity_cm = luminosity * mpc_to_cm
In [18]:
sfr = (7.9E-42) * luminosity_cm # the wl correction
print sfr.size
print (h_alpha_flux[[stellar_mass==-99]]).size
In [19]:
idx_uvup = np.where(uv_class[idx_clean]=='UV_UPTURN')
idx_uvwk = np.where(uv_class[idx_clean]=='UV_WEAK')
idx_rsf = np.where(uv_class[idx_clean]=='RSF')
idx_redseq = np.where((nuv_band-r_band)[idx_clean]>5.4)
In [20]:
print np.array(idx_uvup).size
print np.array(idx_uvwk).size
print np.array(idx_redseq).size
print np.array(idx_uvup).size+np.array(idx_uvwk).size
In [21]:
plt.hist(sfr, bins=50)
plt.xscale('log')
plt.show()
In [22]:
sns.set_style("white")
plt.semilogy(mass_clean[[uv_clean=='RSF']], sfr[[uv_clean=='RSF']], 'o', c='green', label='RSF', alpha=0.5)
plt.semilogy(mass_clean[[uv_clean=='UV_WEAK']], sfr[[uv_clean=='UV_WEAK']], 'o', color='yellow', label='UV weak',
alpha=0.5)
plt.semilogy(mass_clean[[uv_clean=='UV_UPTURN']], sfr[[uv_clean=='UV_UPTURN']], 'o', color='red', label='UV upturn',
alpha=0.5)
plt.xlabel('Log(M$_*$)')
plt.ylabel('SFR (M$_\odot$ yr$^{-1}$)')
plt.legend(loc='best')
plt.ylim(10**(-3), )
plt.show()
plt.savefig('./../Figs/g2_mass_sfr.png')
In [23]:
mag_abs_nuv_clean = mag_abs_nuv[idx_clean]
mag_abs_fuv_clean = mag_abs_fuv[idx_clean]
uv_color_clean = (fuv_band-nuv_band)[idx_clean]
uv_class_clean = uv_class[idx_clean]
In [24]:
with plt.style.context("seaborn-white"):
plt.rcParams["axes.edgecolor"] = "0.15"
plt.rcParams["axes.linewidth"] = 1.
fig = plt.figure(figsize=(8,6))
gs = GridSpec(4,4, height_ratios=[2.,1.5,3.,3.], width_ratios=[3.,1.5,3.,1.5])
ax_joint = fig.add_subplot(gs[1:4,0:3])
ax_marg_x = fig.add_subplot(gs[0,0:3])
ax_marg_y = fig.add_subplot(gs[1:4,3])
# Scatter plot -- MAIN PLOT ------------------------------------------------------------------------------------
ax_joint.scatter(mag_abs_nuv_clean, uv_color_clean, c='gray', alpha=0.3, label='All galaxies')
ax_joint.scatter(mag_abs_nuv_clean[idx_uvwk], uv_color_clean[idx_uvwk], c='#dfc27d', alpha=0.5, label='UV Weak')
ax_joint.scatter(mag_abs_nuv_clean[idx_uvup], uv_color_clean[idx_uvup], c='#a6611a', alpha=0.5, label='UV Upturn')
ax_joint.xaxis.set_major_locator(mt.ticker.MultipleLocator(1))
ax_joint.yaxis.set_major_locator(mt.ticker.MultipleLocator(1))
ax_joint.tick_params('both', labelsize='14')
l1 = ax_joint.legend(loc='lower left', numpoints=1, fontsize=14, frameon=True, framealpha=0.85)
l1.get_frame().set_edgecolor('black')
# Mnuv distribution -- on the top ------------------------------------------------------------------------------
n, bins, patches = ax_marg_x.hist(mag_abs_nuv_clean, color='gray', alpha=0.3, bins=30, edgecolor='black',
normed=True)
n, bins, patches = ax_marg_x.hist(mag_abs_nuv_clean[idx_uvwk], color='#dfc27d', alpha=0.5, bins=bins,
edgecolor='black', normed=True)
n, bins, patches = ax_marg_x.hist(mag_abs_nuv_clean[idx_uvup], color='#a6611a', alpha=0.5, bins=bins,
edgecolor='black', normed=True)
ax_marg_x.tick_params('both', labelsize='14')
ax_marg_x.yaxis.set_major_locator(mt.ticker.MultipleLocator(0.5))
# FUV-NUV distribution --on the right --------------------------------------------------------------------------
n, bins, patches = ax_marg_y.hist(uv_color_clean, orientation="horizontal", color='gray', alpha=0.3, bins=20,
edgecolor='black', normed=True)
n, bins, patches = ax_marg_y.hist(uv_color_clean[idx_uvwk], orientation="horizontal", color='#dfc27d',
alpha=0.5, bins=bins, edgecolor='black', normed=True)
n, bins, patches = ax_marg_y.hist(uv_color_clean[idx_uvup], orientation="horizontal", color='#a6611a',
alpha=0.5, bins=bins, edgecolor='black', normed=True)
ax_marg_y.yaxis.set_major_locator(mt.ticker.MultipleLocator(0.5))
ax_marg_y.tick_params(axis='x', labelsize='14')
# Turn off tick labels on marginals
plt.setp(ax_marg_x.get_xticklabels(), visible=False)
plt.setp(ax_marg_y.get_yticklabels(), visible=False)
# Set labels on joint
ax_joint.set_xlabel("M$_{NUV}$", fontsize=15)
ax_joint.set_ylabel("FUV-NUV", fontsize=15)
# Set labels on marginals
ax_marg_y.set_xlabel('FUV-NUV \n frequency', fontsize=15)
ax_marg_x.set_ylabel('M$_{NUV}$ \n frequency', fontsize=15)
plt.savefig('../Figs/g2_cmag2_uv_dist.pdf')
plt.savefig('../Figs/g2_cmag2_uv_dist.png')
plt.tight_layout()
plt.show()
In [24]:
with plt.style.context("seaborn-white"):
plt.rcParams["axes.edgecolor"] = "0.15"
plt.rcParams["axes.linewidth"] = 1.
fig = plt.figure(figsize=(8,6))
gs = GridSpec(4,4, height_ratios=[2.,1.5,3.,3.], width_ratios=[3.,1.5,3.,1.5])
ax_joint = fig.add_subplot(gs[1:4,0:3])
ax_marg_x = fig.add_subplot(gs[0,0:3])
ax_marg_y = fig.add_subplot(gs[1:4,3])
# Scatter plot -- MAIN PLOT ------------------------------------------------------------------------------------
# ax_joint.scatter(mag_abs_nuv_clean, uv_color_clean, c='gray', alpha=0.3, label='All galaxies')
ax_joint.scatter(mag_abs_nuv_clean[idx_uvwk], uv_color_clean[idx_uvwk], c='#dfc27d', alpha=0.5, label='UV Weak')
ax_joint.scatter(mag_abs_nuv_clean[idx_uvup], uv_color_clean[idx_uvup], c='#a6611a', alpha=0.5, label='UV Upturn')
ax_joint.xaxis.set_major_locator(mt.ticker.MultipleLocator(1))
ax_joint.yaxis.set_major_locator(mt.ticker.MultipleLocator(1))
ax_joint.tick_params('both', labelsize='14')
l1 = ax_joint.legend(loc='lower left', numpoints=1, fontsize=14, frameon=True, framealpha=0.85)
l1.get_frame().set_edgecolor('black')
# Mnuv distribution -- on the top ------------------------------------------------------------------------------
n, bins, patches = ax_marg_x.hist(mag_abs_nuv_clean, color='gray', alpha=0.0, bins=30, edgecolor='black',
normed=True)
n, bins, patches = ax_marg_x.hist(mag_abs_nuv_clean[idx_uvwk], color='#dfc27d', alpha=0.5, bins=bins,
edgecolor='black', normed=True)
n, bins, patches = ax_marg_x.hist(mag_abs_nuv_clean[idx_uvup], color='#a6611a', alpha=0.5, bins=bins,
edgecolor='black', normed=True)
ax_marg_x.tick_params('both', labelsize='14')
ax_marg_x.yaxis.set_major_locator(mt.ticker.MultipleLocator(0.5))
# FUV-NUV distribution --on the right --------------------------------------------------------------------------
n, bins, patches = ax_marg_y.hist(uv_color_clean, orientation="horizontal", color='gray', alpha=0.0, bins=20,
edgecolor='black', normed=True)
n, bins, patches = ax_marg_y.hist(uv_color_clean[idx_uvwk], orientation="horizontal", color='#dfc27d',
alpha=0.5, bins=bins, edgecolor='black', normed=True)
n, bins, patches = ax_marg_y.hist(uv_color_clean[idx_uvup], orientation="horizontal", color='#a6611a',
alpha=0.5, bins=bins, edgecolor='black', normed=True)
ax_marg_y.yaxis.set_major_locator(mt.ticker.MultipleLocator(0.5))
ax_marg_y.tick_params(axis='x', labelsize='14')
# Turn off tick labels on marginals
plt.setp(ax_marg_x.get_xticklabels(), visible=False)
plt.setp(ax_marg_y.get_yticklabels(), visible=False)
# Set labels on joint
ax_joint.set_xlabel("M$_{NUV}$", fontsize=15)
ax_joint.set_ylabel("FUV-NUV", fontsize=15)
# Set labels on marginals
ax_marg_y.set_xlabel('FUV-NUV \n frequency', fontsize=15)
ax_marg_x.set_ylabel('M$_{NUV}$ \n frequency', fontsize=15)
plt.savefig('../Figs/g2_cmag3_uv_dist.pdf')
plt.savefig('../Figs/g2_cmag3_uv_dist.png')
plt.tight_layout()
plt.show()
In [26]:
with plt.style.context("seaborn-white"):
plt.rcParams["axes.edgecolor"] = "0.15"
plt.rcParams["axes.linewidth"] = 1.
fig = plt.figure(figsize=(8,6))
gs = GridSpec(4,4, height_ratios=[2.,1.5,3.,3.], width_ratios=[3.,1.5,3.,1.5])
ax_joint = fig.add_subplot(gs[1:4,0:3])
ax_marg_x = fig.add_subplot(gs[0,0:3])
ax_marg_y = fig.add_subplot(gs[1:4,3])
# Scatter plot -- MAIN PLOT ------------------------------------------------------------------------------------
# ax_joint.scatter(mag_abs_fuv_clean, uv_color_clean, c='gray', alpha=0.3, label='All galaxies')
ax_joint.scatter(mag_abs_fuv_clean[idx_uvwk], uv_color_clean[idx_uvwk], c='#dfc27d', alpha=0.5, label='UV Weak')
ax_joint.scatter(mag_abs_fuv_clean[idx_uvup], uv_color_clean[idx_uvup], c='#a6611a', alpha=0.5, label='UV Upturn')
ax_joint.xaxis.set_major_locator(mt.ticker.MultipleLocator(1))
ax_joint.yaxis.set_major_locator(mt.ticker.MultipleLocator(1))
ax_joint.tick_params('both', labelsize='14')
l1 = ax_joint.legend(loc='lower left', numpoints=1, fontsize=14, frameon=True, framealpha=0.85)
l1.get_frame().set_edgecolor('black')
# Mnuv distribution -- on the top ------------------------------------------------------------------------------
n, bins, patches = ax_marg_x.hist(mag_abs_fuv_clean, color='gray', alpha=0.0, bins=30, edgecolor='black',
normed=True)
n, bins, patches = ax_marg_x.hist(mag_abs_fuv_clean[idx_uvwk], color='#dfc27d', alpha=0.5, bins=bins,
edgecolor='black', normed=True)
n, bins, patches = ax_marg_x.hist(mag_abs_fuv_clean[idx_uvup], color='#a6611a', alpha=0.5, bins=bins,
edgecolor='black', normed=True)
ax_marg_x.tick_params('both', labelsize='14')
ax_marg_x.yaxis.set_major_locator(mt.ticker.MultipleLocator(0.5))
# FUV-NUV distribution --on the right --------------------------------------------------------------------------
n, bins, patches = ax_marg_y.hist(uv_color_clean, orientation="horizontal", color='gray', alpha=0.0, bins=20,
edgecolor='black', normed=True)
n, bins, patches = ax_marg_y.hist(uv_color_clean[idx_uvwk], orientation="horizontal", color='#dfc27d',
alpha=0.5, bins=bins, edgecolor='black', normed=True)
n, bins, patches = ax_marg_y.hist(uv_color_clean[idx_uvup], orientation="horizontal", color='#a6611a',
alpha=0.5, bins=bins, edgecolor='black', normed=True)
ax_marg_y.yaxis.set_major_locator(mt.ticker.MultipleLocator(0.5))
ax_marg_y.tick_params(axis='x', labelsize='14')
# Turn off tick labels on marginals
plt.setp(ax_marg_x.get_xticklabels(), visible=False)
plt.setp(ax_marg_y.get_yticklabels(), visible=False)
# Set labels on joint
ax_joint.set_xlabel("M$_{FUV}$", fontsize=15)
ax_joint.set_ylabel("FUV-NUV", fontsize=15)
# Set labels on marginals
ax_marg_y.set_xlabel('FUV-NUV \n frequency', fontsize=15)
ax_marg_x.set_ylabel('M$_{FUV}$ \n frequency', fontsize=15)
plt.savefig('../Figs/g2_cmag4_uv_dist.pdf')
plt.savefig('../Figs/g2_cmag4_uv_dist.png')
plt.tight_layout()
plt.show()
In [25]:
sns.set_style("white")
plt.rcParams["axes.edgecolor"] = "0.15"
plt.rcParams["axes.linewidth"] = 1.
plt.subplots(1,1, figsize=(10,3.3))
# WHAN SF CLASS ------------------
ax01 = plt.subplot(1,5,1)
plt.semilogy(mass_clean[[(uv_clean=='RSF')*(whan_class[idx_clean]=='SF')]],
sfr[[(uv_clean=='RSF')*(whan_class[idx_clean]=='SF')]], 'o', alpha=0.5, label='RSF')
plt.semilogy(mass_clean[[(uv_clean=='UV_WEAK')*(whan_class[idx_clean]=='SF')]],
sfr[[(uv_clean=='UV_WEAK')*(whan_class[idx_clean]=='SF')]], 'o', alpha=0.5, label='UV weak')
plt.semilogy(mass_clean[[(uv_clean=='UV_UPTURN')*(whan_class[idx_clean]=='SF')]],
sfr[[(uv_clean=='UV_UPTURN')*(whan_class[idx_clean]=='SF')]], 'o', alpha=0.5, label='UV upturn')
plt.title("WHAN: SF")
# plt.xlabel('Log(M$_*$)')
plt.ylabel('SFR (M$_\odot$ yr$^{-1}$)', fontsize=14)
plt.tick_params('both', labelsize='12')
plt.xlim(8, 13)
plt.ylim(10**(-2), 10**(3))
# WHAN sAGN CLASS ------------------
ax02 = plt.subplot(1,5,2)
plt.semilogy(mass_clean[[(uv_clean=='RSF')*(whan_class[idx_clean]=='sAGN')]],
sfr[[(uv_clean=='RSF')*(whan_class[idx_clean]=='sAGN')]], 'o', alpha=0.5, label='RSF')
plt.semilogy(mass_clean[[(uv_clean=='UV_WEAK')*(whan_class[idx_clean]=='sAGN')]],
sfr[[(uv_clean=='UV_WEAK')*(whan_class[idx_clean]=='sAGN')]], 'o', alpha=0.5, label='UV weak')
plt.semilogy(mass_clean[[(uv_clean=='UV_UPTURN')*(whan_class[idx_clean]=='sAGN')]],
sfr[[(uv_clean=='UV_UPTURN')*(whan_class[idx_clean]=='sAGN')]], 'o', alpha=0.5, label='UV upturn')
ax02.yaxis.set_visible(False)
plt.title("WHAN: sAGN")
# plt.xlabel('Log(M$_*$)')
plt.ylabel('SFR (M$_\odot$ yr$^{-1}$)')
plt.tick_params('both', labelsize='12')
plt.xlim(8, 13)
plt.ylim(10**(-2), 10**(3))
# WHAN wAGN CLASS ------------------
ax03= plt.subplot(1,5,3)
plt.semilogy(mass_clean[[(uv_clean=='RSF')*(whan_class[idx_clean]=='wAGN')]],
sfr[[(uv_clean=='RSF')*(whan_class[idx_clean]=='wAGN')]], 'o', alpha=0.5, label='RSF')
plt.semilogy(mass_clean[[(uv_clean=='UV_WEAK')*(whan_class[idx_clean]=='wAGN')]],
sfr[[(uv_clean=='UV_WEAK')*(whan_class[idx_clean]=='wAGN')]], 'o', alpha=0.5, label='UV weak')
plt.semilogy(mass_clean[[(uv_clean=='UV_UPTURN')*(whan_class[idx_clean]=='wAGN')]],
sfr[[(uv_clean=='UV_UPTURN')*(whan_class[idx_clean]=='wAGN')]], 'o', alpha=0.5, label='UV upturn')
ax03.yaxis.set_visible(False)
plt.title("WHAN: wAGN")
plt.xlabel('Log(M$_*$)', fontsize=15)
plt.ylabel('SFR (M$_\odot$ yr$^{-1}$)')
plt.tick_params('both', labelsize='12')
plt.xlim(8, 13)
plt.ylim(10**(-2), 10**(3))
plt.legend(loc='upper left')
# WHAN Retired/Passive CLASS ------------------
ax04 = plt.subplot(1,5,4)
plt.semilogy(mass_clean[[(uv_clean=='RSF')*(whan_class[idx_clean]=='Retired/Passive')]],
sfr[[(uv_clean=='RSF')*(whan_class[idx_clean]=='Retired/Passive')]], 'o', alpha=0.5, label='RSF')
plt.semilogy(mass_clean[[(uv_clean=='UV_WEAK')*(whan_class[idx_clean]=='Retired/Passive')]],
sfr[[(uv_clean=='UV_WEAK')*(whan_class[idx_clean]=='Retired/Passive')]], 'o', alpha=0.5,
label='UV weak')
plt.semilogy(mass_clean[[(uv_clean=='UV_UPTURN')*(whan_class[idx_clean]=='Retired/Passive')]],
sfr[[(uv_clean=='UV_UPTURN')*(whan_class[idx_clean]=='Retired/Passive')]], 'o', alpha=0.5,
label='UV upturn')
plt.title("WHAN: Retired/Passive")
ax04.yaxis.set_visible(False)
# plt.xlabel('Log(M$_*$)')
plt.ylabel('SFR (M$_\odot$ yr$^{-1}$)')
plt.tick_params('both', labelsize='12')
plt.xlim(8, 13)
plt.ylim(10**(-2), 10**(3))
# WHAN NA CLASS (unclassified) ------------------
ax05 = plt.subplot(1,5,5)
plt.semilogy(mass_clean[[(uv_clean=='RSF')*(whan_class[idx_clean]=='NA')]],
sfr[[(uv_clean=='RSF')*(whan_class[idx_clean]=='NA')]], 'o', alpha=0.5, label='RSF')
plt.semilogy(mass_clean[[(uv_clean=='UV_WEAK')*(whan_class[idx_clean]=='NA')]],
sfr[[(uv_clean=='UV_WEAK')*(whan_class[idx_clean]=='NA')]], 'o', alpha=0.5, label='UV weak')
plt.semilogy(mass_clean[[(uv_clean=='UV_UPTURN')*(whan_class[idx_clean]=='NA')]],
sfr[[(uv_clean=='UV_UPTURN')*(whan_class[idx_clean]=='NA')]], 'o', alpha=0.5, label='UV upturn')
plt.title("WHAN: NA")
ax05.yaxis.set_visible(False)
# plt.xlabel('Log(M$_*$)')
plt.ylabel('SFR (M$_\odot$ yr$^{-1}$)')
plt.tick_params('both', labelsize='12')
plt.xlim(8, 13)
plt.ylim(10**(-2), 10**(3))
plt.tight_layout(w_pad=0.0)
plt.savefig('./../Figs/g2_mass_sfr_whan.png')
plt.show()
In [26]:
sns.set_style("white")
plt.rcParams["axes.edgecolor"] = "0.15"
plt.rcParams["axes.linewidth"] = 1.
plt.subplots(1,1, figsize=(10,3.3))
# WHAN SF CLASS ------------------
ax01 = plt.subplot(1,5,1)
plt.semilogy(stellar_age_clean[[(uv_clean=='RSF')*(whan_class[idx_clean]=='SF')]],
sfr[[(uv_clean=='RSF')*(whan_class[idx_clean]=='SF')]], 'o', alpha=0.5, label='RSF')
plt.semilogy(stellar_age_clean[[(uv_clean=='UV_WEAK')*(whan_class[idx_clean]=='SF')]],
sfr[[(uv_clean=='UV_WEAK')*(whan_class[idx_clean]=='SF')]], 'o', alpha=0.5, label='UV weak')
plt.semilogy(stellar_age_clean[[(uv_clean=='UV_UPTURN')*(whan_class[idx_clean]=='SF')]],
sfr[[(uv_clean=='UV_UPTURN')*(whan_class[idx_clean]=='SF')]], 'o', alpha=0.5, label='UV upturn')
plt.title("WHAN: SF")
# plt.xlabel('Log(M$_*$)')
plt.ylabel('SFR (M$_\odot$ yr$^{-1}$)', fontsize='14')
plt.tick_params('both', labelsize='12')
plt.xticks([9,9.5,10])
plt.xlim(8.8,10)
plt.ylim(10**(-2), 10**(3))
# WHAN sAGN CLASS ------------------
ax02 = plt.subplot(1,5,2)
plt.semilogy(stellar_age_clean[[(uv_clean=='RSF')*(whan_class[idx_clean]=='sAGN')]],
sfr[[(uv_clean=='RSF')*(whan_class[idx_clean]=='sAGN')]], 'o', alpha=0.5, label='RSF')
plt.semilogy(stellar_age_clean[[(uv_clean=='UV_WEAK')*(whan_class[idx_clean]=='sAGN')]],
sfr[[(uv_clean=='UV_WEAK')*(whan_class[idx_clean]=='sAGN')]], 'o', alpha=0.5, label='UV weak')
plt.semilogy(stellar_age_clean[[(uv_clean=='UV_UPTURN')*(whan_class[idx_clean]=='sAGN')]],
sfr[[(uv_clean=='UV_UPTURN')*(whan_class[idx_clean]=='sAGN')]], 'o', alpha=0.5, label='UV upturn')
ax02.yaxis.set_visible(False)
plt.title("WHAN: sAGN")
plt.ylabel('SFR (M$_\odot$ yr$^{-1}$)')
plt.tick_params('both', labelsize='12')
plt.xticks([9,9.5,10])
plt.xlim(8.8,10)
plt.ylim(10**(-2), 10**(3))
# WHAN wAGN CLASS ------------------
ax03= plt.subplot(1,5,3)
plt.semilogy(stellar_age_clean[[(uv_clean=='RSF')*(whan_class[idx_clean]=='wAGN')]],
sfr[[(uv_clean=='RSF')*(whan_class[idx_clean]=='wAGN')]], 'o', alpha=0.5, label='RSF')
plt.semilogy(stellar_age_clean[[(uv_clean=='UV_WEAK')*(whan_class[idx_clean]=='wAGN')]],
sfr[[(uv_clean=='UV_WEAK')*(whan_class[idx_clean]=='wAGN')]], 'o', alpha=0.5, label='UV weak')
plt.semilogy(stellar_age_clean[[(uv_clean=='UV_UPTURN')*(whan_class[idx_clean]=='wAGN')]],
sfr[[(uv_clean=='UV_UPTURN')*(whan_class[idx_clean]=='wAGN')]], 'o', alpha=0.5, label='UV upturn')
ax03.yaxis.set_visible(False)
plt.title("WHAN: wAGN")
plt.xlabel('Log(t) (Gyr)', fontsize=14)
plt.ylabel('SFR (M$_\odot$ yr$^{-1}$)')
plt.tick_params('both', labelsize='12')
plt.xlim(8.8,10)
plt.xticks([9,9.5,10])
plt.ylim(10**(-2), 10**(3))
plt.legend(loc='lower left')
# WHAN Retired/Passive CLASS ------------------
ax04 = plt.subplot(1,5,4)
plt.semilogy(stellar_age_clean[[(uv_clean=='RSF')*(whan_class[idx_clean]=='Retired/Passive')]],
sfr[[(uv_clean=='RSF')*(whan_class[idx_clean]=='Retired/Passive')]], 'o', alpha=0.5, label='RSF')
plt.semilogy(stellar_age_clean[[(uv_clean=='UV_WEAK')*(whan_class[idx_clean]=='Retired/Passive')]],
sfr[[(uv_clean=='UV_WEAK')*(whan_class[idx_clean]=='Retired/Passive')]], 'o', alpha=0.5,
label='UV weak')
plt.semilogy(stellar_age_clean[[(uv_clean=='UV_UPTURN')*(whan_class[idx_clean]=='Retired/Passive')]],
sfr[[(uv_clean=='UV_UPTURN')*(whan_class[idx_clean]=='Retired/Passive')]], 'o', alpha=0.5,
label='UV upturn')
plt.title("WHAN: Retired/Passive")
ax04.yaxis.set_visible(False)
# plt.xlabel('Log(M$_*$)')
plt.ylabel('SFR (M$_\odot$ yr$^{-1}$)')
plt.tick_params('both', labelsize='12')
plt.xticks([9,9.5,10])
plt.xlim(8.8,10)
plt.ylim(10**(-2), 10**(3))
# WHAN NA CLASS (unclassified) ------------------
ax05 = plt.subplot(1,5,5)
plt.semilogy(stellar_age_clean[[(uv_clean=='RSF')*(whan_class[idx_clean]=='NA')]],
sfr[[(uv_clean=='RSF')*(whan_class[idx_clean]=='NA')]], 'o', alpha=0.5, label='RSF')
plt.semilogy(stellar_age_clean[[(uv_clean=='UV_WEAK')*(whan_class[idx_clean]=='NA')]],
sfr[[(uv_clean=='UV_WEAK')*(whan_class[idx_clean]=='NA')]], 'o', alpha=0.5, label='UV weak')
plt.semilogy(stellar_age_clean[[(uv_clean=='UV_UPTURN')*(whan_class[idx_clean]=='NA')]],
sfr[[(uv_clean=='UV_UPTURN')*(whan_class[idx_clean]=='NA')]], 'o', alpha=0.5, label='UV upturn')
plt.title("WHAN: NA")
ax05.yaxis.set_visible(False)
# plt.xlabel('Log(M$_*$)')
plt.ylabel('SFR (M$_\odot$ yr$^{-1}$)')
plt.tick_params('both', labelsize='12')
plt.xticks([9,9.5,10])
plt.xlim(8.8,10)
plt.ylim(10**(-2), 10**(3))
plt.tight_layout(w_pad=0.0)
plt.savefig('./../Figs/g2_stellar_age_sfr_whan.png')
plt.savefig('./../Figs/g2_stellar_age_sfr_whan.pdf')
plt.show()
In [27]:
dn4000_clean2 = dn4000_clean[idx_d4k_clean]
mass_clean2 = mass_clean[idx_d4k_clean]
uv_clean2 = uv_clean[idx_d4k_clean]
whan_clean = whan_class[idx_clean]
whan_clean2 = whan_clean[idx_d4k_clean]
In [28]:
print dn4000_clean2[[dn4000_clean2<0]].size
In [29]:
print dn4000_clean.size, dn4000_clean2.size, dn4000_clean.size - dn4000_clean2.size
In [30]:
sns.set_style("white")
plt.rcParams["axes.edgecolor"] = "0.15"
plt.rcParams["axes.linewidth"] = 1.
plt.subplots(1,1, figsize=(10,3.3))
# WHAN SF CLASS ------------------
ax01 = plt.subplot(1,5,1)
plt.plot(mass_clean2[[(uv_clean2=='RSF')*(whan_clean2=='SF')]],
dn4000_clean2[[(uv_clean2=='RSF')*(whan_clean2=='SF')]], 'o', alpha=0.5, label='RSF')
plt.plot(mass_clean2[[(uv_clean2=='UV_WEAK')*(whan_clean2=='SF')]],
dn4000_clean2[[(uv_clean2=='UV_WEAK')*(whan_clean2=='SF')]], 'o', alpha=0.5, label='UV weak')
plt.plot(mass_clean2[[(uv_clean2=='UV_UPTURN')*(whan_clean2=='SF')]],
dn4000_clean2[[(uv_clean2=='UV_UPTURN')*(whan_clean2=='SF')]], 'o', alpha=0.5, label='UV upturn')
plt.title("WHAN: SF")
# plt.xlabel('Log(M$_*$)')
plt.ylabel('D$_n$ 4000', fontsize=14)
plt.tick_params('both', labelsize='12')
plt.xlim(8, 13)
plt.ylim(0, 3)
# WHAN sAGN CLASS ------------------
ax02 = plt.subplot(1,5,2)
plt.plot(mass_clean2[[(uv_clean2=='RSF')*(whan_clean2=='sAGN')]],
dn4000_clean2[[(uv_clean2=='RSF')*(whan_clean2=='sAGN')]], 'o', alpha=0.5, label='RSF')
plt.plot(mass_clean2[[(uv_clean2=='UV_WEAK')*(whan_clean2=='sAGN')]],
dn4000_clean2[[(uv_clean2=='UV_WEAK')*(whan_clean2=='sAGN')]], 'o', alpha=0.5, label='UV weak')
plt.plot(mass_clean2[[(uv_clean2=='UV_UPTURN')*(whan_clean2=='sAGN')]],
dn4000_clean2[[(uv_clean2=='UV_UPTURN')*(whan_clean2=='sAGN')]], 'o', alpha=0.5, label='UV upturn')
ax02.yaxis.set_visible(False)
plt.title("WHAN: sAGN")
# plt.xlabel('Log(M$_*$)')
plt.ylabel('D$_n$ 4000', fontsize=14)
plt.tick_params('both', labelsize='12')
plt.xlim(8, 13)
plt.ylim(0, 3)
# WHAN wAGN CLASS ------------------
ax03= plt.subplot(1,5,3)
plt.plot(mass_clean2[[(uv_clean2=='RSF')*(whan_clean2=='wAGN')]],
dn4000_clean2[[(uv_clean2=='RSF')*(whan_clean2=='wAGN')]], 'o', alpha=0.5, label='RSF')
plt.plot(mass_clean2[[(uv_clean2=='UV_WEAK')*(whan_clean2=='wAGN')]],
dn4000_clean2[[(uv_clean2=='UV_WEAK')*(whan_clean2=='wAGN')]], 'o', alpha=0.5, label='UV weak')
plt.plot(mass_clean2[[(uv_clean2=='UV_UPTURN')*(whan_clean2=='wAGN')]],
dn4000_clean2[[(uv_clean2=='UV_UPTURN')*(whan_clean2=='wAGN')]], 'o', alpha=0.5, label='UV upturn')
ax03.yaxis.set_visible(False)
plt.title("WHAN: wAGN")
plt.xlabel('Log(M$_*$)', fontsize=14)
plt.ylabel('D$_n$ 4000', fontsize=14)
plt.tick_params('both', labelsize='12')
plt.xlim(8, 13)
plt.ylim(0, 3)
ax03.legend(loc='lower center', bbox_to_anchor=(2.1, -0.3), fontsize=12, frameon=True, framealpha=1., ncol=3)
# WHAN Retired/Passive CLASS ------------------
ax04 = plt.subplot(1,5,4)
plt.plot(mass_clean2[[(uv_clean2=='RSF')*(whan_clean2=='Retired/Passive')]],
dn4000_clean2[[(uv_clean2=='RSF')*(whan_clean2=='Retired/Passive')]], 'o', alpha=0.5, label='RSF')
plt.plot(mass_clean2[[(uv_clean2=='UV_WEAK')*(whan_clean2=='Retired/Passive')]],
dn4000_clean2[[(uv_clean2=='UV_WEAK')*(whan_clean2=='Retired/Passive')]], 'o', alpha=0.5,
label='UV weak')
plt.plot(mass_clean2[[(uv_clean2=='UV_UPTURN')*(whan_clean2=='Retired/Passive')]],
dn4000_clean2[[(uv_clean2=='UV_UPTURN')*(whan_clean2=='Retired/Passive')]], 'o', alpha=0.5,
label='UV upturn')
plt.title("WHAN: Retired/Passive")
ax04.yaxis.set_visible(False)
# plt.xlabel('Log(M$_*$)')
plt.ylabel('D$_n$ 4000', fontsize=14)
plt.tick_params('both', labelsize='12')
plt.xlim(8, 13)
plt.ylim(0, 3)
# WHAN NA CLASS (unclassified) ------------------
ax05 = plt.subplot(1,5,5)
plt.plot(mass_clean2[[(uv_clean2=='RSF')*(whan_clean2=='NA')]],
dn4000_clean2[[(uv_clean2=='RSF')*(whan_clean2=='NA')]], 'o', alpha=0.5, label='RSF')
plt.plot(mass_clean2[[(uv_clean2=='UV_WEAK')*(whan_clean2=='NA')]],
dn4000_clean2[[(uv_clean2=='UV_WEAK')*(whan_clean2=='NA')]], 'o', alpha=0.5, label='UV weak')
plt.plot(mass_clean2[[(uv_clean2=='UV_UPTURN')*(whan_clean2=='NA')]],
dn4000_clean2[[(uv_clean2=='UV_UPTURN')*(whan_clean2=='NA')]], 'o', alpha=0.5, label='UV upturn')
plt.title("WHAN: NA")
ax05.yaxis.set_visible(False)
# plt.xlabel('Log(M$_*$)')
plt.ylabel('D$_n$ 4000', fontsize=14)
plt.tick_params('both', labelsize='12')
plt.xlim(8, 13)
plt.ylim(0, 3)
plt.tight_layout(w_pad=0.0)
plt.savefig('./../Figs/g2_mass_dn4000_whan.png')
plt.savefig('./../Figs/g2_mass_dn4000_whan.pdf')
plt.show()
In [31]:
sns.set_style("white")
plt.rcParams["axes.edgecolor"] = "0.15"
plt.rcParams["axes.linewidth"] = 1.
plt.subplots(1,1, figsize=(10,3.3))
# WHAN SF CLASS ------------------
ax01 = plt.subplot(1,5,1)
plt.plot(mass_clean[[(uv_clean=='RSF')*(whan_class[idx_clean]=='SF')]],
stellar_age_clean[[(uv_clean=='RSF')*(whan_class[idx_clean]=='SF')]], 'o', alpha=0.5, label='RSF')
plt.plot(mass_clean[[(uv_clean=='UV_WEAK')*(whan_class[idx_clean]=='SF')]],
stellar_age_clean[[(uv_clean=='UV_WEAK')*(whan_class[idx_clean]=='SF')]], 'o', alpha=0.5, label='UV weak')
plt.plot(mass_clean[[(uv_clean=='UV_UPTURN')*(whan_class[idx_clean]=='SF')]],
stellar_age_clean[[(uv_clean=='UV_UPTURN')*(whan_class[idx_clean]=='SF')]], 'o', alpha=0.5, label='UV upturn')
plt.title("WHAN: SF")
# plt.xlabel('Log(M$_*$)')
plt.ylabel('Log(t) (Gyr)', fontsize=14)
plt.tick_params('both', labelsize='12')
plt.xlim(8, 13)
plt.ylim(8.5,)
# WHAN sAGN CLASS ------------------
ax02 = plt.subplot(1,5,2)
plt.plot(mass_clean[[(uv_clean=='RSF')*(whan_class[idx_clean]=='sAGN')]],
stellar_age_clean[[(uv_clean=='RSF')*(whan_class[idx_clean]=='sAGN')]], 'o', alpha=0.5, label='RSF')
plt.plot(mass_clean[[(uv_clean=='UV_WEAK')*(whan_class[idx_clean]=='sAGN')]],
stellar_age_clean[[(uv_clean=='UV_WEAK')*(whan_class[idx_clean]=='sAGN')]], 'o', alpha=0.5, label='UV weak')
plt.plot(mass_clean[[(uv_clean=='UV_UPTURN')*(whan_class[idx_clean]=='sAGN')]],
stellar_age_clean[[(uv_clean=='UV_UPTURN')*(whan_class[idx_clean]=='sAGN')]], 'o', alpha=0.5, label='UV upturn')
# ax02.yaxis.set_visible(False)
plt.title("WHAN: sAGN")
# plt.xlabel('Log(M$_*$)')
# plt.ylabel('stellar_age_clean (M$_\odot$ yr$^{-1}$)')
plt.tick_params('both', labelsize='12')
plt.xlim(8, 13)
plt.ylim(9.3,)
# WHAN wAGN CLASS ------------------
ax03= plt.subplot(1,5,3)
plt.plot(mass_clean[[(uv_clean=='RSF')*(whan_class[idx_clean]=='wAGN')]],
stellar_age_clean[[(uv_clean=='RSF')*(whan_class[idx_clean]=='wAGN')]], 'o', alpha=0.5, label='RSF')
plt.plot(mass_clean[[(uv_clean=='UV_WEAK')*(whan_class[idx_clean]=='wAGN')]],
stellar_age_clean[[(uv_clean=='UV_WEAK')*(whan_class[idx_clean]=='wAGN')]], 'o', alpha=0.5, label='UV weak')
plt.plot(mass_clean[[(uv_clean=='UV_UPTURN')*(whan_class[idx_clean]=='wAGN')]],
stellar_age_clean[[(uv_clean=='UV_UPTURN')*(whan_class[idx_clean]=='wAGN')]], 'o', alpha=0.5, label='UV upturn')
# ax03.yaxis.set_visible(False)
plt.title("WHAN: wAGN")
plt.xlabel('Log(M$_*$)', fontsize=14)
# plt.ylabel('Log(t) (Gyr)', fontsize=14)
plt.tick_params('both', labelsize='12')
plt.xlim(8, 13)
plt.ylim(9.6, )
ax03.legend(loc='lower center', bbox_to_anchor=(2.3, -0.3), fontsize=12, frameon=True, framealpha=1., ncol=3)
# WHAN Retired/Passive CLASS ------------------
ax04 = plt.subplot(1,5,4)
plt.plot(mass_clean[[(uv_clean=='RSF')*(whan_class[idx_clean]=='Retired/Passive')]],
stellar_age_clean[[(uv_clean=='RSF')*(whan_class[idx_clean]=='Retired/Passive')]], 'o', alpha=0.5, label='RSF')
plt.plot(mass_clean[[(uv_clean=='UV_WEAK')*(whan_class[idx_clean]=='Retired/Passive')]],
stellar_age_clean[[(uv_clean=='UV_WEAK')*(whan_class[idx_clean]=='Retired/Passive')]], 'o', alpha=0.5,
label='UV weak')
plt.plot(mass_clean[[(uv_clean=='UV_UPTURN')*(whan_class[idx_clean]=='Retired/Passive')]],
stellar_age_clean[[(uv_clean=='UV_UPTURN')*(whan_class[idx_clean]=='Retired/Passive')]], 'o', alpha=0.5,
label='UV upturn')
plt.title("WHAN: Retired/Passive")
# ax04.yaxis.set_visible(False)
# plt.xlabel('Log(M$_*$)')
# plt.ylabel('stellar_age_clean (M$_\odot$ yr$^{-1}$)')
plt.tick_params('both', labelsize='12')
plt.xlim(8, 13)
plt.ylim(9.6,)
# WHAN NA CLASS (unclassified) ------------------
ax05 = plt.subplot(1,5,5)
plt.plot(mass_clean[[(uv_clean=='RSF')*(whan_class[idx_clean]=='NA')]],
stellar_age_clean[[(uv_clean=='RSF')*(whan_class[idx_clean]=='NA')]], 'o', alpha=0.5, label='RSF')
plt.plot(mass_clean[[(uv_clean=='UV_WEAK')*(whan_class[idx_clean]=='NA')]],
stellar_age_clean[[(uv_clean=='UV_WEAK')*(whan_class[idx_clean]=='NA')]], 'o', alpha=0.5, label='UV weak')
plt.plot(mass_clean[[(uv_clean=='UV_UPTURN')*(whan_class[idx_clean]=='NA')]],
stellar_age_clean[[(uv_clean=='UV_UPTURN')*(whan_class[idx_clean]=='NA')]], 'o', alpha=0.5, label='UV upturn')
plt.title("WHAN: NA")
# ax05.yaxis.set_visible(False)
# plt.xlabel('Log(M$_*$)')
# plt.ylabel('stellar_age_clean (M$_\odot$ yr$^{-1}$)')
plt.tick_params('both', labelsize='12')
plt.xlim(8, 13)
plt.ylim(9.1, )
plt.tight_layout(w_pad=0.0)
plt.savefig('./../Figs/g2_mass_stellar_age_whan_01.png')
plt.show()
In [34]:
sns.set_style("white")
plt.rcParams["axes.edgecolor"] = "0.15"
plt.rcParams["axes.linewidth"] = 1.
plt.subplots(1,1, figsize=(10,3.3), sharey=True)
# WHAN SF CLASS ------------------
ax01 = plt.subplot(1,5,1)
plt.plot(mass_clean[[(uv_clean=='RSF')*(whan_class[idx_clean]=='SF')]],
stellar_age_clean[[(uv_clean=='RSF')*(whan_class[idx_clean]=='SF')]], 'o', alpha=0.5, label='RSF')
plt.plot(mass_clean[[(uv_clean=='UV_WEAK')*(whan_class[idx_clean]=='SF')]],
stellar_age_clean[[(uv_clean=='UV_WEAK')*(whan_class[idx_clean]=='SF')]], 'o', alpha=0.5, label='UV weak')
plt.plot(mass_clean[[(uv_clean=='UV_UPTURN')*(whan_class[idx_clean]=='SF')]],
stellar_age_clean[[(uv_clean=='UV_UPTURN')*(whan_class[idx_clean]=='SF')]], 'o', alpha=0.5, label='UV upturn')
plt.title("WHAN: SF")
# plt.xlabel('Log(M$_*$)')
plt.ylabel('Log(t) (Gyr)', fontsize=14)
plt.tick_params('both', labelsize='12')
plt.xlim(8, 13)
# plt.ylim(8.5,)
# WHAN sAGN CLASS ------------------
ax02 = plt.subplot(1,5,2, sharey=ax01)
plt.plot(mass_clean[[(uv_clean=='RSF')*(whan_class[idx_clean]=='sAGN')]],
stellar_age_clean[[(uv_clean=='RSF')*(whan_class[idx_clean]=='sAGN')]], 'o', alpha=0.5, label='RSF')
plt.plot(mass_clean[[(uv_clean=='UV_WEAK')*(whan_class[idx_clean]=='sAGN')]],
stellar_age_clean[[(uv_clean=='UV_WEAK')*(whan_class[idx_clean]=='sAGN')]], 'o', alpha=0.5, label='UV weak')
plt.plot(mass_clean[[(uv_clean=='UV_UPTURN')*(whan_class[idx_clean]=='sAGN')]],
stellar_age_clean[[(uv_clean=='UV_UPTURN')*(whan_class[idx_clean]=='sAGN')]], 'o', alpha=0.5, label='UV upturn')
ax02.yaxis.set_visible(False)
plt.title("WHAN: sAGN")
# plt.xlabel('Log(M$_*$)')
# plt.ylabel('stellar_age_clean (M$_\odot$ yr$^{-1}$)')
plt.tick_params('both', labelsize='12')
plt.xlim(8, 13)
# plt.ylim(9.3,)
# WHAN wAGN CLASS ------------------
ax03= plt.subplot(1,5,3, sharey=ax01)
plt.plot(mass_clean[[(uv_clean=='RSF')*(whan_class[idx_clean]=='wAGN')]],
stellar_age_clean[[(uv_clean=='RSF')*(whan_class[idx_clean]=='wAGN')]], 'o', alpha=0.5, label='RSF')
plt.plot(mass_clean[[(uv_clean=='UV_WEAK')*(whan_class[idx_clean]=='wAGN')]],
stellar_age_clean[[(uv_clean=='UV_WEAK')*(whan_class[idx_clean]=='wAGN')]], 'o', alpha=0.5, label='UV weak')
plt.plot(mass_clean[[(uv_clean=='UV_UPTURN')*(whan_class[idx_clean]=='wAGN')]],
stellar_age_clean[[(uv_clean=='UV_UPTURN')*(whan_class[idx_clean]=='wAGN')]], 'o', alpha=0.5, label='UV upturn')
ax03.yaxis.set_visible(False)
plt.title("WHAN: wAGN")
plt.xlabel('Log(M$_*$)', fontsize=14)
# plt.ylabel('Log(t) (Gyr)', fontsize=14)
plt.tick_params('both', labelsize='12')
plt.xlim(8, 13)
# plt.ylim(9.6, )
ax03.legend(loc='lower center', bbox_to_anchor=(2.1, -0.3), fontsize=12, frameon=True, framealpha=1., ncol=3)
# WHAN Retired/Passive CLASS ------------------
ax04 = plt.subplot(1,5,4, sharey=ax01)
plt.plot(mass_clean[[(uv_clean=='RSF')*(whan_class[idx_clean]=='Retired/Passive')]],
stellar_age_clean[[(uv_clean=='RSF')*(whan_class[idx_clean]=='Retired/Passive')]], 'o', alpha=0.5, label='RSF')
plt.plot(mass_clean[[(uv_clean=='UV_WEAK')*(whan_class[idx_clean]=='Retired/Passive')]],
stellar_age_clean[[(uv_clean=='UV_WEAK')*(whan_class[idx_clean]=='Retired/Passive')]], 'o', alpha=0.5,
label='UV weak')
plt.plot(mass_clean[[(uv_clean=='UV_UPTURN')*(whan_class[idx_clean]=='Retired/Passive')]],
stellar_age_clean[[(uv_clean=='UV_UPTURN')*(whan_class[idx_clean]=='Retired/Passive')]], 'o', alpha=0.5,
label='UV upturn')
plt.title("WHAN: Retired/Passive")
ax04.yaxis.set_visible(False)
# plt.xlabel('Log(M$_*$)')
# plt.ylabel('stellar_age_clean (M$_\odot$ yr$^{-1}$)')
plt.tick_params('both', labelsize='12')
plt.xlim(8, 13)
# plt.ylim(9.6,)
# WHAN NA CLASS (unclassified) ------------------
ax05 = plt.subplot(1,5,5, sharey=ax01)
plt.plot(mass_clean[[(uv_clean=='RSF')*(whan_class[idx_clean]=='NA')]],
stellar_age_clean[[(uv_clean=='RSF')*(whan_class[idx_clean]=='NA')]], 'o', alpha=0.5, label='RSF')
plt.plot(mass_clean[[(uv_clean=='UV_WEAK')*(whan_class[idx_clean]=='NA')]],
stellar_age_clean[[(uv_clean=='UV_WEAK')*(whan_class[idx_clean]=='NA')]], 'o', alpha=0.5, label='UV weak')
plt.plot(mass_clean[[(uv_clean=='UV_UPTURN')*(whan_class[idx_clean]=='NA')]],
stellar_age_clean[[(uv_clean=='UV_UPTURN')*(whan_class[idx_clean]=='NA')]], 'o', alpha=0.5, label='UV upturn')
plt.title("WHAN: NA")
ax05.yaxis.set_visible(False)
# plt.xlabel('Log(M$_*$)')
# plt.ylabel('stellar_age_clean (M$_\odot$ yr$^{-1}$)')
plt.tick_params('both', labelsize='12')
plt.xlim(8, 13)
# plt.ylim(9.1, )
plt.tight_layout(w_pad=0.0)
plt.savefig('./../Figs/g2_mass_stellar_age_whan_02.png')
plt.show()
In [32]:
sns.set_style("white")
plt.rcParams["axes.edgecolor"] = "0.15"
plt.rcParams["axes.linewidth"] = 1.
plt.subplots(1,1, figsize=(10,3.3), sharey=True)
# WHAN SF CLASS ------------------
ax01 = plt.subplot(1,5,1)
plt.plot(mass_clean[[(uv_clean=='UV_UPTURN')*(whan_class[idx_clean]=='SF')]],
stellar_age_clean[[(uv_clean=='UV_UPTURN')*(whan_class[idx_clean]=='SF')]], 'o', color='#a6611a',
alpha=0.8, label='UV upturn')
sns.kdeplot(mass_clean[[(uv_clean=='UV_UPTURN')*(whan_class[idx_clean]=='SF')]],
stellar_age_clean[[(uv_clean=='UV_UPTURN')*(whan_class[idx_clean]=='SF')]], color='#a6611a',
alpha=0.4, label='UV upturn')
plt.title("WHAN: SF")
plt.ylabel('Log(t) (Gyr)', fontsize=14)
plt.tick_params('both', labelsize='12')
plt.xlim(9, 12)
plt.ylim(9.70, 9.93)
# WHAN sAGN CLASS ------------------
ax02 = plt.subplot(1,5,2, sharey=ax01)
plt.plot(mass_clean[[(uv_clean=='UV_UPTURN')*(whan_class[idx_clean]=='sAGN')]],
stellar_age_clean[[(uv_clean=='UV_UPTURN')*(whan_class[idx_clean]=='sAGN')]], 'o', color='#a6611a',
alpha=0.8, label='UV upturn')
sns.kdeplot(mass_clean[[(uv_clean=='UV_UPTURN')*(whan_class[idx_clean]=='sAGN')]],
stellar_age_clean[[(uv_clean=='UV_UPTURN')*(whan_class[idx_clean]=='sAGN')]], color='#a6611a',
alpha=0.4, label='UV upturn')
ax02.yaxis.set_visible(False)
plt.title("WHAN: sAGN")
plt.tick_params('both', labelsize='12')
plt.xlim(9, 12)
plt.ylim(9.70, 9.93)
# WHAN wAGN CLASS ------------------
ax03= plt.subplot(1,5,3, sharey=ax01)
plt.plot(mass_clean[[(uv_clean=='UV_UPTURN')*(whan_class[idx_clean]=='wAGN')]],
stellar_age_clean[[(uv_clean=='UV_UPTURN')*(whan_class[idx_clean]=='wAGN')]], 'o', color='#a6611a',
alpha=0.8, label='UV upturn')
sns.kdeplot(mass_clean[[(uv_clean=='UV_UPTURN')*(whan_class[idx_clean]=='wAGN')]],
stellar_age_clean[[(uv_clean=='UV_UPTURN')*(whan_class[idx_clean]=='wAGN')]], color='#a6611a',
alpha=0.4, label='UV upturn')
ax03.yaxis.set_visible(False)
plt.title("WHAN: wAGN")
plt.xlabel('Log(M$_*$)', fontsize=14)
plt.tick_params('both', labelsize='12')
plt.xlim(9, 12)
plt.ylim(9.70, 9.93)
# ax03.legend(loc='lower center', bbox_to_anchor=(2.1, -0.3), fontsize=12, frameon=True, framealpha=0.8, ncol=1)
# WHAN Retired/Passive CLASS ------------------
ax04 = plt.subplot(1,5,4, sharey=ax01)
plt.plot(mass_clean[[(uv_clean=='UV_UPTURN')*(whan_class[idx_clean]=='Retired/Passive')]],
stellar_age_clean[[(uv_clean=='UV_UPTURN')*(whan_class[idx_clean]=='Retired/Passive')]], 'o',
color='#a6611a', alpha=0.8,label='UV upturn')
sns.kdeplot(mass_clean[[(uv_clean=='UV_UPTURN')*(whan_class[idx_clean]=='Retired/Passive')]],
stellar_age_clean[[(uv_clean=='UV_UPTURN')*(whan_class[idx_clean]=='Retired/Passive')]],
color='#a6611a',alpha=0.4, label='UV upturn')
plt.title("WHAN: Retired/Passive")
ax04.yaxis.set_visible(False)
plt.tick_params('both', labelsize='12')
plt.xlim(9, 12)
plt.ylim(9.70, 9.93)
# WHAN NA CLASS (unclassified) ------------------
ax05 = plt.subplot(1,5,5, sharey=ax01)
plt.plot(mass_clean[[(uv_clean=='UV_UPTURN')*(whan_class[idx_clean]=='NA')]],
stellar_age_clean[[(uv_clean=='UV_UPTURN')*(whan_class[idx_clean]=='NA')]], 'o', color='#a6611a',
alpha=0.8, label='UV upturn')
sns.kdeplot(mass_clean[[(uv_clean=='UV_UPTURN')*(whan_class[idx_clean]=='NA')]],
stellar_age_clean[[(uv_clean=='UV_UPTURN')*(whan_class[idx_clean]=='NA')]],
color='#a6611a',alpha=0.4, label='UV upturn')
plt.title("WHAN: NA")
ax05.yaxis.set_visible(False)
plt.tick_params('both', labelsize='12')
plt.xlim(9, 12)
plt.ylim(9.70, 9.93)
plt.tight_layout(w_pad=0.0)
plt.savefig('./../Figs/g2_mass_stellar_age_whan_uvup.png')
plt.show()
In [33]:
print stellar_age_clean[[(uv_clean=='UV_UPTURN')]].max()
print stellar_age_clean[[(uv_clean=='UV_UPTURN')]].min()
In [34]:
sns.set_style("white")
plt.rcParams["axes.edgecolor"] = "0.15"
plt.rcParams["axes.linewidth"] = 1.
plt.subplots(1,1, figsize=(10,3.3), sharey=True)
# WHAN SF CLASS ------------------
ax01 = plt.subplot(1,5,1)
plt.plot(mass_clean[[(uv_clean=='RSF')*(whan_class[idx_clean]=='SF')]],
stellar_met_clean[[(uv_clean=='RSF')*(whan_class[idx_clean]=='SF')]], 'o', alpha=0.5, label='RSF')
plt.plot(mass_clean[[(uv_clean=='UV_WEAK')*(whan_class[idx_clean]=='SF')]],
stellar_met_clean[[(uv_clean=='UV_WEAK')*(whan_class[idx_clean]=='SF')]], 'o', alpha=0.5, label='UV weak')
plt.plot(mass_clean[[(uv_clean=='UV_UPTURN')*(whan_class[idx_clean]=='SF')]],
stellar_met_clean[[(uv_clean=='UV_UPTURN')*(whan_class[idx_clean]=='SF')]], 'o', alpha=0.5, label='UV upturn')
plt.title("WHAN: SF")
# plt.xlabel('Log(M$_*$)')
plt.ylabel('<Z/Z$_{\odot}$>', fontsize=14)
plt.tick_params('both', labelsize='12')
plt.xlim(8, 13)
# plt.ylim(8.5,)
# WHAN sAGN CLASS ------------------
ax02 = plt.subplot(1,5,2, sharey=ax01)
plt.plot(mass_clean[[(uv_clean=='RSF')*(whan_class[idx_clean]=='sAGN')]],
stellar_met_clean[[(uv_clean=='RSF')*(whan_class[idx_clean]=='sAGN')]], 'o', alpha=0.5, label='RSF')
plt.plot(mass_clean[[(uv_clean=='UV_WEAK')*(whan_class[idx_clean]=='sAGN')]],
stellar_met_clean[[(uv_clean=='UV_WEAK')*(whan_class[idx_clean]=='sAGN')]], 'o', alpha=0.5, label='UV weak')
plt.plot(mass_clean[[(uv_clean=='UV_UPTURN')*(whan_class[idx_clean]=='sAGN')]],
stellar_met_clean[[(uv_clean=='UV_UPTURN')*(whan_class[idx_clean]=='sAGN')]], 'o', alpha=0.5, label='UV upturn')
ax02.yaxis.set_visible(False)
plt.title("WHAN: sAGN")
# plt.xlabel('Log(M$_*$)')
# plt.ylabel('stellar_met_clean (M$_\odot$ yr$^{-1}$)')
plt.tick_params('both', labelsize='12')
plt.xlim(8, 13)
# plt.ylim(9.3,)
# WHAN wAGN CLASS ------------------
ax03= plt.subplot(1,5,3, sharey=ax01)
plt.plot(mass_clean[[(uv_clean=='RSF')*(whan_class[idx_clean]=='wAGN')]],
stellar_met_clean[[(uv_clean=='RSF')*(whan_class[idx_clean]=='wAGN')]], 'o', alpha=0.5, label='RSF')
plt.plot(mass_clean[[(uv_clean=='UV_WEAK')*(whan_class[idx_clean]=='wAGN')]],
stellar_met_clean[[(uv_clean=='UV_WEAK')*(whan_class[idx_clean]=='wAGN')]], 'o', alpha=0.5, label='UV weak')
plt.plot(mass_clean[[(uv_clean=='UV_UPTURN')*(whan_class[idx_clean]=='wAGN')]],
stellar_met_clean[[(uv_clean=='UV_UPTURN')*(whan_class[idx_clean]=='wAGN')]], 'o', alpha=0.5, label='UV upturn')
ax03.yaxis.set_visible(False)
plt.title("WHAN: wAGN")
plt.xlabel('Log(M$_*$)', fontsize=14)
# plt.ylabel('Log(t) (Gyr)', fontsize=14)
plt.tick_params('both', labelsize='12')
plt.xlim(8, 13)
# plt.ylim(9.6, )
ax03.legend(loc='lower center', bbox_to_anchor=(2.1, -0.3), fontsize=12, frameon=True, framealpha=1., ncol=3)
# WHAN Retired/Passive CLASS ------------------
ax04 = plt.subplot(1,5,4, sharey=ax01)
plt.plot(mass_clean[[(uv_clean=='RSF')*(whan_class[idx_clean]=='Retired/Passive')]],
stellar_met_clean[[(uv_clean=='RSF')*(whan_class[idx_clean]=='Retired/Passive')]], 'o', alpha=0.5, label='RSF')
plt.plot(mass_clean[[(uv_clean=='UV_WEAK')*(whan_class[idx_clean]=='Retired/Passive')]],
stellar_met_clean[[(uv_clean=='UV_WEAK')*(whan_class[idx_clean]=='Retired/Passive')]], 'o', alpha=0.5,
label='UV weak')
plt.plot(mass_clean[[(uv_clean=='UV_UPTURN')*(whan_class[idx_clean]=='Retired/Passive')]],
stellar_met_clean[[(uv_clean=='UV_UPTURN')*(whan_class[idx_clean]=='Retired/Passive')]], 'o', alpha=0.5,
label='UV upturn')
plt.title("WHAN: Retired/Passive")
ax04.yaxis.set_visible(False)
# plt.xlabel('Log(M$_*$)')
# plt.ylabel('stellar_met_clean (M$_\odot$ yr$^{-1}$)')
plt.tick_params('both', labelsize='12')
plt.xlim(8, 13)
# plt.ylim(9.6,)
# WHAN NA CLASS (unclassified) ------------------
ax05 = plt.subplot(1,5,5, sharey=ax01)
plt.plot(mass_clean[[(uv_clean=='RSF')*(whan_class[idx_clean]=='NA')]],
stellar_met_clean[[(uv_clean=='RSF')*(whan_class[idx_clean]=='NA')]], 'o', alpha=0.5, label='RSF')
plt.plot(mass_clean[[(uv_clean=='UV_WEAK')*(whan_class[idx_clean]=='NA')]],
stellar_met_clean[[(uv_clean=='UV_WEAK')*(whan_class[idx_clean]=='NA')]], 'o', alpha=0.5, label='UV weak')
plt.plot(mass_clean[[(uv_clean=='UV_UPTURN')*(whan_class[idx_clean]=='NA')]],
stellar_met_clean[[(uv_clean=='UV_UPTURN')*(whan_class[idx_clean]=='NA')]], 'o', alpha=0.5, label='UV upturn')
plt.title("WHAN: NA")
ax05.yaxis.set_visible(False)
# plt.xlabel('Log(M$_*$)')
# plt.ylabel('stellar_met_clean (M$_\odot$ yr$^{-1}$)')
plt.tick_params('both', labelsize='12')
plt.xlim(8, 13)
# plt.ylim(9.1, )
plt.tight_layout(w_pad=0.0)
plt.savefig('./../Figs/g2_mass_stellar_met_whan.png')
plt.show()
In [37]:
cataid_clean = cataid[idx_clean]
objdr7_clean = my_dictionary['OBJID_SDSSDR7'][idx_clean]
In [38]:
print cataid_clean[[(uv_clean=='UV_UPTURN')*(whan_class[idx_clean]=='NA')]],
cataid_clean[[(uv_clean=='UV_UPTURN')*(whan_class[idx_clean]=='NA')]].size
Out[38]:
In [39]:
print objdr7_clean[[(uv_clean=='UV_UPTURN')*(whan_class[idx_clean]=='NA')]],
objdr7_clean[[(uv_clean=='UV_UPTURN')*(whan_class[idx_clean]=='NA')]].size
Out[39]:
In [40]:
spec_i_need = {}
spec_i_need['CATAID'] = cataid_clean[[(uv_clean=='UV_UPTURN')*(whan_class[idx_clean]=='NA')]]
spec_i_need['OBJID_SDSSDR7'] = objdr7_clean[[(uv_clean=='UV_UPTURN')*(whan_class[idx_clean]=='NA')]]
In [41]:
cataid_uvup_rp = cataid_clean[[(uv_clean=='UV_UPTURN')*(whan_class[idx_clean]=='Retired/Passive')]]
In [42]:
print cataid_uvup_rp.size
for i in range(cataid_uvup_rp.size):
print cataid_uvup_rp[i]
In [43]:
spec_i_need = pd.DataFrame(spec_i_need)
In [44]:
spec_i_need.to_csv('./spec.csv', index=False)
In [45]:
spec_i_need
Out[45]:
In [ ]: