In [1]:
%pylab inline
from __future__ import (division, print_function)
import os
import sys
import copy
import fnmatch
import warnings
import collections
import numpy as np
import scipy
try:
from scipy.stats import scoreatpercentile
except:
scoreatpercentile = False
from scipy.interpolate import interp1d
import cPickle as pickle
# Astropy
from astropy.io import fits
from astropy import units as u
from astropy.stats import sigma_clip
from astropy.table import Table, Column
from astropy.utils.console import ProgressBar
# AstroML
from astroML.plotting import hist
# Matplotlib related
import matplotlib.pyplot as plt
from matplotlib.patches import Ellipse
from matplotlib.ticker import NullFormatter
from matplotlib.ticker import MaxNLocator
# Matplotlib default settings
rcdef = plt.rcParams.copy()
pylab.rcParams['figure.figsize'] = 12, 10
pylab.rcParams['xtick.major.size'] = 8.0
pylab.rcParams['xtick.major.width'] = 2.5
pylab.rcParams['xtick.minor.size'] = 4.0
pylab.rcParams['xtick.minor.width'] = 2.5
pylab.rcParams['ytick.major.size'] = 8.0
pylab.rcParams['ytick.major.width'] = 2.5
pylab.rcParams['ytick.minor.size'] = 4.0
pylab.rcParams['ytick.minor.width'] = 2.5
# Personal
import hscUtils as hUtil
import galSBP
In [5]:
# Code for Get Bootstrap mean or median
def _confidence_interval_1d(A, alpha=.05, metric=np.mean, numResamples=10000, interpolate=True):
"""Calculates bootstrap confidence interval along one dimensional array"""
if not isinstance(alpha, collections.Iterable):
alpha = np.array([alpha])
N = len(A)
resampleInds = np.random.randint(0, N, (numResamples,N))
metricOfResampled = metric(A[resampleInds], axis=-1)
confidenceInterval = np.zeros(2*len(alpha),dtype='float')
if interpolate:
for thisAlphaInd, thisAlpha in enumerate(alpha):
confidenceInterval[2*thisAlphaInd] = scoreatpercentile(metricOfResampled,
thisAlpha*100/2.0)
confidenceInterval[2*thisAlphaInd+1] = scoreatpercentile(metricOfResampled,
100-thisAlpha*100/2.0)
else:
sortedMetricOfResampled = np.sort(metricOfResampled)
for thisAlphaInd, thisAlpha in enumerate(alpha):
confidenceInterval[2*thisAlphaInd] = sortedMetricOfResampled[int(round(thisAlpha*numResamples/2.0))]
confidenceInterval[2*thisAlphaInd+1] = sortedMetricOfResampled[int(round(numResamples -
thisAlpha*numResamples/2.0))]
return confidenceInterval
def _ma_confidence_interval_1d(A, alpha=.05, metric=np.mean, numResamples=10000, interpolate=True):
A = np.ma.masked_invalid(A, copy=True)
A = A.compressed()
confidenceInterval = _confidence_interval_1d(A, alpha, metric, numResamples, interpolate)
return confidenceInterval
def confidence_interval(A, axis=None, alpha=.05, metric=np.mean, numResamples=10000, interpolate=True):
"""Return the bootstrap confidence interval of an array or along an axis ignoring NaNs and masked elements.
Parameters
----------
A : array_like
Array containing numbers whose confidence interval is desired.
axis : int, optional
Axis along which the confidence interval is computed.
The default is to compute the confidence interval of the flattened array.
alpha: float or array, optional
confidence level of confidence interval. 100.0*(1-alpha) percent confidence
interval will be returned.
If length-n array, n confidence intervals will be computed
The default is .05
metric : numpy function, optional
metric to calculate confidence interval for.
The default is numpy.mean
numResamples : int, optional
number of bootstrap samples. The default is 10000.
interpolate: bool, optional
uses scipy.stats.scoreatpercentile to interpolate between bootstrap samples
if alpha*numResamples/2.0 is not integer.
The default is True
Returns
-------
confidenceInterval : ndarray
An array with the same shape as `A`, with the specified axis replaced by one twice the length of the alpha
If `A` is a 0-d array, or if axis is None, a length-2 ndarray is returned.
"""
if interpolate is True and scoreatpercentile is False:
print("need scipy to interpolate between values")
interpolate = False
A = A.copy()
if axis is None:
A = A.ravel()
outA = _ma_confidence_interval_1d(A, alpha, metric, numResamples, interpolate)
else:
outA = np.apply_along_axis(_ma_confidence_interval_1d, axis, A, alpha,
metric, numResamples, interpolate)
return outA
In [50]:
# Absolute magnitude of sun in HSC filters
# Actuall borrowed from DES filters
# Values from magsun.data in FSPS
amag_sun_des_g = 5.08
amag_sun_des_r = 4.62
amag_sun_des_i = 4.52
amag_sun_des_z = 4.52
amag_sun_des_y = 4.51
# Based on http://www.baryons.org/ezgal/filters.php
amag_sun_ukiss_y = 4.515
# Extinction correction factor for HSC
## A\_lambda = Coeff * E(B-V)
a_hsc_g = 3.233
a_hsc_r = 2.291
a_hsc_i = 1.635
a_hsc_z = 1.261
a_hsc_y = 1.076
#
SIGMA1 = 0.3173
SIGMA2 = 0.0455
SIGMA3 = 0.0027
In [7]:
# Location of the cutouts
import platform
if 'Linux' in platform.platform():
""" On Astro2 / For Linux """
machine = 'w520'
baseDir = '/media/hs/Astro2/hsc/master'
elif 'Darwin' in platform.platform():
machine = 'mbp13'
""" On Astro3 / For MacOS"""
baseDir = '/Users/songhuang/astro3/hscs'
else:
raise Exception("## Unknown location for HSC data!")
# The two current datasets
redBCG = os.path.join(baseDir, 'redmapper')
if not os.path.exists(redBCG):
raise Exception("## Can not find location for redBCG data")
nonBCG = os.path.join(baseDir, 'nonbcg')
#nonBCG = os.path.join(baseDir, 'gama1')
if not os.path.exists(nonBCG):
raise Exception("## Can not find location for nonBCG data")
# Summary tables:
redBCG_sum = os.path.join(redBCG, 'redBCG_new.fits')
nonBCG_sum = os.path.join(nonBCG, 'nonBCG_new.fits')
In [8]:
def findProfile(pattern, loc, verbose=False):
"""
Find the prefix of the ellipse profiles.
Parameters:
"""
result = []
for root, dirs, files in os.walk(loc):
for name in files:
if fnmatch.fnmatch(name, pattern):
result.append(os.path.join(root, name))
if verbose:
print("### %d files found !" % len(result))
return result
def testFindProfile():
"""Test the findProfile function."""
find = findProfile("*ellip*.pkl",
os.path.join(redBCG, '127', 'HSC-I', 'default'))
return find
In [9]:
def readProfile(ellFile):
""" Load the pickle format 1-D profile. """
if os.path.isfile(ellFile):
return pickle.load(open(ellFile, 'rb'))
else:
warnings.warn("!!! Can not find the Ellipse Output at %s" %
ellFile )
return None
In [10]:
def getEllipProfile(galid, base, filter='HSC-I', rerun='default',
prefix='redBCG', suffix=None, stage='3',
verbose=False):
"""
Find and load the Ellipse output.
Parameters:
"""
galid = str(galid).strip()
if suffix is None:
suffix = '_'
else:
suffix = '_' + suffix + '_'
location = os.path.join(base, galid, filter, rerun)
ellFile = (prefix + '_' + str(galid) + '_' + filter +
'_full_img_ellip_' + rerun +
suffix + stage + '.pkl')
ellFile = os.path.join(location, ellFile)
if not os.path.isfile(ellFile):
if verbose:
warnings.warn('!!! Can not find the Ellipse profile ! %s' %
ellFile)
return None
else:
ellProf = readProfile(ellFile)
return ellProf
In [11]:
def correctProf(ellProf, redshift, extinction=0.0, zp=27.0,
amag_sun=None, dimming=True, corCurve=True,
verbose=False, m2l=None, z0=0.1):
"""
Photometric correction of the Ellipse profile.
Parameters:
"""
""" Get physical pixel scale and distant module """
scale = hUtil.cosmoScale(redshift)
distmod = hUtil.cosmoDistMod(redshift)
if dimming:
dim = getDimming(redshift, z0)
else:
dim = 0.0
if verbose:
print("### REDSHIFT : %7.4f" % redshift)
print("### PIX SCALE : %7.4f kpc/arcsec" % scale)
print("### DIST_MOD : %7.4f mag" % distmod)
print("### DIMMING : %7.4f mag" % dim)
""" Convert unit of major axis radius to Kpc """
sma_kpc = ellProf['sma_asec'] * scale
if not corCurve:
abs_mag = (-2.5 * np.log10(ellProf['growth_ori']) +
zp - extinction - distmod)
else:
abs_mag = (-2.5 * np.log10(ellProf['growth_cor']) +
zp - extinction - distmod)
""" Extinction and/or Dimming corrected SBP """
sbp_cor = (ellProf['sbp'] - extinction - dim)
sbp_cor_upp = (ellProf['sbp_upp'] - extinction - dim)
sbp_err = (sbp_cor_upp - sbp_cor)
"""
If absolute magnitude of the Sun is provided,
Convert the SBP into physical unit of (L_sun/kpc**2)
"""
if amag_sun is not None:
abs_sbp = ((amag_sun + 21.572 - sbp_cor)/2.5 + 6.0)
abs_sbp_low = ((amag_sun + 21.572 - sbp_cor_upp)/2.5 + 6.0)
err_sbp = (abs_sbp - abs_sbp_low)
"""
Convert the absolute magnitude into log(L*/L_sun)
"""
abs_mag = ((amag_sun - abs_mag) / 2.5)
"""
If M/L ratio is provided, furthur convert it into
surface stellar mass density profile
"""
if m2l is not None:
abs_sbp += np.log10(m2l)
abs_mag += np.log10(m2l)
else:
abs_sbp = sbp_cor
err_sbp = sbp_err
return sma_kpc, abs_sbp, abs_mag, err_sbp
In [12]:
def sbpExtract(loc, galID, redshift, filter,
prefix, rerun, stage, suffix=None,
zp=27.0, extinction=0.0,
amag_sun=None, m2l=None,
origin=False):
"""
Return important SBP information.
Parameters:
"""
prof = getEllipProfile(galID, loc, filter=filter,
rerun=rerun, prefix=prefix,
stage=stage, suffix=suffix)
if prof is not None:
ell = correctProf(prof, redshift,
extinction=extinction,
zp=zp, amag_sun=amag_sun,
dimming=True, corCurve=True,
verbose=False, m2l=m2l)
if origin:
return ell, prof
else:
return ell
else:
return None
In [13]:
def sbpCollect(loc, galID, redshift, prefix='redBCG',
a_g=0.0, a_r=0.0, a_i=0.0,
a_z=0.0, a_y=0.0, suffix=None,
m2l_g=None, m2l_r=None, m2l_i=None,
m2l_z=None, m2l_y=None,
verbose=False, save=True):
"""
Collect profiles from the cutout folder.
This is a quick work-around, eventually should us a Class for dataset
This works for the redBCG and nonBCG datasets 2015-12-09
And, can not use for any profile with suffix
"""
""" Location and Table name """
sumDir = os.path.join(loc, 'sum')
if suffix is None:
sumTab = str(galID) + '_sbp_sum.fits'
suffix = ''
else:
sumTab = str(galID) + '_' + suffix + '_sbp_sum.fits'
if not os.path.exists(sumDir):
os.mkdir(sumDir)
sumTable = os.path.join(sumDir, sumTab)
""" The basic reference model """
refEllI = sbpExtract(loc, galID, redshift, 'HSC-I',
prefix, 'default', '3',
extinction=a_i, m2l=m2l_i,
amag_sun=amag_sun_des_i)
if refEllI is not None:
""" Reference profile in I-band """
rad, muI1, lumI1, errI1 = refEllI
""" Create a NaN array """
empty = copy.deepcopy(rad)
empty[:] = np.nan
""" I largeR1 """
ellI2 = sbpExtract(loc, galID, redshift,
'HSC-I', prefix, 'largeR1', '4',
m2l=m2l_i, extinction=a_i,
amag_sun=amag_sun_des_i)
if ellI2 is not None:
r, muI2, lumI2, errI2 = ellI2
else:
muI2, lumI2, errI2 = empty, empty, empty
warnings.warn('### Can not find the largeR1 for I-band!')
""" I smallR1 """
ellI3 = sbpExtract(loc, galID, redshift,
'HSC-I', prefix, 'smallR1', '4',
m2l=m2l_i, extinction=a_i,
amag_sun=amag_sun_des_i)
if ellI3 is not None:
r, muI3, lumI3, errI3 = ellI3
else:
muI3, lumI3, errI3 = empty, empty, empty
warnings.warn('### Can not find the smallR1 for I-band!')
""" G default """
ellG1 = sbpExtract(loc, galID, redshift,
'HSC-G', prefix, 'default', '4',
m2l=m2l_g, extinction=a_g,
amag_sun=amag_sun_des_g)
if ellG1 is not None:
r, muG1, lumG1, errG1 = ellG1
else:
muG1, lumG1, errG1 = empty, empty, empty
warnings.warn('### Can not find the default for G-band!')
""" R default """
ellR1 = sbpExtract(loc, galID, redshift,
'HSC-R', prefix, 'default', '4',
m2l=m2l_r, extinction=a_r,
amag_sun=amag_sun_des_r)
if ellR1 is not None:
r, muR1, lumR1, errR1 = ellR1
else:
muR1, lumR1, errR1 = empty, empty, empty
warnings.warn('### Can not find the default for R-band!')
""" Z default """
ellZ1 = sbpExtract(loc, galID, redshift,
'HSC-Z', prefix, 'default', '4',
m2l=m2l_z, extinction=a_z,
amag_sun=amag_sun_des_z)
if ellZ1 is not None:
r, muZ1, lumZ1, errZ1 = ellZ1
else:
muZ1, lumZ1, errZ1 = empty, empty, empty
warnings.warn('### Can not find the default for Z-band!')
""" Y default """
ellY1 = sbpExtract(loc, galID, redshift,
'HSC-Y', prefix, 'default', '4',
m2l=m2l_y, extinction=a_y,
amag_sun=amag_sun_des_y)
if ellY1 is not None:
r, muY1, lumY1, errY1 = ellY1
else:
muY1, lumY1, errY1 = empty, empty, empty
warnings.warn('### Can not find the default for Y-band!')
""" Save the summary table """
sbpTable = Table([rad, muI1, lumI1, errI1,
muI2, lumI2, errI2,
muI3, lumI3, errI3,
muG1, lumG1, errG1,
muR1, lumR1, errR1,
muZ1, lumZ1, errZ1,
muY1, lumY1, errY1,
],
names=('rKpc', 'muI1', 'lumI1', 'errI1',
'muI2', 'lumI2', 'errI2',
'muI3', 'lumI3', 'errI3',
'muG1', 'lumG1', 'errG1',
'muR1', 'lumR1', 'errR1',
'muZ1', 'lumZ1', 'errZ1',
'muY1', 'lumY1', 'errY1'),
meta={'LOCATION': loc,
'GALID': galID,
'REDSHIFT': redshift,
'PREFIX': prefix,
'SUFFIX': suffix,
'A_G': a_g,
'A_R': a_r,
'A_I': a_i,
'A_Z': a_z,
'A_Y': a_y})
if save:
sbpTable.write(sumTable, format='fits',
overwrite=True)
return sbpTable
else:
rad, muI1, lumI1, errI1 = None, None, None, None
warnings.warn('### Model is not available at %s for %s' %
(loc, str(galID)))
return None
In [14]:
## Sometime the Geometric run can have different column size
## Should find a way to fix it
#""" I default Stage-2 for Geometry """
#ref, profI1 = sbpExtract(loc, galID, redshift, 'HSC-I',
# prefix, 'default', '2',
# extinction=a_i, m2l=m2l_i,
# amag_sun=amag_sun_des_i,
# origin=True)
#x0, x0err = profI1['x0'], profI1['x0_err']
#y0, y0err = profI1['y0'], profI1['y0_err']
#ell, ellerr = profI1['ell'], profI1['ell_err']
#pa, paerr = profI1['pa'], profI1['pa_err']
In [15]:
def getExtinction(ra, dec, a_lambda=None):
"""
Estimate the Galactic extinction for HSC filters.
Parameters:
ra, dec : The input coordinates can be arrays
"""
# Check the input, if it's scalar, convert to array
if not hasattr(ra, "__len__") or not hasattr(dec, "__len__"):
ra = np.asrray([ra])
dec = np.asarray([dec])
if len(ra) != len(dec):
raise Exception("## The RA and DEC should contain same number of elements!")
# First try mwdust from Jo Bovy
try:
import mwdust
sfd = mwdust.SFD(sf10=True)
from astropy.coordinates import SkyCoord
coords = SkyCoord(ra, dec, frame='icrs', unit='deg')
galactic = coords.galactic
l, b = galactic.l, galactic.b
ebv = sfd(l, b, 0)
except ImportError:
try:
# Then try sncosmo
from sncosmo import SFD98Map
dustDir = os.environ.get('DUST_DIR')
if (not os.path.isfile(os.path.join(dustDir,
'SFD_dust_4096_ngp.fits'))) or (
not os.path.isfile(os.path.join(dustDir,
'SFD_dust_4096_sgp.fits'))):
print('# DUST_DIR : %s' % dustDir)
raise Exception("# Can not find the SFD dust map!")
else:
sfd = SFD98Map(dustDir)
ebv = sfd.get_ebv((ra, dec))
except ImportError:
raise Exception("# Both mwdust and sncosmo are not available")
if a_lambda is not None:
return (ebv * a_lambda)
else:
return ebv
In [16]:
def getLuminosity(mag, redshift, extinction=None,
amag_sun=None):
"""Get the absolute magnitude or luminosity."""
distmod = hUtil.cosmoDistMod(redshift)
absMag = (mag - distmod)
if extinction is not None:
absMag -= extinction
if amag_sun is not None:
absMag = ((amag_sun - absMag) / 2.5)
return absMag
In [17]:
def getDimming(z1, z0=0.1):
"""
Get the surface brightness dimming effect.
Parameters:
z1: Observed redshift
z0: Reference redshift
Default = 0.1
"""
return (3.0 * np.log10((1.0 + z1) / (1.0 + z0)))
In [18]:
def normProf(sma, sbp, minSma, maxSma):
"""
Naive method to normalize the profile.
Parameters:
sbp : Array for surface brightness profile
sma : Radius range
minSma : Minimum SMA
maxSma Maximum SMA
"""
offset = np.nanmedian(sbp[(sma >= minSma) &
(sma <= maxSma)])
return (sbp-offset)
In [19]:
def pixKpc(redshift, pix=0.168, show=True, npix=1.0):
"""
Get the corresponding Kpc size of a pixel.
Parameters:
"""
pixKpc = pix * npix * hUtil.cosmoScale(redshift)
if show:
print("# %d pixel(s) = %6.3f Kpc" % (npix, pixKpc))
return pixKpc
In [20]:
def logAdd(para1, para2):
""" Useful for adding magnitudes. """
return np.log10((10.0 ** np.asarray(para1)) +
(10.0 ** np.asarray(para2)))
In [21]:
def errAdd(err1, err2):
"""Add error quadral..."""
return np.sqrt((err1 ** 2.0) +
(err2 ** 2.0))
In [23]:
def toColorArr(data, bottom=None, top=None):
"""
Convert a data array to "color array" (between 0 and 1).
Parameters:
bottom, top :
"""
if top is not None:
data[data >= top] = top
if bottom is not None:
data[data <= bottom] = bottom
return ((data - np.nanmin(data)) /
(np.nanmax(data) - np.nanmin(data))) * 255.0
In [47]:
# Nearby cluster as example
expID = 127
expRed = 0.185
prefix = 'redBCG'
In [48]:
tab = sbpCollect(redBCG, expID, expRed, prefix='redBCG', save=True)
In [49]:
tab
Out[49]:
In [50]:
refEllI = sbpExtract(redBCG, expID, expRed, 'HSC-I',
'redBCG', 'default', '3',
extinction=0.1, amag_sun=amag_sun_des_i)
In [51]:
# Find certain profile
# Reference profile in I-band
expProfI = getEllipProfile(expID, redBCG, filter='HSC-I',
rerun='largeR1', prefix='redBCG',
stage='4')
# G-band force model
expProfG = getEllipProfile(expID, redBCG, filter='HSC-G',
rerun='largeR1', prefix='redBCG',
stage='4')
In [52]:
expProfG
Out[52]:
In [53]:
rKpcI, muI, lumI, muErrI = correctProf(expProfI, expRed,
extinction=0.10, zp=27.0,
amag_sun=amag_sun_des_i,
dimming=True, corCurve=True,
verbose=False, m2l=None)
rKpcG, muG, lumG, muErrG = correctProf(expProfG, expRed,
extinction=0.25, zp=27.0,
amag_sun=amag_sun_des_i,
dimming=True, corCurve=True,
verbose=False, m2l=None)
In [55]:
ax1 = plt.subplot(1,1,1)
ax1.plot(rKpcI**0.25, muI, c='r', linewidth=5)
ax1.fill_between(rKpcI**0.25,
(muI + muErrI),
(muI - muErrI),
facecolor='r',
alpha=0.2)
ax1.plot(rKpcG**0.25, muG, c='b', linewidth=5)
ax1.fill_between(rKpcG**0.25,
(muG + muErrG),
(muG - muErrG),
facecolor='b',
alpha=0.2)
ax1.set_ylim(4.2, 9.5)
Out[55]:
In [118]:
giColor, giErr = (muI - muG), errAdd(muErrG, muErrI)
plt.plot(rKpcG**0.25, giColor, c='r', linewidth=5)
plt.fill_between(rKpcG**0.25,
(giColor + giErr),
(giColor - giErr),
facecolor='r',
alpha=0.2)
plt.xlim(1.0, 3.2)
plt.ylim(0.4, 0.8)
Out[118]:
In [29]:
# The input cata
tabDir = '/Users/songhuang/work/hscs/gama_compare/redmapper/'
## Cat 1: Includes all 280 clusters
redCat1 = os.path.join(tabDir, 'hsc_redmapper_cluster_1509.fits')
## Cat 2: HSC matched ones in GAMA; with stellar mass from SED fitting.
redCat2 = os.path.join(tabDir, 'hsc_redmapper_cluster_gama_1509_mass.fits')
redData1 = Table.read(redCat1, format='fits')
redData2 = Table.read(redCat2, format='fits')
In [32]:
'RA' in redData1.colnames
Out[32]:
In [93]:
## Add HSC 5-band extinction information
extG = getExtinction(redData1['RA_BCG'], redData1['DEC_BCG'],
a_lambda=a_hsc_g)
extR = getExtinction(redData1['RA_BCG'], redData1['DEC_BCG'],
a_lambda=a_hsc_r)
extI = getExtinction(redData1['RA_BCG'], redData1['DEC_BCG'],
a_lambda=a_hsc_i)
extZ = getExtinction(redData1['RA_BCG'], redData1['DEC_BCG'],
a_lambda=a_hsc_z)
extY = getExtinction(redData1['RA_BCG'], redData1['DEC_BCG'],
a_lambda=a_hsc_y)
In [94]:
c1 = Column(name='a_g', data=extG)
c2 = Column(name='a_r', data=extR)
c3 = Column(name='a_i', data=extI)
c4 = Column(name='a_z', data=extZ)
c5 = Column(name='a_y', data=extY)
In [95]:
redData1.add_columns([c1, c2, c3, c4, c5])
In [96]:
print(redData1.colnames)
In [97]:
print(redData2.colnames)
In [113]:
colTemp = (np.asarray(redData2['Z_LAMBDA']) * 0.0 - 9999.0)
newRedCat = copy.deepcopy(redData2)
col1 = Column(name='ilum_max', data=colTemp)
col2 = Column(name='ilum_100', data=colTemp)
col3 = Column(name='ilum_50', data=colTemp)
col4 = Column(name='ilum_25', data=colTemp)
col5 = Column(name='ilum_10', data=colTemp)
col6 = Column(name='glum_hsc', data=colTemp)
col7 = Column(name='rlum_hsc', data=colTemp)
col8 = Column(name='ilum_hsc', data=colTemp)
col9 = Column(name='zlum_hsc', data=colTemp)
col10 = Column(name='ylum_hsc', data=colTemp)
newRedCat.add_columns([col1, col2, col3, col4, col5,
col6, col7, col8, col9, col10])
In [34]:
ellRed = []
with ProgressBar(len(redData2), ipython_widget=True) as bar:
print('# Will deal with %d galaxies' % len(redData2))
for (i, galaxy) in enumerate(redData2):
""" For red BCG """
loc = redBCG
""" ID, Z, RA, DEC """
galID = galaxy['ID_CLUSTER']
redshift = galaxy['Z_LAMBDA']
""" Location and Table name """
sumDir = os.path.join(loc, 'sum')
sumTab = str(galID) + '_sbp_sum.fits'
if not os.path.exists(loc):
os.mkdir(sumDir, exist_ok=True)
sumTable = os.path.join(sumDir, sumTab)
ellTab = sbpCollect(loc, galID, redshift,
prefix='redBCG', save=False,
a_g=galaxy['a_g'], a_r=galaxy['a_r'],
a_i=galaxy['a_i'], a_z=galaxy['a_z'],
a_y=galaxy['a_y'])
if ellTab is not None:
""" Radius KPc """
rKpc = ellTab['rKpc']
""" Maximum i-band luminosity """
maxLumI1 = np.nanmax(ellTab['lumI1'])
ellTab.meta['ILUM_MAX'] = maxLumI1.astype(np.float32)
ellTab.meta['ILUM_100'] = np.nanmax(ellTab['lumI1'][rKpc <= 100.0])
ellTab.meta['ILUM_50'] = np.nanmax(ellTab['lumI1'][rKpc <= 50.0])
ellTab.meta['ILUM_25'] = np.nanmax(ellTab['lumI1'][rKpc <= 25.0])
ellTab.meta['ILUM_10'] = np.nanmax(ellTab['lumI1'][rKpc <= 10.0])
""" Update the metadata """
ellTab.meta['RA'] = galaxy['RA_BCG'].astype(np.float32)
ellTab.meta['DEC'] = galaxy['DEC_BCG'].astype(np.float32)
""" STELLAR MASS FROM OTHER WORKS """
if np.isfinite(galaxy['logms_gama'].astype(np.float32)):
ellTab.meta['LOGM1'] = galaxy['logms_gama'].astype(np.float32)
else:
ellTab.meta['LOGM1'] = -9999.0
if np.isfinite(galaxy['logms_err_gama'].astype(np.float32)):
ellTab.meta['LOGM1E'] = galaxy['logms_err_gama'].astype(np.float32)
else:
ellTab.meta['LOGM1E'] = -9999.0
""" STELLAR MASS FROM ISEDFIT """
ellTab.meta['LOGM2'] = galaxy['MSTAR'].astype(np.float32)
ellTab.meta['LOGM2E'] = galaxy['MSTAR_ERR'].astype(np.float32)
""" HSC CMODEL MAG (EXTINCTION CORRECTED) """
gmag_hsc = (galaxy['gmag_cmodel'] - galaxy['a_g']).astype(np.float32)
rmag_hsc = (galaxy['rmag_cmodel'] - galaxy['a_r']).astype(np.float32)
imag_hsc = (galaxy['imag_cmodel'] - galaxy['a_i']).astype(np.float32)
zmag_hsc = (galaxy['zmag_cmodel'] - galaxy['a_z']).astype(np.float32)
ymag_hsc = (galaxy['ymag_cmodel'] - galaxy['a_y']).astype(np.float32)
ellTab.meta['GCMOD_HSC'] = gmag_hsc
ellTab.meta['RCMOD_HSC'] = rmag_hsc
ellTab.meta['ICMOD_HSC'] = imag_hsc
ellTab.meta['ZCMOD_HSC'] = zmag_hsc
ellTab.meta['YCMOD_HSC'] = ymag_hsc
glum_hsc = getLuminosity(gmag_hsc, redshift, amag_sun=amag_sun_des_g)
rlum_hsc = getLuminosity(rmag_hsc, redshift, amag_sun=amag_sun_des_r)
ilum_hsc = getLuminosity(imag_hsc, redshift, amag_sun=amag_sun_des_i)
zlum_hsc = getLuminosity(zmag_hsc, redshift, amag_sun=amag_sun_des_z)
ylum_hsc = getLuminosity(ymag_hsc, redshift, amag_sun=amag_sun_des_y)
""" HSC CMODEL LUMINOSITY """
ellTab.meta['GLUM_HSC'] = glum_hsc
ellTab.meta['RLUM_HSC'] = rlum_hsc
ellTab.meta['ILUM_HSC'] = ilum_hsc
ellTab.meta['ZLUM_HSC'] = zlum_hsc
ellTab.meta['YLUM_HSC'] = ylum_hsc
ellTab.write(sumTable, format='fits', overwrite=True)
## Pass it to table
newRedCat['ilum_max'][i] = ellTab.meta['ILUM_MAX']
newRedCat['ilum_100'][i] = ellTab.meta['ILUM_100']
newRedCat['ilum_50'][i] = ellTab.meta['ILUM_50']
newRedCat['ilum_25'][i] = ellTab.meta['ILUM_25']
newRedCat['ilum_10'][i] = ellTab.meta['ILUM_10']
newRedCat['glum_hsc'][i] = glum_hsc
newRedCat['rlum_hsc'][i] = rlum_hsc
newRedCat['ilum_hsc'][i] = ilum_hsc
newRedCat['zlum_hsc'][i] = zlum_hsc
newRedCat['ylum_hsc'][i] = ylum_hsc
""""""
ellRed.append(ellTab)
else:
warnings.warn('### NO USEFUL DATA FOR %i' % galID)
bar.update()
# Save a new table
newRedCat.write(os.path.join(redBCG, 'redBCG_new.fits'), format='fits',
overwrite=True)
In [115]:
gamaCat = os.path.join(nonBCG, 'massive_nonBCG_test.fits')
gamaData = Table.read(gamaCat, format='fits')
In [117]:
print(gamaData.colnames)
In [118]:
colTemp = (np.asarray(gamaData['MSTAR']) * 0.0 - 9999.0)
newGamaCat = copy.deepcopy(gamaData)
col1 = Column(name='ilum_max', data=colTemp)
col2 = Column(name='ilum_100', data=colTemp)
col3 = Column(name='ilum_50', data=colTemp)
col4 = Column(name='ilum_25', data=colTemp)
col5 = Column(name='ilum_10', data=colTemp)
col6 = Column(name='glum_hsc', data=colTemp)
col7 = Column(name='rlum_hsc', data=colTemp)
col8 = Column(name='ilum_hsc', data=colTemp)
col9 = Column(name='zlum_hsc', data=colTemp)
col10 = Column(name='ylum_hsc', data=colTemp)
newGamaCat.add_columns([col1, col2, col3, col4, col5,
col6, col7, col8, col9, col10])
In [119]:
ellGama = []
with ProgressBar(len(gamaData), ipython_widget=True) as bar:
for (i, galaxy) in enumerate(gamaData):
""" For non BCG """
loc = nonBCG
""" ID, Z, RA, DEC """
galID = galaxy['ISEDFIT_ID']
redshift = galaxy['Z']
""" Location and Table name """
sumDir = os.path.join(loc, 'sum')
sumTab = str(galID) + '_sbp_sum.fits'
if not os.path.exists(loc):
os.mkdir(sumDir, exist_ok=True)
sumTable = os.path.join(sumDir, sumTab)
ellTab = sbpCollect(loc, galID, redshift,
prefix='nonBCG', save=False,
a_g=galaxy['a_g'], a_r=galaxy['a_r'],
a_i=galaxy['a_i'], a_z=galaxy['a_z'],
a_y=galaxy['a_y'])
if ellTab is not None:
""" Radius KPc """
rKpc = ellTab['rKpc']
""" Maximum i-band luminosity """
maxLumI1 = np.nanmax(ellTab['lumI1'])
ellTab.meta['ILUM_MAX'] = maxLumI1.astype(np.float32)
ellTab.meta['ILUM_100'] = np.nanmax(ellTab['lumI1'][rKpc <= 100.0])
ellTab.meta['ILUM_50'] = np.nanmax(ellTab['lumI1'][rKpc <= 50.0])
ellTab.meta['ILUM_25'] = np.nanmax(ellTab['lumI1'][rKpc <= 25.0])
ellTab.meta['ILUM_10'] = np.nanmax(ellTab['lumI1'][rKpc <= 10.0])
""" Update the metadata """
ellTab.meta['RA'] = galaxy['RA'].astype(np.float32)
ellTab.meta['DEC'] = galaxy['DEC'].astype(np.float32)
""" STELLAR MASS FROM OTHER WORKS """
if np.isfinite(galaxy['logms_gama'].astype(np.float32)):
ellTab.meta['LOGM1'] = galaxy['logms_gama'].astype(np.float32)
else:
ellTab.meta['LOGM1'] = -9999.0
if np.isfinite(galaxy['logms_err_gama'].astype(np.float32)):
ellTab.meta['LOGM1E'] = galaxy['logms_err_gama'].astype(np.float32)
else:
ellTab.meta['LOGM1E'] = -9999.0
""" STELLAR MASS FROM ISEDFIT """
ellTab.meta['LOGM2'] = galaxy['MSTAR'].astype(np.float32)
ellTab.meta['LOGM2E'] = galaxy['MSTAR_ERR'].astype(np.float32)
""" HSC CMODEL MAG (EXTINCTION CORRECTED) """
gmag_hsc = (galaxy['gmag_cmodel'] - galaxy['a_g']).astype(np.float32)
rmag_hsc = (galaxy['rmag_cmodel'] - galaxy['a_r']).astype(np.float32)
imag_hsc = (galaxy['imag_cmodel'] - galaxy['a_i']).astype(np.float32)
zmag_hsc = (galaxy['zmag_cmodel'] - galaxy['a_z']).astype(np.float32)
ymag_hsc = (galaxy['ymag_cmodel'] - galaxy['a_y']).astype(np.float32)
ellTab.meta['GCMOD_HSC'] = gmag_hsc
ellTab.meta['RCMOD_HSC'] = rmag_hsc
ellTab.meta['ICMOD_HSC'] = imag_hsc
ellTab.meta['ZCMOD_HSC'] = zmag_hsc
ellTab.meta['YCMOD_HSC'] = ymag_hsc
glum_hsc = getLuminosity(gmag_hsc, redshift, amag_sun=amag_sun_des_g)
rlum_hsc = getLuminosity(rmag_hsc, redshift, amag_sun=amag_sun_des_r)
ilum_hsc = getLuminosity(imag_hsc, redshift, amag_sun=amag_sun_des_i)
zlum_hsc = getLuminosity(zmag_hsc, redshift, amag_sun=amag_sun_des_z)
ylum_hsc = getLuminosity(ymag_hsc, redshift, amag_sun=amag_sun_des_y)
""" HSC CMODEL LUMINOSITY """
ellTab.meta['GLUM_HSC'] = glum_hsc
ellTab.meta['RLUM_HSC'] = rlum_hsc
ellTab.meta['ILUM_HSC'] = ilum_hsc
ellTab.meta['ZLUM_HSC'] = zlum_hsc
ellTab.meta['YLUM_HSC'] = ylum_hsc
ellTab.write(sumTable, format='fits', overwrite=True)
## Pass it to table
newGamaCat['ilum_max'][i] = ellTab.meta['ILUM_MAX']
newGamaCat['ilum_100'][i] = ellTab.meta['ILUM_100']
newGamaCat['ilum_50'][i] = ellTab.meta['ILUM_50']
newGamaCat['ilum_25'][i] = ellTab.meta['ILUM_25']
newGamaCat['ilum_10'][i] = ellTab.meta['ILUM_10']
newGamaCat['glum_hsc'][i] = glum_hsc
newGamaCat['rlum_hsc'][i] = rlum_hsc
newGamaCat['ilum_hsc'][i] = ilum_hsc
newGamaCat['zlum_hsc'][i] = zlum_hsc
newGamaCat['ylum_hsc'][i] = ylum_hsc
""""""
ellGama.append(ellTab)
else:
warnings.warn('### NO USEFUL DATA FOR %i' % galID)
bar.update()
# Save a new table
newGamaCat.write(os.path.join(nonBCG, 'nonBCG_new.fits'), format='fits',
overwrite=True)
In [120]:
redLogM2L = (newRedCat['MSTAR'] - newRedCat['ilum_hsc'])
gamaLogM2L = (newGamaCat['MSTAR'] - newGamaCat['ilum_hsc'])
In [121]:
fig = plt.figure(figsize=(10, 10))
fig.subplots_adjust(left=0.1, right=0.95, bottom=0.15)
ax1 = fig.add_subplot(111)
logmRange = np.arange(10.0, 12.5, 0.2)
ax1.plot(logmRange, logmRange, 'k', linestyle='--', linewidth=3.0, alpha=0.8)
ax1.axhline(0.0, linewidth=5.0, alpha=0.6,
linestyle='dashed', c='k')
# GAMA
ax1.scatter(newGamaCat['MSTAR'],
(newGamaCat['ilum_max'] + gamaLogM2L) - newGamaCat['MSTAR'],
marker='o', color='b', s=75, label='nonBCG',
alpha=0.4)
# Red
ax1.scatter(newRedCat['MSTAR'],
(newRedCat['ilum_max'] + redLogM2L) - newRedCat['MSTAR'],
marker='o', color='r', s=75, label='redBCG',
alpha=0.6)
ax1.set_xlim(10.7, 12.3)
ax1.set_ylim(-0.2, 1.0)
ax1.set_xlabel('ISEDFIT Stellar Mass', size=25.0)
ax1.set_ylabel('Mass Difference', size=25.0)
for tick in ax1.xaxis.get_major_ticks():
tick.label.set_fontsize(20)
for tick in ax1.yaxis.get_major_ticks():
tick.label.set_fontsize(20)
ax1.spines['top'].set_linewidth(3.5)
ax1.spines['right'].set_linewidth(3.5)
ax1.spines['bottom'].set_linewidth(3.5)
ax1.spines['left'].set_linewidth(3.5)
ax1.legend(prop={'size':36})
#ax1.text(-23.45, -23.0, '$0.3<z<0.4$', size=32.0)
#ax1.text(-23.25, -22.8, 'log $(M_{s}/M_{\odot})>11.6$', size=32.0)
#ax1.text(-23.35, -22.55, 'within 50 Kpc', color='g', size=32.0)
#ax1.text(-23.30, -22.35, 'within 100 Kpc', color='r', size=32.0)
Out[121]:
In [228]:
fig = plt.figure(figsize=(12, 12))
fig.subplots_adjust(left=0.1, right=0.95, bottom=0.15)
ax1 = fig.add_subplot(111)
ax1.axvline(3.20, linewidth=5.0, c='k', linestyle='dashed')
for gamaProf in ellGama:
m2l = (gamaProf.meta['LOGM2'] - gamaProf.meta['ILUM_HSC'])
ax1.plot((gamaProf['rKpc']**0.25), gamaProf['muI1'] + m2l, c='b',
alpha=0.25, linewidth=1.5)
for redProf in ellRed:
m2l = (redProf.meta['LOGM2'] - redProf.meta['ILUM_HSC'])
ax1.plot((redProf['rKpc']**0.25), redProf['muI1'] + m2l, c='r',
alpha=0.2, linewidth=2.0)
#ax1.fill_between(rsma_common_z1, asbp_avg_z1+std_stack_z1, asbp_avg_z1-std_stack_z1,
# facecolor='b', alpha=0.2)
#ax1.text(2.4, 8.6, '$0.15<z<0.30$', size=42)
ax1.set_xlabel('$R^{1/4}$ (Kpc)', size=32)
ax1.set_ylabel('log $({\mu}_{\star}/[M_{\odot} Kpc^{-2}])$', size=32)
ax1.set_xlim(0.5, 4.1)
ax1.set_ylim(4.4, 10.4)
for tick in ax1.xaxis.get_major_ticks():
tick.label.set_fontsize(30)
for tick in ax1.yaxis.get_major_ticks():
tick.label.set_fontsize(30)
ax1.spines['top'].set_linewidth(3.5)
ax1.spines['right'].set_linewidth(3.5)
ax1.spines['bottom'].set_linewidth(3.5)
ax1.spines['left'].set_linewidth(3.5)
In [227]:
fig = plt.figure(figsize=(12, 12))
fig.subplots_adjust(left=0.1, right=0.95, bottom=0.15)
ax1 = fig.add_subplot(111)
ax1.axvline(3.20, linewidth=5.0, c='k', linestyle='dashed')
for gamaProf in ellGama:
m2l = (gamaProf.meta['LOGM2'] - gamaProf.meta['ILUM_HSC'])
mnew = (gamaProf.meta['ILUM_MAX'] + m2l)
if (mnew <= 11.6) and (mnew >= 11.40):
ax1.plot((gamaProf['rKpc']**0.25), (gamaProf['muI1'] + m2l), c='b',
alpha=0.1, linewidth=1.5)
for redProf in ellRed:
m2l = (redProf.meta['LOGM2'] - redProf.meta['ILUM_HSC'])
mnew = (redProf.meta['ILUM_MAX'] + m2l)
redshift = redProf.meta['redshift']
if (mnew <= 11.60) and (mnew >= 11.40):
ax1.plot((redProf['rKpc']**0.25), redProf['muI1'] + m2l, c='r',
alpha=0.6, linewidth=2.5)
#ax1.fill_between(rsma_common_z1, asbp_avg_z1+std_stack_z1, asbp_avg_z1-std_stack_z1,
# facecolor='b', alpha=0.2)
#ax1.text(2.4, 8.6, '$0.15<z<0.30$', size=42)
ax1.set_xlabel('$R^{1/4}$ (Kpc)', size=32)
ax1.set_ylabel('log $({\mu}_{\star}/[M_{\odot} Kpc^{-2}])$', size=32)
ax1.set_xlim(0.5, 4.1)
ax1.set_ylim(4.4, 10.4)
for tick in ax1.xaxis.get_major_ticks():
tick.label.set_fontsize(30)
for tick in ax1.yaxis.get_major_ticks():
tick.label.set_fontsize(30)
ax1.spines['top'].set_linewidth(3.5)
ax1.spines['right'].set_linewidth(3.5)
ax1.spines['bottom'].set_linewidth(3.5)
ax1.spines['left'].set_linewidth(3.5)
In [239]:
fig = plt.figure(figsize=(12, 12))
fig.subplots_adjust(left=0.1, right=0.95, bottom=0.15)
ax1 = fig.add_subplot(111)
ax1.axvline(3.20, linewidth=5.0, c='k', linestyle='dashed')
for gamaProf in ellGama:
m2l = (gamaProf.meta['LOGM2'] - gamaProf.meta['ILUM_HSC'])
mnew = (gamaProf.meta['ILUM_25'] + m2l)
if (mnew <= 11.5) and (mnew >= 11.30):
ax1.plot((gamaProf['rKpc']**0.25), (gamaProf['muI1'] + m2l), c='b',
alpha=0.5, linewidth=2.0)
for redProf in ellRed:
m2l = (redProf.meta['LOGM2'] - redProf.meta['ILUM_HSC'])
mnew = (redProf.meta['ILUM_25'] + m2l)
redshift = redProf.meta['redshift']
if (mnew <= 11.5) and (mnew >= 11.30):
ax1.plot((redProf['rKpc']**0.25), redProf['muI1'] + m2l, c='r',
alpha=0.6, linewidth=2.5)
#ax1.fill_between(rsma_common_z1, asbp_avg_z1+std_stack_z1, asbp_avg_z1-std_stack_z1,
# facecolor='b', alpha=0.2)
#ax1.text(2.4, 8.6, '$0.15<z<0.30$', size=42)
ax1.set_xlabel('$R^{1/4}$ (Kpc)', size=32)
ax1.set_ylabel('log $({\mu}_{\star}/[M_{\odot} Kpc^{-2}])$', size=32)
ax1.set_xlim(0.5, 4.1)
ax1.set_ylim(4.4, 10.4)
for tick in ax1.xaxis.get_major_ticks():
tick.label.set_fontsize(30)
for tick in ax1.yaxis.get_major_ticks():
tick.label.set_fontsize(30)
ax1.spines['top'].set_linewidth(3.5)
ax1.spines['right'].set_linewidth(3.5)
ax1.spines['bottom'].set_linewidth(3.5)
ax1.spines['left'].set_linewidth(3.5)
In [234]:
fig = plt.figure(figsize=(16, 10))
fig.subplots_adjust(left=0.1, right=0.95, bottom=0.15)
ax1 = fig.add_subplot(111)
ax1.axvline(3.20, linewidth=5.0, c='k', linestyle='dashed')
for gamaProf in ellGama:
ax1.plot((gamaProf['rKpc']**0.25), gamaProf['muI2'] - gamaProf['muI1'] , c='b',
alpha=0.1, linewidth=1.5)
for redProf in ellRed:
ax1.plot((redProf['rKpc']**0.25), redProf['muI2'] - redProf['muI1'], c='r',
alpha=0.3, linewidth=2.5)
#ax1.fill_between(rsma_common_z1, asbp_avg_z1+std_stack_z1, asbp_avg_z1-std_stack_z1,
# facecolor='b', alpha=0.2)
#ax1.text(2.4, 8.6, '$0.15<z<0.30$', size=42)
ax1.set_xlabel('$R^{1/4}$ (Kpc)', size=32)
ax1.set_ylabel('Change of Surface Brightness Profile', size=32)
ax1.set_xlim(0.0, 4.2)
ax1.set_ylim(-0.2, 2.0)
for tick in ax1.xaxis.get_major_ticks():
tick.label.set_fontsize(30)
for tick in ax1.yaxis.get_major_ticks():
tick.label.set_fontsize(30)
ax1.spines['top'].set_linewidth(3.5)
ax1.spines['right'].set_linewidth(3.5)
ax1.spines['bottom'].set_linewidth(3.5)
ax1.spines['left'].set_linewidth(3.5)
In [242]:
fig = plt.figure(figsize=(16, 9))
fig.subplots_adjust(left=0.1, right=0.95, bottom=0.15)
ax1 = fig.add_subplot(111)
ax1.axvline(3.20, linewidth=5.0, c='k', linestyle='dashed')
for gamaProf in ellGama:
m2l = (gamaProf.meta['LOGM2'] - gamaProf.meta['ILUM_HSC'])
mnew = (gamaProf.meta['ILUM_MAX'] + m2l)
if (mnew <= 11.6) and (mnew >= 11.40):
ax1.plot((gamaProf['rKpc']**0.25), (gamaProf['muZ1'] - gamaProf['muG1']), c='b',
alpha=0.3, linewidth=2.0)
for redProf in ellRed:
m2l = (redProf.meta['LOGM2'] - redProf.meta['ILUM_HSC'])
mnew = (redProf.meta['ILUM_MAX'] + m2l)
redshift = redProf.meta['redshift']
if (mnew <= 11.6) and (mnew >= 11.40) and (redshift < 0.35):
ax1.plot((redProf['rKpc']**0.25), (redProf['muZ1'] - redProf['muG1']), c='r',
alpha=0.5, linewidth=4)
#ax1.fill_between(rsma_common_z1, asbp_avg_z1+std_stack_z1, asbp_avg_z1-std_stack_z1,
# facecolor='b', alpha=0.2)
#ax1.text(2.4, 8.6, '$0.15<z<0.30$', size=42)
ax1.set_xlabel('$R^{1/4}$ (Kpc)', size=32)
ax1.set_ylabel('HSC-G - HSC-I (mag)', size=32)
ax1.set_xlim(1.0, 3.5)
ax1.set_ylim(0.01, 1.4)
for tick in ax1.xaxis.get_major_ticks():
tick.label.set_fontsize(30)
for tick in ax1.yaxis.get_major_ticks():
tick.label.set_fontsize(30)
ax1.spines['top'].set_linewidth(3.5)
ax1.spines['right'].set_linewidth(3.5)
ax1.spines['bottom'].set_linewidth(3.5)
ax1.spines['left'].set_linewidth(3.5)
In [240]:
fig = plt.figure(figsize=(12, 12))
fig.subplots_adjust(left=0.1, right=0.95, bottom=0.15)
ax1 = fig.add_subplot(111)
ax1.axvline(3.20, linewidth=5.0, c='k', linestyle='dashed')
for gamaProf in ellGama:
ax1.plot((gamaProf['rKpc']**0.25), gamaProf['muI1'], c='b',
alpha=0.25, linewidth=1.5)
for redProf in ellRed:
ax1.plot((redProf['rKpc']**0.25), redProf['muI1'], c='r',
alpha=0.2, linewidth=2.0)
#ax1.fill_between(rsma_common_z1, asbp_avg_z1+std_stack_z1, asbp_avg_z1-std_stack_z1,
# facecolor='b', alpha=0.2)
#ax1.text(2.4, 8.6, '$0.15<z<0.30$', size=42)
ax1.set_xlabel('$R^{1/4}$ (Kpc)', size=32)
ax1.set_ylabel('log $({\mu}/[M_{\odot} Kpc^{-2}])$', size=32)
ax1.set_xlim(0.5, 4.1)
ax1.set_ylim(4.4, 10.4)
for tick in ax1.xaxis.get_major_ticks():
tick.label.set_fontsize(30)
for tick in ax1.yaxis.get_major_ticks():
tick.label.set_fontsize(30)
ax1.spines['top'].set_linewidth(3.5)
ax1.spines['right'].set_linewidth(3.5)
ax1.spines['bottom'].set_linewidth(3.5)
ax1.spines['left'].set_linewidth(3.5)
In [255]:
fig = plt.figure(figsize=(12, 9))
fig.subplots_adjust(left=0.1, right=0.95, bottom=0.15)
ax1 = fig.add_subplot(111)
ax1.axvline(3.20, linewidth=5.0, c='k', linestyle='dashed')
for gamaProf in ellGama:
m2l = (gamaProf.meta['LOGM2'] - gamaProf.meta['ILUM_HSC'])
mnew = (gamaProf.meta['ILUM_10'] + m2l)
if (mnew <= 11.20) and (mnew >= 11.00):
ax1.plot((gamaProf['rKpc']**0.25), gamaProf['lumI1'] + m2l, c='b',
alpha=0.6, linewidth=1.5)
for redProf in ellRed:
m2l = (redProf.meta['LOGM2'] - redProf.meta['ILUM_HSC'])
mnew = (redProf.meta['ILUM_10'] + m2l)
redshift = redProf.meta['redshift']
if (mnew <= 11.20) and (mnew >= 11.00) and (redshift <= 0.40):
ax1.plot((redProf['rKpc']**0.25), redProf['lumI1'] + m2l, c='r',
alpha=0.4, linewidth=2.5)
#ax1.fill_between(rsma_common_z1, asbp_avg_z1+std_stack_z1, asbp_avg_z1-std_stack_z1,
# facecolor='b', alpha=0.2)
#ax1.text(2.4, 8.6, '$0.15<z<0.30$', size=42)
ax1.set_xlabel('$R^{1/4}$ (Kpc)', size=32)
ax1.set_ylabel('log $(L_{*}/L_{\odot})$', size=32)
ax1.set_xlim(0.5, 4.1)
ax1.set_ylim(8.5, 12.4)
for tick in ax1.xaxis.get_major_ticks():
tick.label.set_fontsize(30)
for tick in ax1.yaxis.get_major_ticks():
tick.label.set_fontsize(30)
ax1.spines['top'].set_linewidth(3.5)
ax1.spines['right'].set_linewidth(3.5)
ax1.spines['bottom'].set_linewidth(3.5)
ax1.spines['left'].set_linewidth(3.5)
In [130]:
fig = plt.figure(figsize=(12, 12))
fig.subplots_adjust(left=0.1, right=0.95, bottom=0.15)
ax1 = fig.add_subplot(111)
ax1.plot(np.linspace(9.5, 13.0, 100), np.linspace(9.5, 13.0, 100),
linewidth=2.5, linestyle='dashed', color='k', alpha=0.8)
ax1.plot(np.linspace(9.5, 13.0, 100), (0.301 + np.linspace(9.5, 13.0, 100)),
linewidth=4.0, linestyle='dashed', color='g')
for gamaProf in ellGama:
m2l = (gamaProf.meta['LOGM2'] - gamaProf.meta['ILUM_HSC'])
ax1.scatter((gamaProf.meta['ILUM_10'] + m2l),
(gamaProf.meta['LOGM2']), c='b',
alpha=0.45, s=100, marker='o')
for redProf in ellRed:
m2l = (redProf.meta['LOGM2'] - redProf.meta['ILUM_HSC'])
ax1.scatter((redProf.meta['ILUM_10'] + m2l),
(redProf.meta['LOGM2']), c='r',
alpha=0.5, s=120, marker='o')
ax1.set_xlabel('$R^{1/4}$ (Kpc)', size=32)
ax1.set_ylabel('log $({\mu}_{\star}/[M_{\odot} Kpc^{-2}])$', size=32)
ax1.set_xlim(10.4, 11.8)
ax1.set_ylim(10.8, 12.2)
for tick in ax1.xaxis.get_major_ticks():
tick.label.set_fontsize(30)
for tick in ax1.yaxis.get_major_ticks():
tick.label.set_fontsize(30)
ax1.spines['top'].set_linewidth(3.5)
ax1.spines['right'].set_linewidth(3.5)
ax1.spines['bottom'].set_linewidth(3.5)
ax1.spines['left'].set_linewidth(3.5)
In [24]:
newDir = '/Users/songhuang/Downloads/sbp'
# Folder for two datasets
bcgDir = os.path.join(newDir, 'redmapper')
gamaDir = os.path.join(newDir, 'gama')
# Two summary catalogs
bcgCat = os.path.join(bcgDir, 'hsc_redmapper_cluster_gama_1509_mass_sbpsum_use.fits')
gamaCat = os.path.join(gamaDir, 'gama_z0.1_0.25_m11.2_nonbcg_sbpsum_use.fits')
if not os.path.isfile(bcgCat):
raise Exception("## Can not find catalog for BCGs : %s" % bcgCat)
else:
bcgTab = Table.read(bcgCat, format='fits')
if not os.path.isfile(gamaCat):
raise Exception("## Can not find catalog for GAMA galaxies : %s" % gamaCat)
else:
gamaTab = Table.read(gamaCat, format='fits')
In [25]:
print("## Deal with %i galaxies in BCG sample" % len(bcgTab))
print("## Deal with %i galaxies in GAMA sample" % len(gamaTab))
In [26]:
gama1 = gamaTab[(gamaTab['Z'] >= 0.22) &
((gamaTab['ilum_100'] + gamaTab['logm2l_i']) >= 11.4) &
((gamaTab['ilum_100'] + gamaTab['logm2l_i']) <= 11.6)]
bcg1 = bcgTab[(bcgTab['Z'] >= 0.1) &
(bcgTab['Z'] <= 0.45) &
((bcgTab['ilum_100'] + bcgTab['logm2l_i']) >= 11.4) &
((bcgTab['ilum_100'] + bcgTab['logm2l_i']) <= 11.6) &
(bcgTab['P_CEN_1'] >= 0.8)]
print("## 0.2 < z < 0.4 ; 11.4 < logM* < 11.6 using SBP Mass \n")
print("## GAMA1 : %i galaxies" % len(gama1))
print("## Median redshift : ", np.nanmedian(gama1['Z']))
print("## Median logm_sbp : ", np.nanmedian(gama1['ilum_100'] + gama1['logm2l_i']))
print("## Median logm_gama : ", np.nanmedian(gama1['logms_gama']))
print("## BCG1 : %i galaxies" % len(bcg1))
print("## Median redshift : ", np.nanmedian(bcg1['Z']))
print("## Median logm_sbp : ", np.nanmedian(bcg1['ilum_100'] + bcg1['logm2l_i']))
print("## Median logm_gama : ", np.nanmedian(bcg1['logms_gama']))
In [31]:
confidence_interval(bcg1['Z'], alpha=np.asarray([0.3173, 1.0]),
metric=np.median, numResamples=1000, interpolate=True)
Out[31]:
In [32]:
gama2 = gamaTab[(gamaTab['Z'] >= 0.20) &
((gamaTab['ilum_100'] + gamaTab['logm2l_i']) >= 11.65) &
((gamaTab['ilum_100'] + gamaTab['logm2l_i']) <= 11.8)]
bcg2 = bcgTab[(bcgTab['Z'] >= 0.2) &
(bcgTab['Z'] <= 0.4) &
((bcgTab['ilum_100'] + bcgTab['logm2l_i']) >= 11.6) &
((bcgTab['ilum_100'] + bcgTab['logm2l_i']) <= 11.8) &
(bcgTab['P_CEN_1'] >= 0.8)]
print("## 0.2 < z < 0.4 ; 11.6 < logM* < 11.8 using SBP Mass \n")
print("## GAMA2 : %i galaxies" % len(gama2))
print("## Median redshift : ", np.nanmedian(gama2['Z']))
print("## Median logm_sbp : ", np.nanmedian(gama2['ilum_100'] + gama2['logm2l_i']))
print("## Median logm_gama : ", np.nanmedian(gama2['logms_gama']))
print("## BCG2 : %i galaxies" % len(bcg2))
print("## Median redshift : ", np.nanmedian(bcg2['Z']))
print("## Median logm_sbp : ", np.nanmedian(bcg2['ilum_100'] + bcg2['logm2l_i']))
print("## Median logm_gama : ", np.nanmedian(bcg2['logms_gama']))
In [33]:
gama3 = gamaTab[(gamaTab['Z'] >= 0.20) &
((gamaTab['ilum_100'] + gamaTab['logm2l_i']) >= 11.8) &
((gamaTab['ilum_100'] + gamaTab['logm2l_i']) <= 12.0)]
bcg3 = bcgTab[(bcgTab['Z_LAMBDA'] >= 0.2) &
(bcgTab['Z_LAMBDA'] <= 0.45) &
((bcgTab['ilum_100'] + bcgTab['logm2l_i']) >= 11.8) &
((bcgTab['ilum_100'] + bcgTab['logm2l_i']) <= 12.0) &
(bcgTab['P_CEN_1'] >= 0.8)]
print("## 0.2 < z < 0.4 ; 11.8 < logM* < 12.0 using SBP Mass \n")
print("## GAMA3 : %i galaxies" % len(gama3))
print("## Median redshift : ", np.nanmedian(gama3['Z']))
print("## Median logm_sbp : ", np.nanmedian(gama3['ilum_100'] + gama3['logm2l_i']))
print("## Median logm_gama : ", np.nanmedian(gama3['logms_gama']))
print("## BCG3 : %i galaxies" % len(bcg3))
print("## Median redshift : ", np.nanmedian(bcg3['Z']))
print("## Median logm_sbp : ", np.nanmedian(bcg3['ilum_100'] + bcg3['logm2l_i']))
print("## Median logm_gama : ", np.nanmedian(bcg3['logms_gama']))
In [34]:
# Redshift - iSEDFit Mass
fig = plt.figure(figsize=(12, 12))
fig.subplots_adjust(left=0.1, right=0.95, bottom=0.15)
ax1 = fig.add_subplot(111)
ax1.axhline(11.4, linewidth=5.0, alpha=0.3,
linestyle='dashed', c='k')
ax1.axhline(11.6, linewidth=5.0, alpha=0.3,
linestyle='dashed', c='k')
ax1.axhline(11.8, linewidth=5.0, alpha=0.3,
linestyle='dashed', c='k')
ax1.axhline(12.0, linewidth=5.0, alpha=0.3,
linestyle='dashed', c='k')
ax1.scatter(gamaTab['Z'], gamaTab['MSTAR'], c='b', alpha=0.15,
s=100, marker='o', label='non-BCGs')
legnd = ax1.scatter(bcgTab['Z_LAMBDA'], bcgTab['MSTAR'], c='r', alpha=0.9,
s=((bcgTab['P_CEN_1'] - 0.5) * 250), marker='s',
label='BCGs')
ax1.set_xlabel('Redshift', size=32)
ax1.set_ylabel('$\log (M_{\star}/M_{\odot})_{\mathrm{ISEDFit}}$', size=36)
ax1.set_xlim(0.09, 0.51)
ax1.set_ylim(11.01, 12.35)
ax1.legend(loc=(0.10, 0.85), shadow=True, fancybox=True,
numpoints=1, fontsize=24, scatterpoints=1,
markerscale=1.2, borderpad=0.25, handletextpad=0.1)
ax1.text(0.12, 0.78, 'Size: P_CEN_1',
verticalalignment='bottom', horizontalalignment='left',
fontsize=20.0, transform=ax1.transAxes)
for tick in ax1.xaxis.get_major_ticks():
tick.label.set_fontsize(30)
for tick in ax1.yaxis.get_major_ticks():
tick.label.set_fontsize(30)
ax1.spines['top'].set_linewidth(3.5)
ax1.spines['right'].set_linewidth(3.5)
ax1.spines['bottom'].set_linewidth(3.5)
ax1.spines['left'].set_linewidth(3.5)
In [35]:
# Redshift - iSEDFit Mass
fig = plt.figure(figsize=(12, 12))
fig.subplots_adjust(left=0.1, right=0.95, bottom=0.15)
ax1 = fig.add_subplot(111)
ax1.axhline(11.4, linewidth=5.0, alpha=0.3,
linestyle='dashed', c='k')
ax1.axhline(11.6, linewidth=5.0, alpha=0.3,
linestyle='dashed', c='k')
ax1.axhline(11.8, linewidth=5.0, alpha=0.3,
linestyle='dashed', c='k')
ax1.axhline(12.0, linewidth=5.0, alpha=0.3,
linestyle='dashed', c='k')
ax1.scatter(gamaTab['Z'], gamaTab['logms_gama'], c='b', alpha=0.15,
s=100, marker='o', label='non-BCGs')
legnd = ax1.scatter(bcgTab['Z_LAMBDA'], bcgTab['logms_gama'], c='r', alpha=0.9,
s=((bcgTab['LAMBDA_CLUSTER'] - 20) * 5), marker='s',
label='BCGs')
ax1.set_xlabel('Redshift', size=32)
ax1.set_ylabel('$\log (M_{\star}/M_{\odot})_{\mathrm{GAMA}}$', size=36)
ax1.set_xlim(0.09, 0.51)
ax1.set_ylim(11.01, 12.35)
ax1.legend(loc=(0.10, 0.85), shadow=True, fancybox=True,
numpoints=1, fontsize=24, scatterpoints=1,
markerscale=1.2, borderpad=0.25, handletextpad=0.1)
ax1.text(0.12, 0.78, 'Size: ${\Lambda}_{\mathrm{redMapper}}$',
verticalalignment='bottom', horizontalalignment='left',
fontsize=20.0, transform=ax1.transAxes)
for tick in ax1.xaxis.get_major_ticks():
tick.label.set_fontsize(30)
for tick in ax1.yaxis.get_major_ticks():
tick.label.set_fontsize(30)
ax1.spines['top'].set_linewidth(3.5)
ax1.spines['right'].set_linewidth(3.5)
ax1.spines['bottom'].set_linewidth(3.5)
ax1.spines['left'].set_linewidth(3.5)
In [36]:
fig = plt.figure(figsize=(12, 12))
fig.subplots_adjust(left=0.1, right=0.95, bottom=0.15)
ax1 = fig.add_subplot(111)
logmRange = np.arange(10.0, 12.5, 0.2)
ax1.plot(logmRange, logmRange, 'k', linestyle='--', linewidth=3.0, alpha=0.8)
ax1.scatter((gamaTab['ilum_max'] + gamaTab['logm2l_i']),
(gamaTab['ilum_100'] + gamaTab['logm2l_i']),
c='b', alpha=0.15, s=100, marker='o', label='non-BCGs')
ax1.scatter((bcgTab['ilum_max'] + bcgTab['logm2l_i']),
(bcgTab['ilum_100'] + bcgTab['logm2l_i']),
c='r', alpha=0.9, s=((bcgTab['LAMBDA_CLUSTER'] - 20) * 5),
marker='s', label='BCGs')
ax1.set_xlabel('$\log (M_{\star}/M_{\odot})_{\mathrm{Max}}$', size=36)
ax1.set_ylabel('$\log (M_{\star}/M_{\odot})_{<100 \mathrm{kpc}}$', size=36)
ax1.set_xlim(11.01, 12.35)
ax1.set_ylim(11.01, 12.35)
ax1.legend()
for tick in ax1.xaxis.get_major_ticks():
tick.label.set_fontsize(30)
for tick in ax1.yaxis.get_major_ticks():
tick.label.set_fontsize(30)
ax1.legend(loc=(0.10, 0.85), shadow=True, fancybox=True,
numpoints=1, fontsize=24, scatterpoints=1,
markerscale=1.2, borderpad=0.25, handletextpad=0.1)
ax1.text(0.12, 0.78, 'Size: ${\Lambda}_{\mathrm{redMapper}}$',
verticalalignment='bottom', horizontalalignment='left',
fontsize=20.0, transform=ax1.transAxes)
ax1.spines['top'].set_linewidth(3.5)
ax1.spines['right'].set_linewidth(3.5)
ax1.spines['bottom'].set_linewidth(3.5)
ax1.spines['left'].set_linewidth(3.5)
In [37]:
fig = plt.figure(figsize=(12, 12))
fig.subplots_adjust(left=0.1, right=0.95, bottom=0.15)
ax1 = fig.add_subplot(111)
ax1.axhline(11.4, linewidth=5.0, alpha=0.3,
linestyle='dashed', c='k')
ax1.axhline(11.6, linewidth=5.0, alpha=0.3,
linestyle='dashed', c='k')
ax1.axhline(11.8, linewidth=5.0, alpha=0.3,
linestyle='dashed', c='k')
ax1.axhline(12.0, linewidth=5.0, alpha=0.3,
linestyle='dashed', c='k')
ax1.scatter(gamaTab['Z'], (gamaTab['ilum_100'] + gamaTab['logm2l_i']) ,
c='b', alpha=0.3, s=100, marker='o', label='non-BCGs')
ax1.scatter(bcgTab['Z_LAMBDA'], (bcgTab['ilum_100'] + bcgTab['logm2l_i']),
c='r', alpha=0.9, s=((bcgTab['LAMBDA_CLUSTER'] - 20) * 5),
marker='s', label='BCGs')
ax1.set_xlabel('Redshift', size=32)
ax1.set_ylabel('$\log (M_{\star}/M_{\odot})_{\mathrm{SBP}}$', size=36)
ax1.set_xlim(0.09, 0.51)
ax1.set_ylim(11.01, 12.35)
ax1.legend()
for tick in ax1.xaxis.get_major_ticks():
tick.label.set_fontsize(30)
for tick in ax1.yaxis.get_major_ticks():
tick.label.set_fontsize(30)
ax1.legend(loc=(0.10, 0.85), shadow=True, fancybox=True,
numpoints=1, fontsize=24, scatterpoints=1,
markerscale=1.2, borderpad=0.25, handletextpad=0.1)
ax1.text(0.12, 0.78, 'Size: ${\Lambda}_{\mathrm{redMapper}}$',
verticalalignment='bottom', horizontalalignment='left',
fontsize=20.0, transform=ax1.transAxes)
ax1.spines['top'].set_linewidth(3.5)
ax1.spines['right'].set_linewidth(3.5)
ax1.spines['bottom'].set_linewidth(3.5)
ax1.spines['left'].set_linewidth(3.5)
In [38]:
fig = plt.figure(figsize=(10, 10))
fig.subplots_adjust(left=0.1, right=0.95, bottom=0.15)
ax1 = fig.add_subplot(111)
ax1.axvline(11.4, linewidth=5.0, alpha=0.3,
linestyle='dashed', c='k')
ax1.axvline(11.6, linewidth=5.0, alpha=0.3,
linestyle='dashed', c='k')
ax1.axvline(11.8, linewidth=5.0, alpha=0.3,
linestyle='dashed', c='k')
ax1.axvline(12.0, linewidth=5.0, alpha=0.3,
linestyle='dashed', c='k')
ax1.axhline(0.0, linewidth=5.0, alpha=0.6,
linestyle='dashed', c='k')
#
gMassNew = (gamaTab['ilum_100'] + gamaTab['logm2l_i'])
ax1.scatter(gMassNew, (gMassNew - gamaTab['MSTAR']),
c='b', alpha=0.3, s=100, marker='o', label='non-BCGs')
bMassNew = (bcgTab['ilum_100'] + bcgTab['logm2l_i'])
ax1.scatter(bMassNew, (bMassNew - bcgTab['MSTAR']),
c='r', alpha=0.9, s=((bcgTab['LAMBDA_CLUSTER'] - 20) * 5),
marker='s', label='BCGs')
ax1.set_xlabel('$\log (M_{\star}/M_{\odot})_{\mathrm{SBP}}$', size=34)
ax1.set_ylabel('$\log (M_{\star}/M_{\odot})_{\mathrm{SBP}} - \log (M_{\star}/M_{\odot})_{\mathrm{iSEDFit}}$', size=34)
ax1.set_xlim(11.01, 12.35)
ax1.set_ylim(-0.6, 1.5)
ax1.legend()
for tick in ax1.xaxis.get_major_ticks():
tick.label.set_fontsize(30)
for tick in ax1.yaxis.get_major_ticks():
tick.label.set_fontsize(30)
ax1.legend(loc=(0.10, 0.85), shadow=True, fancybox=True,
numpoints=1, fontsize=24, scatterpoints=1,
markerscale=1.2, borderpad=0.25, handletextpad=0.1)
ax1.text(0.12, 0.78, 'Size: ${\Lambda}_{\mathrm{redMapper}}$',
verticalalignment='bottom', horizontalalignment='left',
fontsize=20.0, transform=ax1.transAxes)
ax1.spines['top'].set_linewidth(3.5)
ax1.spines['right'].set_linewidth(3.5)
ax1.spines['bottom'].set_linewidth(3.5)
ax1.spines['left'].set_linewidth(3.5)
In [39]:
fig = plt.figure(figsize=(10, 10))
fig.subplots_adjust(left=0.1, right=0.95, bottom=0.15)
ax1 = fig.add_subplot(111)
ax1.axvline(11.4, linewidth=5.0, alpha=0.3,
linestyle='dashed', c='k')
ax1.axvline(11.6, linewidth=5.0, alpha=0.3,
linestyle='dashed', c='k')
ax1.axvline(11.8, linewidth=5.0, alpha=0.3,
linestyle='dashed', c='k')
ax1.axvline(12.0, linewidth=5.0, alpha=0.3,
linestyle='dashed', c='k')
ax1.axhline(0.0, linewidth=5.0, alpha=0.6,
linestyle='dashed', c='k')
gMassNew = (gamaTab['ilum_100'] + gamaTab['logm2l_i'])
ax1.scatter(gMassNew, (gMassNew - gamaTab['logms_gama']),
c='b', alpha=0.3, s=100, marker='o', label='non-BCGs')
bMassNew = (bcgTab['ilum_100'] + bcgTab['logm2l_i'])
ax1.scatter(bMassNew, (bMassNew - bcgTab['logms_gama']),
c='r', alpha=0.9, s=((bcgTab['LAMBDA_CLUSTER'] - 20) * 5),
marker='s', label='BCGs')
ax1.set_xlabel('$\log (M_{\star}/M_{\odot})_{\mathrm{SBP}}$', size=34)
ax1.set_ylabel('$\log (M_{\star}/M_{\odot})_{\mathrm{SBP}} - \log (M_{\star}/M_{\odot})_{\mathrm{GAMA}}$', size=34)
ax1.set_xlim(11.01, 12.35)
ax1.set_ylim(-0.6, 1.5)
ax1.legend()
for tick in ax1.xaxis.get_major_ticks():
tick.label.set_fontsize(30)
for tick in ax1.yaxis.get_major_ticks():
tick.label.set_fontsize(30)
ax1.legend(loc=(0.10, 0.85), shadow=True, fancybox=True,
numpoints=1, fontsize=24, scatterpoints=1,
markerscale=1.2, borderpad=0.25, handletextpad=0.1)
ax1.text(0.12, 0.78, 'Size: ${\Lambda}_{\mathrm{redMapper}}$',
verticalalignment='bottom', horizontalalignment='left',
fontsize=20.0, transform=ax1.transAxes)
ax1.spines['top'].set_linewidth(3.5)
ax1.spines['right'].set_linewidth(3.5)
ax1.spines['bottom'].set_linewidth(3.5)
ax1.spines['left'].set_linewidth(3.5)
In [40]:
fig = plt.figure(figsize=(12, 12))
fig.subplots_adjust(left=0.1, right=0.95, bottom=0.15)
ax1 = fig.add_subplot(111)
logmRange = np.arange(10.0, 12.5, 0.2)
ax1.plot(logmRange, logmRange, 'k', linestyle='--', linewidth=3.0, alpha=0.8)
ax1.scatter((gamaTab['ilum_10'] + gamaTab['logm2l_i']),
(gamaTab['ilum_25'] + gamaTab['logm2l_i']),
c='b', alpha=0.15, s=(gamaTab['ilum_100'] + gamaTab['logm2l_i'] - 11.1) * 140.0,
marker='o', label='non-BCGs')
ax1.scatter((bcgTab['ilum_10'] + bcgTab['logm2l_i']),
(bcgTab['ilum_25'] + bcgTab['logm2l_i']),
c='r', alpha=0.80, s=(bcgTab['ilum_100'] + bcgTab['logm2l_i'] - 11.1) * 140.0,
marker='s', label='BCGs')
# Sample1
ax1.scatter(np.nanmedian(gama1['ilum_10'] + gama1['logm2l_i']),
np.nanmedian(gama1['ilum_25'] + gama1['logm2l_i']),
c='c', alpha=0.9, s=240, marker='h', label='GAMA1')
ax1.scatter(np.nanmedian(bcg1['ilum_10'] + bcg1['logm2l_i']),
np.nanmedian(bcg1['ilum_25'] + bcg1['logm2l_i']),
c='orange', alpha=0.9, s=240, marker='h', label='BCG1')
# Sample2
ax1.scatter(np.nanmedian(gama2['ilum_10'] + gama2['logm2l_i']),
np.nanmedian(gama2['ilum_25'] + gama2['logm2l_i']),
c='c', alpha=0.9, s=240, marker='p', label='GAMA2')
ax1.scatter(np.nanmedian(bcg2['ilum_10'] + bcg2['logm2l_i']),
np.nanmedian(bcg2['ilum_25'] + bcg2['logm2l_i']),
c='orange', alpha=0.9, s=240, marker='p', label='BCG2')
# Sample3
ax1.scatter(np.nanmedian(gama3['ilum_10'] + gama3['logm2l_i']),
np.nanmedian(gama3['ilum_25'] + gama3['logm2l_i']),
c='c', alpha=0.9, s=240, marker='8', label='GAMA3')
ax1.scatter(np.nanmedian(bcg3['ilum_10'] + bcg3['logm2l_i']),
np.nanmedian(bcg3['ilum_25'] + bcg3['logm2l_i']),
c='orange', alpha=0.9, s=240, marker='8', label='BCG3')
ax1.set_xlabel('$\log (M_{\star}/M_{\odot})_{<10 \mathrm{kpc}}$', size=32)
ax1.set_ylabel('$\log (M_{\star}/M_{\odot})_{<25 \mathrm{kpc}}$', size=36)
ax1.set_xlim(10.7, 12.35)
ax1.set_ylim(10.7, 12.35)
ax1.legend()
for tick in ax1.xaxis.get_major_ticks():
tick.label.set_fontsize(30)
for tick in ax1.yaxis.get_major_ticks():
tick.label.set_fontsize(30)
ax1.legend(loc=(0.70, 0.16), shadow=True, fancybox=True,
numpoints=1, fontsize=24, scatterpoints=1,
markerscale=1.2, borderpad=0.25, handletextpad=0.1)
ax1.text(0.60, 0.08, 'Size: $\log (M_{\star}/M_{\odot})_{\mathrm{SBP}}$',
verticalalignment='bottom', horizontalalignment='left',
fontsize=24.0, transform=ax1.transAxes)
ax1.spines['top'].set_linewidth(3.5)
ax1.spines['right'].set_linewidth(3.5)
ax1.spines['bottom'].set_linewidth(3.5)
ax1.spines['left'].set_linewidth(3.5)
In [41]:
fig = plt.figure(figsize=(12, 12))
fig.subplots_adjust(left=0.1, right=0.95, bottom=0.15)
ax1 = fig.add_subplot(111)
logmRange = np.arange(10.0, 12.5, 0.2)
ax1.plot(logmRange, logmRange, 'k', linestyle='--', linewidth=3.0, alpha=0.8)
ax1.scatter((gamaTab['ilum_10'] + gamaTab['logm2l_i']),
(gamaTab['ilum_50'] + gamaTab['logm2l_i']),
c='b', alpha=0.15, s=(gamaTab['ilum_100'] + gamaTab['logm2l_i'] - 11.1) * 140.0,
marker='o', label='non-BCGs')
ax1.scatter((bcgTab['ilum_10'] + bcgTab['logm2l_i']),
(bcgTab['ilum_50'] + bcgTab['logm2l_i']),
c='r', alpha=0.80, s=(bcgTab['ilum_100'] + bcgTab['logm2l_i'] - 11.1) * 140.0,
marker='s', label='BCGs')
# Sample1
ax1.scatter(np.nanmedian(gama1['ilum_10'] + gama1['logm2l_i']),
np.nanmedian(gama1['ilum_50'] + gama1['logm2l_i']),
c='c', alpha=0.9, s=240, marker='h', label='GAMA1')
ax1.scatter(np.nanmedian(bcg1['ilum_10'] + bcg1['logm2l_i']),
np.nanmedian(bcg1['ilum_50'] + bcg1['logm2l_i']),
c='orange', alpha=0.9, s=240, marker='h', label='BCG1')
# Sample2
ax1.scatter(np.nanmedian(gama2['ilum_10'] + gama2['logm2l_i']),
np.nanmedian(gama2['ilum_50'] + gama2['logm2l_i']),
c='c', alpha=0.9, s=240, marker='p', label='GAMA2')
ax1.scatter(np.nanmedian(bcg2['ilum_10'] + bcg2['logm2l_i']),
np.nanmedian(bcg2['ilum_50'] + bcg2['logm2l_i']),
c='orange', alpha=0.9, s=240, marker='p', label='BCG2')
# Sample3
ax1.scatter(np.nanmedian(gama3['ilum_10'] + gama3['logm2l_i']),
np.nanmedian(gama3['ilum_50'] + gama3['logm2l_i']),
c='c', alpha=0.9, s=240, marker='8', label='GAMA3')
ax1.scatter(np.nanmedian(bcg3['ilum_10'] + bcg3['logm2l_i']),
np.nanmedian(bcg3['ilum_50'] + bcg3['logm2l_i']),
c='orange', alpha=0.9, s=240, marker='8', label='BCG3')
ax1.set_xlabel('$\log (M_{\star}/M_{\odot})_{<10 \mathrm{kpc}}$', size=32)
ax1.set_ylabel('$\log (M_{\star}/M_{\odot})_{<50 \mathrm{kpc}}$', size=36)
ax1.set_xlim(10.7, 12.35)
ax1.set_ylim(10.7, 12.35)
ax1.legend()
for tick in ax1.xaxis.get_major_ticks():
tick.label.set_fontsize(30)
for tick in ax1.yaxis.get_major_ticks():
tick.label.set_fontsize(30)
ax1.legend(loc=(0.70, 0.16), shadow=True, fancybox=True,
numpoints=1, fontsize=24, scatterpoints=1,
markerscale=1.2, borderpad=0.25, handletextpad=0.1)
ax1.text(0.60, 0.08, 'Size: $\log (M_{\star}/M_{\odot})_{\mathrm{SBP}}$',
verticalalignment='bottom', horizontalalignment='left',
fontsize=24.0, transform=ax1.transAxes)
ax1.spines['top'].set_linewidth(3.5)
ax1.spines['right'].set_linewidth(3.5)
ax1.spines['bottom'].set_linewidth(3.5)
ax1.spines['left'].set_linewidth(3.5)
In [42]:
fig = plt.figure(figsize=(12, 12))
fig.subplots_adjust(left=0.1, right=0.95, bottom=0.15)
ax1 = fig.add_subplot(111)
logmRange = np.arange(10.0, 12.5, 0.2)
ax1.plot(logmRange, logmRange, 'k', linestyle='--', linewidth=3.0, alpha=0.8)
ax1.scatter((gamaTab['ilum_10'] + gamaTab['logm2l_i']),
(gamaTab['ilum_75'] + gamaTab['logm2l_i']),
c='b', alpha=0.15, s=(gamaTab['ilum_100'] + gamaTab['logm2l_i'] - 11.1) * 140.0,
marker='o', label='non-BCGs')
ax1.scatter((bcgTab['ilum_10'] + bcgTab['logm2l_i']),
(bcgTab['ilum_75'] + bcgTab['logm2l_i']),
c='r', alpha=0.80, s=(bcgTab['ilum_100'] + bcgTab['logm2l_i'] - 11.1) * 140.0,
marker='s', label='BCGs')
# Sample1
ax1.scatter(np.nanmedian(gama1['ilum_10'] + gama1['logm2l_i']),
np.nanmedian(gama1['ilum_75'] + gama1['logm2l_i']),
c='c', alpha=0.9, s=240, marker='h', label='GAMA1')
ax1.scatter(np.nanmedian(bcg1['ilum_10'] + bcg1['logm2l_i']),
np.nanmedian(bcg1['ilum_75'] + bcg1['logm2l_i']),
c='orange', alpha=0.9, s=240, marker='h', label='BCG1')
# Sample2
ax1.scatter(np.nanmedian(gama2['ilum_10'] + gama2['logm2l_i']),
np.nanmedian(gama2['ilum_75'] + gama2['logm2l_i']),
c='c', alpha=0.9, s=240, marker='p', label='GAMA2')
ax1.scatter(np.nanmedian(bcg2['ilum_10'] + bcg2['logm2l_i']),
np.nanmedian(bcg2['ilum_75'] + bcg2['logm2l_i']),
c='orange', alpha=0.9, s=240, marker='p', label='BCG2')
# Sample3
ax1.scatter(np.nanmedian(gama3['ilum_10'] + gama3['logm2l_i']),
np.nanmedian(gama3['ilum_75'] + gama3['logm2l_i']),
c='c', alpha=0.9, s=240, marker='8', label='GAMA3')
ax1.scatter(np.nanmedian(bcg3['ilum_10'] + bcg3['logm2l_i']),
np.nanmedian(bcg3['ilum_75'] + bcg3['logm2l_i']),
c='orange', alpha=0.9, s=240, marker='8', label='BCG3')
ax1.set_xlabel('$\log (M_{\star}/M_{\odot})_{<10 \mathrm{kpc}}$', size=32)
ax1.set_ylabel('$\log (M_{\star}/M_{\odot})_{<75 \mathrm{kpc}}$', size=36)
ax1.set_xlim(10.7, 12.35)
ax1.set_ylim(10.7, 12.35)
ax1.legend()
for tick in ax1.xaxis.get_major_ticks():
tick.label.set_fontsize(30)
for tick in ax1.yaxis.get_major_ticks():
tick.label.set_fontsize(30)
ax1.legend(loc=(0.70, 0.16), shadow=True, fancybox=True,
numpoints=1, fontsize=24, scatterpoints=1,
markerscale=1.2, borderpad=0.25, handletextpad=0.1)
ax1.text(0.60, 0.08, 'Size: $\log (M_{\star}/M_{\odot})_{\mathrm{SBP}}$',
verticalalignment='bottom', horizontalalignment='left',
fontsize=24.0, transform=ax1.transAxes)
ax1.spines['top'].set_linewidth(3.5)
ax1.spines['right'].set_linewidth(3.5)
ax1.spines['bottom'].set_linewidth(3.5)
ax1.spines['left'].set_linewidth(3.5)
In [43]:
fig = plt.figure(figsize=(12, 12))
fig.subplots_adjust(left=0.1, right=0.95, bottom=0.15)
ax1 = fig.add_subplot(111)
logmRange = np.arange(10.0, 12.5, 0.2)
ax1.plot(logmRange, logmRange, 'k', linestyle='--', linewidth=3.0, alpha=0.8)
ax1.scatter((gamaTab['ilum_10'] + gamaTab['logm2l_i']),
(gamaTab['ilum_100'] + gamaTab['logm2l_i']),
c='b', alpha=0.15, s=(gamaTab['ilum_100'] + gamaTab['logm2l_i'] - 11.1) * 140.0,
marker='o', label='non-BCGs')
ax1.scatter((bcgTab['ilum_10'] + bcgTab['logm2l_i']),
(bcgTab['ilum_100'] + bcgTab['logm2l_i']),
c='r', alpha=0.80, s=(bcgTab['ilum_100'] + bcgTab['logm2l_i'] - 11.1) * 140.0,
marker='s', label='BCGs')
# Sample1
ax1.scatter(np.nanmedian(gama1['ilum_10'] + gama1['logm2l_i']),
np.nanmedian(gama1['ilum_100'] + gama1['logm2l_i']),
c='c', alpha=0.9, s=240, marker='h', label='GAMA1')
ax1.scatter(np.nanmedian(bcg1['ilum_10'] + bcg1['logm2l_i']),
np.nanmedian(bcg1['ilum_100'] + bcg1['logm2l_i']),
c='orange', alpha=0.9, s=240, marker='h', label='BCG1')
# Sample2
ax1.scatter(np.nanmedian(gama2['ilum_10'] + gama2['logm2l_i']),
np.nanmedian(gama2['ilum_100'] + gama2['logm2l_i']),
c='c', alpha=0.9, s=240, marker='p', label='GAMA2')
ax1.scatter(np.nanmedian(bcg2['ilum_10'] + bcg2['logm2l_i']),
np.nanmedian(bcg2['ilum_100'] + bcg2['logm2l_i']),
c='orange', alpha=0.9, s=240, marker='p', label='BCG2')
# Sample3
ax1.scatter(np.nanmedian(gama3['ilum_10'] + gama3['logm2l_i']),
np.nanmedian(gama3['ilum_100'] + gama3['logm2l_i']),
c='c', alpha=0.9, s=240, marker='8', label='GAMA3')
ax1.scatter(np.nanmedian(bcg3['ilum_10'] + bcg3['logm2l_i']),
np.nanmedian(bcg3['ilum_100'] + bcg3['logm2l_i']),
c='orange', alpha=0.9, s=240, marker='8', label='BCG3')
ax1.set_xlabel('$\log (M_{\star}/M_{\odot})_{<10 \mathrm{kpc}}$', size=32)
ax1.set_ylabel('$\log (M_{\star}/M_{\odot})_{<100 \mathrm{kpc}}$', size=36)
ax1.set_xlim(10.7, 12.35)
ax1.set_ylim(10.7, 12.35)
ax1.legend()
for tick in ax1.xaxis.get_major_ticks():
tick.label.set_fontsize(30)
for tick in ax1.yaxis.get_major_ticks():
tick.label.set_fontsize(30)
ax1.legend(loc=(0.70, 0.16), shadow=True, fancybox=True,
numpoints=1, fontsize=24, scatterpoints=1,
markerscale=1.2, borderpad=0.25, handletextpad=0.1)
ax1.text(0.60, 0.08, 'Size: $\log (M_{\star}/M_{\odot})_{\mathrm{SBP}}$',
verticalalignment='bottom', horizontalalignment='left',
fontsize=24.0, transform=ax1.transAxes)
ax1.spines['top'].set_linewidth(3.5)
ax1.spines['right'].set_linewidth(3.5)
ax1.spines['bottom'].set_linewidth(3.5)
ax1.spines['left'].set_linewidth(3.5)
In [44]:
fig = plt.figure(figsize=(12, 12))
fig.subplots_adjust(left=0.1, right=0.95, bottom=0.15)
ax1 = fig.add_subplot(111)
ax1.axvline(11.4, linewidth=5.0, alpha=0.3,
linestyle='dashed', c='k')
ax1.axvline(11.6, linewidth=5.0, alpha=0.3,
linestyle='dashed', c='k')
ax1.axvline(11.8, linewidth=5.0, alpha=0.3,
linestyle='dashed', c='k')
ax1.axvline(12.0, linewidth=5.0, alpha=0.3,
linestyle='dashed', c='k')
ax1.axhline(0.0, linewidth=5.0, alpha=0.6,
linestyle='dashed', c='k')
ax1.scatter((gamaTab['ilum_100'] + gamaTab['logm2l_i']),
(gamaTab['ilum_25'] + gamaTab['logm2l_i']) - (gamaTab['ilum_10'] + gamaTab['logm2l_i']),
c='b', alpha=0.15, s=100.0,
marker='o', label='non-BCGs')
ax1.scatter((bcgTab['ilum_100'] + bcgTab['logm2l_i']),
(bcgTab['ilum_25'] + bcgTab['logm2l_i']) - (bcgTab['ilum_10'] + bcgTab['logm2l_i']),
c='r', alpha=0.80, s=((bcgTab['LAMBDA_CLUSTER'] - 20) * 5),
marker='s', label='BCGs')
# Sample1
ax1.scatter(np.nanmedian(gama1['ilum_100'] + gama1['logm2l_i']),
np.nanmedian(gama1['ilum_25'] - gama1['ilum_10']),
c='c', alpha=0.9, s=240, marker='h', label='GAMA1')
ax1.scatter(np.nanmedian(bcg1['ilum_100'] + bcg1['logm2l_i']),
np.nanmedian(bcg1['ilum_25'] - bcg1['ilum_10']),
c='orange', alpha=0.9, s=240, marker='h', label='BCG1')
# Sample2
ax1.scatter(np.nanmedian(gama2['ilum_100'] + gama2['logm2l_i']),
np.nanmedian(gama2['ilum_25'] - gama2['ilum_10']),
c='c', alpha=0.9, s=240, marker='p', label='GAMA2')
ax1.scatter(np.nanmedian(bcg2['ilum_100'] + bcg2['logm2l_i']),
np.nanmedian(bcg2['ilum_25'] - bcg2['ilum_10']),
c='orange', alpha=0.9, s=240, marker='p', label='BCG2')
# Sample3
ax1.scatter(np.nanmedian(gama3['ilum_100'] + gama3['logm2l_i']),
np.nanmedian(gama3['ilum_25'] - gama3['ilum_10']),
c='c', alpha=0.9, s=240, marker='8', label='GAMA3')
ax1.scatter(np.nanmedian(bcg3['ilum_100'] + bcg3['logm2l_i']),
np.nanmedian(bcg3['ilum_25'] - bcg3['ilum_10']),
c='orange', alpha=0.9, s=240, marker='8', label='BCG3')
ax1.set_xlabel('$\log (M_{\star}/M_{\odot})_{\mathrm{SBP}}$', size=32)
ax1.set_ylabel('$\log (M_{\star}/M_{\odot})_{<25 \mathrm{kpc}} - \log (M_{\star}/M_{\odot})_{<10 \mathrm{kpc}}$',
size=36)
ax1.set_xlim(10.7, 12.35)
ax1.set_ylim(0.01, 0.90)
for tick in ax1.xaxis.get_major_ticks():
tick.label.set_fontsize(30)
for tick in ax1.yaxis.get_major_ticks():
tick.label.set_fontsize(30)
ax1.legend(loc=(0.08, 0.53), shadow=True, fancybox=True,
numpoints=1, fontsize=24, scatterpoints=1,
markerscale=1.2, borderpad=0.25, handletextpad=0.1)
ax1.text(0.10, 0.47, 'Size: ${\Lambda}_{\mathrm{redMapper}}$',
verticalalignment='bottom', horizontalalignment='left',
fontsize=24.0, transform=ax1.transAxes)
ax1.spines['top'].set_linewidth(3.5)
ax1.spines['right'].set_linewidth(3.5)
ax1.spines['bottom'].set_linewidth(3.5)
ax1.spines['left'].set_linewidth(3.5)
In [45]:
fig = plt.figure(figsize=(12, 12))
fig.subplots_adjust(left=0.1, right=0.95, bottom=0.15)
ax1 = fig.add_subplot(111)
ax1.axvline(11.4, linewidth=5.0, alpha=0.3,
linestyle='dashed', c='k')
ax1.axvline(11.6, linewidth=5.0, alpha=0.3,
linestyle='dashed', c='k')
ax1.axvline(11.8, linewidth=5.0, alpha=0.3,
linestyle='dashed', c='k')
ax1.axvline(12.0, linewidth=5.0, alpha=0.3,
linestyle='dashed', c='k')
ax1.axhline(0.0, linewidth=5.0, alpha=0.6,
linestyle='dashed', c='k')
ax1.scatter((gamaTab['ilum_100'] + gamaTab['logm2l_i']),
(gamaTab['ilum_50'] + gamaTab['logm2l_i']) - (gamaTab['ilum_10'] + gamaTab['logm2l_i']),
c='b', alpha=0.15, s=100.0,
marker='o', label='non-BCGs')
ax1.scatter((bcgTab['ilum_100'] + bcgTab['logm2l_i']),
(bcgTab['ilum_50'] + bcgTab['logm2l_i']) - (bcgTab['ilum_10'] + bcgTab['logm2l_i']),
c='r', alpha=0.80, s=((bcgTab['LAMBDA_CLUSTER'] - 20) * 5),
marker='s', label='BCGs')
ax1.set_xlabel('$\log (M_{\star}/M_{\odot})_{\mathrm{SBP}}$', size=32)
ax1.set_ylabel('$\log (M_{\star}/M_{\odot})_{<50 \mathrm{kpc}} - \log (M_{\star}/M_{\odot})_{<10 \mathrm{kpc}}$',
size=36)
# Sample1
ax1.scatter(np.nanmedian(gama1['ilum_100'] + gama1['logm2l_i']),
np.nanmedian(gama1['ilum_50'] - gama1['ilum_10']),
c='c', alpha=0.9, s=240, marker='h', label='GAMA1')
ax1.scatter(np.nanmedian(bcg1['ilum_100'] + bcg1['logm2l_i']),
np.nanmedian(bcg1['ilum_50'] - bcg1['ilum_10']),
c='orange', alpha=0.9, s=240, marker='h', label='BCG1')
# Sample2
ax1.scatter(np.nanmedian(gama2['ilum_100'] + gama2['logm2l_i']),
np.nanmedian(gama2['ilum_50'] - gama2['ilum_10']),
c='c', alpha=0.9, s=240, marker='p', label='GAMA2')
ax1.scatter(np.nanmedian(bcg2['ilum_100'] + bcg2['logm2l_i']),
np.nanmedian(bcg2['ilum_50'] - bcg2['ilum_10']),
c='orange', alpha=0.9, s=240, marker='p', label='BCG2')
# Sample3
ax1.scatter(np.nanmedian(gama3['ilum_100'] + gama3['logm2l_i']),
np.nanmedian(gama3['ilum_50'] - gama3['ilum_10']),
c='c', alpha=0.9, s=240, marker='8', label='GAMA3')
ax1.scatter(np.nanmedian(bcg3['ilum_100'] + bcg3['logm2l_i']),
np.nanmedian(bcg3['ilum_50'] - bcg3['ilum_10']),
c='orange', alpha=0.9, s=240, marker='8', label='BCG3')
ax1.set_xlim(10.7, 12.35)
ax1.set_ylim(0.01, 0.90)
for tick in ax1.xaxis.get_major_ticks():
tick.label.set_fontsize(30)
for tick in ax1.yaxis.get_major_ticks():
tick.label.set_fontsize(30)
ax1.legend(loc=(0.08, 0.53), shadow=True, fancybox=True,
numpoints=1, fontsize=24, scatterpoints=1,
markerscale=1.2, borderpad=0.25, handletextpad=0.1)
ax1.text(0.10, 0.47, 'Size: ${\Lambda}_{\mathrm{redMapper}}$',
verticalalignment='bottom', horizontalalignment='left',
fontsize=24.0, transform=ax1.transAxes)
ax1.spines['top'].set_linewidth(3.5)
ax1.spines['right'].set_linewidth(3.5)
ax1.spines['bottom'].set_linewidth(3.5)
ax1.spines['left'].set_linewidth(3.5)
In [46]:
fig = plt.figure(figsize=(12, 12))
fig.subplots_adjust(left=0.1, right=0.95, bottom=0.15)
ax1 = fig.add_subplot(111)
ax1.axvline(11.4, linewidth=5.0, alpha=0.3,
linestyle='dashed', c='k')
ax1.axvline(11.6, linewidth=5.0, alpha=0.3,
linestyle='dashed', c='k')
ax1.axvline(11.8, linewidth=5.0, alpha=0.3,
linestyle='dashed', c='k')
ax1.axvline(12.0, linewidth=5.0, alpha=0.3,
linestyle='dashed', c='k')
ax1.axhline(0.0, linewidth=5.0, alpha=0.6,
linestyle='dashed', c='k')
ax1.scatter((gamaTab['ilum_100'] + gamaTab['logm2l_i']),
(gamaTab['ilum_75'] + gamaTab['logm2l_i']) - (gamaTab['ilum_10'] + gamaTab['logm2l_i']),
c='b', alpha=0.15, s=100.0,
marker='o', label='non-BCGs')
ax1.scatter((bcgTab['ilum_100'] + bcgTab['logm2l_i']),
(bcgTab['ilum_75'] + bcgTab['logm2l_i']) - (bcgTab['ilum_10'] + bcgTab['logm2l_i']),
c='r', alpha=0.80, s=((bcgTab['LAMBDA_CLUSTER'] - 20) * 5),
marker='s', label='BCGs')
# Sample1
ax1.scatter(np.nanmedian(gama1['ilum_100'] + gama1['logm2l_i']),
np.nanmedian(gama1['ilum_75'] - gama1['ilum_10']),
c='c', alpha=0.9, s=240, marker='h', label='GAMA1')
ax1.scatter(np.nanmedian(bcg1['ilum_100'] + bcg1['logm2l_i']),
np.nanmedian(bcg1['ilum_75'] - bcg1['ilum_10']),
c='orange', alpha=0.9, s=240, marker='h', label='BCG1')
# Sample2
ax1.scatter(np.nanmedian(gama2['ilum_100'] + gama2['logm2l_i']),
np.nanmedian(gama2['ilum_75'] - gama2['ilum_10']),
c='c', alpha=0.9, s=240, marker='p', label='GAMA2')
ax1.scatter(np.nanmedian(bcg2['ilum_100'] + bcg2['logm2l_i']),
np.nanmedian(bcg2['ilum_75'] - bcg2['ilum_10']),
c='orange', alpha=0.9, s=240, marker='p', label='BCG2')
# Sample3
ax1.scatter(np.nanmedian(gama3['ilum_100'] + gama3['logm2l_i']),
np.nanmedian(gama3['ilum_75'] - gama3['ilum_10']),
c='c', alpha=0.9, s=240, marker='8', label='GAMA3')
ax1.scatter(np.nanmedian(bcg3['ilum_100'] + bcg3['logm2l_i']),
np.nanmedian(bcg3['ilum_75'] - bcg3['ilum_10']),
c='orange', alpha=0.9, s=240, marker='8', label='BCG3')
ax1.set_xlabel('$\log (M_{\star}/M_{\odot})_{\mathrm{SBP}}$', size=32)
ax1.set_ylabel('$\log (M_{\star}/M_{\odot})_{<75 \mathrm{kpc}} - \log (M_{\star}/M_{\odot})_{<10 \mathrm{kpc}}$',
size=36)
ax1.set_xlim(10.7, 12.35)
ax1.set_ylim(0.01, 0.90)
ax1.legend()
for tick in ax1.xaxis.get_major_ticks():
tick.label.set_fontsize(30)
for tick in ax1.yaxis.get_major_ticks():
tick.label.set_fontsize(30)
ax1.legend(loc=(0.08, 0.53), shadow=True, fancybox=True,
numpoints=1, fontsize=24, scatterpoints=1,
markerscale=1.2, borderpad=0.25, handletextpad=0.1)
ax1.text(0.10, 0.47, 'Size: ${\Lambda}_{\mathrm{redMapper}}$',
verticalalignment='bottom', horizontalalignment='left',
fontsize=24.0, transform=ax1.transAxes)
ax1.spines['top'].set_linewidth(3.5)
ax1.spines['right'].set_linewidth(3.5)
ax1.spines['bottom'].set_linewidth(3.5)
ax1.spines['left'].set_linewidth(3.5)
In [47]:
fig = plt.figure(figsize=(12, 12))
fig.subplots_adjust(left=0.1, right=0.95, bottom=0.15)
ax1 = fig.add_subplot(111)
ax1.axvline(11.4, linewidth=5.0, alpha=0.3,
linestyle='dashed', c='k')
ax1.axvline(11.6, linewidth=5.0, alpha=0.3,
linestyle='dashed', c='k')
ax1.axvline(11.8, linewidth=5.0, alpha=0.3,
linestyle='dashed', c='k')
ax1.axvline(12.0, linewidth=5.0, alpha=0.3,
linestyle='dashed', c='k')
ax1.axhline(0.0, linewidth=5.0, alpha=0.6,
linestyle='dashed', c='k')
ax1.scatter((gamaTab['ilum_100'] + gamaTab['logm2l_i']),
(gamaTab['ilum_100'] + gamaTab['logm2l_i']) - (gamaTab['ilum_10'] + gamaTab['logm2l_i']),
c='b', alpha=0.15, s=100.0,
marker='o', label='non-BCGs')
ax1.scatter((bcgTab['ilum_100'] + bcgTab['logm2l_i']),
(bcgTab['ilum_100'] + bcgTab['logm2l_i']) - (bcgTab['ilum_10'] + bcgTab['logm2l_i']),
c='r', alpha=0.80, s=((bcgTab['LAMBDA_CLUSTER'] - 20) * 5),
marker='s', label='BCGs')
# Sample1
ax1.scatter(np.nanmedian(gama1['ilum_100'] + gama1['logm2l_i']),
np.nanmedian(gama1['ilum_100'] - gama1['ilum_10']),
c='c', alpha=0.9, s=240, marker='h', label='GAMA1')
ax1.scatter(np.nanmedian(bcg1['ilum_100'] + bcg1['logm2l_i']),
np.nanmedian(bcg1['ilum_100'] - bcg1['ilum_10']),
c='orange', alpha=0.9, s=240, marker='h', label='BCG1')
# Sample2
ax1.scatter(np.nanmedian(gama2['ilum_100'] + gama2['logm2l_i']),
np.nanmedian(gama2['ilum_100'] - gama2['ilum_10']),
c='c', alpha=0.9, s=240, marker='p', label='GAMA2')
ax1.scatter(np.nanmedian(bcg2['ilum_100'] + bcg2['logm2l_i']),
np.nanmedian(bcg2['ilum_100'] - bcg2['ilum_10']),
c='orange', alpha=0.9, s=240, marker='p', label='BCG2')
# Sample3
ax1.scatter(np.nanmedian(gama3['ilum_100'] + gama3['logm2l_i']),
np.nanmedian(gama3['ilum_100'] - gama3['ilum_10']),
c='c', alpha=0.9, s=240, marker='8', label='GAMA3')
ax1.scatter(np.nanmedian(bcg3['ilum_100'] + bcg3['logm2l_i']),
np.nanmedian(bcg3['ilum_100'] - bcg3['ilum_10']),
c='orange', alpha=0.9, s=240, marker='8', label='BCG3')
ax1.set_xlabel('$\log (M_{\star}/M_{\odot})_{\mathrm{SBP}}$', size=32)
ax1.set_ylabel('$\log (M_{\star}/M_{\odot})_{<100 \mathrm{kpc}} - \log (M_{\star}/M_{\odot})_{<10 \mathrm{kpc}}$',
size=36)
ax1.set_xlim(10.7, 12.35)
ax1.set_ylim(0.01, 0.90)
ax1.legend()
for tick in ax1.xaxis.get_major_ticks():
tick.label.set_fontsize(30)
for tick in ax1.yaxis.get_major_ticks():
tick.label.set_fontsize(30)
ax1.legend(loc=(0.08, 0.53), shadow=True, fancybox=True,
numpoints=1, fontsize=24, scatterpoints=1,
markerscale=1.2, borderpad=0.25, handletextpad=0.1)
ax1.text(0.10, 0.47, 'Size: ${\Lambda}_{\mathrm{redMapper}}$',
verticalalignment='bottom', horizontalalignment='left',
fontsize=24.0, transform=ax1.transAxes)
ax1.spines['top'].set_linewidth(3.5)
ax1.spines['right'].set_linewidth(3.5)
ax1.spines['bottom'].set_linewidth(3.5)
ax1.spines['left'].set_linewidth(3.5)
In [67]:
rsma_common = np.arange(0.4, 4.1, 0.1)
fig = plt.figure(figsize=(12, 12))
fig.subplots_adjust(left=0.1, right=0.95, bottom=0.15)
ax1 = fig.add_subplot(111)
# 100 Kpc
ax1.axvline(3.20, linewidth=5.0, c='k', linestyle='dashed')
# z = 0.2 : 1"=3.3 Kpc
ax1.axvline(3.3 ** 0.25, linewidth=8.0, c='g', linestyle='dashed', alpha=0.2)
# z = 0.4 : 1"=5.4 Kpc
ax1.axvline(5.4 ** 0.25, linewidth=8.0, c='k', linestyle='solid', alpha=0.2)
with ProgressBar(len(gama1), ipython_widget=True) as bar:
try:
del gMstack
except Exception:
pass
for g in gama1:
gProf = Table.read(os.path.join(gamaDir, g['sum_tab'].replace('./', '')).strip())
ax1.plot((gProf['rKpc']**0.25), (gProf['muI1'] + g['logm2l_i']), c='c',
alpha=0.15, linewidth=1.5)
intrpFunc = interp1d((gProf['rKpc']**0.25), (gProf['muI1'] + g['logm2l_i']),
kind='linear')
try:
gMprof_intrp = intrpFunc(rsma_common)
except Exception:
print("## GAMA :BAD INTERPOLATION FOR %i" % g['ISEDFIT_ID'])
continue
try:
gMstack = np.vstack((gMstack, gMprof_intrp))
except NameError:
gMstack = gMprof_intrp
bar.update()
with ProgressBar(len(bcg1), ipython_widget=True) as bar:
try:
del bMstack
except Exception:
pass
for b in bcg1:
bProf = Table.read(os.path.join(bcgDir, b['sum_tab'].replace('./', '')).strip())
ax1.plot((bProf['rKpc']**0.25), (bProf['muI1'] + b['logm2l_i']), c='orange',
alpha=0.8, linewidth=2.5)
intrpFunc = interp1d((bProf['rKpc']**0.25), (bProf['muI1'] + b['logm2l_i']),
kind='linear')
try:
bMprof_intrp = intrpFunc(rsma_common)
except Exception:
print("## BCG :BAD INTERPOLATION FOR %i" % b['ID_CLUSTER'])
continue
try:
bMstack = np.vstack((bMstack, bMprof_intrp))
except NameError:
bMstack = bMprof_intrp
bar.update()
# Median & Average profiles
gMprof_med = confidence_interval(gMstack, axis=0, alpha=np.asarray([SIGMA1, 1.0]),
metric=np.nanmedian, numResamples=1000,
interpolate=True)
gMprof_avg = np.nanmean(gMstack, axis=0)
bMprof_med = confidence_interval(bMstack, axis=0, alpha=np.asarray([SIGMA1, 1.0]),
metric=np.nanmedian, numResamples=1000,
interpolate=True)
bMprof_avg = np.nanmean(bMstack, axis=0)
ax1.fill_between(rsma_common, gMprof_med[0], gMprof_med[1],
facecolor='b', alpha=0.4, zorder=1005)
ax1.fill_between(rsma_common, bMprof_med[0], bMprof_med[1],
facecolor='r', alpha=0.4, zorder=1005)
ax1.plot(rsma_common, gMprof_med[2], c='b', linewidth=3.5, linestyle='-',
label='non-BCG Med')
ax1.plot(rsma_common, gMprof_avg, c='b', linewidth=3.5, linestyle='--',
label='non-BCG Avg')
ax1.plot(rsma_common, bMprof_med[2], c='r', linewidth=3.5, linestyle='-',
label='BCG Med')
ax1.plot(rsma_common, bMprof_avg, c='r', linewidth=3.5, linestyle='--',
label='BCG Avg')
ax1.text(0.30, 0.90, '$11.4 < \log (M_{\mathrm{SBP}}) < 11.6$',
verticalalignment='bottom', horizontalalignment='left',
fontsize=30.0, transform=ax1.transAxes)
ax1.set_xlabel('$R^{1/4}$ (Kpc)', size=32)
ax1.set_ylabel('$log ({\mu}_{\star}/[M_{\odot} Kpc^{-2}])$', size=36)
ax1.set_xlim(0.5, 4.1)
ax1.set_ylim(4.4, 10.4)
for tick in ax1.xaxis.get_major_ticks():
tick.label.set_fontsize(30)
for tick in ax1.yaxis.get_major_ticks():
tick.label.set_fontsize(30)
ax1.spines['top'].set_linewidth(3.5)
ax1.spines['right'].set_linewidth(3.5)
ax1.spines['bottom'].set_linewidth(3.5)
ax1.spines['left'].set_linewidth(3.5)
In [188]:
rsma_common = np.arange(0.4, 4.1, 0.1)
fig = plt.figure(figsize=(12, 12))
fig.subplots_adjust(left=0.1, right=0.95, bottom=0.15)
ax1 = fig.add_subplot(111)
# 100 Kpc
ax1.axvline(3.20, linewidth=5.0, c='k', linestyle='dashed')
# z = 0.2 : 1"=3.3 Kpc
ax1.axvline(3.3 ** 0.25, linewidth=8.0, c='g', linestyle='dashed', alpha=0.2)
# z = 0.4 : 1"=5.4 Kpc
ax1.axvline(5.4 ** 0.25, linewidth=8.0, c='k', linestyle='solid', alpha=0.2)
with ProgressBar(len(gama1), ipython_widget=True) as bar:
try:
del gNstack
except Exception:
pass
for g in gama1:
gProf = Table.read(os.path.join(gamaDir, g['sum_tab'].replace('./', '')).strip())
gNorm = normProf(gProf['rKpc'], (gProf['muI1'] + g['logm2l_i']), 10.0, 12.0)
ax1.plot((gProf['rKpc']**0.25), gNorm, c='c',
alpha=0.15, linewidth=1.0)
intrpFunc = interp1d((gProf['rKpc']**0.25), gNorm,
kind='linear')
try:
gNprof_intrp = intrpFunc(rsma_common)
except Exception:
print("## GAMA :BAD INTERPOLATION FOR %i" % g['ISEDFIT_ID'])
continue
try:
gNstack = np.vstack((gNstack, gNprof_intrp))
except NameError:
gNstack = gNprof_intrp
bar.update()
with ProgressBar(len(bcg1), ipython_widget=True) as bar:
try:
del bNstack
except Exception:
pass
for b in bcg1:
bProf = Table.read(os.path.join(bcgDir, b['sum_tab'].replace('./', '')).strip())
bNorm = normProf(bProf['rKpc'], (bProf['muI1'] + b['logm2l_i']), 10.0, 12.0)
ax1.plot((bProf['rKpc']**0.25), bNorm, c='orange',
alpha=0.8, linewidth=2.5)
intrpFunc = interp1d((bProf['rKpc']**0.25), bNorm,
kind='linear')
try:
bNprof_intrp = intrpFunc(rsma_common)
except Exception:
print("## BCG :BAD INTERPOLATION FOR %i" % b['ID_CLUSTER'])
continue
try:
bNstack = np.vstack((bNstack, bNprof_intrp))
except NameError:
bNstack = bNprof_intrp
bar.update()
# Median & Average profiles
gNprof_med = np.nanmedian(gNstack, axis=0)
gNprof_avg = np.nanmean(gNstack, axis=0)
bNprof_med = np.nanmedian(bNstack, axis=0)
bNprof_avg = np.nanmean(bNstack, axis=0)
ax1.plot(rsma_common, gNprof_med, c='b', linewidth=4.5, linestyle='-',
label='non-BCG Med')
ax1.plot(rsma_common, gNprof_avg, c='b', linewidth=4.5, linestyle='--',
label='non-BCG Avg')
ax1.plot(rsma_common, bNprof_med, c='r', linewidth=4.5, linestyle='-',
label='BCG Med')
ax1.plot(rsma_common, bNprof_avg, c='r', linewidth=4.5, linestyle='--',
label='BCG Avg')
ax1.text(0.30, 0.90, '$11.4 < \log (M_{\mathrm{SBP}}) < 11.6$',
verticalalignment='bottom', horizontalalignment='left',
fontsize=30.0, transform=ax1.transAxes)
ax1.text(0.30, 0.83, 'Normalized at 10 kpc',
verticalalignment='bottom', horizontalalignment='left',
fontsize=30.0, transform=ax1.transAxes)
ax1.set_xlabel('$R^{1/4}$ (Kpc)', size=32)
ax1.set_ylabel('$\log ({\mu}_{\star}/[M_{\odot} Kpc^{-2}])$', size=36)
ax1.set_xlim(0.5, 4.1)
ax1.set_ylim(-4.1, 2.09)
for tick in ax1.xaxis.get_major_ticks():
tick.label.set_fontsize(30)
for tick in ax1.yaxis.get_major_ticks():
tick.label.set_fontsize(30)
ax1.spines['top'].set_linewidth(3.5)
ax1.spines['right'].set_linewidth(3.5)
ax1.spines['bottom'].set_linewidth(3.5)
ax1.spines['left'].set_linewidth(3.5)
In [189]:
rsma_common = np.arange(0.4, 4.1, 0.1)
fig = plt.figure(figsize=(12, 12))
fig.subplots_adjust(left=0.1, right=0.95, bottom=0.15)
ax1 = fig.add_subplot(111)
# 100 Kpc
ax1.axvline(3.20, linewidth=5.0, c='k', linestyle='dashed')
# z = 0.2 : 1"=3.3 Kpc
ax1.axvline(3.3 ** 0.25, linewidth=8.0, c='g', linestyle='dashed', alpha=0.2)
# z = 0.4 : 1"=5.4 Kpc
ax1.axvline(5.4 ** 0.25, linewidth=8.0, c='k', linestyle='solid', alpha=0.2)
with ProgressBar(len(gama1), ipython_widget=True) as bar:
try:
del gCstack
except Exception:
pass
for g in gama1:
gProf = Table.read(os.path.join(gamaDir, g['sum_tab'].replace('./', '')).strip())
gCNorm = normProf(gProf['rKpc'], (gProf['muI1'] - gProf['muG1']), 10.0, 12.0)
ax1.plot((gProf['rKpc']**0.25), gCNorm, c='c',
alpha=0.15, linewidth=1.5)
intrpFunc = interp1d((gProf['rKpc']**0.25), gCNorm,
kind='linear')
try:
gCprof_intrp = intrpFunc(rsma_common)
except Exception:
print("## GAMA :BAD INTERPOLATION FOR %i" % g['ISEDFIT_ID'])
continue
try:
gCstack = np.vstack((gCstack, gCprof_intrp))
except NameError:
gCstack = gCprof_intrp
bar.update()
with ProgressBar(len(bcg1), ipython_widget=True) as bar:
try:
del bCstack
except Exception:
pass
for b in bcg1:
bProf = Table.read(os.path.join(bcgDir, b['sum_tab'].replace('./', '')).strip())
bCNorm = normProf(bProf['rKpc'], (bProf['muI1'] - bProf['muG1']), 10.0, 12.0)
ax1.plot((bProf['rKpc']**0.25), bCNorm, c='orange',
alpha=0.8, linewidth=2.5)
intrpFunc = interp1d((bProf['rKpc']**0.25), bCNorm,
kind='linear')
try:
bCprof_intrp = intrpFunc(rsma_common)
except Exception:
print("## BCG :BAD INTERPOLATION FOR %i" % b['ID_CLUSTER'])
continue
try:
bCstack = np.vstack((bCstack, bCprof_intrp))
except NameError:
bCstack = bCprof_intrp
bar.update()
# Median & Average profiles
gCprof_med = np.nanmedian(gCstack, axis=0)
gCprof_avg = np.nanmean(gCstack, axis=0)
bCprof_med = np.nanmedian(bCstack, axis=0)
bCprof_avg = np.nanmean(bCstack, axis=0)
ax1.plot(rsma_common, gCprof_med, c='b', linewidth=4.5, linestyle='-',
label='non-BCG Med')
ax1.plot(rsma_common, gCprof_avg, c='b', linewidth=4.5, linestyle='--',
label='non-BCG Avg')
ax1.plot(rsma_common, bCprof_med, c='r', linewidth=4.5, linestyle='-',
label='BCG Med')
ax1.plot(rsma_common, bCprof_avg, c='r', linewidth=4.5, linestyle='--',
label='BCG Avg')
ax1.text(0.30, 0.90, '$11.4 < \log (M_{\mathrm{SBP}}) < 11.6$',
verticalalignment='bottom', horizontalalignment='left',
fontsize=30.0, transform=ax1.transAxes)
ax1.text(0.30, 0.83, 'Normalized at 10 kpc',
verticalalignment='bottom', horizontalalignment='left',
fontsize=30.0, transform=ax1.transAxes)
ax1.set_xlabel('$R^{1/4}$ (Kpc)', size=32)
ax1.set_ylabel('($g-i$) (mag)', size=36)
ax1.set_xlim(0.5, 4.1)
ax1.set_ylim(-0.6, 0.5)
for tick in ax1.xaxis.get_major_ticks():
tick.label.set_fontsize(30)
for tick in ax1.yaxis.get_major_ticks():
tick.label.set_fontsize(30)
ax1.spines['top'].set_linewidth(3.5)
ax1.spines['right'].set_linewidth(3.5)
ax1.spines['bottom'].set_linewidth(3.5)
ax1.spines['left'].set_linewidth(3.5)
In [190]:
rsma_common = np.arange(0.4, 4.1, 0.1)
fig = plt.figure(figsize=(12, 12))
fig.subplots_adjust(left=0.1, right=0.95, bottom=0.15)
ax1 = fig.add_subplot(111)
ax1.axhline(0.00, linewidth=4.0, c='k', linestyle='solid', alpha=0.4)
# 100 Kpc
ax1.axvline(3.20, linewidth=5.0, c='k', linestyle='dashed')
# z = 0.2 : 1"=3.3 Kpc
ax1.axvline(3.3 ** 0.25, linewidth=8.0, c='g', linestyle='dashed', alpha=0.2)
# z = 0.4 : 1"=5.4 Kpc
ax1.axvline(5.4 ** 0.25, linewidth=8.0, c='k', linestyle='solid', alpha=0.2)
with ProgressBar(len(gama1), ipython_widget=True) as bar:
try:
del gGstack
except Exception:
pass
for g in gama1:
gProf = Table.read(os.path.join(gamaDir, g['sum_tab'].replace('./', '')).strip())
gGrowth = (gProf['lumI1'] - g['ilum_100'])
ax1.plot((gProf['rKpc']**0.25), gGrowth, c='c',
alpha=0.15, linewidth=1.5)
intrpFunc = interp1d((gProf['rKpc']**0.25), gGrowth,
kind='linear')
try:
gGrowth_intrp = intrpFunc(rsma_common)
except Exception:
print("## GAMA :BAD INTERPOLATION FOR %i" % g['ISEDFIT_ID'])
continue
try:
gGstack = np.vstack((gGstack, gGrowth_intrp))
except NameError:
gGstack = gGrowth_intrp
bar.update()
with ProgressBar(len(bcg1), ipython_widget=True) as bar:
try:
del bGstack
except Exception:
pass
for b in bcg1:
bProf = Table.read(os.path.join(bcgDir, b['sum_tab'].replace('./', '')).strip())
bGrowth = (bProf['lumI1'] - b['ilum_100'])
ax1.plot((bProf['rKpc']**0.25), bGrowth, c='orange',
alpha=0.8, linewidth=2.5)
intrpFunc = interp1d((bProf['rKpc']**0.25), bGrowth,
kind='linear')
try:
bGrowth_intrp = intrpFunc(rsma_common)
except Exception:
print("## BCG :BAD INTERPOLATION FOR %i" % b['ID_CLUSTER'])
continue
try:
bGstack = np.vstack((bGstack, bGrowth_intrp))
except NameError:
bGstack = bGrowth_intrp
bar.update()
# Median & Average profiles
gGprof_med = np.nanmedian(gGstack, axis=0)
gGprof_avg = np.nanmean(gGstack, axis=0)
bGprof_med = np.nanmedian(bGstack, axis=0)
bGprof_avg = np.nanmean(bGstack, axis=0)
ax1.plot(rsma_common, gGprof_med, c='b', linewidth=4.5, linestyle='-',
label='non-BCG Med')
ax1.plot(rsma_common, gGprof_avg, c='b', linewidth=4.5, linestyle='--',
label='non-BCG Avg')
ax1.plot(rsma_common, bGprof_med, c='r', linewidth=4.5, linestyle='-',
label='BCG Med')
ax1.plot(rsma_common, bGprof_avg, c='r', linewidth=4.5, linestyle='--',
label='BCG Avg')
ax1.text(0.30, 0.90, '$11.4 < \log (M_{\mathrm{SBP}}) < 11.6$',
verticalalignment='bottom', horizontalalignment='left',
fontsize=30.0, transform=ax1.transAxes)
ax1.set_xlabel('$R^{1/4}$ (Kpc)', size=32)
ax1.set_ylabel('Nomalized Curve of Growth', size=32)
ax1.set_xlim(0.5, 4.3)
ax1.set_ylim(-3.0, 0.49)
for tick in ax1.xaxis.get_major_ticks():
tick.label.set_fontsize(30)
for tick in ax1.yaxis.get_major_ticks():
tick.label.set_fontsize(30)
ax1.spines['top'].set_linewidth(3.5)
ax1.spines['right'].set_linewidth(3.5)
ax1.spines['bottom'].set_linewidth(3.5)
ax1.spines['left'].set_linewidth(3.5)
In [199]:
rsma_common = np.arange(0.4, 4.1, 0.1)
fig = plt.figure(figsize=(12, 12))
fig.subplots_adjust(left=0.1, right=0.95, bottom=0.15)
ax1 = fig.add_subplot(111)
ax1.axhline(0.00, linewidth=4.0, c='k', linestyle='solid', alpha=0.4)
# 100 Kpc
ax1.axvline(3.20, linewidth=5.0, c='k', linestyle='dashed')
# z = 0.2 : 1"=3.3 Kpc
ax1.axvline(3.3 ** 0.25, linewidth=8.0, c='g', linestyle='dashed', alpha=0.2)
# z = 0.4 : 1"=5.4 Kpc
ax1.axvline(5.4 ** 0.25, linewidth=8.0, c='k', linestyle='solid', alpha=0.2)
with ProgressBar(len(gama1), ipython_widget=True) as bar:
try:
del gLstack
except Exception:
pass
for g in gama1:
gProf = Table.read(os.path.join(gamaDir, g['sum_tab'].replace('./', '')).strip())
gLprof = (gProf['lumI1'] + g['logm2l_i'])
ax1.plot((gProf['rKpc']**0.25), gLprof, c='c',
alpha=0.15, linewidth=1.5)
intrpFunc = interp1d((gProf['rKpc']**0.25), gLprof,
kind='linear')
try:
gLprof_intrp = intrpFunc(rsma_common)
except Exception:
print("## GAMA :BAD INTERPOLATION FOR %i" % g['ISEDFIT_ID'])
continue
try:
gLstack = np.vstack((gLstack, gLprof_intrp))
except NameError:
gLstack = gLprof_intrp
bar.update()
with ProgressBar(len(bcg1), ipython_widget=True) as bar:
try:
del bLstack
except Exception:
pass
for b in bcg1:
bProf = Table.read(os.path.join(bcgDir, b['sum_tab'].replace('./', '')).strip())
bLprof = (bProf['lumI1'] + b['logm2l_i'])
ax1.plot((bProf['rKpc']**0.25), bLprof, c='orange',
alpha=0.8, linewidth=2.5)
intrpFunc = interp1d((bProf['rKpc']**0.25), bLprof,
kind='linear')
try:
bLprof_intrp = intrpFunc(rsma_common)
except Exception:
print("## BCG :BAD INTERPOLATION FOR %i" % b['ID_CLUSTER'])
continue
try:
bLstack = np.vstack((bLstack, bLprof_intrp))
except NameError:
bLstack = bLprof_intrp
bar.update()
# Median & Average profiles
gLprof_med = np.nanmedian(gLstack, axis=0)
gLprof_avg = np.nanmean(gLstack, axis=0)
bLprof_med = np.nanmedian(bLstack, axis=0)
bLprof_avg = np.nanmean(bLstack, axis=0)
ax1.plot(rsma_common, gLprof_med, c='b', linewidth=4.5, linestyle='-',
label='non-BCG Med')
ax1.plot(rsma_common, gLprof_avg, c='b', linewidth=4.5, linestyle='--',
label='non-BCG Avg')
ax1.plot(rsma_common, bLprof_med, c='r', linewidth=4.5, linestyle='-',
label='BCG Med')
ax1.plot(rsma_common, bLprof_avg, c='r', linewidth=4.5, linestyle='--',
label='BCG Avg')
ax1.text(0.30, 0.90, '$11.4 < \log (M_{\mathrm{SBP}}) < 11.6$',
verticalalignment='bottom', horizontalalignment='left',
fontsize=30.0, transform=ax1.transAxes)
ax1.set_xlabel('$R^{1/4}$ (Kpc)', size=32)
ax1.set_ylabel('Nomalized Curve of Growth', size=32)
ax1.set_xlim(0.5, 4.3)
ax1.set_ylim(8.5, 12.09)
for tick in ax1.xaxis.get_major_ticks():
tick.label.set_fontsize(30)
for tick in ax1.yaxis.get_major_ticks():
tick.label.set_fontsize(30)
ax1.spines['top'].set_linewidth(3.5)
ax1.spines['right'].set_linewidth(3.5)
ax1.spines['bottom'].set_linewidth(3.5)
ax1.spines['left'].set_linewidth(3.5)
In [192]:
rsma_common = np.arange(0.4, 4.1, 0.1)
fig = plt.figure(figsize=(12, 12))
fig.subplots_adjust(left=0.1, right=0.95, bottom=0.15)
ax1 = fig.add_subplot(111)
# 100 Kpc
ax1.axvline(3.20, linewidth=5.0, c='k', linestyle='dashed')
# z = 0.2 : 1"=3.3 Kpc
ax1.axvline(3.3 ** 0.25, linewidth=8.0, c='g', linestyle='dashed', alpha=0.2)
# z = 0.4 : 1"=5.4 Kpc
ax1.axvline(5.4 ** 0.25, linewidth=8.0, c='k', linestyle='solid', alpha=0.2)
with ProgressBar(len(gama2), ipython_widget=True) as bar:
try:
del gMstack
except Exception:
pass
for g in gama2:
gProf = Table.read(os.path.join(gamaDir, g['sum_tab'].replace('./', '')).strip())
ax1.plot((gProf['rKpc']**0.25), (gProf['muI1'] + g['logm2l_i']), c='c',
alpha=0.15, linewidth=1.5)
intrpFunc = interp1d((gProf['rKpc']**0.25), (gProf['muI1'] + g['logm2l_i']),
kind='linear')
try:
gMprof_intrp = intrpFunc(rsma_common)
except Exception:
print("## GAMA: BAD INTERPOLATION FOR %i" % g['ISEDFIT_ID'])
continue
try:
gMstack = np.vstack((gMstack, gMprof_intrp))
except NameError:
gMstack = gMprof_intrp
bar.update()
with ProgressBar(len(bcg2), ipython_widget=True) as bar:
try:
del bMstack
except Exception:
pass
for b in bcg2:
bProf = Table.read(os.path.join(bcgDir, b['sum_tab'].replace('./', '')).strip())
ax1.plot((bProf['rKpc']**0.25), (bProf['muI1'] + b['logm2l_i']), c='orange',
alpha=0.8, linewidth=2.5)
intrpFunc = interp1d((bProf['rKpc']**0.25), (bProf['muI1'] + b['logm2l_i']),
kind='linear')
try:
bMprof_intrp = intrpFunc(rsma_common)
except Exception:
print("## BCG: BAD INTERPOLATION FOR %i" % b['ID_CLUSTER'])
continue
try:
bMstack = np.vstack((bMstack, bMprof_intrp))
except NameError:
bMstack = bMprof_intrp
bar.update()
# Median & Average profiles
gMprof_med = np.nanmedian(gMstack, axis=0)
gMprof_avg = np.nanmean(gMstack, axis=0)
bMprof_med = np.nanmedian(bMstack, axis=0)
bMprof_avg = np.nanmean(bMstack, axis=0)
ax1.plot(rsma_common, gMprof_med, c='b', linewidth=4.5, linestyle='-',
label='non-BCG Med')
ax1.plot(rsma_common, gMprof_avg, c='b', linewidth=4.5, linestyle='--',
label='non-BCG Avg')
ax1.plot(rsma_common, bMprof_med, c='r', linewidth=4.5, linestyle='-',
label='BCG Med')
ax1.plot(rsma_common, bMprof_avg, c='r', linewidth=4.5, linestyle='--',
label='BCG Avg')
ax1.text(0.30, 0.90, '$11.6 < \log (M_{\mathrm{SBP}}) < 11.8$',
verticalalignment='bottom', horizontalalignment='left',
fontsize=30.0, transform=ax1.transAxes)
ax1.set_xlabel('$R^{1/4}$ (Kpc)', size=32)
ax1.set_ylabel('$log ({\mu}_{\star}/[M_{\odot} Kpc^{-2}])$', size=36)
ax1.set_xlim(0.5, 4.1)
ax1.set_ylim(4.4, 10.4)
for tick in ax1.xaxis.get_major_ticks():
tick.label.set_fontsize(30)
for tick in ax1.yaxis.get_major_ticks():
tick.label.set_fontsize(30)
ax1.spines['top'].set_linewidth(3.5)
ax1.spines['right'].set_linewidth(3.5)
ax1.spines['bottom'].set_linewidth(3.5)
ax1.spines['left'].set_linewidth(3.5)
In [193]:
fig = plt.figure(figsize=(12, 12))
fig.subplots_adjust(left=0.1, right=0.95, bottom=0.15)
ax1 = fig.add_subplot(111)
# 100 Kpc
ax1.axvline(3.20, linewidth=5.0, c='k', linestyle='dashed')
# z = 0.2 : 1"=3.3 Kpc
ax1.axvline(3.3 ** 0.25, linewidth=8.0, c='g', linestyle='dashed', alpha=0.2)
# z = 0.4 : 1"=5.4 Kpc
ax1.axvline(5.4 ** 0.25, linewidth=8.0, c='k', linestyle='solid', alpha=0.2)
with ProgressBar(len(gama2), ipython_widget=True) as bar:
try:
del gNstack
except Exception:
pass
for g in gama2:
gProf = Table.read(os.path.join(gamaDir, g['sum_tab'].replace('./', '')).strip())
gNorm = normProf(gProf['rKpc'], (gProf['muI1'] + g['logm2l_i']), 10.0, 12.0)
ax1.plot((gProf['rKpc']**0.25), gNorm, c='c',
alpha=0.15, linewidth=1.0)
intrpFunc = interp1d((gProf['rKpc']**0.25), gNorm,
kind='linear')
try:
gNprof_intrp = intrpFunc(rsma_common)
except Exception:
print("## GAMA : BAD INTERPOLATION FOR %i" % g['ISEDFIT_ID'])
continue
try:
gNstack = np.vstack((gNstack, gNprof_intrp))
except NameError:
gNstack = gNprof_intrp
bar.update()
with ProgressBar(len(bcg2), ipython_widget=True) as bar:
try:
del bNstack
except Exception:
pass
for b in bcg2:
bProf = Table.read(os.path.join(bcgDir, b['sum_tab'].replace('./', '')).strip())
bNorm = normProf(bProf['rKpc'], (bProf['muI1'] + b['logm2l_i']), 10.0, 12.0)
ax1.plot((bProf['rKpc']**0.25), bNorm, c='orange',
alpha=0.8, linewidth=2.5)
intrpFunc = interp1d((bProf['rKpc']**0.25), bNorm,
kind='linear')
try:
bNprof_intrp = intrpFunc(rsma_common)
except Exception:
print("## GAMA : BAD INTERPOLATION FOR %i" % b['ID_CLUSTER'])
continue
try:
bNstack = np.vstack((bNstack, bNprof_intrp))
except NameError:
bNstack = bNprof_intrp
bar.update()
# Median & Average profiles
gNprof_med = np.nanmedian(gNstack, axis=0)
gNprof_avg = np.nanmean(gNstack, axis=0)
bNprof_med = np.nanmedian(bNstack, axis=0)
bNprof_avg = np.nanmean(bNstack, axis=0)
ax1.plot(rsma_common, gNprof_med, c='b', linewidth=4.5, linestyle='-',
label='non-BCG Med')
ax1.plot(rsma_common, gNprof_avg, c='b', linewidth=4.5, linestyle='--',
label='non-BCG Avg')
ax1.plot(rsma_common, bNprof_med, c='r', linewidth=4.5, linestyle='-',
label='BCG Med')
ax1.plot(rsma_common, bNprof_avg, c='r', linewidth=4.5, linestyle='--',
label='BCG Avg')
ax1.text(0.30, 0.90, '$11.6 < \log (M_{\mathrm{SBP}}) < 11.8$',
verticalalignment='bottom', horizontalalignment='left',
fontsize=30.0, transform=ax1.transAxes)
ax1.text(0.30, 0.83, 'Normalized at 10 kpc',
verticalalignment='bottom', horizontalalignment='left',
fontsize=30.0, transform=ax1.transAxes)
ax1.set_xlabel('$R^{1/4}$ (Kpc)', size=32)
ax1.set_ylabel('$\log ({\mu}_{\star}/[M_{\odot} Kpc^{-2}])$', size=36)
ax1.set_xlim(0.5, 4.1)
ax1.set_ylim(-4.1, 2.09)
for tick in ax1.xaxis.get_major_ticks():
tick.label.set_fontsize(30)
for tick in ax1.yaxis.get_major_ticks():
tick.label.set_fontsize(30)
ax1.spines['top'].set_linewidth(3.5)
ax1.spines['right'].set_linewidth(3.5)
ax1.spines['bottom'].set_linewidth(3.5)
ax1.spines['left'].set_linewidth(3.5)
In [194]:
fig = plt.figure(figsize=(12, 12))
fig.subplots_adjust(left=0.1, right=0.95, bottom=0.15)
ax1 = fig.add_subplot(111)
# 100 Kpc
ax1.axvline(3.20, linewidth=5.0, c='k', linestyle='dashed')
# z = 0.2 : 1"=3.3 Kpc
ax1.axvline(3.3 ** 0.25, linewidth=8.0, c='g', linestyle='dashed', alpha=0.2)
# z = 0.4 : 1"=5.4 Kpc
ax1.axvline(5.4 ** 0.25, linewidth=8.0, c='k', linestyle='solid', alpha=0.2)
with ProgressBar(len(gama2), ipython_widget=True) as bar:
try:
del gNstack
except Exception:
pass
for g in gama2:
gProf = Table.read(os.path.join(gamaDir, g['sum_tab'].replace('./', '')).strip())
gNorm = normProf(gProf['rKpc'], (gProf['muI1'] + g['logm2l_i']), 13.0, 17.0)
ax1.plot((gProf['rKpc']**0.25), gNorm, c='c',
alpha=0.15, linewidth=1.0)
intrpFunc = interp1d((gProf['rKpc']**0.25), gNorm,
kind='linear')
try:
gNprof_intrp = intrpFunc(rsma_common)
except Exception:
print("## GAMA : BAD INTERPOLATION FOR %i" % g['ISEDFIT_ID'])
continue
try:
gNstack = np.vstack((gNstack, gNprof_intrp))
except NameError:
gNstack = gNprof_intrp
bar.update()
with ProgressBar(len(bcg2), ipython_widget=True) as bar:
try:
del bNstack
except Exception:
pass
for b in bcg2:
bProf = Table.read(os.path.join(bcgDir, b['sum_tab'].replace('./', '')).strip())
bNorm = normProf(bProf['rKpc'], (bProf['muI1'] + b['logm2l_i']), 13.0, 17.0)
ax1.plot((bProf['rKpc']**0.25), bNorm, c='orange',
alpha=0.8, linewidth=2.5)
intrpFunc = interp1d((bProf['rKpc']**0.25), bNorm,
kind='linear')
try:
bNprof_intrp = intrpFunc(rsma_common)
except Exception:
print("## BCG : BAD INTERPOLATION FOR %i" % b['ID_CLUSTER'])
continue
try:
bNstack = np.vstack((bNstack, bNprof_intrp))
except NameError:
bNstack = bNprof_intrp
bar.update()
# Median & Average profiles
gNprof_med = np.nanmedian(gNstack, axis=0)
gNprof_avg = np.nanmean(gNstack, axis=0)
bNprof_med = np.nanmedian(bNstack, axis=0)
bNprof_avg = np.nanmean(bNstack, axis=0)
ax1.plot(rsma_common, gNprof_med, c='b', linewidth=4.5, linestyle='-',
label='non-BCG Med')
ax1.plot(rsma_common, gNprof_avg, c='b', linewidth=4.5, linestyle='--',
label='non-BCG Avg')
ax1.plot(rsma_common, bNprof_med, c='r', linewidth=4.5, linestyle='-',
label='BCG Med')
ax1.plot(rsma_common, bNprof_avg, c='r', linewidth=4.5, linestyle='--',
label='BCG Avg')
ax1.text(0.30, 0.90, '$11.6 < \log (M_{\mathrm{SBP}}) < 11.8$',
verticalalignment='bottom', horizontalalignment='left',
fontsize=30.0, transform=ax1.transAxes)
ax1.text(0.30, 0.83, 'Normalized at 15 kpc',
verticalalignment='bottom', horizontalalignment='left',
fontsize=30.0, transform=ax1.transAxes)
ax1.set_xlabel('$R^{1/4}$ (Kpc)', size=32)
ax1.set_ylabel('$\log ({\mu}_{\star}/[M_{\odot} Kpc^{-2}])$', size=36)
ax1.set_xlim(0.5, 4.1)
ax1.set_ylim(-3.8, 2.39)
for tick in ax1.xaxis.get_major_ticks():
tick.label.set_fontsize(30)
for tick in ax1.yaxis.get_major_ticks():
tick.label.set_fontsize(30)
ax1.spines['top'].set_linewidth(3.5)
ax1.spines['right'].set_linewidth(3.5)
ax1.spines['bottom'].set_linewidth(3.5)
ax1.spines['left'].set_linewidth(3.5)
In [195]:
rsma_common = np.arange(0.4, 4.1, 0.1)
fig = plt.figure(figsize=(12, 12))
fig.subplots_adjust(left=0.1, right=0.95, bottom=0.15)
ax1 = fig.add_subplot(111)
# 100 Kpc
ax1.axvline(3.20, linewidth=5.0, c='k', linestyle='dashed')
# z = 0.2 : 1"=3.3 Kpc
ax1.axvline(3.3 ** 0.25, linewidth=8.0, c='g', linestyle='dashed', alpha=0.2)
# z = 0.4 : 1"=5.4 Kpc
ax1.axvline(5.4 ** 0.25, linewidth=8.0, c='k', linestyle='solid', alpha=0.2)
with ProgressBar(len(gama2), ipython_widget=True) as bar:
try:
del gCstack
except Exception:
pass
for g in gama2:
gProf = Table.read(os.path.join(gamaDir, g['sum_tab'].replace('./', '')).strip())
gCNorm = normProf(gProf['rKpc'], (gProf['muI1'] - gProf['muG1']), 10.0, 12.0)
ax1.plot((gProf['rKpc']**0.25), gCNorm, c='c',
alpha=0.15, linewidth=1.5)
intrpFunc = interp1d((gProf['rKpc']**0.25), gCNorm,
kind='linear')
try:
gCprof_intrp = intrpFunc(rsma_common)
except Exception:
print("## GAMA : BAD INTERPOLATION FOR %i" % g['ISEDFIT_ID'])
continue
try:
gCstack = np.vstack((gCstack, gCprof_intrp))
except NameError:
gCstack = gCprof_intrp
bar.update()
with ProgressBar(len(bcg2), ipython_widget=True) as bar:
try:
del bCstack
except Exception:
pass
for b in bcg2:
bProf = Table.read(os.path.join(bcgDir, b['sum_tab'].replace('./', '')).strip())
bCNorm = normProf(bProf['rKpc'], (bProf['muI1'] - bProf['muG1']), 10.0, 12.0)
ax1.plot((bProf['rKpc']**0.25), bCNorm, c='orange',
alpha=0.8, linewidth=2.5)
intrpFunc = interp1d((bProf['rKpc']**0.25), bCNorm,
kind='linear')
try:
bCprof_intrp = intrpFunc(rsma_common)
except Exception:
print("## BCG : BAD INTERPOLATION FOR %i" % b['ID_CLUSTER'])
continue
try:
bCstack = np.vstack((bCstack, bCprof_intrp))
except NameError:
bCstack = bCprof_intrp
bar.update()
# Median & Average profiles
gCprof_med = np.nanmedian(gCstack, axis=0)
gCprof_avg = np.nanmean(gCstack, axis=0)
bCprof_med = np.nanmedian(bCstack, axis=0)
bCprof_avg = np.nanmean(bCstack, axis=0)
ax1.plot(rsma_common, gCprof_med, c='b', linewidth=4.5, linestyle='-',
label='non-BCG Med')
ax1.plot(rsma_common, gCprof_avg, c='b', linewidth=4.5, linestyle='--',
label='non-BCG Avg')
ax1.plot(rsma_common, bCprof_med, c='r', linewidth=4.5, linestyle='-',
label='BCG Med')
ax1.plot(rsma_common, bCprof_avg, c='r', linewidth=4.5, linestyle='--',
label='BCG Avg')
ax1.text(0.30, 0.90, '$11.6 < \log (M_{\mathrm{SBP}}) < 11.8$',
verticalalignment='bottom', horizontalalignment='left',
fontsize=30.0, transform=ax1.transAxes)
ax1.text(0.30, 0.83, 'Normalized at 10 kpc',
verticalalignment='bottom', horizontalalignment='left',
fontsize=30.0, transform=ax1.transAxes)
ax1.set_xlabel('$R^{1/4}$ (Kpc)', size=32)
ax1.set_ylabel('($g-i$) (mag)', size=36)
ax1.set_xlim(0.5, 4.1)
ax1.set_ylim(-0.6, 0.5)
for tick in ax1.xaxis.get_major_ticks():
tick.label.set_fontsize(30)
for tick in ax1.yaxis.get_major_ticks():
tick.label.set_fontsize(30)
ax1.spines['top'].set_linewidth(3.5)
ax1.spines['right'].set_linewidth(3.5)
ax1.spines['bottom'].set_linewidth(3.5)
ax1.spines['left'].set_linewidth(3.5)
In [196]:
rsma_common = np.arange(0.4, 4.1, 0.1)
fig = plt.figure(figsize=(12, 12))
fig.subplots_adjust(left=0.1, right=0.95, bottom=0.15)
ax1 = fig.add_subplot(111)
ax1.axhline(0.00, linewidth=4.0, c='k', linestyle='solid', alpha=0.4)
# 100 Kpc
ax1.axvline(3.20, linewidth=5.0, c='k', linestyle='dashed')
# z = 0.2 : 1"=3.3 Kpc
ax1.axvline(3.3 ** 0.25, linewidth=8.0, c='g', linestyle='dashed', alpha=0.2)
# z = 0.4 : 1"=5.4 Kpc
ax1.axvline(5.4 ** 0.25, linewidth=8.0, c='k', linestyle='solid', alpha=0.2)
with ProgressBar(len(gama2), ipython_widget=True) as bar:
try:
del gGstack
except Exception:
pass
for g in gama2:
gProf = Table.read(os.path.join(gamaDir, g['sum_tab'].replace('./', '')).strip())
gGrowth = (gProf['lumI1'] - g['ilum_max'])
ax1.plot((gProf['rKpc']**0.25), gGrowth, c='c',
alpha=0.15, linewidth=1.5)
intrpFunc = interp1d((gProf['rKpc']**0.25), gGrowth,
kind='linear')
try:
gGrowth_intrp = intrpFunc(rsma_common)
except Exception:
print("## GAMA : BAD INTERPOLATION FOR %i" % g['ISEDFIT_ID'])
continue
try:
gGstack = np.vstack((gGstack, gGrowth_intrp))
except NameError:
gGstack = gGrowth_intrp
bar.update()
with ProgressBar(len(bcg2), ipython_widget=True) as bar:
try:
del bGstack
except Exception:
pass
for b in bcg2:
bProf = Table.read(os.path.join(bcgDir, b['sum_tab'].replace('./', '')).strip())
bGrowth = (bProf['lumI1'] - b['ilum_max'])
ax1.plot((bProf['rKpc']**0.25), bGrowth, c='orange',
alpha=0.8, linewidth=2.5)
intrpFunc = interp1d((bProf['rKpc']**0.25), bGrowth,
kind='linear')
try:
bGrowth_intrp = intrpFunc(rsma_common)
except Exception:
print("## BCG : BAD INTERPOLATION FOR %i" % b['ID_CLUSTER'])
continue
try:
bGstack = np.vstack((bGstack, bGrowth_intrp))
except NameError:
bGstack = bGrowth_intrp
bar.update()
# Median & Average profiles
gGprof_med = np.nanmedian(gGstack, axis=0)
gGprof_avg = np.nanmean(gGstack, axis=0)
bGprof_med = np.nanmedian(bGstack, axis=0)
bGprof_avg = np.nanmean(bGstack, axis=0)
ax1.plot(rsma_common, gGprof_med, c='b', linewidth=4.5, linestyle='-',
label='non-BCG Med')
ax1.plot(rsma_common, gGprof_avg, c='b', linewidth=4.5, linestyle='--',
label='non-BCG Avg')
ax1.plot(rsma_common, bGprof_med, c='r', linewidth=4.5, linestyle='-',
label='BCG Med')
ax1.plot(rsma_common, bGprof_avg, c='r', linewidth=4.5, linestyle='--',
label='BCG Avg')
ax1.text(0.30, 0.90, '$11.6 < \log (M_{\mathrm{SBP}}) < 11.8$',
verticalalignment='bottom', horizontalalignment='left',
fontsize=30.0, transform=ax1.transAxes)
ax1.set_xlabel('$R^{1/4}$ (Kpc)', size=32)
ax1.set_ylabel('Nomalized Curve of Growth', size=32)
ax1.set_xlim(0.5, 4.1)
ax1.set_ylim(-3.0, 0.49)
for tick in ax1.xaxis.get_major_ticks():
tick.label.set_fontsize(30)
for tick in ax1.yaxis.get_major_ticks():
tick.label.set_fontsize(30)
ax1.spines['top'].set_linewidth(3.5)
ax1.spines['right'].set_linewidth(3.5)
ax1.spines['bottom'].set_linewidth(3.5)
ax1.spines['left'].set_linewidth(3.5)
In [201]:
rsma_common = np.arange(0.4, 4.1, 0.1)
fig = plt.figure(figsize=(12, 12))
fig.subplots_adjust(left=0.1, right=0.95, bottom=0.15)
ax1 = fig.add_subplot(111)
ax1.axhline(0.00, linewidth=4.0, c='k', linestyle='solid', alpha=0.4)
# 100 Kpc
ax1.axvline(3.20, linewidth=5.0, c='k', linestyle='dashed')
# z = 0.2 : 1"=3.3 Kpc
ax1.axvline(3.3 ** 0.25, linewidth=8.0, c='g', linestyle='dashed', alpha=0.2)
# z = 0.4 : 1"=5.4 Kpc
ax1.axvline(5.4 ** 0.25, linewidth=8.0, c='k', linestyle='solid', alpha=0.2)
with ProgressBar(len(gama2), ipython_widget=True) as bar:
try:
del gLstack
except Exception:
pass
for g in gama2:
gProf = Table.read(os.path.join(gamaDir, g['sum_tab'].replace('./', '')).strip())
gLprof = (gProf['lumI1'] + g['logm2l_i'])
ax1.plot((gProf['rKpc']**0.25), gLprof, c='c',
alpha=0.15, linewidth=1.5)
intrpFunc = interp1d((gProf['rKpc']**0.25), gLprof,
kind='linear')
try:
gLprof_intrp = intrpFunc(rsma_common)
except Exception:
print("## GAMA :BAD INTERPOLATION FOR %i" % g['ISEDFIT_ID'])
continue
try:
gLstack = np.vstack((gLstack, gLprof_intrp))
except NameError:
gLstack = gLprof_intrp
bar.update()
with ProgressBar(len(bcg2), ipython_widget=True) as bar:
try:
del bLstack
except Exception:
pass
for b in bcg2:
bProf = Table.read(os.path.join(bcgDir, b['sum_tab'].replace('./', '')).strip())
bLprof = (bProf['lumI1'] + b['logm2l_i'])
ax1.plot((bProf['rKpc']**0.25), bLprof, c='orange',
alpha=0.6, linewidth=2.5)
intrpFunc = interp1d((bProf['rKpc']**0.25), bLprof,
kind='linear')
try:
bLprof_intrp = intrpFunc(rsma_common)
except Exception:
print("## BCG :BAD INTERPOLATION FOR %i" % b['ID_CLUSTER'])
continue
try:
bLstack = np.vstack((bLstack, bLprof_intrp))
except NameError:
bLstack = bLprof_intrp
bar.update()
# Median & Average profiles
gLprof_med = np.nanmedian(gLstack, axis=0)
gLprof_avg = np.nanmean(gLstack, axis=0)
bLprof_med = np.nanmedian(bLstack, axis=0)
bLprof_avg = np.nanmean(bLstack, axis=0)
ax1.plot(rsma_common, gLprof_med, c='b', linewidth=4.5, linestyle='-',
label='non-BCG Med')
ax1.plot(rsma_common, gLprof_avg, c='b', linewidth=4.5, linestyle='--',
label='non-BCG Avg')
ax1.plot(rsma_common, bLprof_med, c='r', linewidth=4.5, linestyle='-',
label='BCG Med')
ax1.plot(rsma_common, bLprof_avg, c='r', linewidth=4.5, linestyle='--',
label='BCG Avg')
ax1.text(0.30, 0.90, '$11.6 < \log (M_{\mathrm{SBP}}) < 11.8$',
verticalalignment='bottom', horizontalalignment='left',
fontsize=30.0, transform=ax1.transAxes)
ax1.set_xlabel('$R^{1/4}$ (Kpc)', size=32)
ax1.set_ylabel('Nomalized Curve of Growth', size=32)
ax1.set_xlim(0.5, 4.3)
ax1.set_ylim(8.5, 12.19)
for tick in ax1.xaxis.get_major_ticks():
tick.label.set_fontsize(30)
for tick in ax1.yaxis.get_major_ticks():
tick.label.set_fontsize(30)
ax1.spines['top'].set_linewidth(3.5)
ax1.spines['right'].set_linewidth(3.5)
ax1.spines['bottom'].set_linewidth(3.5)
ax1.spines['left'].set_linewidth(3.5)
In [202]:
rsma_common = np.arange(0.4, 4.1, 0.1)
fig = plt.figure(figsize=(12, 12))
fig.subplots_adjust(left=0.1, right=0.95, bottom=0.15)
ax1 = fig.add_subplot(111)
# 100 Kpc
ax1.axvline(3.20, linewidth=5.0, c='k', linestyle='dashed')
# z = 0.2 : 1"=3.3 Kpc
ax1.axvline(3.3 ** 0.25, linewidth=8.0, c='g', linestyle='dashed', alpha=0.2)
# z = 0.4 : 1"=5.4 Kpc
ax1.axvline(5.4 ** 0.25, linewidth=8.0, c='k', linestyle='solid', alpha=0.2)
with ProgressBar(len(gama3), ipython_widget=True) as bar:
try:
del gMstack
except Exception:
pass
for g in gama3:
gProf = Table.read(os.path.join(gamaDir, g['sum_tab'].replace('./', '')).strip())
ax1.plot((gProf['rKpc']**0.25), (gProf['muI1'] + g['logm2l_i']), c='c',
alpha=0.15, linewidth=1.5)
intrpFunc = interp1d((gProf['rKpc']**0.25), (gProf['muI1'] + g['logm2l_i']),
kind='linear')
try:
gMprof_intrp = intrpFunc(rsma_common)
except Exception:
print("## GAMA : BAD INTERPOLATION FOR %i" % g['ISEDFIT_ID'])
continue
try:
gMstack = np.vstack((gMstack, gMprof_intrp))
except NameError:
gMstack = gMprof_intrp
bar.update()
with ProgressBar(len(bcg3), ipython_widget=True) as bar:
try:
del bMstack
except Exception:
pass
for b in bcg3:
bProf = Table.read(os.path.join(bcgDir, b['sum_tab'].replace('./', '')).strip())
ax1.plot((bProf['rKpc']**0.25), (bProf['muI1'] + b['logm2l_i']), c='orange',
alpha=0.8, linewidth=2.5)
intrpFunc = interp1d((bProf['rKpc']**0.25), (bProf['muI1'] + b['logm2l_i']),
kind='linear')
try:
bMprof_intrp = intrpFunc(rsma_common)
except Exception:
print("## BCG : BAD INTERPOLATION FOR %i" % b['ID_CLUSTER'])
continue
try:
bMstack = np.vstack((bMstack, bMprof_intrp))
except NameError:
bMstack = bMprof_intrp
bar.update()
# Median & Average profiles
gMprof_med = np.nanmedian(gMstack, axis=0)
gMprof_avg = np.nanmean(gMstack, axis=0)
bMprof_med = np.nanmedian(bMstack, axis=0)
bMprof_avg = np.nanmean(bMstack, axis=0)
ax1.plot(rsma_common, gMprof_med, c='b', linewidth=4.5, linestyle='-',
label='non-BCG Med')
ax1.plot(rsma_common, gMprof_avg, c='b', linewidth=4.5, linestyle='--',
label='non-BCG Avg')
ax1.plot(rsma_common, bMprof_med, c='r', linewidth=4.5, linestyle='-',
label='BCG Med')
ax1.plot(rsma_common, bMprof_avg, c='r', linewidth=4.5, linestyle='--',
label='BCG Avg')
ax1.text(0.30, 0.90, '$11.8 < \log (M_{\mathrm{SBP}}) < 12.0$',
verticalalignment='bottom', horizontalalignment='left',
fontsize=30.0, transform=ax1.transAxes)
ax1.set_xlabel('$R^{1/4}$ (Kpc)', size=32)
ax1.set_ylabel('$log ({\mu}_{\star}/[M_{\odot} Kpc^{-2}])$', size=36)
ax1.set_xlim(0.5, 4.1)
ax1.set_ylim(4.4, 10.4)
for tick in ax1.xaxis.get_major_ticks():
tick.label.set_fontsize(30)
for tick in ax1.yaxis.get_major_ticks():
tick.label.set_fontsize(30)
ax1.spines['top'].set_linewidth(3.5)
ax1.spines['right'].set_linewidth(3.5)
ax1.spines['bottom'].set_linewidth(3.5)
ax1.spines['left'].set_linewidth(3.5)
In [203]:
fig = plt.figure(figsize=(12, 12))
fig.subplots_adjust(left=0.1, right=0.95, bottom=0.15)
ax1 = fig.add_subplot(111)
# 100 Kpc
ax1.axvline(3.20, linewidth=5.0, c='k', linestyle='dashed')
# z = 0.2 : 1"=3.3 Kpc
ax1.axvline(3.3 ** 0.25, linewidth=8.0, c='g', linestyle='dashed', alpha=0.2)
# z = 0.4 : 1"=5.4 Kpc
ax1.axvline(5.4 ** 0.25, linewidth=8.0, c='k', linestyle='solid', alpha=0.2)
with ProgressBar(len(gama3), ipython_widget=True) as bar:
try:
del gNstack
except Exception:
pass
for g in gama3:
gProf = Table.read(os.path.join(gamaDir, g['sum_tab'].replace('./', '')).strip())
gNorm = normProf(gProf['rKpc'], (gProf['muI1'] + g['logm2l_i']), 10.0, 12.0)
ax1.plot((gProf['rKpc']**0.25), gNorm, c='c',
alpha=0.15, linewidth=1.0)
intrpFunc = interp1d((gProf['rKpc']**0.25), gNorm,
kind='linear')
try:
gNprof_intrp = intrpFunc(rsma_common)
except Exception:
print("## GAMA : BAD INTERPOLATION FOR %i" % g['ISEDFIT_ID'])
continue
try:
gNstack = np.vstack((gNstack, gNprof_intrp))
except NameError:
gNstack = gNprof_intrp
bar.update()
with ProgressBar(len(bcg3), ipython_widget=True) as bar:
try:
del bNstack
except Exception:
pass
for b in bcg3:
bProf = Table.read(os.path.join(bcgDir, b['sum_tab'].replace('./', '')).strip())
bNorm = normProf(bProf['rKpc'], (bProf['muI1'] + b['logm2l_i']), 10.0, 12.0)
ax1.plot((bProf['rKpc']**0.25), bNorm, c='orange',
alpha=0.8, linewidth=2.5)
intrpFunc = interp1d((bProf['rKpc']**0.25), bNorm,
kind='linear')
try:
bNprof_intrp = intrpFunc(rsma_common)
except Exception:
print("## BCG : BAD INTERPOLATION FOR %i" % b['ID_CLUSTER'])
continue
try:
bNstack = np.vstack((bNstack, bNprof_intrp))
except NameError:
bNstack = bNprof_intrp
bar.update()
# Median & Average profiles
gNprof_med = np.nanmedian(gNstack, axis=0)
gNprof_avg = np.nanmean(gNstack, axis=0)
bNprof_med = np.nanmedian(bNstack, axis=0)
bNprof_avg = np.nanmean(bNstack, axis=0)
ax1.plot(rsma_common, gNprof_med, c='b', linewidth=4.5, linestyle='-',
label='non-BCG Med')
ax1.plot(rsma_common, gNprof_avg, c='b', linewidth=4.5, linestyle='--',
label='non-BCG Avg')
ax1.plot(rsma_common, bNprof_med, c='r', linewidth=4.5, linestyle='-',
label='BCG Med')
ax1.plot(rsma_common, bNprof_avg, c='r', linewidth=4.5, linestyle='--',
label='BCG Avg')
ax1.text(0.30, 0.90, '$11.8 < \log (M_{\mathrm{SBP}}) < 12.0$',
verticalalignment='bottom', horizontalalignment='left',
fontsize=30.0, transform=ax1.transAxes)
ax1.text(0.30, 0.83, 'Normalized at 10 kpc',
verticalalignment='bottom', horizontalalignment='left',
fontsize=30.0, transform=ax1.transAxes)
ax1.set_xlabel('$R^{1/4}$ (Kpc)', size=32)
ax1.set_ylabel('$\log ({\mu}_{\star}/[M_{\odot} Kpc^{-2}])$', size=36)
ax1.set_xlim(0.5, 4.1)
ax1.set_ylim(-4.1, 2.09)
for tick in ax1.xaxis.get_major_ticks():
tick.label.set_fontsize(30)
for tick in ax1.yaxis.get_major_ticks():
tick.label.set_fontsize(30)
ax1.spines['top'].set_linewidth(3.5)
ax1.spines['right'].set_linewidth(3.5)
ax1.spines['bottom'].set_linewidth(3.5)
ax1.spines['left'].set_linewidth(3.5)
In [204]:
fig = plt.figure(figsize=(12, 12))
fig.subplots_adjust(left=0.1, right=0.95, bottom=0.15)
ax1 = fig.add_subplot(111)
# 100 Kpc
ax1.axvline(3.20, linewidth=5.0, c='k', linestyle='dashed')
# z = 0.2 : 1"=3.3 Kpc
ax1.axvline(3.3 ** 0.25, linewidth=8.0, c='g', linestyle='dashed', alpha=0.2)
# z = 0.4 : 1"=5.4 Kpc
ax1.axvline(5.4 ** 0.25, linewidth=8.0, c='k', linestyle='solid', alpha=0.2)
with ProgressBar(len(gama3), ipython_widget=True) as bar:
try:
del gNstack
except Exception:
pass
for g in gama3:
gProf = Table.read(os.path.join(gamaDir, g['sum_tab'].replace('./', '')).strip())
gNorm = normProf(gProf['rKpc'], (gProf['muI1'] + g['logm2l_i']), 13.0, 17.0)
ax1.plot((gProf['rKpc']**0.25), gNorm, c='c',
alpha=0.15, linewidth=1.0)
intrpFunc = interp1d((gProf['rKpc']**0.25), gNorm,
kind='linear')
try:
gNprof_intrp = intrpFunc(rsma_common)
except Exception:
print("## GAMA : BAD INTERPOLATION FOR %i" % g['ISEDFIT_ID'])
continue
try:
gNstack = np.vstack((gNstack, gNprof_intrp))
except NameError:
gNstack = gNprof_intrp
bar.update()
with ProgressBar(len(bcg3), ipython_widget=True) as bar:
try:
del bNstack
except Exception:
pass
for b in bcg3:
bProf = Table.read(os.path.join(bcgDir, b['sum_tab'].replace('./', '')).strip())
bNorm = normProf(bProf['rKpc'], (bProf['muI1'] + b['logm2l_i']), 13.0, 17.0)
ax1.plot((bProf['rKpc']**0.25), bNorm, c='orange',
alpha=0.8, linewidth=2.5)
intrpFunc = interp1d((bProf['rKpc']**0.25), bNorm,
kind='linear')
try:
bNprof_intrp = intrpFunc(rsma_common)
except Exception:
print("## BCG : BAD INTERPOLATION FOR %i" % b['ID_CLUSTER'])
continue
try:
bNstack = np.vstack((bNstack, bNprof_intrp))
except NameError:
bNstack = bNprof_intrp
bar.update()
# Median & Average profiles
gNprof_med = np.nanmedian(gNstack, axis=0)
gNprof_avg = np.nanmean(gNstack, axis=0)
bNprof_med = np.nanmedian(bNstack, axis=0)
bNprof_avg = np.nanmean(bNstack, axis=0)
ax1.plot(rsma_common, gNprof_med, c='b', linewidth=4.5, linestyle='-',
label='non-BCG Med')
ax1.plot(rsma_common, gNprof_avg, c='b', linewidth=4.5, linestyle='--',
label='non-BCG Avg')
ax1.plot(rsma_common, bNprof_med, c='r', linewidth=4.5, linestyle='-',
label='BCG Med')
ax1.plot(rsma_common, bNprof_avg, c='r', linewidth=4.5, linestyle='--',
label='BCG Avg')
ax1.text(0.30, 0.90, '$11.8 < \log (M_{\mathrm{SBP}}) < 12.0$',
verticalalignment='bottom', horizontalalignment='left',
fontsize=30.0, transform=ax1.transAxes)
ax1.text(0.30, 0.83, 'Normalized at 15 kpc',
verticalalignment='bottom', horizontalalignment='left',
fontsize=30.0, transform=ax1.transAxes)
ax1.set_xlabel('$R^{1/4}$ (Kpc)', size=32)
ax1.set_ylabel('$\log ({\mu}_{\star}/[M_{\odot} Kpc^{-2}])$', size=36)
ax1.set_xlim(0.5, 4.1)
ax1.set_ylim(-3.8, 2.39)
for tick in ax1.xaxis.get_major_ticks():
tick.label.set_fontsize(30)
for tick in ax1.yaxis.get_major_ticks():
tick.label.set_fontsize(30)
ax1.spines['top'].set_linewidth(3.5)
ax1.spines['right'].set_linewidth(3.5)
ax1.spines['bottom'].set_linewidth(3.5)
ax1.spines['left'].set_linewidth(3.5)
In [205]:
rsma_common = np.arange(0.4, 4.1, 0.1)
fig = plt.figure(figsize=(12, 12))
fig.subplots_adjust(left=0.1, right=0.95, bottom=0.15)
ax1 = fig.add_subplot(111)
# 100 Kpc
ax1.axvline(3.20, linewidth=5.0, c='k', linestyle='dashed')
# z = 0.2 : 1"=3.3 Kpc
ax1.axvline(3.3 ** 0.25, linewidth=8.0, c='g', linestyle='dashed', alpha=0.2)
# z = 0.4 : 1"=5.4 Kpc
ax1.axvline(5.4 ** 0.25, linewidth=8.0, c='k', linestyle='solid', alpha=0.2)
with ProgressBar(len(gama3), ipython_widget=True) as bar:
try:
del gCstack
except Exception:
pass
for g in gama3:
gProf = Table.read(os.path.join(gamaDir, g['sum_tab'].replace('./', '')).strip())
gCNorm = normProf(gProf['rKpc'], (gProf['muI1'] - gProf['muG1']), 10.0, 12.0)
ax1.plot((gProf['rKpc']**0.25), gCNorm, c='c',
alpha=0.15, linewidth=1.5)
intrpFunc = interp1d((gProf['rKpc']**0.25), gCNorm,
kind='linear')
try:
gCprof_intrp = intrpFunc(rsma_common)
except Exception:
print("## GAMA : BAD INTERPOLATION FOR %i" % g['ISEDFIT_ID'])
continue
try:
gCstack = np.vstack((gCstack, gCprof_intrp))
except NameError:
gCstack = gCprof_intrp
bar.update()
with ProgressBar(len(bcg3), ipython_widget=True) as bar:
try:
del bCstack
except Exception:
pass
for b in bcg3:
bProf = Table.read(os.path.join(bcgDir, b['sum_tab'].replace('./', '')).strip())
bCNorm = normProf(bProf['rKpc'], (bProf['muI1'] - bProf['muG1']), 10.0, 12.0)
ax1.plot((bProf['rKpc']**0.25), bCNorm, c='orange',
alpha=0.8, linewidth=2.5)
intrpFunc = interp1d((bProf['rKpc']**0.25), bCNorm,
kind='linear')
try:
bCprof_intrp = intrpFunc(rsma_common)
except Exception:
print("## BCG : BAD INTERPOLATION FOR %i" % b['ID_CLUSTER'])
continue
try:
bCstack = np.vstack((bCstack, bCprof_intrp))
except NameError:
bCstack = bCprof_intrp
bar.update()
# Median & Average profiles
gCprof_med = np.nanmedian(gCstack, axis=0)
gCprof_avg = np.nanmean(gCstack, axis=0)
bCprof_med = np.nanmedian(bCstack, axis=0)
bCprof_avg = np.nanmean(bCstack, axis=0)
ax1.plot(rsma_common, gCprof_med, c='b', linewidth=4.5, linestyle='-',
label='non-BCG Med')
ax1.plot(rsma_common, gCprof_avg, c='b', linewidth=4.5, linestyle='--',
label='non-BCG Avg')
ax1.plot(rsma_common, bCprof_med, c='r', linewidth=4.5, linestyle='-',
label='BCG Med')
ax1.plot(rsma_common, bCprof_avg, c='r', linewidth=4.5, linestyle='--',
label='BCG Avg')
ax1.text(0.30, 0.90, '$11.8 < \log (M_{\mathrm{SBP}}) < 12.0$',
verticalalignment='bottom', horizontalalignment='left',
fontsize=30.0, transform=ax1.transAxes)
ax1.text(0.30, 0.83, 'Normalized at 10 kpc',
verticalalignment='bottom', horizontalalignment='left',
fontsize=30.0, transform=ax1.transAxes)
ax1.set_xlabel('$R^{1/4}$ (Kpc)', size=32)
ax1.set_ylabel('($g-i$) (mag)', size=36)
ax1.set_xlim(0.5, 4.1)
ax1.set_ylim(-0.6, 0.5)
for tick in ax1.xaxis.get_major_ticks():
tick.label.set_fontsize(30)
for tick in ax1.yaxis.get_major_ticks():
tick.label.set_fontsize(30)
ax1.spines['top'].set_linewidth(3.5)
ax1.spines['right'].set_linewidth(3.5)
ax1.spines['bottom'].set_linewidth(3.5)
ax1.spines['left'].set_linewidth(3.5)
In [206]:
rsma_common = np.arange(0.4, 4.1, 0.1)
fig = plt.figure(figsize=(12, 12))
fig.subplots_adjust(left=0.1, right=0.95, bottom=0.15)
ax1 = fig.add_subplot(111)
ax1.axhline(0.00, linewidth=4.0, c='k', linestyle='solid', alpha=0.4)
# 100 Kpc
ax1.axvline(3.20, linewidth=5.0, c='k', linestyle='dashed')
# z = 0.2 : 1"=3.3 Kpc
ax1.axvline(3.3 ** 0.25, linewidth=8.0, c='g', linestyle='dashed', alpha=0.2)
# z = 0.4 : 1"=5.4 Kpc
ax1.axvline(5.4 ** 0.25, linewidth=8.0, c='k', linestyle='solid', alpha=0.2)
with ProgressBar(len(gama3), ipython_widget=True) as bar:
try:
del gGstack
except Exception:
pass
for g in gama3:
gProf = Table.read(os.path.join(gamaDir, g['sum_tab'].replace('./', '')).strip())
gGrowth = (gProf['lumI1'] - g['ilum_max'])
ax1.plot((gProf['rKpc']**0.25), gGrowth, c='c',
alpha=0.15, linewidth=1.5)
intrpFunc = interp1d((gProf['rKpc']**0.25), gGrowth,
kind='linear')
try:
gGrowth_intrp = intrpFunc(rsma_common)
except Exception:
print("## GAMA : BAD INTERPOLATION FOR %i" % g['ISEDFIT_ID'])
continue
try:
gGstack = np.vstack((gGstack, gGrowth_intrp))
except NameError:
gGstack = gGrowth_intrp
bar.update()
with ProgressBar(len(bcg3), ipython_widget=True) as bar:
try:
del bGstack
except Exception:
pass
for b in bcg3:
bProf = Table.read(os.path.join(bcgDir, b['sum_tab'].replace('./', '')).strip())
bGrowth = (bProf['lumI1'] - b['ilum_max'])
ax1.plot((bProf['rKpc']**0.25), bGrowth, c='orange',
alpha=0.8, linewidth=2.5)
intrpFunc = interp1d((bProf['rKpc']**0.25), bGrowth,
kind='linear')
try:
bGrowth_intrp = intrpFunc(rsma_common)
except Exception:
print("## BCG : BAD INTERPOLATION FOR %i" % b['ID_CLUSTER'])
continue
try:
bGstack = np.vstack((bGstack, bGrowth_intrp))
except NameError:
bGstack = bGrowth_intrp
bar.update()
# Median & Average profiles
gGprof_med = np.nanmedian(gGstack, axis=0)
gGprof_avg = np.nanmean(gGstack, axis=0)
bGprof_med = np.nanmedian(bGstack, axis=0)
bGprof_avg = np.nanmean(bGstack, axis=0)
ax1.plot(rsma_common, gGprof_med, c='b', linewidth=4.5, linestyle='-',
label='non-BCG Med')
ax1.plot(rsma_common, gGprof_avg, c='b', linewidth=4.5, linestyle='--',
label='non-BCG Avg')
ax1.plot(rsma_common, bGprof_med, c='r', linewidth=4.5, linestyle='-',
label='BCG Med')
ax1.plot(rsma_common, bGprof_avg, c='r', linewidth=4.5, linestyle='--',
label='BCG Avg')
ax1.text(0.30, 0.90, '$11.8 < \log (M_{\mathrm{SBP}}) < 12.0$',
verticalalignment='bottom', horizontalalignment='left',
fontsize=30.0, transform=ax1.transAxes)
ax1.set_xlabel('$R^{1/4}$ (Kpc)', size=32)
ax1.set_ylabel('Nomalized Curve of Growth', size=32)
ax1.set_xlim(0.5, 4.1)
ax1.set_ylim(-3.0, 0.49)
for tick in ax1.xaxis.get_major_ticks():
tick.label.set_fontsize(30)
for tick in ax1.yaxis.get_major_ticks():
tick.label.set_fontsize(30)
ax1.spines['top'].set_linewidth(3.5)
ax1.spines['right'].set_linewidth(3.5)
ax1.spines['bottom'].set_linewidth(3.5)
ax1.spines['left'].set_linewidth(3.5)
In [207]:
rsma_common = np.arange(0.4, 4.1, 0.1)
fig = plt.figure(figsize=(12, 12))
fig.subplots_adjust(left=0.1, right=0.95, bottom=0.15)
ax1 = fig.add_subplot(111)
ax1.axhline(0.00, linewidth=4.0, c='k', linestyle='solid', alpha=0.4)
# 100 Kpc
ax1.axvline(3.20, linewidth=5.0, c='k', linestyle='dashed')
# z = 0.2 : 1"=3.3 Kpc
ax1.axvline(3.3 ** 0.25, linewidth=8.0, c='g', linestyle='dashed', alpha=0.2)
# z = 0.4 : 1"=5.4 Kpc
ax1.axvline(5.4 ** 0.25, linewidth=8.0, c='k', linestyle='solid', alpha=0.2)
with ProgressBar(len(gama3), ipython_widget=True) as bar:
try:
del gLstack
except Exception:
pass
for g in gama3:
gProf = Table.read(os.path.join(gamaDir, g['sum_tab'].replace('./', '')).strip())
gLprof = (gProf['lumI1'] + g['logm2l_i'])
ax1.plot((gProf['rKpc']**0.25), gLprof, c='c',
alpha=0.15, linewidth=1.5)
intrpFunc = interp1d((gProf['rKpc']**0.25), gLprof,
kind='linear')
try:
gLprof_intrp = intrpFunc(rsma_common)
except Exception:
print("## GAMA :BAD INTERPOLATION FOR %i" % g['ISEDFIT_ID'])
continue
try:
gLstack = np.vstack((gLstack, gLprof_intrp))
except NameError:
gLstack = gLprof_intrp
bar.update()
with ProgressBar(len(bcg3), ipython_widget=True) as bar:
try:
del bLstack
except Exception:
pass
for b in bcg3:
bProf = Table.read(os.path.join(bcgDir, b['sum_tab'].replace('./', '')).strip())
bLprof = (bProf['lumI1'] + b['logm2l_i'])
ax1.plot((bProf['rKpc']**0.25), bLprof, c='orange',
alpha=0.6, linewidth=2.5)
intrpFunc = interp1d((bProf['rKpc']**0.25), bLprof,
kind='linear')
try:
bLprof_intrp = intrpFunc(rsma_common)
except Exception:
print("## BCG :BAD INTERPOLATION FOR %i" % b['ID_CLUSTER'])
continue
try:
bLstack = np.vstack((bLstack, bLprof_intrp))
except NameError:
bLstack = bLprof_intrp
bar.update()
# Median & Average profiles
gLprof_med = np.nanmedian(gLstack, axis=0)
gLprof_avg = np.nanmean(gLstack, axis=0)
bLprof_med = np.nanmedian(bLstack, axis=0)
bLprof_avg = np.nanmean(bLstack, axis=0)
ax1.plot(rsma_common, gLprof_med, c='b', linewidth=4.5, linestyle='-',
label='non-BCG Med')
ax1.plot(rsma_common, gLprof_avg, c='b', linewidth=4.5, linestyle='--',
label='non-BCG Avg')
ax1.plot(rsma_common, bLprof_med, c='r', linewidth=4.5, linestyle='-',
label='BCG Med')
ax1.plot(rsma_common, bLprof_avg, c='r', linewidth=4.5, linestyle='--',
label='BCG Avg')
ax1.text(0.30, 0.90, '$11.8 < \log (M_{\mathrm{SBP}}) < 12.0$',
verticalalignment='bottom', horizontalalignment='left',
fontsize=30.0, transform=ax1.transAxes)
ax1.set_xlabel('$R^{1/4}$ (Kpc)', size=32)
ax1.set_ylabel('Nomalized Curve of Growth', size=32)
ax1.set_xlim(0.5, 4.3)
ax1.set_ylim(8.5, 12.29)
for tick in ax1.xaxis.get_major_ticks():
tick.label.set_fontsize(30)
for tick in ax1.yaxis.get_major_ticks():
tick.label.set_fontsize(30)
ax1.spines['top'].set_linewidth(3.5)
ax1.spines['right'].set_linewidth(3.5)
ax1.spines['bottom'].set_linewidth(3.5)
ax1.spines['left'].set_linewidth(3.5)
In [208]:
sma_common = np.arange(0.1, 200.0, 2.0)
fig = plt.figure(figsize=(12, 12))
fig.subplots_adjust(left=0.1, right=0.95, bottom=0.15)
ax1 = fig.add_subplot(111)
# 100 Kpc
ax1.axvline(100.0, linewidth=5.0, c='k', linestyle='dashed')
# z = 0.2 : 1"=3.3 Kpc
ax1.axvline(3.3, linewidth=8.0, c='g', linestyle='dashed', alpha=0.2)
# z = 0.4 : 1"=5.4 Kpc
ax1.axvline(5.4, linewidth=8.0, c='k', linestyle='solid', alpha=0.2)
with ProgressBar(len(gama3), ipython_widget=True) as bar:
try:
del gMstack
except Exception:
pass
for g in gama3:
gProf = Table.read(os.path.join(gamaDir, g['sum_tab'].replace('./', '')).strip())
ax1.plot(gProf['rKpc'], (gProf['muI1'] + g['logm2l_i']), c='c',
alpha=0.15, linewidth=1.5)
intrpFunc = interp1d(gProf['rKpc'], (gProf['muI1'] + g['logm2l_i']),
kind='linear')
try:
gMprof_intrp = intrpFunc(sma_common)
except Exception:
print("## GAMA : BAD INTERPOLATION FOR %i" % g['ISEDFIT_ID'])
continue
try:
gMstack = np.vstack((gMstack, gMprof_intrp))
except NameError:
gMstack = gMprof_intrp
bar.update()
with ProgressBar(len(bcg3), ipython_widget=True) as bar:
try:
del bMstack
except Exception:
pass
for b in bcg3:
bProf = Table.read(os.path.join(bcgDir, b['sum_tab'].replace('./', '')).strip())
ax1.plot(bProf['rKpc'], (bProf['muI1'] + b['logm2l_i']), c='orange',
alpha=0.8, linewidth=2.5)
intrpFunc = interp1d(bProf['rKpc'], (bProf['muI1'] + b['logm2l_i']),
kind='linear')
try:
bMprof_intrp = intrpFunc(sma_common)
except Exception:
print("## BCG : BAD INTERPOLATION FOR %i" % b['ID_CLUSTER'])
continue
try:
bMstack = np.vstack((bMstack, bMprof_intrp))
except NameError:
bMstack = bMprof_intrp
bar.update()
# Median & Average profiles
gMprof_med = np.nanmedian(gMstack, axis=0)
gMprof_avg = np.nanmean(gMstack, axis=0)
bMprof_med = np.nanmedian(bMstack, axis=0)
bMprof_avg = np.nanmean(bMstack, axis=0)
ax1.plot(sma_common, gMprof_med, c='b', linewidth=4.5, linestyle='-',
label='non-BCG Med')
ax1.plot(sma_common, gMprof_avg, c='b', linewidth=4.5, linestyle='--',
label='non-BCG Avg')
ax1.plot(sma_common, bMprof_med, c='r', linewidth=4.5, linestyle='-',
label='BCG Med')
ax1.plot(sma_common, bMprof_avg, c='r', linewidth=4.5, linestyle='--',
label='BCG Avg')
ax1.text(0.30, 0.90, '$11.8 < \log (M_{\mathrm{SBP}}) < 12.0$',
verticalalignment='bottom', horizontalalignment='left',
fontsize=30.0, transform=ax1.transAxes)
ax1.set_xlabel('$R$ (Kpc)', size=32)
ax1.set_ylabel('$log ({\mu}_{\star}/[M_{\odot} Kpc^{-2}])$', size=36)
ax1.set_xlim(0.2, 256.0)
ax1.set_ylim(4.4, 10.4)
for tick in ax1.xaxis.get_major_ticks():
tick.label.set_fontsize(30)
for tick in ax1.yaxis.get_major_ticks():
tick.label.set_fontsize(30)
ax1.spines['top'].set_linewidth(3.5)
ax1.spines['right'].set_linewidth(3.5)
ax1.spines['bottom'].set_linewidth(3.5)
ax1.spines['left'].set_linewidth(3.5)
In [ ]: