In [129]:
import numpy as np
from pylab import *
%matplotlib inline
import warnings
warnings.filterwarnings('ignore')
from astropy.cosmology import WMAP9 as cosmo
import sys
sys.path.append("/Users/rfinn/Dropbox/pythonCode/")
In [2]:
%run ~/Dropbox/pythonCode/LCSanalyzeblue.py
In [4]:
s.plotsizeBTblue()
http://wise2.ipac.caltech.edu/docs/release/allwise/expsup/sec2_3a.html
fluxes are in microJy
bandwidth from here
http://wise2.ipac.caltech.edu/docs/release/prelim/expsup/figures/sec4_3gt4.gif
In [417]:
# central wavelengths of W1-W4
w1_wave = 3.4
w2_wave = 4.6
w3_wave = 12.
w4_wave = 22.
# 5sigma flux limits in micro-Jy
w1_5sigma = 68.
w2_5sigma = 111.
w3_5sigma = 860.
w4_5sigma = 5700.
# bandwidth in Hz
w1_bw = 1.7506e13
w2_bw = 1.4653e13
w3_bw = 1.1327e13
w4_bw = 2.4961e12
# nuFnu
w1_nuFnu = w1_5sigma*w1_bw*1.e-6
w2_nuFnu = w2_5sigma*w2_bw*1.e-6
w3_nuFnu = w3_5sigma*w3_bw*1.e-6
w4_nuFnu = w4_5sigma*w4_bw*1.e-6
z= 0.043
lum_w1 = w1_5sigma*1.e-6*1.e-23*3.e8/(w1_wave*1.e-6)*4*pi*(cosmo.luminosity_distance(z).value*3.08e24)**2
lum_w2 = w2_5sigma*1.e-6*1.e-23*3.e8/(w2_wave*1.e-6)*4*pi*(cosmo.luminosity_distance(z).value*3.08e24)**2
lum_w3 = w3_5sigma*1.e-6*1.e-23*3.e8/(w3_wave*1.e-6)*4*pi*(cosmo.luminosity_distance(z).value*3.08e24)**2
lum_w4 = w4_5sigma*1.e-6*1.e-23*3.e8/(w4_wave*1.e-6)*4*pi*(cosmo.luminosity_distance(z).value*3.08e24)**2
lum_wise = np.array([lum_w1,lum_w2,lum_w3,lum_w4],'d')
# create arrays
wise_wave = np.array([w1_wave,w2_wave,w3_wave,w4_wave],'f')
wise_nuFnu_JyHz = np.array([w1_nuFnu,w2_nuFnu,w3_nuFnu,w4_nuFnu],'f')
wise_flux_Jy = np.array([w1_5sigma,w2_5sigma,w3_5sigma,w4_5sigma],'d')*1.e-6
In [418]:
#import daleTemplates as dale
reload(dale)
Out[418]:
In [419]:
mod = dale.models()
mod.readDaleSED()
mod.findIndexWavelength(12.,0)
print mod.lam[mod.iwave]
In [422]:
plt.figure(figsize=(6,4))
plt.subplots_adjust(bottom=.15,left=.15)
#plt.plot(wise_wave,(wise_nuFnu),'kv',markersize=12)
plt.hold('on')
#Luminosity = w4_nuFnu*1.e-23*4*np.pi*(cosmo.luminosity_distance(.01).value*3.08e24)**2
flux_to_lum = 4*np.pi*(cosmo.luminosity_distance(.01).value*3.08e24)**2#*1.e-23
mod.scale_models(lum_w3)
plt.gca().set_yscale('log')
#plt.axis([1,100,6,12])
plt.xlim(1,30)
plt.ylim(1.e40,6.e42)
plt.plot(wise_wave,(lum_wise),'kv',markersize=12)
plt.ylabel(r'$\rm Luminosity \ (erg/s) $')
plt.xlabel(r'$\rm Wavelength \ (\mu m)$')
#plt.legend()
plt.hold('off')
plt.savefig('/Users/rfinn/proposals/NASA2016/WISE_sensitivity.eps')
plt.savefig('/Users/rfinn/proposals/NASA2016/WISE_sensitivity.png')
In [299]:
# reality check
# chary & elbaz say that a source with
# f_nu (24) = 5700 micro-Jy at z=.01
# Lir = 4e8
# SFR = 0.069
f_nu_reference = 5700.
# can we recover something similar with dale models?
print mod.iwave,mod.lam[mod.iwave]
print 'log(fnu) of model at wavelength = ',mod.flux[15][mod.iwave]
print 'sfr = ',mod.sfr[15]
print 'L_TIR = ',mod.Ltir[15]
L_reference = f_nu_reference*w4_bw*1.e-6*1.e-23*4*np.pi*(cosmo.luminosity_distance(.01).value*3.08e24)**2
scale = L_reference / 10.**mod.flux[15][mod.iwave]
print 'scale = ',scale
print 'scaled sfr = ',mod.sfr[15]*scale
print 'scaled L_TIR = ',mod.Ltir[15]*scale/1.e8
In [415]:
%run /Users/rfinn/Dropbox/pythonCode/LCSanalyzeblue.py
In [416]:
plt.figure(figsize=(4.5,8))
plt.subplots_adjust(left = 0.2,hspace=0.01)
flag = s.sampleflag & ~s.agnflag #& s.membflag
plt.subplot(2,1,2)
y = s.s.SERSIC_TH50*s.DA
plt.plot(s.logstellarmass[flag],np.log10(y[flag]),'ko')
c1 = np.polyfit(s.logstellarmass[flag],np.log10(y[flag]),1)
xl=np.linspace(8.6,12,100)
plt.hold('on')
plt.plot(xl,np.polyval(c1,xl),'r--')
plt.ylabel(r'$\rm \log_{10} (r_{50}/kpc) \ stars $',fontsize=18)
plt.axis([8.2,12.2,-.6,1.8])
plt.xticks(np.arange(9,13))
plt.xlabel(r'$\rm \log_{10} (M/M_\odot) $',fontsize=18)
plt.subplot(2,1,1)
plt.plot(s.logstellarmass[flag],np.log10(s.Re24_kpc[flag]),'ko')
#flag = s.sampleflag & ~s.agnflag & ~s.membflag
#plt.plot(s.logstellarmass[flag],np.log10(s.Re24_kpc[flag]),'go')
plt.hold('on')
plt.plot(xl,np.polyval(c1,xl),'r--')
plt.ylabel(r'$\rm \log_{10} (r_{50}/kpc) \ SFR({24}) $',fontsize=18)
plt.xticks(np.arange(9,13),[])
plt.axis([8.2,12.2,-.6,1.8])
#plt.show()
#plt.savefig('/Users/rfinn/proposals/NASA2016/size_stellarmass.pdf')
plt.savefig('/Users/rfinn/proposals/NASA2016/size_stellarmass.pdf')
In [375]:
s.s.columns
Out[375]:
In [376]:
s.DA
Out[376]:
In [ ]: