In [46]:
from astropy.io import fits,ascii
import numpy as np
from matplotlib import pyplot as plt
import os
import sys
import warnings
warnings.filterwarnings('ignore')
from astropy.table import Table
from astropy.coordinates import SkyCoord
from scipy.stats import ks_2samp
from astropy import units as u
In [4]:
sys.path.append('/home/rfinn/github/APPSS/')
In [5]:
from a100sdss import ks, anderson
In [6]:
sys.path.append('/home/rfinn/github/LCS/python/Python3/')
In [7]:
from LCScommon import *
In [8]:
homedir = os.getenv("HOME")
In [9]:
def colormass(x1,y1,x2,y2,name1,name2, figname, hexbinflag=False,contourflag=False, \
xmin=7.9, xmax=11.6, ymin=-1.2, ymax=1.2, contour_bins = 40, ncontour_levels=5,\
xlabel='$\log_{10}(M_\star/M_\odot) $', ylabel='$(g-i)_{corrected} $', color2='c',\
nhistbin=50, alphagray=.1):
fig = plt.figure(figsize=(8,8))
nrow = 4
ncol = 4
# for purposes of this plot, only keep data within the
# window specified by [xmin:xmax, ymin:ymax]
keepflag1 = (x1 >= xmin) & (x1 <= xmax) & (y1 >= ymin) & (y1 <= ymax)
keepflag2 = (x2 >= xmin) & (x2 <= xmax) & (y2 >= ymin) & (y2 <= ymax)
x1 = x1[keepflag1]
y1 = y1[keepflag1]
x2 = x2[keepflag2]
y2 = y2[keepflag2]
ax1 = plt.subplot2grid((nrow,ncol),(1,0),rowspan=nrow-1,colspan=ncol-1, fig=fig)
if hexbinflag:
#t1 = plt.hist2d(x1,y1,bins=100,cmap='gray_r')
#H, xbins,ybins = np.histogram2d(x1,y1,bins=20)
#extent = [xbins[0], xbins[-1], ybins[0], ybins[-1]]
#plt.contour(np.log10(H.T+1), 10, extent = extent, zorder=1,colors='k')
#plt.hexbin(xvar2,yvar2,bins='log',cmap='Blues', gridsize=100)
plt.hexbin(x1,y1,bins='log',cmap='gray_r', gridsize=75,label=name1)
else:
plt.plot(x1,y1,'k.',alpha=alphagray,label=name1, zorder=2)
if contourflag:
H, xbins,ybins = np.histogram2d(x2,y2,bins=contour_bins)
extent = [xbins[0], xbins[-1], ybins[0], ybins[-1]]
plt.contour((H.T), levels=ncontour_levels, extent = extent, zorder=1,colors=color2, label='__nolegend__')
#plt.legend()
else:
plt.plot(x2,y2,'c.',color=color2,alpha=.3, label=name2)
#plt.legend()
#sns.kdeplot(agc['LogMstarTaylor'][keepagc],agc['gmi_corrected'][keepagc])#,bins='log',gridsize=200,cmap='blue_r')
#plt.colorbar()
plt.axis([xmin,xmax,ymin,ymax])
plt.xticks(fontsize=12)
plt.yticks(fontsize=12)
plt.xlabel(xlabel,fontsize=22)
plt.ylabel(ylabel,fontsize=22)
#plt.axis([7.9,11.6,-.05,2])
ax2 = plt.subplot2grid((nrow,ncol),(0,0),rowspan=1,colspan=ncol-1, fig=fig, sharex = ax1, yticks=[])
t = plt.hist(x1, normed=True, bins=nhistbin,color='k',histtype='step',lw=1.5, label=name1)
t = plt.hist(x2, normed=True, bins=nhistbin,color=color2,histtype='step',lw=1.5, label=name2)
#plt.legend()
ax2.legend(fontsize=10,loc='upper left')
ax2.xaxis.tick_top()
ax3 = plt.subplot2grid((nrow,ncol),(1,ncol-1),rowspan=nrow-1,colspan=1, fig=fig, sharey = ax1, xticks=[])
t=plt.hist(y1, normed=True, orientation='horizontal',bins=nhistbin,color='k',histtype='step',lw=1.5, label=name1)
t=plt.hist(y2, normed=True, orientation='horizontal',bins=nhistbin,color=color2,histtype='step',lw=1.5, label=name2)
plt.yticks(rotation='horizontal')
ax3.yaxis.tick_right()
plt.savefig(figname)
print('############################################################# ')
print('KS test comparising galaxies within range shown on the plot')
print('')
print('STELLAR MASS')
t = ks(x1,x2,run_anderson=False)
print('')
print('COLOR')
t = ks(y1,y2,run_anderson=False)
In [10]:
def plotsalim07():
#plot the main sequence from Salim+07 for a Chabrier IMF
lmstar=np.arange(8.5,11.5,0.1)
#use their equation 11 for pure SF galaxies
lssfr = -0.35*(lmstar - 10) - 9.83
#use their equation 12 for color-selected galaxies including
#AGN/SF composites. This is for log(Mstar)>9.4
#lssfr = -0.53*(lmstar - 10) - 9.87
lsfr = lmstar + lssfr -.3
sfr = 10.**lsfr
plt.plot(lmstar, lsfr, 'w-', lw=4)
plt.plot(lmstar, lsfr, c='salmon',ls='-', lw=2, label='$Salim+07$')
plt.plot(lmstar, lsfr-np.log10(5.), 'w--', lw=4)
plt.plot(lmstar, lsfr-np.log10(5.), c='salmon',ls='--', lw=2)
def plotelbaz():
#plot the main sequence from Elbaz+13
xe=np.arange(8.5,11.5,.1)
xe=10.**xe
#I think that this comes from the intercept of the
#Main-sequence curve in Fig. 18 of Elbaz+11. They make the
#assumption that galaxies at a fixed redshift have a constant
#sSFR=SFR/Mstar. This is the value at z=0. This is
#consistent with the value in their Eq. 13
#This is for a Salpeter IMF
ye=(.08e-9)*xe
plt.plot(log10(xe),np.log19(ye),'w-',lw=3)
plt.plot(log10(xe),np.log10(ye),'k-',lw=2,label='$Elbaz+2011$')
#plot(log10(xe),(2*ye),'w-',lw=4)
#plot(log10(xe),(2*ye),'k:',lw=2,label='$2 \ SFR_{MS}$')
plt.plot(log10(xe),np.log10(ye/5.),'w--',lw=4)
plt.plot(log10(xe),np.log10(ye/5.),'k--',lw=2,label='$SFR_{MS}/5$')
In [11]:
lcs = fits.getdata(homedir+'/github/LCS/tables/LCS_all_size.fits')
In [12]:
mstar = lcs['MSTAR_50']
sfr = np.log10(lcs['SFR_ZDIST'])
core = (lcs['DR_R200'] < 0.6) & (lcs['DELTA_V'] < 3.)
ssfr = sfr-mstar
sf_flag = ssfr > -11.2
In [13]:
plt.figure(figsize=(8,6))
plt.plot(mstar[core],(sfr[core]),'ro',label='Core')
plt.plot(mstar[~core],(sfr[~core]),'bo',label='External')
plt.xlabel('M*')
plt.ylabel('SFR')
#plt.gca().set_yscale('log')
xl = np.linspace(8,12,100)
yl = -11.2 + xl
plt.plot(xl,yl,'k--')
Out[13]:
In [14]:
plt.figure()
mybins = np.linspace(-14,-8,20)
plt.hist(ssfr[core],bins=mybins,color='r',histtype='step',label='core')
plt.hist(ssfr[~core],bins=mybins,color='b',histtype='step',label='external')
Out[14]:
In [15]:
flag1 = core & sf_flag #& (mstar > 9.5) & (mstar < 10.)
flag2 = ~core & sf_flag #& (mstar > 9.5) & (mstar < 10.)
colormass(mstar[flag1],(sfr[flag1]),mstar[flag2],(sfr[flag2]),'core','external','sfr-mstar.pdf',ymin=-3,ymax=1,nhistbin=20,ylabel='$\log_{10}(SFR)$')
So if we compare the core and external samples in the SFR-M* plane, we find no significant differences in either mass or SFR distribution.
In [16]:
%run ~/github/LCS/python/Python3/LCSbase.py
In [17]:
sfr = g.SFR_NUV_BEST
sfr = g.SFR_BEST
sfr = g.logSFR_NUV_BEST
#sfr = np.log10(g.s['SFR_ZDIST'])
mstar = g.logstellarmass
ssfr = sfr - mstar
sf_flag = ssfr > -11
In [18]:
core = g.membflag
core = (g.s['DR_R200'] < 0.6) & (g.s['DELTA_V'] < 3.)
In [19]:
plt.figure()
sfr_uv = g.logSFR_NUV_BEST
sfr_ir = np.log10(g.SFR_BEST)
plt.plot(sfr_ir,sfr_uv,'bo')
plt.xlabel('SFR IR')
plt.ylabel('SFR UV+IR')
xmin=-2
xmax=1
plt.axis([xmin,xmax,xmin,xmax])
xl = np.linspace(xmin,xmax,100)
plt.plot(xl,xl,'k-',lw=3)
Out[19]:
Switched from chary & elbaz to kennicutt and Evans SFRs. The plot below shows UV, IR, and UV+IR SFRs. The IR is sensitive to highests SFRs, and UV misses or underestimates these. However, the UV detects lower SFRs that IR tracers miss. Thus, the optimum tracer of SF is UV+IR.
In [20]:
# compare distribution of SFRs
plt.figure()
mybins = np.linspace(-5,1,20)
plt.hist(g.logSFR_NUVIR_KE,histtype='step',color='c',bins=mybins,label='UV+IR')
plt.hist(g.logSFR_IR_KE,histtype='step',color='r',bins=mybins,label='IR')
plt.hist(g.logSFR_NUV_KE,histtype='step',color='b',bins=mybins,label='UV')
plt.legend(loc='upper left')
Out[20]:
UV+IR probes to lower SFRs than IR alone.
In [21]:
sfr = g.logSFR_NUVIR_KE
mstar = g.logstellarmass
ssfr = sfr - mstar
flag1 = core #& sf_flag #& (mstar > 9.5) & (mstar < 10.)
flag2 = ~core #& sf_flag #& (mstar > 9.5) & (mstar < 10.)
colormass(mstar[flag1],(sfr[flag1]),mstar[flag2],(sfr[flag2]),'core','external','sfr-mstar.pdf',ymin=-3,ymax=1,nhistbin=20,ylabel='$\log_{10}(SFR)$')
This difference we see between the core and external sample is do to the higher fraction of galaxies on the passive sequence. The SFRs on the passive sequence are not reliable and should be thought of as upper limits (according to Leroy+2019).
We also need to apply mass cuts.
In [22]:
plt.figure()
sfr = g.logSFR_NUVIR_KE
mstar = g.logstellarmass
ssfr = sfr - mstar
flag1 = core & (mstar > 9.5) #& (mstar < 10.)
flag2 = ~core & (mstar > 9.5) #& (mstar < 10.)
plt.hist(ssfr[~core],bins=np.linspace(-14,-8,30),color='b',histtype='step')
plt.hist(ssfr[core],bins=np.linspace(-14,-8,30),color='r',histtype='step')
plt.axvline(x=-11.5,color='k')
plt.axvline(x=-11.,color='k')
Out[22]:
Our internal analysis for LCS is limited by :
We are looking for other field samples to compare with.
This is a reprocessing of galaxies with $z < 3500$~km/s. There are only 18 galaxies in common with LCS. However, we can use this as a field comparison.
The GALEX-SDSS-WISE Legacy survey has SFR and Mstar for SDSS galaxies out to $z < ??$
We have $\sim$1500 galaxies in common b/w LCS and GSWLC. This is definitely a better field sample. And we can use the SFRs and Mstar values from GSW for all comparisons (including LCS galaxies) so that there is in no potential systematics related to how these quantities are calculated.
In [24]:
plt.figure()
plt.hist(g.s['ZDIST']*3.e5)
plt.xlabel('Recession Velocity')
plt.ylabel('number')
plt.title('Recession Velocity Distribution of LCS')
Out[24]:
In [25]:
search_radius = 30.*np.ones(len(g.s)) # units are arcsec
newtable = Table([g.s['NSAID'],g.s['RA'],g.s['DEC'],search_radius],names=['galid','ra','dec','major'])
newtable.write('/home/rfinn/research/lcs_sample.txt',format='ipac',overwrite=True)
In [27]:
lcsmgs = ascii.read('/home/rfinn/research/LCS/tables/lcs_z0mgs_match.tbl',format='ipac')
In [28]:
# number of matches
print(sum(lcsmgs['ra'] > 0))
We have 18 galaxies that overlap between the Local Cluster Survey and the z0MGS. We compare the stellar mass and SFR estimates from LCS and z0MGS for these galaxies. Both the stellar mass and SFRs are consistent.
In [29]:
# compare SFRs
plt.figure(figsize=(8,6))
sfr1 = g.logSFR_NUVIR_KE
sfr2 = lcsmgs['logsfr']
plt.plot(sfr1,sfr2,'bo')
xl = np.linspace(-1.5,1,10)
plt.plot(xl,xl,'k-')
plt.xlabel('$\log_{10}(SFR \ LCS)$',fontsize=20)
plt.ylabel('$ \log_{10}(SFR \ z0MGS)$',fontsize=20)
Out[29]:
In [30]:
# compare SFRs
plt.figure()
sfr1 = g.logstellarmass
sfr2 = lcsmgs['logmass']
plt.plot(sfr1,sfr2,'bo')
xl = np.linspace(9,12,10)
plt.plot(xl,xl,'k-')
plt.xlabel('$\log_{10}(M_\star \ LCS/M_\odot)$',fontsize=20)
plt.ylabel('$\log_{10}(M_\star \ z0MGS/M_\odot)$',fontsize=20)
Out[30]:
The z0MGS SFRs are systematically higher than the K&E SFRs that I calculated for the LCS galaxies.
The slope of the z0MGS vs Moustakas stellar masses is less than 1, meaning that z0MGS has lower masses for high mass galaxies and higher masses for low-mass galaxies. Not sure what to make of this...
GSWLC is a better comparison sample, so skip z0MGS for now.
In [32]:
mgs = ascii.read('/home/rfinn/research/z0mgs/z0mgs_full_catalog.tbl',format='ipac')
In [33]:
mgs.columns
Out[33]:
In [34]:
plt.figure(figsize=(8,6))
plt.plot(mgs['ra'],mgs['dec'],'k.',alpha=.05)
plt.gca().invert_xaxis()
ra = mgs['ra']
dec = mgs['dec']
region1 = (ra > 225) & (dec > 50)
region2 = (ra < 150) & (dec < -50)
region3 = (ra < 100) & (dec > 60)
plt.plot(ra[region1],dec[region1],'c.',alpha=.1)
plt.plot(ra[region2],dec[region2],'c.',alpha=.1)
plt.plot(ra[region3],dec[region3],'c.',alpha=.1)
print(sum(region1)+sum(region2) + sum(region3))
fieldsample = region1 | region2 | region3
plt.xlabel('RA (deg)',fontsize=20)
plt.ylabel('DEC (deg)',fontsize=20)
plt.title('Leroy+2019 z0MGS')
plt.savefig('z0mgs-positions.pdf')
The cyan regions are areas that we selected "by eye" to be relatively low density regions. This is a first attempt at creating a field sample.
A more quantitative comparison is to calculate local density, and then select a "field" sample according to local density.
In [36]:
pos = SkyCoord(ra=mgs['ra'],dec=mgs['dec'], distance=mgs['dist_mpc'],frame='icrs')
In [66]:
NN = 10
idx, d2d, d3d = pos.match_to_catalog_3d(pos,nthneighbor=NN)
In [75]:
plt.figure(figsize=(10,8))
densN = NN/d3d
plt.scatter(mgs['ra'],mgs['dec'],c=np.log10(densN*u.Mpc),vmin=-.5,vmax=1.,s=10)
plt.colorbar(label='$\log_{10}(N/d_N)$')
plt.xlabel('RA')
plt.ylabel('DEC')
plt.gca().invert_xaxis()
In [79]:
plt.figure()
t = plt.hist(np.log10(densN*u.Mpc), bins=20)
plt.xlabel('$ \log_{10} (N/d_N)$')
Out[79]:
Seems reasonable to select "field" as galaxies with $\log_{10}(N/d_N) < 0.5$
we can use the GSWLC SFRs and Stellar masses for both the LCS and comparison galaxies. This removes significant uncertainty associated with mixing methods for calculating SFR and Mstar.
redshift limit $0.01 < z < 0.3$
Stellar Mass Limit
SFR Limit
Environment Catalogs
In [12]:
# this catalog is a joined catalog between LCS and GSWLC
# it contains 1505 rows - the number of matches b/w the two catalogs
lcsgsw = fits.getdata('/home/rfinn/research/LCS/tables/lcs-gswlc-x2-match.fits')
#lcsgsw['sampleflag'] = lcsgsw['sampleflag'] == 84
In [38]:
print('number of matches between LCS and GSWLC = ',len(lcsgsw))
print('number with UV = ',sum(lcsgsw['flag_uv'] == 2))
print('number with mid IR = ',sum(lcsgsw['flag_midir'] == 1))
print('number with SDSS galaxy data = ',sum(lcsgsw['flag_mgs'] == 1))
In [26]:
zmax = max(lcsgsw['ZDIST'])
print(zmax)
# assume hubble flow
dmax = zmax*3.e5/70
r_limit = 18.
# abs r
# m - M = 5logd_pc - 5
# M = m - 5logd_pc + 5
## r = 22.5 - np.log10(lcsgsw['NMGY'][:,4])
Mr = r_limit - 5*np.log10(dmax*1.e6) +5
print(Mr)
In [38]:
ssfr = lcsgsw['logSFR'] - lcsgsw['logMstar']
flag = (lcsgsw['logMstar'] > 0) & (ssfr > -11.5)
Mr = lcsgsw['ABSMAG'][:,4]
plt.figure()
plt.plot(Mr[flag],lcsgsw['logMstar'][flag],'bo',alpha=.2,markersize=3)
plt.axvline(x=-18.33)
plt.axhline(y=9.8)
plt.axhline(y=9.5)
plt.xlabel('Mr')
plt.ylabel('logMstar GSWLC')
plt.grid(True)
In [219]:
plt.figure()
plt.plot((lcsgsw['MSTAR_50']),lcsgsw['logMstar'],'ko',color='0.5',alpha=.5)
flag = lcsgsw['sampleflag']
plt.plot(lcsgsw['MSTAR_50'][flag],lcsgsw['logMstar'][flag],'bo',alpha=.5)
axis([8,12,8,12])
xl = np.linspace(8,12,100)
plt.plot(xl,xl,'k--',lw=3)
plt.xlabel('Moustakas Mstar')
plt.ylabel('GSWLC Mstar')
Out[219]:
The fact that GSWLC and JM's stellar mass values agree is reassuring. However, we will be using GSWLC measurements for both the LCS and comparison samples, so this is not as critical.
In [274]:
plt.figure()
mybins=np.arange(8,12,.125)
plt.hist(lcsgsw['logMstar'],bins=mybins)
plt.axvline(x=9.5,c='k')
plt.title('Distribution of GSWLC Mstar for LCS Galaxies')
#print(sum(lcsgsw.sampleflag))
Out[274]:
In [287]:
plt.figure()
flag = lcsgsw['logMstar']> 0
x = lcsgsw['Z']*3.e5
y = lcsgsw['logMstar']
plt.plot(x[flag],y[flag],'k.')
plt.xlim([3000,15000])
plt.axhline(y=9.5)
plt.title('Mstar limits of LCS+GSWLC')
plt.xlabel('vr (km/s)',fontsize=16)
plt.ylabel('GSWLC logMstar',fontsize=16)
print('number of galaxies with logMstar > 9.5 = ',sum(y > 9.5))
In [40]:
plt.figure()
flag = lcsgsw['logMstar']> 0
x = lcsgsw['Z']*3.e5
y = lcsgsw['logSFR']
plt.plot(x[flag],y[flag],'k.')
plt.xlim([3000,15000])
#plt.axhline(y=9.5)
plt.title('SFR limits of LCS+GSWLC')
plt.xlabel('vr (km/s)',fontsize=16)
plt.ylabel('GSWLC logSFR',fontsize=16)
Out[40]:
make SFR-Mstar plot using 11,000 < vr < 13,000. Set sSFR limits using this plot.
In [55]:
plt.figure()
x = lcsgsw['Z']*3.e5
flag = (lcsgsw['logMstar']> 0) #& (x < 13000) & (x > 10000)
flag2 = (lcsgsw['logMstar']> 0) & (x < 13000) & (x > 10000)
y = lcsgsw['logSFR']
x = lcsgsw['logMstar']
plt.plot(x[flag],y[flag],'k.',alpha=.5)
plt.plot(x[flag2],y[flag2],'c.')
#plt.xlim([3000,15000])
#plt.axhline(y=9.5)
xl = np.linspace(8.5,10.5,20)
ssfr = -10
plt.plot(xl,xl+ssfr,'b--',lw=3)
plotsalim07()
plt.title('SFR - Mstar of LCS+GSWLC')
plt.xlabel('GSWLC logMstar',fontsize=16)
plt.ylabel('GSWLC logSFR',fontsize=16)
Out[55]:
In [207]:
plt.figure(figsize=(8,6))
flag = lcsgsw['sampleflag'] & ~lcsgsw['membflag']
flag = lcsgsw['lirflag']
plt.plot(lcsgsw['logSFR_NUVIR_KE'][flag],lcsgsw['logSFR'][flag],'bo')
axis([-2,1.5,-2,1.5])
xl = np.linspace(-1.5,1,20)
plt.plot(xl,xl,'c-',lw=3,label='1:1')
offset=.18
plt.plot(xl,xl+offset,'c--',lw=3,label='1:1+'+str(offset))
plt.xlabel('SFR LCS',fontsize=16)
plt.ylabel('SFR GSWLC',fontsize=16)
plt.legend()
Out[207]:
need to check which IMF is used in Kennicutt & Evans, and by GSWLC
In [236]:
masscut = 9.25
#core = (g.s['DR_R200'] < 0.6) & (g.s['DELTA_V'] < 3.)
mstar = lcsgsw['logMstar']
sfr = lcsgsw['logSFR']
ssfr = sfr - mstar
mybins = np.arange(-14,-8,.2)
t=plt.hist(ssfr,bins=mybins)
In [244]:
plt.figure()
flag = mstar > -20
print(sum(flag))
print(sum(flag & (mstar > 9.5)))
plt.plot(mstar[flag],sfr[flag],'k.',alpha=.5)
Out[244]:
In [295]:
masscut = 9.5
ssfrcut = -11.5
#core = (g.s['DR_R200'] < 0.6) & (g.s['DELTA_V'] < 3.)
mstar = lcsgsw['logMstar']
sfr = lcsgsw['logSFR']
ssfr = sfr - mstar
ssfr_flag = (ssfr < -7) & (ssfr > ssfrcut)
#core = (g.s['DR_R200'] < 0.6) & (g.s['DELTA_V'] < 3.)
flag1 = lcsgsw['membflag'] & (lcsgsw['logMstar']> masscut) & ssfr_flag
#fieldflag = (lcsgsw['DR_R200'] > 3) & (lcsgsw['DELTA_V'] > 3)
#print('number in field = ',print(sum(fieldflag)))
flag2 = ~lcsgsw['membflag'] & (lcsgsw['logMstar']> masscut) & ssfr_flag
#flag2 = fieldflag & (lcsgsw['logMstar']> masscut) & ssfr_flag
print('number in core sample = ',sum(flag1))
print('number in external sample = ',sum(flag2))
colormass(mstar[flag1],sfr[flag1],mstar[flag2],sfr[flag2],'core','external','sfr-mstar-gswlc.pdf',ymin=-3,ymax=1.6,xmin=8.5,xmax=11.5,nhistbin=15,ylabel='$\log_{10}(SFR)$')
#plt.plot(xl,xl+ssfr_lower_limit,'k--',c='0.5'6
#plt.axis([9,12,-2,1.5]),
In [43]:
gsw = ascii.read('/home/rfinn/research/GSWLC/GSWLC-X2.dat')
gsw = gsw[((gsw['Z']*3.e5 < 13000.) & (gsw['logMstar']> 0))]
print('number is GSWLC = ',len(gsw))
measure local densities
cut GSWLC by local density to create a field sample
could also try matching to Yang catalog - see if it matters.
In [44]:
print(sum(gsw['flag_mgs']))
In [47]:
pos = SkyCoord(ra=gsw['RA']*u.deg,dec=gsw['DEC']*u.deg, distance=gsw['Z']*3.e5/70*u.Mpc,frame='icrs')
NN = 10
idx, d2d, d3d = pos.match_to_catalog_3d(pos,nthneighbor=NN)
In [48]:
plt.figure(figsize=(14,8))
densN = NN/d3d
plt.scatter(gsw['RA'],gsw['DEC'],c=np.log10(densN*u.Mpc),vmin=-.5,vmax=1.,s=10)
plt.colorbar(label='$\log_{10}(N/d_N)$')
plt.xlabel('RA')
plt.ylabel('DEC')
plt.gca().invert_xaxis()
plt.axhline(y=5)
plt.axhline(y=60)
plt.axvline(x=135)
plt.axvline(x=225)
Out[48]:
cutting GSWLC to main SDSS survey area, and then recalculating local densities
In [49]:
ramin=135
ramax=225
decmin=5
decmax=60
gsw_position_flag = (gsw['RA'] > ramin) & (gsw['RA'] < ramax) & (gsw['DEC'] > decmin) & (gsw['DEC'] < decmax)
In [50]:
gsw = gsw[gsw_position_flag]
In [51]:
pos = SkyCoord(ra=gsw['RA']*u.deg,dec=gsw['DEC']*u.deg, distance=gsw['Z']*3.e5/70*u.Mpc,frame='icrs')
NN = 10
idx, d2d, d3d = pos.match_to_catalog_3d(pos,nthneighbor=NN)
In [52]:
plt.figure(figsize=(14,8))
densN = NN/d3d
plt.scatter(gsw['RA'],gsw['DEC'],c=np.log10(densN*u.Mpc),vmin=-.5,vmax=1.,s=10)
plt.colorbar(label='$\log_{10}(N/d_N)$')
plt.xlabel('RA')
plt.ylabel('DEC')
plt.gca().invert_xaxis()
plt.axhline(y=5)
plt.axhline(y=60)
plt.axvline(x=135)
plt.axvline(x=225)
Out[52]:
In [53]:
# make a histogram of local densities
plt.figure()
t = plt.hist(np.log10(densN*u.Mpc), bins=20)
plt.xlabel('$ \log_{10} (N/d_N)$')
print('median local density = %.3f'%(np.median(np.log10(densN*u.Mpc))))
plt.axvline(x = (np.median(np.log10(densN*u.Mpc))),c='k')
gsw_density_flag = np.log10(densN*u.Mpc) < np.median(np.log10(densN*u.Mpc))
gsw_density_flag = np.log10(densN*u.Mpc) < .2
Could also use Yang catalog to remove all galaxies in halos with log M_halo > 13.5 or 14
To determine SFR M* limits
In [55]:
# repeat above, but only keep galaxies in redshift range of LCS
# so that we can judge the mass limit where we can probe SF a factor of
# 5 (or N) below the main sequence
# redshift range of LCS
# 0.0137 < z < 0.0433.
zmin = 0.0137
zmax = 0.0433
zflag = (gsw['Z'] > zmin) & (gsw['Z'] < zmax)
plt.figure(figsize=(8,6))
x = gsw['logMstar'][zflag]
y = gsw['logSFR'][zflag]
plt.plot(x,y,'k.',alpha=.1)
#plt.hexbin(x,y,gridsize=30,vmin=5,cmap='gray_r')
#plt.colorbar()
xl=np.linspace(8,12,50)
ssfr_limit = -10
#plt.plot(xl,xl+ssfr_limit,'r-')
plotsalim07()
plt.xlabel('logMstar',fontsize=16)
plt.ylabel('logSFR',fontsize=16)
Out[55]:
In [56]:
field_gsw = zflag & gsw_density_flag
The Figure above shows the Salim+07 fit to SF main sequence, minus 0.3 dex. Apparently there is a normalization offset b/w Salim+07 and GSWLC from Salim+16. The solid line is the mass-dependent fit to the MS, and the dashed line is a factor of 5 below the MS. The function to plot the lines is from Greg.
lssfr = -0.35*(lmstar - 10) - 9.83
#use their equation 12 for color-selected galaxies including
#AGN/SF composites. This is for log(Mstar)>9.4
#lssfr = -0.53*(lmstar - 10) - 9.87
lsfr = lmstar + lssfr -.3
sfr = 10.**lsfr
Plot samples vs distance from MS.
According to Salim+2016, the mass limit is log10Mstar = 9.8, and the ssfr cut is -11.5.
When we apply these cuts and compare the LCS and GSWLC in the SFR-Mstar plane, the LCS galaxies have a similar distribution of stellar masses, but significantly lower SFRs.
We can also compare sSFRs.
In [58]:
#masscut = 8.5
masscut = 9.8
ssfrcut = -11.5
In [ ]:
mstar = lcsgsw['logMstar']
sfr = lcsgsw['logSFR']
ssfr = sfr - mstar
gswssfr = gsw['logSFR'] - gsw['logMstar']
In [77]:
flag1 = lcsgsw['membflag'] & (lcsgsw['logMstar']> masscut) & (ssfr > ssfrcut)
flag2 = (gsw['logMstar'] > masscut) & (gswssfr > ssfrcut) & field_gsw
print('number in core sample = ',sum(flag1))
print('number in external sample = ',sum(flag2))
colormass(mstar[flag1],sfr[flag1],gsw['logMstar'][flag2],gsw['logSFR'][flag2],'LCS core','GSWLC','sfr-mstar-gswlc-field.pdf',ymin=-2,ymax=1.6,xmin=9.75,xmax=11.5,nhistbin=10,ylabel='$\log_{10}(SFR)$',contourflag=False,alphagray=.8)
plt.savefig(homedir+'/research/LCS/plots/lcscore-gsw-sfms.pdf')
plt.savefig(homedir+'/research/LCS/plots/lcscore-gsw-sfms.png')
In [78]:
lcsinfall = ~lcsgsw['membflag'] & (lcsgsw['DELTA_V'] < 3.)
mstar = lcsgsw['logMstar']
sfr = lcsgsw['logSFR']
ssfr = sfr - mstar
gswssfr = gsw['logSFR'] - gsw['logMstar']
flag1 = lcsinfall & (lcsgsw['logMstar']> masscut) & (ssfr > ssfrcut)
flag2 = (gsw['logMstar'] > masscut) & (gswssfr > ssfrcut) & field_gsw
print('number in infall sample = ',sum(flag1))
print('number in GSWLC field sample = ',sum(flag2))
colormass(mstar[flag1],sfr[flag1],gsw['logMstar'][flag2],gsw['logSFR'][flag2],'LCS infall','GSWLC','lcsinfall-gswlc-sfms.pdf',ymin=-2,ymax=1.6,xmin=9.75,xmax=11.5,nhistbin=15,ylabel='$\log_{10}(SFR)$',contourflag=False,alphagray=.8)
plt.savefig(homedir+'/research/LCS/plots/lcsinfall-gsw-sfms.pdf')
plt.savefig(homedir+'/research/LCS/plots/lcsinfall-gsw-sfms.png')
In [80]:
sigma_split = 600
group = lcsgsw['CLUSTER_SIGMA'] < sigma_split
cluster = lcsgsw['CLUSTER_SIGMA'] > sigma_split
In [81]:
flag1 = lcsgsw['membflag'] & (lcsgsw['logMstar']> masscut) & (ssfr > ssfrcut) & group
flag2 = (gsw['logMstar'] > masscut) & (gswssfr > ssfrcut) & field_gsw
print('number in core sample = ',sum(flag1))
print('number in external sample = ',sum(flag2))
colormass(mstar[flag1],sfr[flag1],gsw['logMstar'][flag2],gsw['logSFR'][flag2],'LCS core groups','GSWLC','sfr-mstar-gswlc-field.pdf',ymin=-2,ymax=1.6,xmin=9.5,xmax=11.5,nhistbin=15,ylabel='$\log_{10}(SFR)$',contourflag=False,alphagray=.8)
plt.savefig(homedir+'/research/LCS/plots/lcsgroup-gsw-sfms.pdf')
plt.savefig(homedir+'/research/LCS/plots/lcsgroup-gsw-sfms.png')
In [82]:
flag1 = lcsgsw['membflag'] & (lcsgsw['logMstar']> masscut) & (ssfr > ssfrcut) & cluster
flag2 = (gsw['logMstar'] > masscut) & (gswssfr > ssfrcut) & field_gsw
print('number in core sample = ',sum(flag1))
print('number in external sample = ',sum(flag2))
colormass(mstar[flag1],sfr[flag1],gsw['logMstar'][flag2],gsw['logSFR'][flag2],'LCS core cluster','GSWLC','sfr-mstar-gswlc-field.pdf',ymin=-2,ymax=1.6,xmin=9.5,xmax=11.5,nhistbin=15,ylabel='$\log_{10}(SFR)$',contourflag=False,alphagray=.8)
plt.savefig(homedir+'/research/LCS/plots/lcscluster-gsw-sfms.pdf')
plt.savefig(homedir+'/research/LCS/plots/lcscluster-gsw-sfms.png')
In [99]:
flag1 = lcsgsw['membflag'] & (lcsgsw['logMstar']> masscut) & (ssfr > ssfrcut)
flag2 = (gsw['logMstar'] > masscut) & (gswssfr > ssfrcut) & field_gsw
flag3 = ~lcsgsw['membflag'] & (lcsgsw['logMstar']> masscut) & (ssfr > ssfrcut)
print('number in core sample = ',sum(flag1))
print('number in external sample = ',sum(flag2))
ks(ssfr[flag1],gswssfr[flag2])
plt.figure(figsize=(6,8))
plt.subplot(2,1,1)
mybins = np.linspace(-11.5,-8.75,20)
t = plt.hist(ssfr[flag1],bins=mybins,histtype='step',normed=True,lw=2,label='LCS Core')
t = plt.hist(gswssfr[flag2],bins=mybins,histtype='step',normed=True,lw=2,label='GSWLC')
#t = plt.hist(ssfr[flag3],bins=mybins,histtype='step',normed=True,lw=2,label='LCS External')
plt.legend()
#plt.xlabel('$\log_{10}(sSFR)$',fontsize=20)
plt.ylabel('$Normalized \ Frequency$',fontsize=20)
plt.subplot(2,1,2)
mybins = np.linspace(-11.5,-8.75,20)
#t = plt.hist(ssfr[flag1],bins=mybins,histtype='step',normed=True,lw=2,label='LCS Core')
t = plt.hist(ssfr[flag3],bins=mybins,histtype='step',normed=True,lw=2,label='LCS External')
t = plt.hist(gswssfr[flag2],bins=mybins,histtype='step',normed=True,lw=2,label='GSWLC')
plt.legend()
plt.xlabel('$\log_{10}(sSFR)$',fontsize=20)
plt.ylabel('$Normalized \ Frequency$',fontsize=20)
Out[99]:
In [ ]:
In [72]:
sfms_dist_lcs = lcsgsw['logSFR'] - ((-0.35*(lcsgsw['logMstar'] - 10) -9.83+ lcsgsw['logMstar']-.3))
sfms_dist_gsw = gsw['logSFR'] - ((-0.35*(gsw['logMstar'] - 10) -9.83+ gsw['logMstar']-.3))
In [73]:
mstar = lcsgsw['logMstar']
sfr = lcsgsw['logSFR']
ssfr = sfr - mstar
lcs_flag = lcsgsw['membflag'] & (lcsgsw['logMstar']> masscut) & (ssfr_cut_lcs)
gsw_flag = (gsw['logMstar'] > masscut) & (ssfr_cut_gsw)
plt.figure(figsize=(8,6))
#mybins = np.arange(-1,1.5,20)
t = plt.hist(sfms_dist_lcs[lcs_flag],histtype='step',normed=True,lw=2,label='LCS')#,bins=mybins)
t = plt.hist(sfms_dist_gsw[gsw_flag],histtype='step',normed=True,lw=2,label='GSWLC')#,bins=mybins)
plt.legend(loc='upper right')
plt.xlabel('$\log_{10}(SFR) - \log_{10}(SFR_{MS})$',fontsize=20)
plt.ylabel('$Frequency$',fontsize=20)
# KS test
ks_2samp(sfms_dist_lcs[lcs_flag],sfms_dist_gsw[gsw_flag])
Out[73]:
In [234]:
sigma_split = 600
group = lcsgsw['CLUSTER_SIGMA'] < sigma_split
cluster = lcsgsw['CLUSTER_SIGMA'] > sigma_split
In [235]:
mstar = lcsgsw['logMstar']
sfr = lcsgsw['logSFR']
ssfr = sfr - mstar
lcs_flag = lcsgsw['membflag'] & (lcsgsw['logMstar']> masscut) & (ssfr_cut_lcs) & group
gsw_flag = (gsw['logMstar'] > masscut) & (ssfr_cut_gsw)
plt.figure(figsize=(8,6))
#mybins = np.arange(-1,1.5,20)
t = plt.hist(sfms_dist_lcs[lcs_flag],histtype='step',normed=True,lw=2,label='LCS')#,bins=mybins)
t = plt.hist(sfms_dist_gsw[gsw_flag],histtype='step',normed=True,lw=2,label='GSWLC')#,bins=mybins)
plt.legend(loc='upper right')
plt.xlabel('$\log_{10}(SFR) - \log_{10}(SFR_{MS})$',fontsize=20)
plt.ylabel('$Frequency$',fontsize=20)
# KS test
ks_2samp(sfms_dist_lcs[lcs_flag],sfms_dist_gsw[gsw_flag])
Out[235]:
In [236]:
mstar = lcsgsw['logMstar']
sfr = lcsgsw['logSFR']
ssfr = sfr - mstar
lcs_flag = lcsgsw['membflag'] & (lcsgsw['logMstar']> masscut) & (ssfr_cut_lcs) & cluster
gsw_flag = (gsw['logMstar'] > masscut) & (ssfr_cut_gsw)
plt.figure(figsize=(8,6))
mybins = np.arange(-1,1.5,20)
t = plt.hist(sfms_dist_lcs[lcs_flag],histtype='step',normed=True,lw=2,label='LCS')#,bins=mybins)
t = plt.hist(sfms_dist_gsw[gsw_flag],histtype='step',normed=True,lw=2,label='GSWLC')#,bins=mybins)
plt.legend(loc='upper right')
plt.xlabel('$\log_{10}(SFR) - \log_{10}(SFR_{MS})$',fontsize=20)
plt.ylabel('$Frequency$',fontsize=20)
# KS test
ks_2samp(sfms_dist_lcs[lcs_flag],sfms_dist_gsw[gsw_flag])
Out[236]:
In [237]:
clusters = set(lcsgsw['CLUSTER'])
print(clusters)
In [238]:
mstar = lcsgsw['logMstar']
sfr = lcsgsw['logSFR']
ssfr = sfr - mstar
for c in clusters:
lcs_flag = lcsgsw['membflag'] & (lcsgsw['logMstar']> masscut) & (ssfr_cut_lcs) & (lcsgsw['CLUSTER'] == c)
gsw_flag = (gsw['logMstar'] > masscut) & (ssfr_cut_gsw)
plt.figure(figsize=(8,6))
mybins = np.arange(-1,1.5,20)
t = plt.hist(sfms_dist_lcs[lcs_flag],histtype='step',normed=True,lw=2,label='LCS')#,bins=mybins)
t = plt.hist(sfms_dist_gsw[gsw_flag],histtype='step',normed=True,lw=2,label='GSWLC')#,bins=mybins)
plt.legend(loc='upper right')
plt.xlabel('$\log_{10}(SFR) - \log_{10}(SFR_{MS})$',fontsize=20)
plt.ylabel('$Frequency$',fontsize=20)
plt.title(c,fontsize=22)
# KS test
t = ks_2samp(sfms_dist_lcs[lcs_flag],sfms_dist_gsw[gsw_flag])
print(c,sum(lcs_flag),sum(gsw_flag),t)
In [256]:
plt.figure()
x = lcsgsw['DELTA_V']
y = lcsgsw['DR_R200']
plt.plot(x,y,'k.')
#plt.gca().set_xscale('log')
plt.xlim(0,5)
print(len(x))
In [ ]:
In [ ]:
In [34]:
sfr = g.logSFR_NUVIR_KE
mstar = g.logstellarmass
ssfr = sfr - mstar
sf_flag = ssfr > -99
ssfr_lower_limit = -11.5
xl = np.linspace(8.5,11.5)
In [51]:
flag1 = core & g.clusterflag & sf_flag & (mstar > masscut) #& (mstar < 10.)
flag2 = ~core & sf_flag & (mstar > masscut) #& (mstar < 10.)
plt.figure()
plt.plot(mstar[flag1],ssfr[flag1],'k.')
plt.plot(mstar[flag2],ssfr[flag2],'c.')
plt.ylim(-12.5,-9)
xl = np.linspace(9,12,20)
plt.plot(xl,-.25*(xl-9)-11.1,'m-',lw=3)
plt.xlabel('$\log_{10}(M_star/M_\odot) $')
plt.ylabel('$\log_{10}(SFR/M_star) $')
plt.savefig('ssfr_cut.pdf')
ssfr_flag = ssfr > (-.25*(mstar-9)-11.1)
In [96]:
plt.figure(figsize=(10,8))
flag1 = core & g.clusterflag & sf_flag & (mstar > masscut) #& (mstar < 10.)
flag2 = ~core & sf_flag & (mstar > masscut) #& (mstar < 10.)
plt.plot(mgs['logmass'][fieldsample],mgs['logsfr'][fieldsample],'k.',alpha=.2)
plt.plot(mstar[flag2],sfr[flag2],'c.',alpha=.2)
plt.xlabel('$\log_{10}(M_\star/M_\odot) $')
plt.ylabel('$\log_{10}(SFR) $')
plt.ylim(-4,2)
plt.savefig('sfms_with_mgs.pdf')
In [136]:
masscut = 9.5
#core = (g.s['DR_R200'] < 0.6) & (g.s['DELTA_V'] < 3.)
core = g.membflag
#core = (g.s['DR_R200'] < 0.6) & (g.s['DELTA_V'] < 3.)
flag1 = core & (mstar > masscut) & (ssfr > -11.)
flag2 = fieldsample & (mgs['logmass'] > masscut) & (mgs['logsfr']-mgs['logmass'] > -11.)
colormass(mstar[flag1],sfr[flag1],mgs['logmass'][flag2],mgs['logsfr'][flag2],'core','mgs','sfr-mstar-cluster-mgs.pdf',ymin=-1.6,ymax=1.6,xmin=9,xmax=11.5,nhistbin=15,ylabel='$\log_{10}(SFR)$')
#plt.plot(xl,xl+ssfr_lower_limit,'k--',c='0.5'6
#plt.axis([9,12,-2,1.5]),
In [128]:
masscut = 9.5
ssfr_cut = -11
core = (g.s['DR_R200'] < 0.6) & (g.s['DELTA_V'] < 3.)
flag1 = core & (mstar > masscut) & (ssfr > ssfr_cut)
flag2 = ~core & sf_flag & (mstar > masscut) & (ssfr > ssfr_cut)
colormass(mstar[flag1],(sfr[flag1]),mstar[flag2],(sfr[flag2]),'core','external','sfr-mstar.pdf',ymin=-1.5,ymax=1.5,xmin=9,xmax=11.5,nhistbin=15,ylabel='$\log_{10}(SFR)$')
#plt.plot(xl,xl+ssfr_lower_limit,'k--',c='0.5')
In [103]:
plt.figure()
mybins = np.linspace(-13,-8,20)
plt.hist(ssfr[core],bins=mybins,color='r',histtype='step',label='core')
plt.hist(ssfr[~core],bins=mybins,color='b',histtype='step',label='external')
Out[103]:
In [22]:
flag1 = g.membflag & sf_flag
flag2 = ~core & sf_flag
colormass(mstar[flag1],(sfr[flag1]),mstar[flag2],(sfr[flag2]),'core','external','sfr-mstar.pdf',ymin=-3,ymax=1,nhistbin=20,ylabel='$\log_{10}(SFR)$')
In [105]:
sfr_ir = np.log10(g.s['SFR_ZDIST'])
sfr_uvir = g.logSFR_NUV_ZDIST
sfr_ratio = sfr_ir - sfr_uvir
In [109]:
plt.figure()
mybins = np.linspace(-1,1,20)
plt.hist(sfr_ratio[core],bins=mybins,color='r',histtype='step',label='core')
plt.hist(sfr_ratio[~core],bins=mybins,color='b',histtype='step',label='external')
plt.legend(loc='upper left')
Out[109]:
In [97]:
nuv24 = g.s.ABSMAG[:,1] - g.s.fcmag1
In [100]:
plt.figure()
mybins = np.linspace(-20,0,20)
plt.hist(nuv24[core],bins=mybins,color='r',histtype='step',label='core')
plt.hist(nuv24[~core],bins=mybins,color='b',histtype='step',label='external')
Out[100]:
In [99]:
plt.figure()
plt.hist(nuv24)
Out[99]:
In [23]:
sfr = g.SFR_NUV_BEST
sfr = g.SFR_BEST
sfr = g.logSFR_NUV_BEST
#sfr = np.log10(g.s['SFR_ZDIST'])
mstar = g.logstellarmass
ssfr = sfr - mstar
sf_flag = ssfr > -11.8
In [24]:
inner_cluster = g.membflag & (g.s['DR_R200'] < .5)
outer_cluster = g.membflag & (g.s['DR_R200'] >= .5)
flags = [inner_cluster & g.galfitflag, outer_cluster & g.galfitflag, ~g.membflag & g.galfitflag]
plt.figure(figsize=(14,4))
all_axes=[]
for i in range(len(flags)):
plt.subplot(1,3,i+1)
plt.scatter(mstar[flags[i]],sfr[flags[i]],c=g.sizeratio[flags[i]],vmin=.1,vmax=1)
if i > 0:
plt.yticks([])
plt.axis([8,12,-2,1])
all_axes.append(plt.gca())
xl = np.linspace(8,12,100)
yl = -11.8 + xl
plt.plot(xl,yl,'k--')
yl = -10.4 + xl
plt.plot(xl,yl,'k-')
xbin,ybin,ybinerr= binxycolor(mstar[flags[i]& sf_flag],sfr[flags[i]& sf_flag],g.sizeratio[flags[i] & sf_flag],6,use_median=True)
print(xbin,ybin)
plt.scatter(xbin,ybin,c=ybinerr,s=300,vmin=.1,vmax=1,marker='s')
plt.colorbar(ax=all_axes)
Out[24]:
In [153]:
# size vs color for SF field pop
plt.figure()
flag = ~g.membflag & g.galfitflag & sf_flag
plt.scatter(g.sizeratio[flag],g.NUVr[flag],c=g.s['SERSIC_N'][flag],vmin=1,vmax=4)
plt.colorbar()
Out[153]:
In [155]:
inner_cluster = g.membflag & (g.s['DR_R200'] < .5)
outer_cluster = g.membflag & (g.s['DR_R200'] >= .5)
flags = [inner_cluster & g.galfitflag, outer_cluster & g.galfitflag, ~g.membflag & g.galfitflag]
plt.figure(figsize=(14,4))
all_axes=[]
for i in range(len(flags)):
plt.subplot(1,3,i+1)
plt.scatter(mstar[flags[i]],sfr[flags[i]],c=g.s['SERSIC_N'][flags[i]],vmin=1,vmax=4)
if i > 0:
plt.yticks([])
plt.axis([8,12,-2,1])
all_axes.append(plt.gca())
xl = np.linspace(8,12,100)
yl = -11.8 + xl
plt.plot(xl,yl,'k--')
yl = -10.4 + xl
plt.plot(xl,yl,'k-')
xbin,ybin,ybinerr= binxycolor(mstar[flags[i]& sf_flag],sfr[flags[i]& sf_flag],g.s['SERSIC_N'][flags[i] & sf_flag],6,use_median=True)
print(xbin,ybin)
plt.scatter(xbin,ybin,c=ybinerr,s=300,vmin=1,vmax=4,marker='s')
plt.colorbar(ax=all_axes)
Out[155]:
In [191]:
def sfr_mstar(flags,colorvar,plotbinned=True,v1=.1,v2=1):
plt.figure(figsize=(14,4))
all_axes=[]
for i in range(len(flags)):
plt.subplot(1,3,i+1)
plt.scatter(mstar[flags[i]],sfr[flags[i]],c=colorvar[flags[i]],vmin=v1,vmax=v2)
if i > 0:
plt.yticks([])
plt.axis([8,12,-2,1])
all_axes.append(plt.gca())
xl = np.linspace(8,12,100)
# chi by eye split b/w SF and quiescent
yl = -11.8 + xl
plt.plot(xl,yl,'k--')
# chi by eye fit to main sequence in field
yl = -10.4 + xl
plt.plot(xl,yl,'k-')
if plotbinned:
xbin,ybin,ybinerr= binxycolor(mstar[flags[i]& sf_flag],sfr[flags[i]& sf_flag],colorvar[flags[i] & sf_flag],6,use_median=True)
plt.scatter(xbin,ybin,c=ybinerr,s=300,vmin=v1,vmax=v2,marker='s')
plt.colorbar(ax=all_axes)
def size_vs_size(flags,colorvar,plotbinned=True,v1=1,v2=10):
xmin=0
xmax=15
plt.figure(figsize=(14,4))
all_axes=[]
for i in range(len(flags)):
plt.subplot(1,3,i+1)
#plt.scatter(g.s['Rd'][flags[i]],g.s['fre1'][flags[i]],c=colorvar[flags[i]],vmin=v1,vmax=v2)
plt.scatter(g.s['Rd'][flags[i]],g.s['fre1'][flags[i]],c=colorvar[flags[i]],vmin=v1,vmax=v2)
if i > 0:
plt.yticks([])
plt.axis([xmin,xmax,xmin,xmax])
#plt.gca().set_xscale('log')
#plt.gca().set_yscale('log')
all_axes.append(plt.gca())
xl = np.linspace(xmin,xmax,100)
# chi by eye split b/w SF and quiescent
#yl = -11.8 + xl
plt.plot(xl,xl,'k--')
# chi by eye fit to main sequence in field
#yl = -10.4 + xl
#plt.plot(xl,yl,'k-')
if plotbinned:
xbin,ybin,ybinerr= binxycolor(mstar[flags[i]& sf_flag],sfr[flags[i]& sf_flag],colorvar[flags[i] & sf_flag],6,use_median=True)
plt.scatter(xbin,ybin,c=ybinerr,s=300,vmin=v1,vmax=v2,marker='s')
plt.colorbar(ax=all_axes)
In [176]:
inner_cluster = g.membflag & (g.s['DR_R200'] < .5)
outer_cluster = g.membflag & (g.s['DR_R200'] >= .5)
flags = [inner_cluster & g.galfitflag, outer_cluster & g.galfitflag, ~g.membflag & g.galfitflag]
sfr_mstar(flags,g.s['SERSIC_N'],v1=1,v2=4)
In [169]:
myclusters = set(g.s['CLUSTER'])
for c in myclusters:
inner_cluster = g.membflag & (g.s['DR_R200'] < .5)
outer_cluster = g.membflag & (g.s['DR_R200'] >= .5)
flags = [inner_cluster & g.galfitflag, outer_cluster & g.galfitflag, ~g.membflag & g.galfitflag]
#flags = [inner_cluster , outer_cluster, ~g.membflag ]
for i in range(len(flags)):
flags[i] = flags[i] & (g.s['CLUSTER'] == c)
sfr_mstar(flags,g.sizeratio,plotbinned=False)
plt.title(c)
Removing galfit flag to see about what we are cutting out with this.
Hercules looses A LOT of points. This was the cluster where I had PSF problems and ended up using the standard MIPS PRF rather than one from the actual scan.
Perhaps we should make a measurement using the galfit models without the PRF folded in.
In [168]:
myclusters = set(g.s['CLUSTER'])
for c in myclusters:
inner_cluster = g.membflag & (g.s['DR_R200'] < .5)
outer_cluster = g.membflag & (g.s['DR_R200'] >= .5)
flags = [inner_cluster & g.galfitflag, outer_cluster & g.galfitflag, ~g.membflag & g.galfitflag]
flags = [inner_cluster , outer_cluster, ~g.membflag ]
for i in range(len(flags)):
flags[i] = flags[i] & (g.s['CLUSTER'] == c)
sfr_mstar(flags,g.sizeratio,plotbinned=False)
plt.title(c)
Comparing 24um sizes with and without convolution.
In [190]:
# Disk scale length vs Re24 w/out PRF
inner_cluster = g.membflag & (g.s['DR_R200'] < .5)
outer_cluster = g.membflag & (g.s['DR_R200'] >= .5)
flags = [inner_cluster & g.galfitflag, outer_cluster & g.galfitflag, ~g.membflag & g.galfitflag]
flags = [inner_cluster , outer_cluster, ~g.membflag]
size_vs_size(flags,g.sizeratio,plotbinned=False)
In [192]:
myclusters = set(g.s['CLUSTER'])
for c in myclusters:
inner_cluster = g.membflag & (g.s['DR_R200'] < .5)
outer_cluster = g.membflag & (g.s['DR_R200'] >= .5)
flags = [inner_cluster & g.galfitflag, outer_cluster & g.galfitflag, ~g.membflag & g.galfitflag]
#flags = [inner_cluster , outer_cluster, ~g.membflag ]
for i in range(len(flags)):
flags[i] = flags[i] & (g.s['CLUSTER'] == c)
size_vs_size(flags,g.sizeratio,plotbinned=False,v1=.1,v2=1)
plt.title(c)
In [105]:
# read in matched catalog that has GSWLC and Tempel group galaxies
gg = Table(fits.getdata('/home/rfinn/research/GSWLC/GSWLC-X2-Tempel2012-groups.fits'))
gg = gg[gg['redshift'] < 0.04]
In [106]:
# catalog with group info
tgroups = Table(fits.getdata('/home/rfinn/research/sdss-tempel/dr8_ggc.fits',2))
In [109]:
plt.figure()
mybins = np.linspace(0,200,100)
t = plt.hist(tgroups['nrich'],bins=mybins)
In [110]:
gg
Out[110]:
In [ ]: