In [1]:
from astropy.io import fits,ascii
import numpy as np
from matplotlib import pyplot as plt
%matplotlib inline
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 [2]:
homedir = os.getenv("HOME")
sys.path.append(homedir+'/github/APPSS/')
from a100sdss import ks, anderson
sys.path.append(homedir+'/github/LCS/python/Python3/')
from LCScommon import *


Running on coma

In [3]:
plotdir = homedir+'/research/LCS/plots/'

In [5]:
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)

Generating the LCS Catalog

  • this is done in LCSbase.py
  • this calculates the SFRs according to the Kennicutt & Evans prescriptions
  • I have corrected the NSA magnitudes to the WMAP 9 cosmology

In [181]:
%run ~/github/LCS/python/Python3/LCSbase.py


nothing happening here
(1800, 1800)
updating table

Comparison of LCS with GSWLC

  • The GSWLC provides a better comparison sample for us.
  • I matched to GSWLC-X2 - used 5 arcsecond radius. found 1496 matches.
    • I didn't note how I did the match. I don't see any python programs, so I probably used topcat.
    • redoing on 5/29/20
    • matching LCS_all_size_KE_SFR.fits with GSWLC-X2-LCS-Zoverlap.dat
    • matching NSA RA,DEC with GSWLC RA,DEC
      • 5 arcsec offset
      • best match, symmetric
      • 1 and 2
      • found 1477 pairs (~20 fewer than last time :( )
      • 10 arcsec search radius
        • 1487 pairs
      • 15 arcsec search radius
        • 1490 pairs
  • 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.03$

  • mag limit r petrosian $r = 18.0$
  • main sequence: $log10(sSFR) > -11$
  • explanation of GSWLC-2 catalog http://pages.iu.edu/~salims/gswlc/table2.pdf

Stellar Mass Limit

  • convert r to Mr at maximum distance of LCS ($z=.0433$)
  • then plot Mstar vs Mr, and estimate Mstar limit from Mr limit

SFR Limit

  • Salim+2018 use $log10(sSFR) > -11$ to select star-forming galaxies
  • $log10(sSFR) < -11.5$ should be considered upper limits GSWLC-A (Salim+2018, pg 11, col2)
    • we use this as our sSFR limit
  • for SF galaxies, SFR errors are typically below 0.1dex

Environment Catalogs


In [30]:
# 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 [31]:
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))


number of matches between LCS and GSWLC =  1505
number with UV =  546
number with mid IR =  437
number with SDSS galaxy data =  1477

In [ ]:

Reviewing LCS core/external cut for paper2


In [98]:
os.chdir(homedir+'/research/LCS/plots/')
%run ~/github/LCS/python/Python3/lcs_paper2.py
figname1 = homedir+'/research/LCS/plots/lcs-dvdr.png'
figname2 = homedir+'/research/LCS/plots/lcs-dvdr.pdf'
lcs.plot_dvdr(figname1=figname1,figname2=figname2)


normalizing by radius of disk
No handles with labels found to put in legend.
<Figure size 489.6x360 with 0 Axes>

Creating Field Sample from Full GSWLC

  • for a quick test, use entire GSWLC catalog
  • sort by local density first, then use group catalog from Temple+2014
    • measure local densities
    • cut GSWLC by local density to create a field sample
    • could also try matching to Yang catalog - see if it matters.
  • tempel+2014 catlog can be downloaded from here ftp://cdsarc.u-strasbg.fr/pub/cats/J/A+A/566/A1

In [34]:
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))


number is GSWLC =  65611

In [35]:
print(sum(gsw['flag_mgs']))


63521

cutting GSWLC to main SDSS survey area, and then recalculating local densities


In [66]:
%run ~/github/LCS/python/Python3/lcs_paper2.py
figname1 = homedir+'/research/LCS/plots/gswlc-skyplot.png'
figname2 = homedir+'/research/LCS/plots/gswlc-skyplot.pdf'
g.plot_field1(figname1=figname1,figname2=figname2)


normalizing by radius of disk
<Figure size 489.6x360 with 0 Axes>

In [67]:
%run ~/github/LCS/python/Python3/lcs_paper2.py
figname1 = homedir+'/research/LCS/plots/gswlc-dens-hist.png'
figname2 = homedir+'/research/LCS/plots/gswlc-dens-hist.pdf'
g.plot_dens_hist(figname1=figname1,figname2=figname2)


normalizing by radius of disk
median local density =  0.483
<Figure size 489.6x360 with 0 Axes>

Could also use Yang catalog to remove all galaxies in halos with log M_halo > 13.5 or 14

Visualizing GSWLC sSFR Limit

Salim+2016 state that $sSFR < -11.5$ should be considered upper limits.

The goal of this figure is to visualize where the $sSFR > -11.5$ is relative to SF main sequence. First need to see if we can show the sSFR of the main sequence.

The Figure below 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

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


In [9]:
os.chdir(homedir+'/research/LCS/plots/')
%run ~/github/LCS/python/Python3/lcs_paper2.py
g.plot_ms()


normalizing by radius of disk
<Figure size 489.6x360 with 0 Axes>

Determining the stellar mass limit of GSWLC+LCS

Salim+2016 report $r=18$ limit. This corresponds to $M_r = -18.3$ at the distance of our farthest cluster.

We use the distribution of logMstar vs Mr to determine what stellar mass this corresponds to. The answer is $logMstar = 9.8$.

Therefore, we cut the GSWLC and LCS samples at $logMstar (GSWLC) > 9.8$.

NOTE - we updated this in the second plot, but I can't remember why. Maybe the Tempel sample has a different magnitude cut?


In [50]:
%run ~/github/LCS/python/Python3/lcs_paper2.py
lcs.get_mstar_limit()


normalizing by radius of disk
0.0433
-18.342555555293856
<Figure size 489.6x360 with 0 Axes>

In [133]:
%run ~/github/LCS/python/Python3/lcs_paper2.py
lcs.get_mstar_limit()


normalizing by radius of disk
17.7 0.0433
-18.642555555293857
<Figure size 489.6x360 with 0 Axes>

Comparing LCS vs GSWLC with correct mass and sSFR cuts

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]:
# cutting GSWLC by local density
os.chdir(homedir+'/research/LCS/plots/')
%run ~/github/LCS/python/Python3/lcs_paper2.py
b.plot_sfr_mstar()


normalizing by radius of disk
number in core sample =  137
number in external sample =  1096
############################################################# 
KS test comparising galaxies within range shown on the plot

STELLAR MASS
KS Test:
D =   0.10
p-vale = 0.14559 (prob that samples are from same distribution)

COLOR
KS Test:
D =   0.32
p-vale = 0.00000 (prob that samples are from same distribution)
<Figure size 489.6x360 with 0 Axes>

In [134]:
# cutting by halo mass: log(M) < 12.5
# mass limit log(M) > 9.9 (instead of 9.8)
os.chdir(homedir+'/research/LCS/plots/')
%run ~/github/LCS/python/Python3/lcs_paper2.py
b.plot_sfr_mstar()


normalizing by radius of disk
number in core sample =  92
number in external sample =  3599
############################################################# 
KS test comparising galaxies within range shown on the plot

STELLAR MASS
KS Test:
D =   0.12
p-vale = 0.13924 (prob that samples are from same distribution)
Anderson-Darling test Test:
D =   0.14
p-vale = 0.30142 (prob that samples are from same distribution)

COLOR
KS Test:
D =   0.29
p-vale = 0.00000 (prob that samples are from same distribution)
Anderson-Darling test Test:
D =  21.46
p-vale = 0.00001 (prob that samples are from same distribution)
<Figure size 489.6x360 with 0 Axes>

LCS Infall vs GSWLC Field

CONCLUSION:

  • LCS infall galaxies have significantly lower SFRs

In [6]:
os.chdir(homedir+'/research/LCS/plots/')
%run ~/github/LCS/python/Python3/lcs_paper2.py
flag = ~b.lcs.cat['membflag'] & (b.lcs.cat['DELTA_V'] < 3.)
outfile1 = homedir+'/research/LCS/plots/lcsinfall-gsw-sfms.pdf'
outfile2 = homedir+'/research/LCS/plots/lcsinfall-gsw-sfms.png'
b.plot_sfr_mstar(lcsflag=flag,outfile1=outfile1,outfile2=outfile2)


normalizing by radius of disk
number in core sample =  88
number in external sample =  3599
############################################################# 
KS test comparising galaxies within range shown on the plot

STELLAR MASS
KS Test:
D =   0.12
p-vale = 0.16472 (prob that samples are from same distribution)

COLOR
KS Test:
D =   0.20
p-vale = 0.00196 (prob that samples are from same distribution)
<Figure size 489.6x360 with 0 Axes>

sSFR vs Mstar


In [58]:
os.chdir(homedir+'/research/LCS/plots/')
%run ~/github/LCS/python/Python3/lcs_paper2.py
flag = b.lcs.cat['membflag'] 
outfile1 = homedir+'/research/LCS/plots/lcscore-gsw-ssfrmstar.pdf'
outfile2 = homedir+'/research/LCS/plots/lcscore-gsw-ssfrmstar.png'
b.plot_ssfr_mstar(lcsflag=flag,outfile1=outfile1,outfile2=outfile2)


normalizing by radius of disk
number in core sample =  92
number in external sample =  3599
############################################################# 
KS test comparising galaxies within range shown on the plot

STELLAR MASS
KS Test:
D =   0.12
p-vale = 0.13875 (prob that samples are from same distribution)

COLOR
KS Test:
D =   0.29
p-vale = 0.00000 (prob that samples are from same distribution)
<Figure size 489.6x360 with 0 Axes>

In [129]:
# using sSFR > -11, logMstar > 9.9
os.chdir(homedir+'/research/LCS/plots/')
%run ~/github/LCS/python/Python3/lcs_paper2.py
flag = b.lcs.cat['membflag'] 
outfile1 = homedir+'/research/LCS/plots/lcscore-gsw-ssfrmstar.pdf'
outfile2 = homedir+'/research/LCS/plots/lcscore-gsw-ssfrmstar.png'
b.plot_ssfr_mstar(lcsflag=flag,outfile1=outfile1,outfile2=outfile2)


normalizing by radius of disk
number in core sample =  66
number in external sample =  3359
############################################################# 
KS test comparising galaxies within range shown on the plot

STELLAR MASS
KS Test:
D =   0.13
p-vale = 0.18973 (prob that samples are from same distribution)
Anderson-Darling test Test:
D =   0.42
p-vale = 0.22514 (prob that samples are from same distribution)

COLOR
KS Test:
D =   0.11
p-vale = 0.36597 (prob that samples are from same distribution)
Anderson-Darling test Test:
D =  -0.92
p-vale = 0.92727 (prob that samples are from same distribution)
<Figure size 489.6x360 with 0 Axes>

In [8]:
os.chdir(homedir+'/research/LCS/plots/')
%run ~/github/LCS/python/Python3/lcs_paper2.py
flag = ~b.lcs.cat['membflag'] & (b.lcs.cat['DELTA_V'] < 3.)
outfile1 = homedir+'/research/LCS/plots/lcsinfall-gsw-ssfrmstar.pdf'
outfile2 = homedir+'/research/LCS/plots/lcsinfall-gsw-ssfrmstar.png'
b.plot_ssfr_mstar(lcsflag=flag,outfile1=outfile1,outfile2=outfile2)


normalizing by radius of disk
number in core sample =  88
number in external sample =  3599
############################################################# 
KS test comparising galaxies within range shown on the plot

STELLAR MASS
KS Test:
D =   0.11
p-vale = 0.26468 (prob that samples are from same distribution)

COLOR
KS Test:
D =   0.20
p-vale = 0.00209 (prob that samples are from same distribution)
<Figure size 489.6x360 with 0 Axes>

Splitting LCS by Cluster/group vs GSWLC Field

CONCLUSIONS:

Group members have lower SFRs compared to GSWLC sample.


In [80]:
sigma_split = 600
group = lcsgsw['CLUSTER_SIGMA'] < sigma_split
cluster = lcsgsw['CLUSTER_SIGMA'] > sigma_split

In [59]:
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')


---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-59-32e6fb336e9d> in <module>
----> 1 flag1 = lcsgsw['membflag'] &   (lcsgsw['logMstar']> masscut)  & (ssfr > ssfrcut) & group
      2 flag2 = (gsw['logMstar'] > masscut) & (gswssfr > ssfrcut)  & field_gsw
      3 print('number in core sample = ',sum(flag1))
      4 print('number in external sample = ',sum(flag2))
      5 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)

TypeError: 'type' object is not subscriptable

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')


number in core sample =  105
number in external sample =  1159
############################################################# 
KS test comparising galaxies within range shown on the plot

STELLAR MASS
KS Test:
D =   0.12
p-vale = 0.10553 (prob that samples are from same distribution)

COLOR
KS Test:
D =   0.32
p-vale = 0.00000 (prob that samples are from same distribution)

Comparing sSFRs of LCS vs GSWLC


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)


number in core sample =  137
number in external sample =  1159
KS Test:
D =   0.33
p-vale = 0.00000 (prob that samples are from same distribution)
Anderson-Darling test Test:
D =  39.14
p-vale = 0.04896 (prob that samples are from same distribution)
Out[99]:
Text(0, 0.5, '$Normalized \\ Frequency$')

In [127]:
plt.figure()
nbins = 50
flag = (g.cat['logSFR'] > -99) & (g.cat['logMstar'] > 9.9) & (g.ssfr < -4)
#t = plt.hist(g.ssfr[flag],bins=nbins,normed=True,histtype='step',label='GSWLC')
t = plt.hist(g.ssfr[flag],bins=nbins,weights=np.ones(sum(flag))/sum(flag),histtype='step',label='GSWLC')
flag = (lcs.cat['logSFR'] > -99) & (lcs.cat['logMstar'] > 9.9) & (lcs.ssfr < -4) &  lcs.cat['membflag']
#t = plt.hist(lcs.ssfr[flag],bins=nbins,normed=True,histtype='step',label='LCS')
t = plt.hist(lcs.ssfr[flag],bins=nbins,weights=np.ones(sum(flag))/sum(flag),histtype='step',label='LCS')
plt.legend(loc='upper left')


Out[127]:
<matplotlib.legend.Legend at 0x7f881a2dfdd0>

In [128]:
plt.figure()
nbins = 50
flag = (g.cat['logSFR'] > -99) & (g.cat['logMstar'] > 9.9) & (g.ssfr < -4)
t = plt.hist(g.ssfr[flag],bins=nbins,normed=True,histtype='step',label='GSWLC')
#t = plt.hist(g.ssfr[flag],bins=nbins,weights=np.ones(sum(flag))/sum(flag),histtype='step',label='GSWLC')
flag = (lcs.cat['logSFR'] > -99) & (lcs.cat['logMstar'] > 9.9) & (lcs.ssfr < -4) &  lcs.cat['membflag']
t = plt.hist(lcs.ssfr[flag],bins=nbins,normed=True,histtype='step',label='LCS')
#t = plt.hist(lcs.ssfr[flag],bins=nbins,weights=np.ones(sum(flag))/sum(flag),histtype='step',label='LCS')
plt.legend(loc='upper left')


Out[128]:
<matplotlib.legend.Legend at 0x7f8817234b50>

Still to do

  • bootstrap our external sample, selecting galaxies that have some distribution in SFR-Mass plane as the z0MGS sample.
  • this will let us include size in the SF MS plot, using bootstrapped external sample
  • incorporate SF in the disk shrinking model. apply to SF-stellar mass plane. where do objects go in main sequence. do we reproduce low SF tail seen in core sample.
  • what if we split LCS into low and high mass clusters

Results

  • pop of galaxies with low sSFRs in clusters
  • we show that SF is suppressed in infall regions because the external sample is similar in SF-M* to core sample.
  • drop in SFRs can be explained by disk shrinking?

Matching GSWLC-2 and Group Catalogs

  • matched GSWLC-X2 and Tempel+2012 GALAXY group catalog using topcat
    • matching by SDSS objid yielded only a few thousand matches, so I concluded that GSWLC is using DR7 ids whereas tempel is using DR8. Should look into this more closely b/c (1) why would salim use DR7 in a 2018 paper? (2) salim does not specifically mention which DR the ids correspond to.
    • matched by RA, DEC, 1 arcsec offset
      • best match, symmetric
      • join 1 and 2
      • 514,186 matches
      • saved as fits-basic: ~/research/GSWLC/GSWLC-X2-Tempel2012-groups.fits

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]:
Table length=514186
ididclnrichredshiftdistdistclra_1dec_1lonlatetalammag_umag_gmag_rmag_imag_zabsmag_uabsmag_gabsmag_rabsmag_iabsmag_zkcor_ukcor_gkcor_rkcor_ikcor_zlumrwrankden1den2den4den8den16edgedistmorfhcearlydr8objiddr8specobjididdr7zobsdistcorflagfcObjIDGLXIDplateMJDfiber_idRA_2DEC_2ZchisqlogMstarlogMstar_errlogSFRlogSFR_errAFUVAFUV_errABAB_errAVAV_errflag_sedUV_surveyflag_uvflag_midirflag_mgsSeparation
int32int32int16float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32int16float32float32float32float32float32float32int16float32int64int64int32float32float32int16int64int64int16int32int16float64float64float32float32float32float32float32float32float32float32float32float32float32float32int16int16int16int16int16float64
16120.104439306.3157308.8412251.1607428.22249648.5633838.8796820.51776553.7014619.2995417.562916.7360416.3734116.00028-18.22351-20.15187-20.87932-21.17534-21.626630.3013860.2635090.1198650.0521960.0408411.613351.812161.98037710.3588913.64147935.48209523.290123510.794410.08454123766230245002470418982747228906721285712910.104394308.576201237662302450024731377802984268077476916865347227251.1607428.2224840.10440.6611.0110.024-0.9540.5961.2480.5940.2460.040.180.036022610.04506360017438818
17120.106202311.3657308.8412251.1773728.13795748.46217338.84575320.43824453.77322419.8001818.2274617.4094416.9397216.64743-17.78977-19.47799-20.26045-20.60851-21.025040.3682870.2541860.174390.0516710.0863980.91238731.812238.717788.5538193.40109855.10169653.21922511.050310.0208123766230245002496018982755475243929605713200.106156309.107111237662302450024875637147876234992406116865347230251.1773628.1379530.10620.1510.7590.0620.2060.2563.0020.9380.8250.1710.6180.183012710.02900791424883003
18230.132497386.2322387.9647251.3480528.4655548.9158138.775421.00071153.63523520.6164918.6641517.6812617.2685816.89503-17.54496-19.69511-20.49315-20.82019-21.284280.5078430.4154840.1747330.087760.0651521.1304772.559261.0939616.4778256.35576874.24706842.270448411.372510.48339123765915261049267218982758224022999045716840.132455387.9086601237659152610492765-9916865347231251.3480428.4655420.13250.8810.7880.029-1.3460.8681.6350.7150.2660.1050.180.072020010.049092403110811415
19230.133721389.6974387.9647251.3502228.48285348.93797338.7775221.02281653.62377521.1488118.6336817.5644217.1463216.81766-17.03879-19.77514-20.60835-20.96562-21.359240.5339960.4650460.1730890.1109270.0627431.257022.559163.63989616.6678186.48113254.2736812.27346811.298500.37689123765915261049267218982766470360207365716880.13368388.0207501237659152610492746-9916865347234251.3502128.4828440.13370.710.8560.026-1.3870.8292.2680.8040.3950.1090.270.077020010.0445205440503209
22230.133109387.9639387.9647251.3375728.49566848.95070338.7912821.02362853.6068219.9600218.6426617.660217.2971917.07429-18.12773-19.69588-20.48092-20.76989-21.068780.434150.3947610.1414410.0660610.0289051.1178142.559363.6123916.575156.4190164.26653962.273171711.329800.59931123765915261049267218982774716697415685716600.133067387.9646601237659152610492720-9916865347237251.3375628.4956510.13311.2210.8110.047-0.7750.691.6880.8770.2820.1070.1970.075020610.07048647425396412
21320.139811406.8983405.6975251.5639828.5398149.06429338.6077921.32178353.70834718.8658218.0853517.3515416.9990116.8454-19.0461-20.22903-20.86916-21.10735-21.395040.1757650.2743610.122130.0064020.0220051.5983142.81160.0642315.9797065.1295753.48100042.61858910.491510.21858123766230298689561618982771967918346245720560.139774405.9749801237662302986895706287804878902054392816865347236251.5639928.5397920.13980.9611.0520.0230.3620.0831.1970.350.2290.0810.1610.065022610.07255010812356293
97487320.13896404.4965405.6975251.5324928.57082749.094838.64184621.32238453.66678218.8395617.9274617.4054217.0921216.94814-19.06352-20.28695-20.7935-20.95586-21.279280.1669220.1743940.100355-0.0519760.0089921.4907312.81265.7757416.477484.96496253.44225742.637304310.581310.13945123766230298683033615110146215683297285720000.138922405.42047012376623029868303082878048789020544316134252793207251.5324928.570840.13890.2110.6870.0490.9190.0681.860.3030.2710.0640.1680.05022210.04683095094840111
23420.063235187.1078186.8625251.635728.50939649.04538.53947421.3661953.77319317.5410316.0703215.349714.9724614.7903-18.91487-20.42364-21.12309-21.41729-21.677360.2318080.13220.0845050.0008420.0250652.0194651.269138.2149478.2099642.4738891.49127461.2568445.366200.12294123766230298689587218982777465476485125721840.063199187.0998501237662302986895795287804878902054361316865347238251.635728.5093780.06321.0111.0150.0270.2980.1212.9520.5380.4340.1160.2820.096022710.06436688629151503
25420.063067186.6173186.8625251.5739728.42580448.9249638.5729421.20309653.79862218.0159116.7365716.2770915.9661115.83089-18.40732-19.69057-20.20828-20.35374-20.623680.1991450.0653790.09708-0.0690610.0119830.86958221.269232.6617937.8072442.47587161.50083371.27661145.528410.05443123766230298689587218982782963034624005720760.063029186.6252401237662302986895852287804878902054287816865347240251.5739728.4258040.0631.0910.2990.0540.4090.0742.4790.3960.6460.0990.4570.087022210.01460158902986252
27540.107642315.4893318.0026250.5860627.50923347.51688839.20560519.06168453.8649520.3786418.499417.4247117.0762316.77213-17.30153-19.3648-20.25968-20.56937-20.922290.4022550.3497020.1243270.0844490.0410280.91174451.877497.0372519.3199653.8482742.27239251.878613515.497620.93898123766230137634841618982788460592762885701890.107583317.812921237662301376348538-9916865347242250.5860927.5092470.10761.0910.6950.034-1.130.7651.7040.7260.2740.1230.1870.085010010.10867884228156727
...............................................................................................................................................................................................................
57646838875710.147332428.0726428.0726210.643947.5847293.4359165.26494618.0242916.97219318.9496418.3019517.7620717.4538317.31482-18.97049-20.03344-20.54798-20.72349-21.041530.0858290.1799070.092704-0.0415040.0122921.1890333.188136.8619547.14753152.09990052.14149741.6807028128.198610.01237661212042395904144800078440591564800.146842428.0726012376611519197349593748615707614515274128652725340210.643947.5847020.14680.3610.9140.0360.4910.0720.9140.2590.2690.1070.2030.092022110.06838679035531006
57647238876110.113021330.8691330.8691215.7197646.96570286.8490463.24697518.74864620.40263719.4110718.3016417.7493717.4566717.29531-18.1468-19.45763-19.98209-20.15215-20.438060.2040220.1590430.083752-0.040009-0.0115380.70604861.977127.9323649.5669072.68071251.15631620.808404393.401610.14681123766249838673945614491764372642467844241890.112576330.8691012376619572253820656374610214417597148128752728521215.7197846.965690.11260.8810.1660.0520.4340.0662.4340.4050.4250.0830.2730.063013210.07109624609791332
57647638876310.108786318.7622318.7622216.7095546.59771385.27705462.9487718.6814621.17130720.019117.8947917.2947517.2181917.24389-17.63993-19.774-20.39735-20.17727-20.396210.3765340.1491370.126768-0.170966-0.0187981.0350041.882126.8125659.9559914.02415942.300391.003646589.745800.56819123766246832006758414491992521305231364287090.108347318.7622012376619572257096026374610213343857780128752728604216.7094546.5976810.10830.810.2820.0480.3820.0821.2430.240.6460.1410.5350.123013210.2712455127771415
57647738876410.116256340.0983340.0983219.4781845.70164581.3178461.88905718.68696623.28817720.160118.7568517.764117.328617.00948-17.6281-19.26099-20.10165-20.48043-20.867310.3819640.3581610.1572470.0993570.0683080.78824522.055121.3759216.90405752.85449650.75132290.577478694.413910.17097123765820613230617614503273511109529604422980.115839340.098301237661957226627224-99128852731612219.4781845.7016390.11581.4910.7480.032-2.0070.621.3320.7610.2320.0690.1610.043010610.02123155503986127
57648038876610.146856426.734426.734222.325242.30472672.9456961.640616.35381326.64318719.8386418.519517.7292817.402117.13284-18.32095-19.95687-20.60626-20.82974-21.215540.3309940.3276250.1251140.0199470.0116551.2545943.162133.7952737.23418471.3724150.41840830.3127752129.828910.11407123765820344945868814524881663877713924551910.146437426.734012376614359306731606374786045009988701129052734281222.3252442.3047210.14641.8410.7680.050.2650.1351.6520.510.5470.1310.4270.121013710.12014956999153588
57648338876710.137989401.7574401.7574215.1530844.9516683.8194564.8132816.60263420.82334320.4619618.6335217.7061417.2946317.04238-17.76626-19.78139-20.5367-20.83814-21.203110.5100290.3958950.165870.0544230.0498491.1767362.746135.2877546.35924531.87093842.64140922.1769989126.378200.76725123766121043348710414491030448630927364217150.137514401.757401237658203446902802-99128752728254215.1530844.9516740.13750.1110.7960.05-1.3850.8192.3550.9180.3540.1110.2340.07010610.05078285187298792
57648438876810.113693332.7875332.7875225.2336743.39000373.3637659.25699618.57660927.99384718.9132218.1794517.7428617.3746517.26306-18.54485-19.54366-20.04427-20.21775-20.541410.093190.1103790.12665-0.0692150.0462150.74766651.992111.4546266.7107982.92773151.46605150.886632989.327110.06399123766121258411622414525802504865976324684720.113324332.7875012376624983900161256374610207975147026129052734616225.2336743.3899960.11330.5710.4560.0470.3940.0931.3640.2150.2690.1070.1820.084013110.027170684989730475
57648638876910.154885449.2627449.2627226.6865242.7509471.50223558.47686418.56694629.23266819.4656718.3918717.744517.4491117.25587-18.72579-20.1322-20.70318-20.83447-21.217590.2698780.2648420.123399-0.0422570.0159771.3717463.61147.23747614.6072146.56592373.58548761.6193584115.761410.385123766121258464076814536803119372963844752000.154528449.2627012376624983906059736374786041788761828129152738522226.6864942.7509390.15450.1410.8440.050.8160.0971.8640.2570.8820.1410.720.131013710.08841777291812682
57648738877010.143519417.3458417.3458219.5575943.2418576.6490363.07419616.29085224.40678420.2938918.6189417.7630717.3678717.13032-18.00334-19.85428-20.56199-20.81425-21.198070.5091740.3723030.1638710.0194860.0437711.2044733.001126.7369426.59767772.75318671.09257670.616932129.76100.43573123766120989818880014513633659925565444426670.143075417.3458012376614359296903146374786039641281693128952734285219.5576243.2418560.14310.0210.8260.0370.0860.1831.7140.6120.3110.0930.2180.079012610.08870170569276291
57648938877110.148589431.6054431.6054235.1474837.7660160.55952553.10445817.90432437.36411719.4735318.4810717.74617.3953816.99607-18.56297-19.9735-20.62507-20.90979-21.418890.1872910.2814360.1355280.0681430.0516321.2765193.259141.66709518.69134510.4469974.3057112.3753824108.04910.11719123765820506472473614569244212467077125148950.148315431.605401237662504291860686637492679753072685512945275336235.147537.7659960.14830.1110.7430.0530.7150.1022.3060.3460.7860.1420.5950.13013710.08504954109834578

Next steps

  • what do galaxies with -11 < ssfr < -11.5 look like. We could pull up NSA cutouts for LCS galaxies in this range
  • what is the morphologies of the SF galaxies. Use galaxy zoo information included in Tempel+ catalog
  • try a Sf cut that is parallel to the main sequence. factor of 5 below?
  • fit offset between salim+07 mass-dependent main sequence and the MS for the GSWLC. There is about 0.3 dex offset

  • how to incorporate SFR into simple modeling of cluster infall

    • from first paper we have best-fit infall time
    • assume exponential disk for SF
    • decrease external sample by the amount lost by disk shrinking
    • compare resulting population to LCS core SFRs

What does shrinking size imply about SFR

$$ I (r) = I_0 exp(-r/Re) $$$$ SFR \propto \int_0^{R_{max}} I(r) dr $$

Find average size of external sample, average size of core sample, what is offset in SFRs?


In [19]:
%run ~/github/LCS/python/Python3/LCSbase.py


nothing happening here
(1800, 1800)
updating table
<Figure size 489.6x360 with 0 Axes>

In [35]:
sizecore = np.median(g.sizeratio[g.membflag & g.sampleflag])

In [36]:
sizeexternal = np.median(g.sizeratio[~g.membflag & g.sampleflag])

In [30]:
SFRexternal = 1 - np.exp(-1*np.median(g.sizeratio[~g.membflag & g.sampleflag]))
SFRcore = 1 - np.exp(-1*np.median(g.sizeratio[g.membflag & g.sampleflag]))

In [31]:
# Drop in SFR
drop = 1 - SFRcore/SFRexternal

In [39]:
ratioSize = sizecore/sizeexternal
ratioSFR = SFRcore/SFRexternal
print("drop in size = {:.2f}, drop in SFR ={:.2f}".format(1-ratioSize,1-ratioSFR))


drop in size = 0.26, drop in SFR =0.18

In [57]:
os.chdir(homedir+'/research/LCS/plots/')
%run ~/github/LCS/python/Python3/lcs_paper2.py
lcs.compare_sfrs(nbins=15)


normalizing by radius of disk
CORE VS EXTERNAL
KS Test:
D =   0.19
p-vale = 0.04910 (prob that samples are from same distribution)
<Figure size 489.6x360 with 0 Axes>

IDs of low sSFR Galaxies


In [62]:
os.chdir(homedir+'/research/LCS/plots/')
%run ~/github/LCS/python/Python3/lcs_paper2.py

b.print_lowssfr_nsaids()


normalizing by radius of disk
70595
70694
43814
43840
43874
68305
82122
82189
99837
99838
99840
166676
166701
72635
72688
72745
72759
72773
72779
146115
79534
166036
166081
89063
89097
103607
103628
103795
103841
103935
104179
104231
104244
142735
142776
142790
142797
162770
162832
162925

In [94]:
os.chdir(homedir+'/research/LCS/plots/')
%run ~/github/LCS/python/Python3/lcs_paper2.py
b.get_legacy_images(ssfrmax=-11.2,ssfrmin=-11.5)


normalizing by radius of disk
<Figure size 489.6x360 with 0 Axes>

In [91]:
os.chdir(homedir+'/research/LCS/plots/')
%run ~/github/LCS/python/Python3/lcs_paper2.py
b.get_legacy_images(lcsflag = ~b.lcs.cat['membflag'],ssfrmax=-11.2,ssfrmin=-11.4)


normalizing by radius of disk
<Figure size 489.6x360 with 0 Axes>

Use disk galaxies only

We are detecting an excess of low sSFR galaxies in LCS core and external samples. Even when we cut by group/cluster mass - we find excess in every combination of LCS sample.

Concern: is sSFR = -11.5 picking up tail of the passive sequence (meaning these are not SF, but we are detecting dust emission from post main sequence stars). If this is the case, then the trends with environment that we are detecting are just due to the morphology-density relation.

For example,

in clusters:

  • 10 low sSFR spiral - truly low sSFR
  • mixing in 20 E/S0 galaxies in the cluster - not low sSFR

in field:

  • 10 low sSFR
  • 5 E/S0

If we can remove E/S0 from both the field and cluster samples, then we can be more confident that we are detecting low sSFR galaxies.

On the other hand, there can by E/S0 galaxies with some residual SF. Need to think about how this affects results, or do it both ways: with and without a morphology cut.

Implementation

Two approaches: NSA Sersic index or galaxy zoo morphology from Tempel catalogs

  • we could cut on NSA sersic index
    • need
  • would need to match tempel field to GSWLC and NSA (LCS galaxies already have info from all of these catalogs)

Tempel + galaxy zoo

  • or use tempel - that includes prob of spiral
  • BV matched LCS+GSWLC sample to tempel galaxies file
    • best match, 10 arcsec
    • all but 10 galaxies are matched
  • make a cut on early type
    • (pE + pS0) > 0.5 = early type galaxy
  • keep only late-type galaxies for both
  • repeat SFR-M* comparison

Field Sample

  • Benedetta will resend the GSWLC M < 12.5 catalog. not sure if the single galaxies are included.
  • send full catalog, and I will cut in redshift range

  • using updated catalogs now. the results are unchanged


In [11]:
os.chdir(homedir+'/research/LCS/plots/')
%run ~/github/LCS/python/Python3/lcs_paper2.py


normalizing by radius of disk

sSFR-Mstar: Compare LCS and GSWLC - no B/T cut

(updates from 7/1/2020)

  • limited by stellar mass, ssfr, and B/T < 0.3

LCS core vs GSWLC Field


In [21]:
os.chdir(homedir+'/research/LCS/plots/')
%run ~/github/LCS/python/Python3/lcs_paper2.py 
flag = b.lcs.cat['membflag'] 
outfile1 = homedir+'/research/LCS/plots/lcscore-gsw-ssfrmstar.pdf'
outfile2 = homedir+'/research/LCS/plots/lcscore-gsw-ssfrmstar.png'
b.plot_ssfr_mstar(lcsflag=flag,outfile1=outfile1,outfile2=outfile2)


number in core sample =  92
number in external sample =  7835
############################################################# 
KS test comparising galaxies within range shown on the plot

STELLAR MASS
KS Test:
D =   0.14
p-vale = 0.06000 (prob that samples are from same distribution)

COLOR
KS Test:
D =   0.32
p-vale = 0.00000 (prob that samples are from same distribution)
<Figure size 489.6x360 with 0 Axes>

LCS infall vs GSWLC Field


In [45]:
os.chdir(homedir+'/research/LCS/plots/')
%run ~/github/LCS/python/Python3/lcs_paper2.py 
flag = ~b.lcs.cat['membflag'] & (b.lcs.cat['DELTA_V'] < 3.)
outfile1 = homedir+'/research/LCS/plots/lcscore-gsw-ssfrmstar.pdf'
outfile2 = homedir+'/research/LCS/plots/lcscore-gsw-ssfrmstar.png'
b.plot_ssfr_mstar(lcsflag=flag,label='LCS infall',outfile1=outfile1,outfile2=outfile2)


number in core sample =  88
number in external sample =  7835
############################################################# 
KS test comparising galaxies within range shown on the plot

STELLAR MASS
KS Test:
D =   0.16
p-vale = 0.02216 (prob that samples are from same distribution)

COLOR
KS Test:
D =   0.25
p-vale = 0.00004 (prob that samples are from same distribution)
<Figure size 489.6x360 with 0 Axes>

LCS Core vs infall


In [30]:
os.chdir(homedir+'/research/LCS/plots/')
%run ~/github/LCS/python/Python3/lcs_paper2.py 
outfile1 = homedir+'/research/LCS/plots/lcscore-external-ssfrmstar.pdf'
outfile2 = homedir+'/research/LCS/plots/lcscore-external-ssfrmstar.png'
b.plot_ssfr_mstar_lcs(outfile1=outfile1,outfile2=outfile2,nbins=12)


number in core sample =  92
number in external sample =  88
############################################################# 
KS test comparising galaxies within range shown on the plot

STELLAR MASS
KS Test:
D =   0.17
p-vale = 0.12193 (prob that samples are from same distribution)

COLOR
KS Test:
D =   0.19
p-vale = 0.07296 (prob that samples are from same distribution)
<Figure size 489.6x360 with 0 Axes>

With B/T Cut


In [47]:
os.chdir(homedir+'/research/LCS/plots/')
%run ~/github/LCS/python/Python3/lcs_paper2.py --cutBT
flag = b.lcs.cat['membflag'] 
outfile1 = homedir+'/research/LCS/plots/lcscore-gsw-ssfrmstar-BTcut.pdf'
outfile2 = homedir+'/research/LCS/plots/lcscore-gsw-ssfrmstar-BTcut.png'
b.plot_ssfr_mstar(lcsflag=flag,outfile1=outfile1,outfile2=outfile2,nbins=12)


number in core sample =  38
number in external sample =  4791
############################################################# 
KS test comparising galaxies within range shown on the plot

STELLAR MASS
KS Test:
D =   0.17
p-vale = 0.22630 (prob that samples are from same distribution)

COLOR
KS Test:
D =   0.35
p-vale = 0.00010 (prob that samples are from same distribution)
<Figure size 489.6x360 with 0 Axes>

In [44]:
os.chdir(homedir+'/research/LCS/plots/')
%run ~/github/LCS/python/Python3/lcs_paper2.py --cutBT
flag = ~b.lcs.cat['membflag'] & (b.lcs.cat['DELTA_V'] < 3.)
outfile1 = homedir+'/research/LCS/plots/lcsinfall-gsw-ssfrmstar-BTcut.pdf'
outfile2 = homedir+'/research/LCS/plots/lcsinfall-gsw-ssfrmstar-BTcut.png'
b.plot_ssfr_mstar(lcsflag=flag,label='LCS infall',outfile1=outfile1,outfile2=outfile2,nbins=12)


number in core sample =  39
number in external sample =  4791
############################################################# 
KS test comparising galaxies within range shown on the plot

STELLAR MASS
KS Test:
D =   0.15
p-vale = 0.28102 (prob that samples are from same distribution)

COLOR
KS Test:
D =   0.16
p-vale = 0.28034 (prob that samples are from same distribution)
<Figure size 489.6x360 with 0 Axes>

In [46]:
os.chdir(homedir+'/research/LCS/plots/')
%run ~/github/LCS/python/Python3/lcs_paper2.py --cutBT
outfile1 = homedir+'/research/LCS/plots/lcscore-external-ssfrmstar-BTcut.pdf'
outfile2 = homedir+'/research/LCS/plots/lcscore-external-ssfrmstar-BTcut.png'
b.plot_ssfr_mstar_lcs(outfile1=outfile1,outfile2=outfile2,nbins=12)


number in core sample =  38
number in external sample =  39
############################################################# 
KS test comparising galaxies within range shown on the plot

STELLAR MASS
KS Test:
D =   0.25
p-vale = 0.15091 (prob that samples are from same distribution)

COLOR
KS Test:
D =   0.32
p-vale = 0.03018 (prob that samples are from same distribution)
<Figure size 489.6x360 with 0 Axes>

SFR - Mstar: no B/T cut

repeating above three plots, but for SFR vs Mstar

LCS core vs GSWLC field


In [4]:
os.chdir(homedir+'/research/LCS/plots/')
%run ~/github/LCS/python/Python3/lcs_paper2.py 
flag = b.lcs.cat['membflag'] 
outfile1 = homedir+'/research/LCS/plots/lcscore-gsw-sfrmstar.pdf'
outfile2 = homedir+'/research/LCS/plots/lcscore-gsw-sfrmstar.png'
b.plot_sfr_mstar(lcsflag=flag,outfile1=outfile1,outfile2=outfile2)


number in core sample =  92
number in external sample =  7835
############################################################# 
KS test comparising galaxies within range shown on the plot

STELLAR MASS
KS Test:
D =   0.16
p-vale = 1.263e-02 (prob that samples are from same distribution)

COLOR
KS Test:
D =   0.38
p-vale = 1.666e-12 (prob that samples are from same distribution)

In [43]:
os.chdir(homedir+'/research/LCS/plots/')
%run ~/github/LCS/python/Python3/lcs_paper2.py 
flag = ~b.lcs.cat['membflag'] & (b.lcs.cat['DELTA_V'] < 3.)
outfile1 = homedir+'/research/LCS/plots/lcscore-gsw-sfrmstar.pdf'
outfile2 = homedir+'/research/LCS/plots/lcscore-gsw-sfrmstar.png'
b.plot_sfr_mstar(lcsflag=flag,label='LCS infall',outfile1=outfile1,outfile2=outfile2)


number in core sample =  88
number in external sample =  7835
############################################################# 
KS test comparising galaxies within range shown on the plot

STELLAR MASS
KS Test:
D =   0.16
p-vale = 0.02064 (prob that samples are from same distribution)

COLOR
KS Test:
D =   0.18
p-vale = 0.00576 (prob that samples are from same distribution)
<Figure size 489.6x360 with 0 Axes>

In [39]:
os.chdir(homedir+'/research/LCS/plots/')
%run ~/github/LCS/python/Python3/lcs_paper2.py
outfile1 = homedir+'/research/LCS/plots/lcscore-external-sfrmstar.pdf'
outfile2 = homedir+'/research/LCS/plots/lcscore-external-sfrmstar.png'
b.plot_sfr_mstar_lcs(outfile1=outfile1,outfile2=outfile2,nbins=12)


number in core sample =  92
number in external sample =  88
############################################################# 
KS test comparising galaxies within range shown on the plot

STELLAR MASS
KS Test:
D =   0.17
p-vale = 0.14627 (prob that samples are from same distribution)

COLOR
KS Test:
D =   0.18
p-vale = 0.08667 (prob that samples are from same distribution)
<Figure size 489.6x360 with 0 Axes>

SFR- Mstar with B/T < 0.3


In [19]:
os.chdir(homedir+'/research/LCS/plots/')
%run ~/github/LCS/python/Python3/lcs_paper2.py --cutBT
flag = b.lcs.cat['membflag'] 
outfile1 = homedir+'/research/LCS/plots/lcscore-gsw-sfrmstar-BTcut.pdf'
outfile2 = homedir+'/research/LCS/plots/lcscore-gsw-sfrmstar-BTcut.png'
b.plot_sfr_mstar(lcsflag=flag,outfile1=outfile1,outfile2=outfile2)


number in core sample =  38
number in external sample =  4791
############################################################# 
KS test comparising galaxies within range shown on the plot

STELLAR MASS
KS Test:
D =   0.10
p-vale = 0.77859 (prob that samples are from same distribution)

COLOR
KS Test:
D =   0.28
p-vale = 0.00468 (prob that samples are from same distribution)

In [6]:
os.chdir(homedir+'/research/LCS/plots/')
%run ~/github/LCS/python/Python3/lcs_paper2.py --cutBT
flag = ~b.lcs.cat['membflag'] & (b.lcs.cat['DELTA_V'] < 3.)
outfile1 = homedir+'/research/LCS/plots/lcsinfall-gsw-sfrmstar-BTcut.pdf'
outfile2 = homedir+'/research/LCS/plots/lcsinfall-gsw-sfrmstar-BTcut.png'
b.plot_sfr_mstar(lcsflag=flag,label='LCS infall',outfile1=outfile1,outfile2=outfile2)


number in core sample =  39
number in external sample =  4791
############################################################# 
KS test comparising galaxies within range shown on the plot

STELLAR MASS
KS Test:
D =   0.11
p-vale = 0.71655 (prob that samples are from same distribution)

COLOR
KS Test:
D =   0.29
p-vale = 0.00212 (prob that samples are from same distribution)
<Figure size 489.6x360 with 0 Axes>

In [7]:
os.chdir(homedir+'/research/LCS/plots/')
%run ~/github/LCS/python/Python3/lcs_paper2.py --cutBT
outfile1 = homedir+'/research/LCS/plots/lcscore-external-sfrmstar-BTcut.pdf'
outfile2 = homedir+'/research/LCS/plots/lcscore-external-sfrmstar-BTcut.png'
b.plot_sfr_mstar_lcs(outfile1=outfile1,outfile2=outfile2,nbins=12)


number in core sample =  38
number in external sample =  39
############################################################# 
KS test comparising galaxies within range shown on the plot

STELLAR MASS
KS Test:
D =   0.17
p-vale = 0.51996 (prob that samples are from same distribution)

COLOR
KS Test:
D =   0.40
p-vale = 0.00315 (prob that samples are from same distribution)
<Figure size 489.6x360 with 0 Axes>

Compare B/T distribution of core and infall galaxies

  • need to see if BT distribution is similar
  • if not, we will need to cut on BT for the simulation
  • otherwise we will conflate multiple factors

CONCLUSION

  • B/T of core/infall are significantly different. pvalue = 1.6e-10
  • after cutting B/T < 0.3, the difference is much smaller. pvalue = 0.015

In [57]:
os.chdir(homedir+'/research/LCS/plots/')
%run ~/github/LCS/python/Python3/lcs_paper2.py 
outfile1 = homedir+'/research/LCS/plots/lcscore-external-BTcut.pdf'
outfile2 = homedir+'/research/LCS/plots/lcscore-external-BTcut.png'
b.lcs_compare_BT()#outfile1=outfile1,outfile2=outfile2,nbins=12)
plt.savefig(outfile1)
plt.savefig(outfile2)


Ks_2sampResult(statistic=0.18716414862340822, pvalue=1.626687673450533e-10)
Ks_2sampResult(statistic=0.12097346123698256, pvalue=0.015355063312994743)
<Figure size 489.6x360 with 0 Axes>

In [ ]:

With B/T < 0.3 cut

Quick comparison of LCS core and infall.

We are able to detect a difference in sSFRs between core and infall, but the significance is not super high (pvalue = 0.014).

We are therefore getting a consistent story:

  • difference in sSFRs between core and infall of LCS sample, but significance is not high
  • we create a comparison sample from GSWLC
    • cut in redshift to match LCS
    • match to Tempel, limit to galaxies in halos with $logM < 12.5$ (we now include isolated galaxies)
    • match to Simard+2011, limit to galaxies with $B/T < 0.3$
  • LCS core has significantly lower sSFR than GSWLC field ($>5\sigma$)
  • LCS infall also has lower sSFR than GSWLC field ($>5\sigma$)

Where to next:

  • need to find meaningful way to link the size and sSFR evolution
    • are the changes in size and sSFR consistent?
    • can we get better handle on quenching timescale by including comparison of sSFR with GSWLC field?
    • how do these results revise the delay+rapid quenching model?

Long term:

  • need size measurements for a large field sample!
  • repeat for large sample of groups and clusters - can we measure a halo mass where this becomes important?
    • could also use tempel catalogs, and repeat for
      • logM < 12.5
      • 12.5 < logM < 13.0
      • 13.0 < logM < 13.5
      • 13.5 < logM < 14.0

Concerns:

  • is B/T distribution different (even for B/T < 0.3 galaxies) between LCS and GSWLC field?

NOTES:

  • can we predict the size of the disks in the field?

    • we solve for dr/dt
    • we have infall - an estimate of how the infall region has been "not field"
    • Bendo+2007 paper, has size measurements, ratios R24/R > 1
  • can we refine the model. fitting disk times, we can also now incorporate SFRs.

  • infall models tell you time b/w field/infall and field/core

  • quantify - how much lower are cluster SFRs?

  • what happens to R24 if disk is truncated?

Update Original model - Shrink disk

  • We started with size distribution in infall region.
  • Get get a processing time from infall models. (used a range between 0 and 4Gyr)
  • Then we solve for best-fitting dr/dt - where we compare distribution of shrunk infall sizes with distribution of core sizes using a KS test.

  • for every galaxy that we are shrinking in size, we use comparison of original profile vs shrunk profile to calculate the change in SFR

$$ \Delta SFR = 1 - \int_0^\inf I(r, Re_{shrunk}, n)/\int I(r, Re_{original}, n) $$

$$ SFR_{core,predicted} = SFR_{infall} - \Delta SFR $$$$ I(r) = Sersic profile $$

Compare the distribution of resulting SFRs to the distribution of SFRs in the core.

Need to compare SFR and size distributions.

IMPLEMENTATION

  • Need

Model 2: Truncating

What if shrinking is due to Truncation rather than shrinking?

  • if we have a truncated sersic profile and refit with a sersic profile, what happens to the resulting Re?

  • this will probably make different predictions about SFRs

Third Model: Shrink Re and Boost

  • maintain the flux

Questions

  • What about controlling for stellar mass?

  • SINGS sample - covers range of galaxies

  • predict size distributions of field galaxies - motivates measuring the size of SF disk for a large sample of field galaxies

    • we are just going to use LCS sample for modeling because we need
    • we need a bigger sample of field galaxies, could motivate a proposal (ADAP, NSF)
  • how do we fold in the two KS tests (size and SFRs)? - 2D (size and SFR)

    • size and SFRs measurements are independent

From 5/20/20

Measuring "Goodness of Fit"

  • One approach is to use the best-fit shrinking time to predict distribution of SFs in the core
    • then compare core and predicted SFRs using a KS test to see if they are consistent and to rule out any infall times that produce SFRs that are inconsisten with SFR distribution of core sample.
    • downside: we are not really using both
  • let's take all the acceptable timescales and see if we can reject any of these based on their prediction for change in SFRs
  • if we end up with a family of acceptable solutions, is there a way to tell which is the best solution in a statistically robust way

In paper, we used different infall times because we could have a large distribution of infall times.

We assigned infall times randomly, but we let tmax vary. models say infall time should be less than 5 Gyr.


In [26]:
os.chdir(homedir+'/research/LCS/plots/')
%run ~/github/LCS/python/Python3/lcs_paper2.py
outfile1 = homedir+'/research/LCS/plots/lcs-core-infall-ssfrmstar.pdf'
outfile2 = homedir+'/research/LCS/plots/lcs-core-infall-ssfrmstar.png'
b.plot_ssfr_mstar_lcs(outfile1=outfile1,outfile2=outfile2)


normalizing by radius of disk
number in core sample =  38
number in external sample =  39
############################################################# 
KS test comparising galaxies within range shown on the plot

STELLAR MASS
KS Test:
D =   0.22
p-vale = 0.24495 (prob that samples are from same distribution)

COLOR
KS Test:
D =   0.35
p-vale = 0.01377 (prob that samples are from same distribution)

Simulation

  • the table that is LCS matched to GSWLC is missing 26/225 galaxies with size measurements
  • want to use the full sample for best comparability with model in paper1

  • table is created by LCSbase.py - update_table()

  • I updated the simulation program to read the main data table directly, rather than writing out a separate version for the simulation.

In [74]:
os.chdir(homedir+'/research/LCS/plots/')
%run ~/github/LCS/python/Python3/LCSbase.py


/home/rfinn/github/LCS/python/Python3/LCSbase.py:74: RuntimeWarning: divide by zero encountered in true_divide
  self.MAG24 = 2.5*np.log10(3631./(self.s.FLUX24*1.e-6))
/home/rfinn/github/LCS/python/Python3/LCSbase.py:88: RuntimeWarning: invalid value encountered in true_divide
  self.AGNKAUFF= ((np.log10(self.s.O3FLUX/self.s.HBFLUX) > (.61/(np.log10(self.s.N2FLUX/self.s.HAFLUX)-.05)+1.3)) | (np.log10(self.s.N2FLUX/self.s.HAFLUX) > 0.)) #& (self.s.HAEW > 0.)
/home/rfinn/github/LCS/python/Python3/LCSbase.py:88: RuntimeWarning: invalid value encountered in log10
  self.AGNKAUFF= ((np.log10(self.s.O3FLUX/self.s.HBFLUX) > (.61/(np.log10(self.s.N2FLUX/self.s.HAFLUX)-.05)+1.3)) | (np.log10(self.s.N2FLUX/self.s.HAFLUX) > 0.)) #& (self.s.HAEW > 0.)
/home/rfinn/github/LCS/python/Python3/LCSbase.py:88: RuntimeWarning: invalid value encountered in greater
  self.AGNKAUFF= ((np.log10(self.s.O3FLUX/self.s.HBFLUX) > (.61/(np.log10(self.s.N2FLUX/self.s.HAFLUX)-.05)+1.3)) | (np.log10(self.s.N2FLUX/self.s.HAFLUX) > 0.)) #& (self.s.HAEW > 0.)
/home/rfinn/github/LCS/python/Python3/LCSbase.py:98: RuntimeWarning: divide by zero encountered in log10
  self.sb_obs[flag]=self.s.fcmag1[flag] + 2.5*np.log10(np.pi*((self.s.fcre1[flag]*mipspixelscale)**2)*self.s.fcaxisratio1[flag])
/home/rfinn/github/LCS/python/Python3/LCSbase.py:114: RuntimeWarning: divide by zero encountered in true_divide
  self.galfitflag = (self.s.fcmag1 > .1)  & ~self.nerrorflag & (self.sb_obs < 20.) & (self.s.fcre1/self.s.fcre1err > .5)#20.)
/home/rfinn/github/LCS/python/Python3/LCSbase.py:114: RuntimeWarning: invalid value encountered in true_divide
  self.galfitflag = (self.s.fcmag1 > .1)  & ~self.nerrorflag & (self.sb_obs < 20.) & (self.s.fcre1/self.s.fcre1err > .5)#20.)
/home/rfinn/github/LCS/python/Python3/LCSbase.py:114: RuntimeWarning: invalid value encountered in greater
  self.galfitflag = (self.s.fcmag1 > .1)  & ~self.nerrorflag & (self.sb_obs < 20.) & (self.s.fcre1/self.s.fcre1err > .5)#20.)
nothing happening here
/home/rfinn/github/LCS/python/Python3/LCSbase.py:270: RuntimeWarning: divide by zero encountered in log10
  self.logSFR_IR_KE = np.log10(self.nuLnu24_ZDIST.cgs.value)-42.69
(1800, 1800)
/home/rfinn/github/LCS/python/Python3/LCSbase.py:151: RuntimeWarning: divide by zero encountered in log10
  self.sb_obs[flag]=self.s.fcmag1[flag] + 2.5*np.log10(np.pi*((self.s.fcre1[flag]*mipspixelscale)**2)*self.s.fcaxisratio1[flag])
/home/rfinn/github/LCS/python/Python3/LCSbase.py:165: RuntimeWarning: invalid value encountered in greater
  self.HIflag = self.s.HIMASS > 0.
updating table

Simulation program will read

'/home/rfinn/research/LCS/tables/LCS_all_size_KE_SFR.fits'

directly


In [34]:
tab  = Table.read('/home/rfinn/research/LCS/tables/LCS-simulation-data.fits')

In [49]:
os.chdir(homedir+'/research/LCS/plots/')
%run ~/github/LCS/python/Python3/LCSsimulate-infall-paper2.py

In [58]:
best_drdt, best_sim_core,ks_p_max,all_drdt,all_p,all_p_sfr = run_sim(tmax=2,drdt_step=0.05,nrandom=100)


best dr/dt =  -0.2999999999999985
disk is quenched in 3.3 Gyr
fraction that are quenched = 0.12
KS p value = 9.99807214e-01

In [73]:
plt.figure(figsize=(8,6))
plt.scatter(all_p,all_p_sfr,c=all_drdt,s=10,vmin=-.4,vmax=0)
plt.xlabel('p value size')
plt.ylabel('p value SFR')
plt.colorbar(label='dr/dt')
plt.axhline(y=.05,ls='--')
plt.axvline(x=.05,ls='--')
plt.savefig('pvalue-SFR-size-tmax2.0Gyr.png')



In [7]:
os.chdir(homedir+'/research/LCS/plots/')
%run ~/github/LCS/python/Python3/LCSsimulate-infall-paper2.py


<Figure size 432x288 with 0 Axes>

In [8]:
best_drdt, best_sim_core,ks_p_max,all_drdt,all_p,all_p_sfr = run_sim(tmax=2,drdt_step=0.05,nrandom=100)


best dr/dt =  -1.6499999999999997
disk is quenched in 0.6 Gyr
fraction that are quenched = 0.70
KS p value = 9.99046109e-01

In [9]:
plt.figure(figsize=(8,6))
plt.scatter(all_p,all_p_sfr,c=all_drdt,s=10,vmin=-.4,vmax=0)
plt.xlabel('p value size')
plt.ylabel('p value SFR')
plt.colorbar(label='dr/dt')
plt.axhline(y=.05,ls='--')
plt.axvline(x=.05,ls='--')
ax = plt.gca()
#ax.set_yscale('log')
plt.savefig('pvalue-SFR-size-tmax2.0Gyr-shrink0.png')


running with simpler integration scheme

  • we shrink the effective radius according to dr/dt and radomly assigned infall time
  • using ratio of surface areas between infall and sim_core galaxies, we scale the SFR of infall galaxies
    • 1 = integrating the sersic profile of the infall galaxy
    • 2 = integrating the sersic profile of the sim_core galaxy
    • scale the SFR of the infall galaxy by the ratio 2/1
  • basically, this removes too much star formation
    • we don't find any solutions that simultaneously reproduce the distribution of sizes and SFRs of the core galaxies.
    • the simulations that do a good job matching the distribution of sizes in the core

In [10]:
os.chdir(homedir+'/research/LCS/plots/')
%run ~/github/LCS/python/Python3/LCSsimulate-infall-paper2.py 
best_drdt, best_sim_core,ks_p_max,all_drdt,all_p,all_p_sfr = run_sim(tmax=2,drdt_step=0.05,nrandom=100)
plt.figure(figsize=(8,6))
plt.scatter(all_p,all_p_sfr,c=all_drdt,s=10,vmin=-.4,vmax=0)
plt.xlabel('p value size')
plt.ylabel('p value SFR')
plt.colorbar(label='dr/dt')
plt.axhline(y=.05,ls='--')
plt.axvline(x=.05,ls='--')
ax = plt.gca()
#ax.set_yscale('log')
plt.savefig('pvalue-SFR-size-tmax2.0Gyr-shrinkorig.png')


best dr/dt =  -1.9
disk is quenched in 0.5 Gyr
fraction that are quenched = 0.75
KS p value = 9.99992445e-01
<Figure size 432x288 with 0 Axes>

In [82]:
plt.figure(figsize=(8,6))
plt.scatter(all_p,all_p_sfr,c=all_drdt,s=10,vmin=-.4,vmax=0)
plt.xlabel('p value size')
plt.ylabel('p value SFR')
plt.colorbar(label='dr/dt')
plt.axhline(y=.05,ls='--')
plt.axvline(x=.05,ls='--')
ax = plt.gca()
#ax.set_yscale('log')
plt.savefig('pvalue-SFR-size-tmax2.0Gyr-shrink0.png')



In [92]:
ks_2samp(sizes['fcnsersic1'][core_flag],sizes['fcnsersic1'][~core_flag])


Out[92]:
Ks_2sampResult(statistic=0.09131652661064425, pvalue=0.6973441666424081)

Comparing distribution of sersic indices of core and external galaxies

  • we are assuming that these are comparable in our modeling, and I want to make sure this is the case

In [95]:
plt.figure()

plt.hist(sizes['fcnsersic1'][core_flag],histtype='step',label='core',cumulative=True,normed=True,bins=20)
plt.hist(sizes['fcnsersic1'][~core_flag],histtype='step',label='external',cumulative=True,normed=True,bins=20)
plt.legend()


/home/rfinn/anaconda3/lib/python3.7/site-packages/ipykernel_launcher.py:3: MatplotlibDeprecationWarning: 
The 'normed' kwarg was deprecated in Matplotlib 2.1 and will be removed in 3.1. Use 'density' instead.
  This is separate from the ipykernel package so we can avoid doing imports until
/home/rfinn/anaconda3/lib/python3.7/site-packages/ipykernel_launcher.py:4: MatplotlibDeprecationWarning: 
The 'normed' kwarg was deprecated in Matplotlib 2.1 and will be removed in 3.1. Use 'density' instead.
  after removing the cwd from sys.path.
Out[95]:
<matplotlib.legend.Legend at 0x7f9d218ca390>

Running Simulations - Model 1


In [281]:
best_drdt, best_sim_core,ks_p_max,all_drdt,all_p,all_p_sfr = run_sim(tmax=1,drdt_step=0.05,nrandom=100)
plt.figure(figsize=(8,6))
plt.scatter(all_p,all_p_sfr,c=all_drdt,s=10,vmin=-.4,vmax=0)
plt.xlabel('p value size')
plt.ylabel('p value SFR')
plt.colorbar(label='dr/dt')
plt.axhline(y=.05,ls='--')
plt.axvline(x=.05,ls='--')
ax = plt.gca()
#ax.set_yscale('log')
plt.savefig('pvalue-SFR-size-tmax1.0Gyr-shrink0.png')


best dr/dt =  -0.6999999999999988
disk is quenched in 1.4 Gyr
fraction that are quenched = 0.19
KS p value = 9.99835962e-01

In [6]:
os.chdir(homedir+'/research/LCS/plots/')
%run ~/github/LCS/python/Python3/LCSsimulate-infall-paper2.py 
best_drdt, best_sim_core,ks_p_max,all_drdt,all_p,all_p_sfr = run_sim(tmax=3,drdt_step=0.05,nrandom=100)
plt.figure(figsize=(8,6))
plt.scatter(all_p,all_p_sfr,c=all_drdt,s=10,vmin=-.4,vmax=0)
plt.xlabel('Constraint from size of SF disk (p value)')
plt.ylabel('Constraint from Total SFR (p value)')
plt.colorbar(label='dr/dt')
plt.axhline(y=.05,ls='--')
plt.axvline(x=.05,ls='--')
ax = plt.gca()
#ax.set_yscale('log')
plt.savefig('adap2020-timescale.png')
plt.savefig('adap2020-timescale.pdf')


Welcome!
<Figure size 489.6x360 with 0 Axes>

In [59]:
plt.figure(figsize=(8,6))
plt.scatter(all_p,all_p_sfr,c=all_drdt,s=15,vmin=-.4,vmax=0)
plt.xlabel('Constraint from size of SF disk (KS p value)',fontsize=18)
plt.ylabel('Constraint from Total SFR (KS p value)',fontsize=18)
cb = plt.colorbar(label='Rate of disk shrinking (1/Gyr)')
cb.set_label('Rate of disk shrinking (1/Gyr)',fontsize=18)
plt.axhline(y=.05,ls='--')
plt.axvline(x=.05,ls='--')
ax = plt.gca()
plt.axis([-.01,.35,-.01,.2])
xl = np.linspace(.05,1,100)
y1 = np.ones(len(xl))
y2 = .05*np.ones(len(xl))
plt.fill_between(xl,y1=y1,y2=y2,alpha=.1)
plt.text(.2,.11,'Models that meet both \nSFR AND size constraints',horizontalalignment='center',bbox=dict(facecolor='white', alpha=0.8))
plt.text(.2,.025,'Models ruled out by SFR constraints',horizontalalignment='center',bbox=dict(facecolor='white', alpha=0.8))
plt.text(.03,.1,'Models ruled out by size constraints',verticalalignment='center',horizontalalignment='center',rotation=90,bbox=dict(facecolor='white', alpha=0.8))
#ax.set_yscale('log')
plt.savefig('adap2020-timescale.png')
plt.savefig('adap2020-timescale.pdf')



In [40]:
help(plt.text)


Help on function text in module matplotlib.pyplot:

text(x, y, s, fontdict=None, withdash=<deprecated parameter>, **kwargs)
    Add text to the axes.
    
    Add the text *s* to the axes at location *x*, *y* in data coordinates.
    
    Parameters
    ----------
    x, y : scalars
        The position to place the text. By default, this is in data
        coordinates. The coordinate system can be changed using the
        *transform* parameter.
    
    s : str
        The text.
    
    fontdict : dictionary, optional, default: None
        A dictionary to override the default text properties. If fontdict
        is None, the defaults are determined by your rc parameters.
    
    withdash : boolean, optional, default: False
        Creates a `~matplotlib.text.TextWithDash` instance instead of a
        `~matplotlib.text.Text` instance.
    
    Returns
    -------
    text : `.Text`
        The created `.Text` instance.
    
    Other Parameters
    ----------------
    **kwargs : `~matplotlib.text.Text` properties.
        Other miscellaneous text parameters.
    
    Examples
    --------
    Individual keyword arguments can be used to override any given
    parameter::
    
        >>> text(x, y, s, fontsize=12)
    
    The default transform specifies that text is in data coords,
    alternatively, you can specify text in axis coords (0,0 is
    lower-left and 1,1 is upper-right).  The example below places
    text in the center of the axes::
    
        >>> text(0.5, 0.5, 'matplotlib', horizontalalignment='center',
        ...      verticalalignment='center', transform=ax.transAxes)
    
    You can put a rectangular box around the text instance (e.g., to
    set a background color) by using the keyword `bbox`.  `bbox` is
    a dictionary of `~matplotlib.patches.Rectangle`
    properties.  For example::
    
        >>> text(x, y, s, bbox=dict(facecolor='red', alpha=0.5))


In [282]:
best_drdt, best_sim_core,ks_p_max,all_drdt,all_p,all_p_sfr = run_sim(tmax=2,drdt_step=0.05,nrandom=100)
plt.figure(figsize=(8,6))
plt.scatter(all_p,all_p_sfr,c=all_drdt,s=10,vmin=-.4,vmax=0)
plt.xlabel('p value size')
plt.ylabel('p value SFR')
plt.colorbar(label='dr/dt')
plt.axhline(y=.05,ls='--')
plt.axvline(x=.05,ls='--')
ax = plt.gca()
#ax.set_yscale('log')
plt.savefig('pvalue-SFR-size-tmax2.0Gyr-shrink0.png')


best dr/dt =  -1.9
disk is quenched in 0.5 Gyr
fraction that are quenched = 0.80
KS p value = 9.99888517e-01

In [283]:
best_drdt, best_sim_core,ks_p_max,all_drdt,all_p,all_p_sfr = run_sim(tmax=3,drdt_step=0.05,nrandom=100)
plt.figure(figsize=(8,6))
plt.scatter(all_p,all_p_sfr,c=all_drdt,s=10,vmin=-.4,vmax=0)
plt.xlabel('p value size')
plt.ylabel('p value SFR')
plt.colorbar(label='dr/dt')
plt.axhline(y=.05,ls='--')
plt.axvline(x=.05,ls='--')
ax = plt.gca()
#ax.set_yscale('log')
plt.savefig('pvalue-SFR-size-tmax3.0Gyr-shrink0.png')


best dr/dt =  -0.1999999999999984
disk is quenched in 5.0 Gyr
fraction that are quenched = 0.11
KS p value = 9.98300242e-01

In [284]:
best_drdt, best_sim_core,ks_p_max,all_drdt,all_p,all_p_sfr = run_sim(tmax=4,drdt_step=0.05,nrandom=100)
plt.figure(figsize=(8,6))
plt.scatter(all_p,all_p_sfr,c=all_drdt,s=10,vmin=-.4,vmax=0)
plt.xlabel('p value size')
plt.ylabel('p value SFR')
plt.colorbar(label='dr/dt')
plt.axhline(y=.05,ls='--')
plt.axvline(x=.05,ls='--')
ax = plt.gca()
#ax.set_yscale('log')
plt.savefig('pvalue-SFR-size-tmax4.0Gyr-shrink0.png')


/home/rfinn/github/LCS/python/Python3/LCSsimulate-infall-paper2.py:146: RuntimeWarning: invalid value encountered in power
  x_after = bn*(ratio_after)**(1./n)
best dr/dt =  -0.849999999999999
disk is quenched in 1.2 Gyr
fraction that are quenched = 0.71
KS p value = 9.99660959e-01

In [280]:
os.chdir(homedir+'/research/LCS/plots/')
%run ~/github/LCS/python/Python3/LCSsimulate-infall-paper2.py --use24
plot_multiple_tmax_wsfr(nrandom=100)


/home/rfinn/github/LCS/python/Python3/LCSsimulate-infall-paper2.py:146: RuntimeWarning: invalid value encountered in power
  x_after = bn*(ratio_after)**(1./n)
best dr/dt =  -0.5499999999999987
disk is quenched in 1.8 Gyr
fraction that are quenched = 0.12
KS p value = 9.95824017e-01
best dr/dt =  -1.2499999999999993
disk is quenched in 0.8 Gyr
fraction that are quenched = 0.62
KS p value = 9.99430321e-01
best dr/dt =  -1.4499999999999995
disk is quenched in 0.7 Gyr
fraction that are quenched = 0.79
KS p value = 9.97218857e-01
best dr/dt =  -0.849999999999999
disk is quenched in 1.2 Gyr
fraction that are quenched = 0.75
KS p value = 9.99218253e-01

Fitting truncated Sersic profiles in 1D

  • generated sersic profiles based on properties on external 24um fits
  • truncated each to a random amount between 0.25 and 5 Re
  • fit truncated models with sersic profile
  • save results
  • program: fit-truncated-sersic-1d.py

In [13]:
os.chdir(homedir+'/research/LCS/plots/')
%run ~/github/LCS/python/Python3/fit-truncated-sersic-1d.py --nres 20 --ngal 10 --minrtrunc .75 --maxrtrunc 1


WARNING: RuntimeError

trouble with that fit

WARNING: RuntimeError

trouble with that fit

WARNING: RuntimeError

trouble with that fit

WARNING: RuntimeError

trouble with that fit

WARNING: RuntimeError

trouble with that fit

updating truncation simulation

  • we set the intensity of the truncated profile to zero outside the truncation radius
  • we are fitting the profile out to 6 Re (by default)
  • previously, we were only fitting out to the truncation radius
  • I am no longer using 24um properties of the external sample to seed the simulation. Instead, I set Re to 5 and Ie to 2 for all galaxies, and then vary truncation radius and n among the different trials.

In [23]:
os.chdir(homedir+'/research/LCS/plots/')
%run ~/github/LCS/python/Python3/fit-truncated-sersic-1d.py --nres 30 --ngal 10 --minrtrunc .5 --maxrtrunc 2
plt.show()


translating between truncation radius and inferred Re

  • we are fitting a truncated profile with a sersic profile
  • the plots below show that the sersic fit of a truncated profile will have a lower value of Re than that of the underlying/non-truncated profile
  • in addition, the sersic fit to a truncated sersic profile will have a boosted Ie, and lower n. The effect on Ie is the least pronounced.

In [108]:
os.chdir(homedir+'/research/LCS/plots/')
%run ~/github/LCS/python/Python3/fit-truncated-sersic-1d.py --nres 30 --ngal 500 --minrtrunc .5 --maxrtrunc 3 
plt.show()


fitting R/Re vs truncation radius with y = a-b*exp(-c*x/d):  [1.03179629 1.49588586 1.23861193]

In [179]:
os.chdir(homedir+'/research/LCS/plots/')
%run ~/github/LCS/python/Python3/fit-truncated-sersic-1d.py --nres 30 --ngal 500 --minrtrunc .5 --maxrtrunc 5 
plt.show()


fitting vs truncation radius with y = a+b*exp(c*x):  [ 1.00198564 -1.47774914 -1.65656873]
fitting vs truncation radius with y = a+b*exp(c*x):  [ 1.00492674 -1.64793246 -1.40501981]
fitting vs truncation radius with y = a+b*exp(c*x):  [ 1.03676508 23.87434954 -3.11509669]

Model 2: New strategy for simulation

  • take field galaxy
  • pick random dr/dt, where dr/dt is how fast the radius is truncated

    • assuming it starts at 6 (encloses 95% for an n=4 profile. enclosed flux is higher for lower n profiles).
    • outer limit of integral is dr/dt times 6Re(time since infall)
    • QUESTION ABOUT HOW TO IMPLEMENT THIS -
      • is dr/dt the rate at which Rtrunc/Re changes (this is how I have coded it), or the rate at which Rtrunc changes (this would need to be in physical units, and this would make it more complicated)
  • to compare sizes, take truncated radius and use fitting function to translate into Re_fit/Re_input. this predicts the effective radius we would get by fitting a single component sersic profile to the truncated profile.

  • to compare SFRs:

    • integrate original profile out to 6 Re
    • integrate the simulated core profile out to $Rtrunc \times R_e$
  • alternate method for computing new SFR:

    • use all parameters (n, Re, Ie) associated with the truncation radius
    • integrate corresponding sersic profile from r=0 to 6Re
    • compare
  • plot integral of truncated profile (out to rtrunc)/ integral best-fit sersic model (out to 6Re) VS Rtrunc

    • do these give the same result?
    • if yes, then our two ways of estimating the change in SFR are consistent

Third Model

  • if model two fits the change in Re but can't simultaneously fit the change in SFR, then we can try adding a boost to model 2.

Plotting

  • change the format of the plots that we showed in paper 1
  • rather than showing the hexbin distribution of p value vs dr/dt, show fraction of trials at a particular dr/dt that have a p value < 0.05
  • could make this even lower threshold, e.g. p value < .003

Implementing Model 2


In [178]:
os.chdir(homedir+'/research/LCS/plots/')
%run ~/github/LCS/python/Python3/LCSsimulate-infall-paper2.py --use24 --model 2 --tmax 3
plot_multiple_tmax_wsfr2(nrandom=30)


Welcome!
USING MODEL 2
best dr/dt =  -3.95
disk is quenched in 0.3 Gyr
fraction that are quenched = 0.00
KS p value = 5.48005310e-03
drdt multiple values of dr/dt
#################
	 best dr/dt =  -3.95
	 disk is quenched in 0.3 Gyr
USING MODEL 2
best dr/dt =  -4.0
disk is quenched in 0.2 Gyr
fraction that are quenched = 0.29
KS p value = 9.95815221e-01
USING MODEL 2
best dr/dt =  -3.3500000000000023
disk is quenched in 0.3 Gyr
fraction that are quenched = 0.50
KS p value = 9.98028481e-01
USING MODEL 2
best dr/dt =  -3.750000000000001
disk is quenched in 0.3 Gyr
fraction that are quenched = 0.60
KS p value = 9.98620662e-01
<Figure size 432x288 with 0 Axes>

Alternate method for calculating change in SFR

  • alternate method for computing new SFR:
    • use all parameters (n, Re, Ie) associated with the truncation radius
    • integrate corresponding sersic profile from r=0 to 6Re
    • compare

Result

This definitely gives different results. It seems to me that method one is more physical, but method 2 is closer to what we do with the data. Except we get SFRs from the MIPS flux and NUV flux from NSA. We don't use the galfit magnitude to calculate the SFR.


In [177]:
os.chdir(homedir+'/research/LCS/plots/')
%run ~/github/LCS/python/Python3/LCSsimulate-infall-paper2.py --use24 --model 2 --tmax 3 --sfrint 2
plot_multiple_tmax_wsfr2(nrandom=30)


Welcome!
USING MODEL 2
best dr/dt =  -3.95
disk is quenched in 0.3 Gyr
fraction that are quenched = 0.00
KS p value = 5.48005310e-03
drdt multiple values of dr/dt
#################
	 best dr/dt =  -3.95
	 disk is quenched in 0.3 Gyr
#################
	 best dr/dt =  -3.8500000000000005
	 disk is quenched in 0.3 Gyr
USING MODEL 2
best dr/dt =  -3.0500000000000034
disk is quenched in 0.3 Gyr
fraction that are quenched = 0.08
KS p value = 9.84678073e-01
USING MODEL 2
best dr/dt =  -2.7000000000000046
disk is quenched in 0.4 Gyr
fraction that are quenched = 0.35
KS p value = 9.97041775e-01
USING MODEL 2
best dr/dt =  -3.3500000000000023
disk is quenched in 0.3 Gyr
fraction that are quenched = 0.50
KS p value = 9.96839538e-01
<Figure size 432x288 with 0 Axes>

In [185]:
os.chdir(homedir+'/research/LCS/plots/')
%run ~/github/LCS/python/Python3/LCSsimulate-infall-paper2.py --use24 --model 2 --tmax 3 --sfrint 2
plot_multiple_tmax_wsfr2(nrandom=10)


Welcome!
USING MODEL 2
best dr/dt =  -3.9000000000000004
disk is quenched in 0.3 Gyr
fraction that are quenched = 0.00
KS p value = 4.73440817e-03
USING MODEL 2
best dr/dt =  -3.750000000000001
disk is quenched in 0.3 Gyr
fraction that are quenched = 0.30
KS p value = 8.90153250e-01
USING MODEL 2
best dr/dt =  -2.9500000000000037
disk is quenched in 0.3 Gyr
fraction that are quenched = 0.34
KS p value = 9.97234694e-01
USING MODEL 2
best dr/dt =  -4.0
disk is quenched in 0.2 Gyr
fraction that are quenched = 0.52
KS p value = 9.95462257e-01
<Figure size 432x288 with 0 Axes>

In [190]:
os.chdir(homedir+'/research/LCS/plots/')
%run ~/github/LCS/python/Python3/LCSsimulate-infall-paper2.py --rmax 4 --use24 --model 2 --tmax 3 --sfrint 1
plot_multiple_tmax_wsfr2(nrandom=10)


Welcome!
USING MODEL 2
drdt multiple values of dr/dt
#################
	 best dr/dt =  -3.9000000000000004
	 disk is quenched in 0.3 Gyr
USING MODEL 2
USING MODEL 2
USING MODEL 2
Warning: < 20% of sim core sample has SFRs above detection threshold
Warning: < 20% of sim core sample has SFRs above detection threshold
Warning: < 20% of sim core sample has SFRs above detection threshold
Warning: < 20% of sim core sample has SFRs above detection threshold
Warning: < 20% of sim core sample has SFRs above detection threshold
Warning: < 20% of sim core sample has SFRs above detection threshold
Warning: < 20% of sim core sample has SFRs above detection threshold
Warning: < 20% of sim core sample has SFRs above detection threshold
Warning: < 20% of sim core sample has SFRs above detection threshold
Warning: < 20% of sim core sample has SFRs above detection threshold
Warning: < 20% of sim core sample has SFRs above detection threshold
Warning: < 20% of sim core sample has SFRs above detection threshold
Warning: < 20% of sim core sample has SFRs above detection threshold
Warning: < 20% of sim core sample has SFRs above detection threshold
Warning: < 20% of sim core sample has SFRs above detection threshold
Warning: < 20% of sim core sample has SFRs above detection threshold
Warning: < 20% of sim core sample has SFRs above detection threshold
Warning: < 20% of sim core sample has SFRs above detection threshold
Warning: < 20% of sim core sample has SFRs above detection threshold
Warning: < 20% of sim core sample has SFRs above detection threshold
Warning: < 20% of sim core sample has SFRs above detection threshold
Warning: < 20% of sim core sample has SFRs above detection threshold
Warning: < 20% of sim core sample has SFRs above detection threshold
Warning: < 20% of sim core sample has SFRs above detection threshold
Warning: < 20% of sim core sample has SFRs above detection threshold
Warning: < 20% of sim core sample has SFRs above detection threshold
Warning: < 20% of sim core sample has SFRs above detection threshold
Warning: < 20% of sim core sample has SFRs above detection threshold
<Figure size 432x288 with 0 Axes>

Found that I had the limit se


In [6]:
os.chdir(homedir+'/research/LCS/plots/')
%run ~/github/LCS/python/Python3/LCSsimulate-infall-paper2.py --rmax 4 --use24 --model 2 --tmax 3 --sfrint 1
plot_multiple_tmax_wsfr2(nrandom=10)


Welcome!
USING MODEL 2
USING MODEL 2
USING MODEL 2
USING MODEL 2
<Figure size 432x288 with 0 Axes>

Update July 21, 2020

  • need to restrict to B/T < 0.3 galaxies
  • do this and then rerun models 1 and 2
  • then run model 3

Model 1 with B/T < 0.3 only


In [10]:
os.chdir(homedir+'/research/LCS/plots/')
%run ~/github/LCS/python/Python3/LCSsimulate-infall-paper2.py --use24
best_drdt, best_sim_core,ks_p_max,all_drdt,all_p,all_p_sfr = run_sim(tmax=3,drdt_step=0.05,nrandom=100)


Welcome!
<Figure size 432x288 with 0 Axes>

In [11]:
os.chdir(homedir+'/research/LCS/plots/')
%run ~/github/LCS/python/Python3/LCSsimulate-infall-paper2.py --btcut --use24
best_drdt, best_sim_core,ks_p_max,all_drdt,all_p,all_p_sfr = run_sim(tmax=3,drdt_step=0.05,nrandom=100)


Welcome!
<Figure size 432x288 with 0 Axes>

Model 2 with B/T < 0.3 only

  • first rechecking to make sure we get the same results as before, and that I didn't inadvertently change something.

In [18]:
os.chdir(homedir+'/research/LCS/plots/')
%run ~/github/LCS/python/Python3/LCSsimulate-infall-paper2.py --use24 --model 1 --tmax 3 --sfrint 1
plot_multiple_tmax_wsfr2(nrandom=30)


Welcome!
<Figure size 432x288 with 0 Axes>

In [19]:
os.chdir(homedir+'/research/LCS/plots/')
%run ~/github/LCS/python/Python3/LCSsimulate-infall-paper2.py --use24 --model 1 --tmax 3 --sfrint 1 --btcut
plot_multiple_tmax_wsfr2(nrandom=30)


Welcome!
<Figure size 432x288 with 0 Axes>

Testing new plot for models 1 and 2

  • 22-July-2020

In [154]:
os.chdir(homedir+'/research/LCS/plots/')
%run ~/github/LCS/python/Python3/LCSsimulate-infall-paper2.py --use24 --model 1 --tmax 3 --sfrint 1 --btcut
tmax=3
best_drdt, best_sim_core,ks_p_max,all_drdt,all_p,all_p_sfr=run_sim(tmax=tmax,drdt_step=.05,nrandom=30,plotsingle=False,plotflag=False)


Welcome!
Warning: < 20% of sim core sample has SFRs above detection threshold
Warning: < 20% of sim core sample has SFRs above detection threshold

In [155]:
plot_model1_3panel(all_drdt,all_p,all_p_sfr,tmax=3,v2=.005,model=1)



In [106]:


In [141]:
def plot_model1_3panel(all_drdt,all_p,all_p_sfr,tmax=2,v2=.005,model=1):
    '''
    make a 1x3 plot showing
     (1) pvalue vs dr/dt for size
     (2) pvalue vs dr/dt for SFR
     (3) pvalue size vs pvalue SFR, color coded by dr/dt

    PARAMS
    ------
    * all_drdt : output from run_sum; disk-shrinking rate for each model
    * all_p : output from run_sum; KS pvalue for size comparision
    * all_p_sfr : output from run_sum; KS pvalue for SFR comparison
    * tmax : tmax of simulation, default is 2 Gyr
    * v2 : max value for colorbar; default is 0.005 for 2sigma
    * model : default is 1; could use this plot for models 1 and 2

    OUTPUT
    ------
    * save png and pdf plot in plotdir
    * title is: model3-tmax'+str(tmax)+'-size-sfr-constraints-3panel.pdf
    '''
    
    plt.figure(figsize=(14,4))
    plt.subplots_adjust(wspace=.5,bottom=.15)
    xvars = [all_drdt, all_drdt, all_p]
    yvars = [all_p, all_p_sfr, all_p_sfr]
    xlabels=['dr/dt','dr/dt','pvalue Size']
    ylabels=['pvalue Size','pvalue SFR','pvalue SFR']    
    titles = ['Size Constraints','SFR Constraints','']
    allax = []
    for i in range(len(xvars)):
        plt.subplot(1,3,i+1)
        if i < 2:
            plt.scatter(xvars[i],yvars[i],s=10,alpha=.5)
            plt.title(titles[i])
        else:
            # plot pvalue vs pvalue, color coded by dr/dt
            plt.scatter(all_p,all_p_sfr,c=all_drdt,vmin=-4,vmax=0,s=5)
            plt.title('Size & SFR Constraints')

        plt.xlabel(xlabels[i],fontsize=16)
        plt.ylabel(ylabels[i],fontsize=16)        
        
        allax.append(plt.gca())
    cb = plt.colorbar(ax=allax,fraction=.08)
    cb.set_label('dr/dt')
    plt.axhline(y=.05,ls='--')
    plt.axvline(x=.05,ls='--')
    ax = plt.gca()
    #plt.axis([-.01,.35,-.01,.2])
    xl = np.linspace(.05,1,100)
    y1 = np.ones(len(xl))
    y2 = .05*np.ones(len(xl))
    plt.fill_between(xl,y1=y1,y2=y2,alpha=.1)
    plt.savefig(plotdir+'/model'+str(model)+'-tmax'+str(tmax)+'-size-sfr-constraints-3panel.png')
    plt.savefig(plotdir+'/model'+str(model)+'-tmax'+str(tmax)+'-size-sfr-constraints-3panel.pdf')

In [131]:
os.chdir(homedir+'/research/LCS/plots/')
%run ~/github/LCS/python/Python3/LCSsimulate-infall-paper2.py --use24 --model 2 --tmax 3 --sfrint 1 --btcut
tmax=3
best_drdt, best_sim_core,ks_p_max,all_drdt,all_p,all_p_sfr=run_sim(tmax=tmax,drdt_step=.05,nrandom=30,plotsingle=False,plotflag=False)


Welcome!
USING MODEL 2
<Figure size 432x288 with 0 Axes>

In [138]:
plot_model1_3panel(all_drdt,all_p,all_p_sfr,tmax=3,v2=.005,model=2)



In [149]:
os.chdir(homedir+'/research/LCS/plots/')
%run ~/github/LCS/python/Python3/LCSsimulate-infall-paper2.py --use24 --model 2 --tmax 3 --sfrint 1 --btcut --rmax 1
tmax=3
best_drdt, best_sim_core,ks_p_max,all_drdt,all_p,all_p_sfr=run_sim(tmax=tmax,drdt_step=.05,nrandom=30,plotsingle=False,plotflag=False)
plot_model1_3panel(all_drdt,all_p,all_p_sfr,tmax=3,v2=.005,model=2)


Welcome!
USING MODEL 2
Warning: < 20% of sim core sample has SFRs above detection threshold
Warning: < 20% of sim core sample has SFRs above detection threshold
Warning: < 20% of sim core sample has SFRs above detection threshold
Warning: < 20% of sim core sample has SFRs above detection threshold
Warning: < 20% of sim core sample has SFRs above detection threshold
Warning: < 20% of sim core sample has SFRs above detection threshold
Warning: < 20% of sim core sample has SFRs above detection threshold
Warning: < 20% of sim core sample has SFRs above detection threshold
Warning: < 20% of sim core sample has SFRs above detection threshold
Warning: < 20% of sim core sample has SFRs above detection threshold
Warning: < 20% of sim core sample has SFRs above detection threshold
<Figure size 432x288 with 0 Axes>

In [150]:
plot_model1_3panel(all_drdt,all_p,all_p_sfr,tmax=3,v2=.005,model=2)



In [ ]:


In [ ]:

Model 3

  • model 3 is the same as model 2 (truncated disk) BUT we add a boost factor to the central intensity
  • want to plot dr/dt vs boost. maybe color code if p-value for both are below 0.05 (Greg's suggestion - to make it 2 colors)
    • could also do as a first step: p-value vs pvalue, 2x1, left color coded by dr/dt, right color coded by boost
    • then move on to the second version

In [28]:
os.chdir(homedir+'/research/LCS/plots/')
%run ~/github/LCS/python/Python3/LCSsimulate-infall-paper2.py --use24 --model 3 --tmax 3 --sfrint 1 --btcut
plot_multiple_tmax_wsfr2(nrandom=10)


Welcome!
<Figure size 432x288 with 0 Axes>

In [24]:
np.random.random()


Out[24]:
0.8304808518230361

In [42]:
os.chdir(homedir+'/research/LCS/plots/')
%run ~/github/LCS/python/Python3/LCSsimulate-infall-paper2.py --use24 --model 3 --tmax 3 --sfrint 1 --btcut
tmax=3
best_drdt, best_sim_core,ks_p_max,all_drdt,all_p,all_p_sfr,boost=run_sim(tmax=tmax,drdt_step=.05,nrandom=30,plotsingle=False,plotflag=False)


Welcome!
<Figure size 432x288 with 0 Axes>

In [55]:
tmax=3
best_drdt, best_sim_core,ks_p_max,all_drdt,all_p,all_p_sfr,boost=run_sim(tmax=tmax,drdt_step=.05,nrandom=30,plotsingle=False,plotflag=False)
plt.figure(figsize=(12,4))
plt.subplots_adjust(wspace=.5)
colors = [all_p,all_p_sfr]
labels = ['size p value','sfr p value']
titles = ['Size Constraints','SFR Constraints']
v2 = .005
for i in range(len(colors)):
    plt.subplot(1,2,i+1)
    plt.scatter(all_drdt,boost,c=colors[i],vmin=0,vmax=v2,s=15)
    cb = plt.colorbar()
    cb.set_label(labels[i])
    plt.title(titles[i])
    plt.xlabel('dr/dt',fontsize=16)
    plt.ylabel('I boost/I0',fontsize=16)
plt.savefig(plotdir+'/model3-tmax'+str(tmax)+'-size-sfr-constraints.png')
plt.savefig(plotdir+'/model3-tmax'+str(tmax)+'-size-sfr-constraints.pdf')



In [49]:
tmax=2
best_drdt, best_sim_core,ks_p_max,all_drdt,all_p,all_p_sfr,boost=run_sim(tmax=tmax,drdt_step=.05,nrandom=30,plotsingle=False,plotflag=False)



In [51]:
plt.figure(figsize=(12,4))
plt.subplots_adjust(wspace=.5)
colors = [all_p,all_p_sfr]
labels = ['size p value','sfr p value']
titles = ['Size Constraints','SFR Constraints']
v2 = .005
for i in range(len(colors)):
    plt.subplot(1,2,i+1)
    plt.scatter(all_drdt,boost,c=colors[i],vmin=0,vmax=v2,s=15)
    cb = plt.colorbar()
    cb.set_label(labels[i])
    plt.title(titles[i])
    plt.xlabel('dr/dt',fontsize=16)
    plt.ylabel('I boost/I0',fontsize=16)
plt.savefig(plotdir+'/model3-tmax'+str(tmax)+'-size-sfr-constraints.png')
plt.savefig(plotdir+'/model3-tmax'+str(tmax)+'-size-sfr-constraints.pdf')



In [52]:
tmax=4
best_drdt, best_sim_core,ks_p_max,all_drdt,all_p,all_p_sfr,boost=run_sim(tmax=tmax,drdt_step=.05,nrandom=30,plotsingle=False,plotflag=False)

In [68]:
def plot_model3(all_drdt,all_p,all_p_sfr,boost,tmax=2,v2=.005):
    plt.figure(figsize=(12,4))
    plt.subplots_adjust(wspace=.5)
    colors = [all_p,all_p_sfr]
    labels = ['size p value','sfr p value']
    titles = ['Size Constraints','SFR Constraints']
    allax = []
    for i in range(len(colors)):
        plt.subplot(1,2,i+1)
        plt.scatter(all_drdt,boost,c=colors[i],vmin=0,vmax=v2,s=15)
    
        plt.title(titles[i])
        plt.xlabel('dr/dt',fontsize=16)
        plt.ylabel('I boost/I0',fontsize=16)
        allax.append(plt.gca())
    cb = plt.colorbar(ax=allax,fraction=.08)
    cb.set_label('KS p value')
    plt.savefig(plotdir+'/model3-tmax'+str(tmax)+'-size-sfr-constraints.png')
    plt.savefig(plotdir+'/model3-tmax'+str(tmax)+'-size-sfr-constraints.pdf')

In [103]:
def plot_model3_3panel(all_drdt,all_p,all_p_sfr,boost,tmax=2,v2=.005):
    plt.figure(figsize=(14,4))
    plt.subplots_adjust(wspace=.01,bottom=.15)
    colors = [all_p,all_p_sfr]
    labels = ['size p value','sfr p value']
    titles = ['Size Constraints','SFR Constraints']
    allax = []
    for i in range(len(colors)+1):
        plt.subplot(1,3,i+1)
        if i < 2:
            plt.scatter(all_drdt,boost,c=colors[i],vmin=0,vmax=v2,s=10)
            plt.title(titles[i])
        else:
            # plot both together
            flag = np.arange(0,len(all_drdt),2)
            plt.scatter(all_drdt[flag],boost[flag],c=colors[0][flag],vmin=0,vmax=v2,s=10)
            flag = np.arange(1,len(all_drdt),2)
            plt.scatter(all_drdt[flag],boost[flag],c=colors[1][flag],vmin=0,vmax=v2,s=10)
            #plt.scatter(all_drdt,boost,c=colors[0]+colors[1],vmin=0,vmax=v2,s=10)
            plt.title('Size & SFR Constraints')
        if i == 0:
            plt.ylabel('Iboost/Ie',fontsize=16)
        else:
            y1,y2 = plt.ylim()
            #t = plt.yticks()
            #print(t)
            plt.yticks([])
            plt.ylim(y1,y2)
        plt.xlabel('dr/dt',fontsize=16)
        
        allax.append(plt.gca())
    cb = plt.colorbar(ax=allax,fraction=.08)
    cb.set_label('KS p value')
    plt.savefig(plotdir+'/model3-tmax'+str(tmax)+'-size-sfr-constraints-3panel.png')
    plt.savefig(plotdir+'/model3-tmax'+str(tmax)+'-size-sfr-constraints-3panel.pdf')

In [80]:
tmax=3
best_drdt, best_sim_core,ks_p_max,all_drdt,all_p,all_p_sfr,boost=run_sim(tmax=tmax,drdt_step=.05,nrandom=30,plotsingle=False,plotflag=False)

In [73]:
plot_model3(all_drdt,all_p,all_p_sfr,boost)



In [104]:
plot_model3_3panel(all_drdt,all_p,all_p_sfr,boost,tmax=3)


Using GSWLC SFRs


In [99]:
os.chdir(homedir+'/research/LCS/plots/')
%run ~/github/LCS/python/Python3/LCSsimulate-infall-paper2.py --use24 --model 3 --tmax 3 --sfrint 1 --btcut
tmax=4
best_drdt, best_sim_core,ks_p_max,all_drdt,all_p,all_p_sfr,boost=run_sim(tmax=tmax,drdt_step=.1,nrandom=30,rmax=4,plotsingle=False,plotflag=False)
plot_model3_3panel(all_drdt,all_p,all_p_sfr,boost,tmax=3)


core vs external: size distribution
KS test: 0.20, p=8.09e-02
core vs external: SFR distribution
KS test: 0.09, p=8.65e-01
core vs external: n sersic distribution
KS test: 0.10, p=7.39e-01
Welcome!
Warning: < 20% of sim core sample has SFRs above detection threshold
Warning: < 20% of sim core sample has SFRs above detection threshold
Warning: < 20% of sim core sample has SFRs above detection threshold
Warning: < 20% of sim core sample has SFRs above detection threshold
Warning: < 20% of sim core sample has SFRs above detection threshold
Warning: < 20% of sim core sample has SFRs above detection threshold
Warning: < 20% of sim core sample has SFRs above detection threshold
Warning: < 20% of sim core sample has SFRs above detection threshold
Warning: < 20% of sim core sample has SFRs above detection threshold
Warning: < 20% of sim core sample has SFRs above detection threshold
Warning: < 20% of sim core sample has SFRs above detection threshold
Warning: < 20% of sim core sample has SFRs above detection threshold
Warning: < 20% of sim core sample has SFRs above detection threshold
Warning: < 20% of sim core sample has SFRs above detection threshold
Warning: < 20% of sim core sample has SFRs above detection threshold
Warning: < 20% of sim core sample has SFRs above detection threshold
Warning: < 20% of sim core sample has SFRs above detection threshold
Warning: < 20% of sim core sample has SFRs above detection threshold
Warning: < 20% of sim core sample has SFRs above detection threshold
Warning: < 20% of sim core sample has SFRs above detection threshold
Warning: < 20% of sim core sample has SFRs above detection threshold
Warning: < 20% of sim core sample has SFRs above detection threshold
Warning: < 20% of sim core sample has SFRs above detection threshold
Warning: < 20% of sim core sample has SFRs above detection threshold
Warning: < 20% of sim core sample has SFRs above detection threshold
Warning: < 20% of sim core sample has SFRs above detection threshold
Warning: < 20% of sim core sample has SFRs above detection threshold
Warning: < 20% of sim core sample has SFRs above detection threshold
Warning: < 20% of sim core sample has SFRs above detection threshold
Warning: < 20% of sim core sample has SFRs above detection threshold
<Figure size 432x288 with 0 Axes>

In [103]:
os.chdir(homedir+'/research/LCS/plots/')
%run ~/github/LCS/python/Python3/LCSsimulate-infall-paper2.py --use24 --model 2 --tmax 3 --sfrint 1 --btcut --rmax 4
tmax=3
best_drdt, best_sim_core,ks_p_max,all_drdt,all_p,all_p_sfr=run_sim(tmax=tmax,drdt_step=.05,rmax=4,nrandom=30,plotsingle=False,plotflag=False)
plot_model1_3panel(all_drdt,all_p,all_p_sfr,tmax=3,v2=.005,model=2)


core vs external: size distribution
KS test: 0.20, p=8.09e-02
core vs external: SFR distribution
KS test: 0.09, p=8.65e-01
core vs external: n sersic distribution
KS test: 0.10, p=7.39e-01
Welcome!
USING MODEL 2
drdt multiple values of dr/dt
#################
	 best dr/dt =  -2.1000000000000014
	 disk is quenched in 0.5 Gyr
<Figure size 432x288 with 0 Axes>

In [104]:
os.chdir(homedir+'/research/LCS/plots/')
%run ~/github/LCS/python/Python3/LCSsimulate-infall-paper2.py --use24 --model 1 --tmax 3 --sfrint 1 --btcut --rmax 4
tmax=3
best_drdt, best_sim_core,ks_p_max,all_drdt,all_p,all_p_sfr=run_sim(tmax=tmax,drdt_step=.05,rmax=4,nrandom=30,plotsingle=False,plotflag=False)
plot_model1_3panel(all_drdt,all_p,all_p_sfr,tmax=3,v2=.005,model=2)


core vs external: size distribution
KS test: 0.20, p=8.09e-02
core vs external: SFR distribution
KS test: 0.09, p=8.65e-01
core vs external: n sersic distribution
KS test: 0.10, p=7.39e-01
Welcome!
<Figure size 432x288 with 0 Axes>

Cartoon Drawing of Models

Model 1

  • Sersic profile
  • Re shrinks, everthing else stays the same

In [9]:
def sersic(x,Ie,n,Re):
    bn = 1.999*n - 0.327
    return Ie*np.exp(-1*bn*((x/Re)**(1./n)-1))

In [106]:
plt.figure(figsize=(10,8))
plt.subplots_adjust(wspace=.3)

rmax = 4
scaleRe = 0.8
rtrunc = 1.5
n=1
# shrink Re
plt.subplot(3,2,1)
x = np.linspace(0,rmax,100)

Ie=1
Re=1
y = sersic(x,Ie,n,Re)
plt.plot(x,y,label='sersic n='+str(n))
y2 = sersic(x,Ie,n,scaleRe*Re)
plt.plot(x,y2,label="Re -> "+str(scaleRe)+"Re",ls='--')
plt.legend()
plt.xlabel('radius')
plt.ylabel('Intensity')

# plot total flux
plt.subplot(3,2,2)
dx = x[1]-x[0]
sum1 = (y*dx*2*np.pi*x)
sum2 = (y2*dx*2*np.pi*x)
plt.plot(x,np.cumsum(sum1)/np.max(np.cumsum(sum1)),label='sersic n='+str(n))
plt.plot(x,np.cumsum(sum2)/np.max(np.cumsum(sum1)),label="Re -> "+str(scaleRe)+"Re",ls='--')
plt.ylabel('Enclosed Flux')
plt.grid()

# truncated sersic model
plt.subplot(3,2,3)
plt.plot(x,y,label='sersic n='+str(n))
y3 = y.copy()
flag = x > rtrunc
y3[flag] = np.zeros(sum(flag))
plt.plot(x,y3,ls='--',label='truncated at '+str(rtrunc)+' Re')
plt.legend()
plt.ylabel('Intensity')
plt.legend()
#plt.gca().set_yscale('log')

plt.subplot(3,2,4)
sum3 = (y3*dx*2*np.pi*x)
plt.plot(x,np.cumsum(sum1)/np.max(np.cumsum(sum1)),label='sersic n='+str(n))
plt.plot(x,np.cumsum(sum3)/np.max(np.cumsum(sum1)),label='truncated at '+str(rtrunc)+' Re',ls='--')
plt.ylabel('Enclosed Flux')
plt.legend()
plt.grid()

# need to show what measured Re would be in model 2

# truncated and boosted



In [ ]: