In [1]:
import absorberspec, ebossspec, sdssspec, datapath, fitsio, starburstspec
import cookb_signalsmooth as cbs
from scipy.stats import nanmean, nanmedian
import cosmology as cosmo
masterwave, allflux, allivar = ebossspec.rest_allspec_readin()
objs_ori = ebossspec.elg_readin()
nobj = objs_ori.size
galaxytype = objs_ori['CLASS']
zgood = objs_ori['zGOOD']
z = objs_ori['Z']
In [2]:
index_wave_all = searchsorted(masterwave, [1900., 7200.])
tmpflux = allflux[index_wave_all[0]:index_wave_all[1],:]
tmpivar = allivar[index_wave_all[0]:index_wave_all[1],:]
tmpwave = masterwave[index_wave_all[0]:index_wave_all[1]]
tmploglam = log10(tmpwave)
In [3]:
median_sn = zeros(objs_ori.size)
for i in arange(objs_ori.size):
iuse = (where(tmpivar[:,i]>0))[0]
median_sn[i] = median(tmpflux[iuse,i]*sqrt(tmpivar[iuse,i]))
tmpmedian = zeros(tmpwave.size)
for i in arange((tmpflux.shape)[0]):
iuse = (where(np.logical_and(np.logical_and(tmpivar[i,:]>0, zgood==1), median_sn>0)))[0]
tmpmedian[i] = median(tmpflux[i,iuse])
In [4]:
nemlines = 21
emission = zeros(nemlines, dtype=[('NAME','S10'),('XPOS','f4'),('YPOS','f4'), ('WAVE','f4')])
emission[0] = ('FeII*', 2344.-0., 0.52, 2344.)
emission[1] = ('FeII*', 2600.-25., 0.52, 2600.)
emission[2] = ('[OII]', 3727.+20., 1.75, 3727.)
emission[3] = ('[NeIII]', 3868.-100., 0.63, 3868.)
emission[4] = ('[OIII]', 4364.44-5., 0.52, 4364.44)
emission[5] = ('[OIII]', 4959.-100., 0.96, 4959.)
emission[6] = ('[OIII]', 5008.+10., 1.55, 5008.)
emission[7] = ('HeI', 5876.-55., 0.56, 5876.)
emission[8] = ('[OI]', 6302.-70., 0.51, 6302.)
emission[9] = ('[NII]', 6548.-120., 0.57, 6548.)
emission[10] = ('[NII]', 6583.-5., 0.89, 6583.)
emission[11] = ('[SII]', 6716.+20., 0.93, 6716.)
emission[12] = ('[SII]', 6730.+15, 0.68, 6730.)
emission[13] = ('[ArIII]', 7137.-100., 0.45, 7137.)
emission[14] = ('CII]', 2327.64-60., 0.60, 2327.64)
emission[15] = ('HeI', 3189.67-55., 0.41, 3189.67)
emission[16] = ('[NI]', 5200.00-55., 0.43, 5200.00)
emission[17] = ('[OI]', 6365.53-45., 0.42, 6365.53)
emission[18] = ('[SII]', 4069.75-99., 0.545, 4069.75)
nabslines = 10
absorption = zeros(nabslines, dtype=[('NAME','S20'),('XPOS','f4'),('YPOS','f4'),('WAVE', 'f4')])
absorption[0] = ('FeII', 2300.+10., 0.20, 2300.)
absorption[1] = ('FeII', 2600.-60., 0.16, 2600.)
absorption[2] = ('MgII', 2800.-60., 0.17, 2800.)
absorption[3] = ('MgI', 2853.-30., 0.24, 2853.)
#absorption[4] = ('CaII', 3934.78-180., 0.05, 3934.78)
#absorption[5] = ('K', 3934.78-25., 0.05, 3934.78)
#absorption[6] = ('H', 3969.59-10., 0.05, 3969.59)
#absorption[7] = ('MgI b', 5183.62-150., 0.15, 5183.62)
#absorption[8] = (r'NaI D$_{2,1}$', 5900.-165., 0.15, 5900.)
#absorption[9] = (r'G band', 4307.-15., 0.09, 4307.)
nstellarabs = 7
stellarabs = zeros(nstellarabs, dtype=[('NAME','S20'),('XPOS','f4'),('YPOS','f4'),('WAVE', 'f4')])
stellarabs[0] = ('CaII', 3934.78-180., 0.05, 3934.78)
stellarabs[1] = ('K', 3934.78-25., 0.05, 3934.78)
stellarabs[2] = ('H', 3969.59-10., 0.05, 3969.59)
stellarabs[3] = ('MgI b', 5183.62-150., 0.15, 5183.62)
stellarabs[4] = (r'NaI D$_{2,1}$', 5900.-165., 0.15, 5900.)
stellarabs[5] = (r'G band', 4307.-15., 0.09, 4307.)
nbalmer = 7
balmer = zeros(nbalmer, dtype=[('NAME','S10'),('XPOS','f4'),('YPOS','f4'),('WAVE', 'f4')])
balmer[0] = (r'$\alpha$', 6563.-35., 0.25, 6563.)
balmer[1] = (r'$\beta$', 4861.-35., 0.25, 4861.)
balmer[2] = (r'$\gamma$', 4341.-35., 0.265, 4341.)
balmer[3] = (r'$\delta$', 4102.-35., 0.24, 4102.)
balmer[4] = (r'$\epsilon$', 3970.-30., 0.22, 3907.)
balmer[5] = (r'$\zeta$', 3889.-28., 0.235, 3889.)
balmer[6] = (r'$\eta$', 3835.-30., 0.22, 3835.)
In [7]:
fig = figure(figsize=(24,8))
ax = fig.add_subplot(111)
minorLocator = MultipleLocator(100)
ax.xaxis.set_minor_locator(minorLocator)
ax.plot(tmpwave, tmpmedian, lw=1)
ax.set_xlim(2000, 7250)
ax.set_ylim(-0.05, 2.0)
ax.set_title('Composite Spectrum of Emission Line Galaxies (ELGs) from eBOSS', fontsize=20)
ax.set_xlabel(r'$\lambda$ [$\AA$]', fontsize=24)
ax.set_ylabel(r'$f(\lambda)$ [arbitrary unit]', fontsize=24)
#ax.set_xscale('log')
#ax.set_yscale('log')
for axis in ['top','bottom','left','right']:
ax.spines[axis].set_linewidth(3.0)
ax.tick_params(axis='both', which='minor', length=5, width=2, labelsize=20)
ax.tick_params(axis='both', which='major', length=10, width=2, labelsize=20)
#emission_name = array(['FeII*', 'FeII*', '[OII]', '[NeIII]','[OIII]', '[OIII]', 'HeI', '[OI]',
# 'NII', 'NII', 'SII', 'SII', '[ArIII]'])
#emission_xpos = array([2300., 2550., 3727., 3868., 4363., 4959., 5876., 6300.,
# 6548., 6583., 6716., 6730., 7137.])
for i in arange(nemlines):
etmp = emission[i]
ax.text(etmp['XPOS'], etmp['YPOS'], etmp['NAME'], fontsize=15, color='g')
for i in arange(nabslines):
atmp = absorption[i]
ax.text(atmp['XPOS'], atmp['YPOS'], atmp['NAME'], fontsize=15)
for i in arange(nbalmer):
btmp = balmer[i]
ax.text(btmp['XPOS'], btmp['YPOS'], btmp['NAME'], color='brown', fontsize=22)
for i in arange(nstellarabs):
stmp = stellarabs[i]
ax.text(stmp['XPOS'], stmp['YPOS'], stmp['NAME'], color='brown', fontsize=15)
ax.plot([3934.78, 3934.78], [0.115, 0.18], 'brown', lw=1) # Ca II
ax.plot([3969.59, 3969.59], [0.115, 0.18], 'brown', lw=1) # Ca II
ax.plot([5891.58, 5891.58], [0.225, 0.30], 'brown', lw=1) # Na I
ax.plot([5897.56, 5897.56], [0.225, 0.30], 'brown', lw=1) # Na I
ax.plot([4307.90, 4307.90], [0.155, 0.22], 'brown', lw=1) # G (Ca, CH+, Fe)
ax.plot([5183.62, 5183.62], [0.225, 0.30], 'brown', lw=1) # Mg I
ax.plot([5172.70, 5172.70], [0.225, 0.30], 'brown', lw=1) # Mg I
ax.plot([5167.33, 5167.33], [0.225, 0.30], 'brown', lw=1) # Mg I
ax.plot([4364.44+10., 4364.44+55], [0.44, 0.50], 'green', lw=1) # [OIII]
ax.plot([4069.75+0., 4069.75-35], [0.46, 0.52], 'green', lw=1) # [SII]
fig.savefig('/Users/Benjamin/Dropbox/Zhu_Projects/Fine Structure Emission/Version 1/Movies/eBOSS_composite_full.jpg')
#fig.savefig('/Users/Benjamin/Dropbox/Zhu_Projects/Fine Structure Emission/Version 1/eBOSS_composite_full.eps')
In [8]:
(outwave, fluxmedian, fluxmean, oiifluxmedian, oiifluxmean) = ebossspec.new_feiimgii_composite()
absorberstack = (fitsio.read('/Users/Benjamin/AstroData/Absorbers/Absorbers_Composite_Allabs_0.8AA.fits'))[0]
In [11]:
fig = figure(figsize=(24,8))
#fig.subplots_adjust(top=0.99, bottom=0.01)
this_ylim = [0.15, 1.8]
ax = fig.add_subplot(111)
minorLocator = MultipleLocator(20)
ax.xaxis.set_minor_locator(minorLocator)
dwave = median(outwave[1:]-outwave[:-1])
ax.plot(outwave+dwave/2., fluxmedian, 'b', drawstyle='steps', linewidth=1)
ax.set_ylim(this_ylim)
ax.set_xlim(2200, 2900)
ax.set_xlabel(r'$\lambda$ [$\AA$]', fontsize=24)
ax.set_ylabel(r'Normalized $f(\lambda)$', fontsize=24)
for axis in ['top','bottom','left','right']:
ax.spines[axis].set_linewidth(2.0)
ax.tick_params(axis='both', which='minor', length=5, width=2, labelsize=24)
ax.tick_params(axis='both', which='major', length=10, width=2, labelsize=24)
#ax.text(2205, 1.90, 'Blue: Emission Line Galaxies at 0.6<z<1.2 (eBOSS 2015)', color='b', fontsize=18, fontname='serif')
#ax.text(2205, 1.83, r'Red: Quasar Absorption-line Systems at 0.4<z<2.2 (Zhu & Menard 2013)', color='r', fontsize=18, fontname='serif')
this_nabslines = 13
this_absorption = zeros(this_nabslines, dtype=[('NAME','S20'),('XPOS','f4'),('YPOS','f4'),('WAVE', 'f4')])
this_absorption[0] = ('FeII 2249.88', 2249.88-8.5, 0.25, 2249.88)
this_absorption[1] = ('FeII 2260.78', 2260.78+2.5, 0.25, 2260.78)
this_absorption[2] = ('FeII 2344.21', 2344.21+2.5, 0.25, 2344.21)
this_absorption[3] = ('FeII 2374.46', 2374.46-8.5, 0.25, 2374.46)
this_absorption[4] = ('FeII 2382.76', 2382.76+2.5, 0.25, 2382.76)
#this_absorption[5] = ('MnII 2576.88', 2576.88-3, 0.2, 2576.88)
this_absorption[6] = ('FeII 2586.65', 2586.65-8.5, 0.23, 2586.65)
#this_absorption[7] = ('MnII 2594.50', 2594.50-3, 0.2, 2594.50)
this_absorption[8] = ('FeII 2600.17', 2600.17+2.5, 0.23, 2600.17)
#this_absorption[9] = ('MnII 2606.46', 2606.46+1.5, 0.2, 2606.46)
this_absorption[10] = ('MgII 2796.35', 2796.35-10.5, 0.25, 2796.35)
this_absorption[11] = ('MgII 2803.53', 2803.53+3.5, 0.25, 2803.53)
this_absorption[12] = ('MgI 2852.96', 2852.96+3.5, 0.25, 2852.96)
this_nemlines = 11
this_emission = zeros(this_nemlines, dtype=[('NAME','S25'),('XPOS','f4'),('YPOS','f4'), ('WAVE','f4')])
this_emission[0] = ('CII] doublet', 2324.21-9.0, 1.37, 2324.21)
this_emission[1] = ('CII]* triplet', 2328.83+2.5, 1.37, 2328.83)
#this_emission[2] = ('', 2328.83+2.5, 1.11, 2328.83)
this_emission[3] = ('FeII* 2365.55', 2365.55-8.5, 1.35, 2365.55)
this_emission[4] = ('FeII* 2396.36', 2396.36+2.5, 1.35, 2396.36)
this_emission[5] = ('FeII* 2626.45', 2626.45+2.5, 1.35, 2626.45)
this_emission[6] = ('FeII* 2612.65', 2612.65-8.5, 1.35, 2612.65)
#this_emission[7] = ('[NeIV] doublet+FeIII', 2422.56-9.5, 1.2, 2422.56)
this_emission[7] = ('[NeIV] doublet', 2422.56-9.5, 1.35, 2422.56)
this_emission[8] = ('2422.56 2425.14', 2425.14+2.5, 1.33, 2425.14)
this_emission[9] = ('[OII] doublet', 2470.97-9.5, 1.35, 2470.97)
this_emission[10] = ('2470.97 2471.09', 2471.09+2.5, 1.335, 2471.09)
#this_emission[5] = ('FeII* 2632.11', 2632.11+2.5, 1.3, 2632.11)
#this_emission[5] = ('FeII* 2467.98', 2467.98+2.5, 1.3, 2467.98)
this_nstellarabs = 2
this_stellarabs = zeros(this_nstellarabs, dtype=[('NAME','S20'),('XPOS','f4'),('YPOS','f4'), ('WAVE','f4')])
this_stellarabs[0] = ('CIII 2297.58', 2297.58+2.5, 0.48, 2297.58)
#this_stellarabs[1] = ('CoI 2295.87', 2295.87+2.5, 0.48, 2295.87)
#for i in arange(this_nabslines):
# atmp = this_absorption[i]
# ax.text(atmp['XPOS'], atmp['YPOS'], atmp['NAME'], fontsize=16, rotation='vertical',va='bottom')
# ax.plot([atmp['WAVE'], atmp['WAVE']], [1.0, this_ylim[0]], '--k', linewidth=2)
#for i in arange(this_nemlines):
# etmp = this_emission[i]
# ax.text(etmp['XPOS'], etmp['YPOS'], etmp['NAME'], color='g', rotation='vertical',va='bottom', fontsize=16)
# ax.plot([etmp['WAVE'], etmp['WAVE']], [1.0, this_ylim[1]], '--g', linewidth=2)
#for i in arange(this_nstellarabs):
# atmp = this_stellarabs[i]
# ax.text(atmp['XPOS'], atmp['YPOS'], atmp['NAME'], fontsize=16, rotation='vertical',va='bottom', color='brown')
# ax.plot([atmp['WAVE'], atmp['WAVE']], [0.43, 0.85], '-', color='brown')
# MnII
#ax.plot([2576.88-0., 2576.88-0], [1, 0.53], '--k', lw=2)
#ax.text(2576.88-9.5, 0.545, 'MnII 2576.88', fontsize=16, rotation='vertical',va='bottom')
#ax.plot([2594.50-0., 2594.50-0.], [this_ylim[0], 1.48], '--k', lw=2)
#ax.text(2594.50-9.5, 1.1, 'MnII 2594.50', fontsize=16, rotation='vertical',va='bottom')
#ax.plot([2606.46-0., 2606.46-0.], [1, 0.53], '--k', lw=2)
#ax.text(2606.46+2.5, 0.545, 'MnII 2606.46', fontsize=16, rotation='vertical',va='bottom')
#ax.text(2328.83+2.0, 1.17, '2326.11 2327.64 2328.83', color='g', rotation='vertical',va='bottom', fontsize=12)
# Replot
ax.plot(outwave+dwave/2., fluxmedian, 'b', drawstyle='steps', linewidth=1.5)
yabs = 1.-(1.-absorberstack['FLUXMEDIAN'])*2.
fig.savefig('/Users/Benjamin/Dropbox/Zhu_Projects/Fine Structure Emission/Version 1/Movies/eBOSS_composite_withqsoabsorbers_0.jpg')
ax.plot(absorberstack['WAVE'], yabs, 'r', linewidth=2)
fig.savefig('/Users/Benjamin/Dropbox/Zhu_Projects/Fine Structure Emission/Version 1/Movies/eBOSS_composite_withqsoabsorbers_1.jpg')
In [16]:
(sboutwave, sbfluxmean, sbfluxmedian, sbfluxused) = starburstspec.mgii_composite()
In [221]:
fig = figure(figsize=(24,8))
this_ylim = [0.15, 1.8]
ax = fig.add_subplot(111)
minorLocator = MultipleLocator(5)
ax.xaxis.set_minor_locator(minorLocator)
dwave = median(outwave[1:]-outwave[:-1])
ax.plot(outwave+dwave/2., fluxmedian, 'b', drawstyle='steps', linewidth=1)
ax.set_ylim(this_ylim)
ax.set_xlim(2230, 2415)
#ax.set_title('Composite Spectrum of Emission Line Galaxies (ELGs) from eBOSS', fontsize=15)
ax.set_xlabel(r'$\lambda$ [$\AA$]', fontsize=24)
ax.set_ylabel(r'Normalized $f(\lambda)$', fontsize=24)
for axis in ['top','bottom','left','right']:
ax.spines[axis].set_linewidth(2.0)
ax.tick_params(axis='both', which='minor', length=5, width=2, labelsize=20)
ax.tick_params(axis='both', which='major', length=10, width=2, labelsize=20)
this_nabslines = 6
this_absorption = zeros(this_nabslines, dtype=[('NAME','S20'),('XPOS','f4'),('YPOS','f4'),('WAVE', 'f4')])
this_absorption[0] = ('FeII 2249.88', 2249.88-5, 0.2, 2249.88)
this_absorption[1] = ('FeII 2260.78', 2260.78+1.5, 0.2, 2260.78)
this_absorption[2] = ('FeII 2344.21', 2344.21+1.5, 0.2, 2344.21)
this_absorption[3] = ('FeII 2374.46', 2374.46+1.5, 0.2, 2374.46)
this_absorption[4] = ('FeII 2382.76', 2382.76+1.5, 0.2, 2382.76)
#this_absorption[5] = ('CIII 2297.58', 2297.58+1.5, 0.2, 2297.58)
this_nemlines = 7
this_emission = zeros(this_nemlines, dtype=[('NAME','S25'),('XPOS','f4'),('YPOS','f4'), ('WAVE','f4')])
this_emission[0] = ('CII] doublet', 2324.21-3.0, 1.37, 2324.21)
this_emission[1] = ('', 2325.40-9.0, 1.3, 2325.40)
this_emission[2] = ('CII]* triplet', 2326.11+4.0, 1.37, 2326.11)
this_emission[3] = ('', 2327.64-9.0, 1.3, 2327.64)
this_emission[4] = ('', 2328.83+2.5, 1.3, 2328.83)
#this_emission[2] = ('2326.11 2327.64 2328.83', 2328.83+2.5, 1.03, 2328.83)
this_emission[5] = ('FeII* 2396.36', 2396.36+1., 1.3, 2396.36)
this_emission[6] = ('FeII* 2365.55', 2365.55+1., 1.3, 2365.55)
this_nstellarabs = 1
this_stellarabs = zeros(this_nstellarabs, dtype=[('NAME','S20'),('XPOS','f4'),('YPOS','f4'), ('WAVE','f4')])
this_stellarabs[0] = ('CIII 2297.58', 2297.58+2.5, 0.48, 2297.58)
#this_emission[2] = ('FeII* 2632.11', 2632.11+10., 1.2, 2632.11)
for i in arange(this_nabslines):
atmp = this_absorption[i]
ax.text(atmp['XPOS'], atmp['YPOS'], atmp['NAME'], fontsize=16, rotation='vertical',va='bottom')
ax.plot([atmp['WAVE'], atmp['WAVE']], [1, this_ylim[0]], '--k', lw=2)
for i in arange(this_nemlines):
etmp = this_emission[i]
ax.text(etmp['XPOS'], etmp['YPOS'], etmp['NAME'], color='g', rotation='vertical',va='bottom', fontsize=16)
ax.plot([etmp['WAVE'], etmp['WAVE']], [1, this_ylim[1]], '--g', linewidth=2)
for i in arange(this_nstellarabs):
atmp = this_stellarabs[i]
ax.text(atmp['XPOS'], atmp['YPOS'], atmp['NAME'], fontsize=16, rotation='vertical',va='bottom', color='brown')
ax.plot([atmp['WAVE'], atmp['WAVE']], [0.43, 0.85], '-', color='brown', lw=1)
# Replot
ax.plot(outwave+dwave/2., fluxmedian, 'b', drawstyle='steps', linewidth=2.0)
yabs = 1.-(1.-absorberstack['FLUXMEDIAN'])*2.
ax.plot(absorberstack['WAVE'], yabs, 'r', linewidth=2)
fig.savefig('/Users/Benjamin/Dropbox/Zhu_Projects/Fine Structure Emission/Version 1/eBOSS_composite_withqsoabsorbers_2350.eps')
In [14]:
fig = figure(figsize=(24,8))
this_ylim = [0.15, 1.8]
ax = fig.add_subplot(111)
minorLocator = MultipleLocator(2)
ax.xaxis.set_minor_locator(minorLocator)
dwave = median(outwave[1:]-outwave[:-1])
ax.plot(outwave+dwave/2., fluxmedian, 'b', drawstyle='steps', linewidth=1)
ax.set_ylim(this_ylim)
ax.set_xlim(2560, 2640)
#ax.set_title('Composite Spectrum of Emission Line Galaxies (ELGs) from eBOSS', fontsize=15)
ax.set_xlabel(r'$\lambda$ [$\AA$]', fontsize=24)
ax.set_ylabel(r'Normalized $f(\lambda)$', fontsize=24)
for axis in ['top','bottom','left','right']:
ax.spines[axis].set_linewidth(3.0)
ax.tick_params(axis='both', which='minor', length=5, width=2, labelsize=24)
ax.tick_params(axis='both', which='major', length=10, width=2, labelsize=24)
this_nabslines = 5
this_absorption = zeros(this_nabslines, dtype=[('NAME','S20'),('XPOS','f4'),('YPOS','f4'),('WAVE', 'f4')])
this_absorption[0] = ('MnII 2576.88', 2576.88-3, 0.2, 2576.88)
this_absorption[1] = ('FeII 2586.65', 2586.65-3, 0.2, 2586.65)
this_absorption[2] = ('MnII 2594.50', 2594.50-3, 0.2, 2594.50)
this_absorption[3] = ('FeII 2600.17', 2600.17+1.5, 0.2, 2600.17)
this_absorption[4] = ('MnII 2606.46', 2606.46+1.5, 0.2, 2606.46)
this_nemlines = 3
this_emission = zeros(this_nemlines, dtype=[('NAME','S20'),('XPOS','f4'),('YPOS','f4'), ('WAVE','f4')])
this_emission[0] = ('FeII* 2626.45', 2626.45+1.5, 1.3, 2626.45)
this_emission[1] = ('FeII* 2612.65', 2612.65+1.5, 1.3, 2612.65)
#this_emission[2] = ('FeII* 2632.11', 2632.11+10., 1.2, 2632.11)
for i in arange(this_nabslines):
atmp = this_absorption[i]
ax.text(atmp['XPOS'], atmp['YPOS'], atmp['NAME'], fontsize=16, rotation='vertical',va='bottom')
ax.plot([atmp['WAVE'], atmp['WAVE']], [1, this_ylim[0]], '--k', lw=2)
for i in arange(this_nemlines):
etmp = this_emission[i]
ax.text(etmp['XPOS'], etmp['YPOS'], etmp['NAME'], color='g', rotation='vertical',va='bottom', fontsize=16)
ax.plot([etmp['WAVE'], etmp['WAVE']], [1,this_ylim[1]], '--g', linewidth=2)
# Replot
ax.plot(outwave+dwave/2., fluxmedian, 'b', drawstyle='steps', linewidth=3)
fig.savefig('/Users/Benjamin/Dropbox/Zhu_Projects/Fine Structure Emission/Version 1/Movies/eBOSS_composite_withqsoabsorbers_2600_0.jpg')
yabs = 1.-(1.-absorberstack['FLUXMEDIAN'])*2.
ax.plot(absorberstack['WAVE'], yabs, 'r', linewidth=3)
fig.savefig('/Users/Benjamin/Dropbox/Zhu_Projects/Fine Structure Emission/Version 1/Movies/eBOSS_composite_withqsoabsorbers_2600_1.jpg')
In [209]:
fig = figure(figsize=(24,8))
this_ylim = [0.15, 1.8]
ax = fig.add_subplot(111)
minorLocator = MultipleLocator(2)
ax.xaxis.set_minor_locator(minorLocator)
dwave = median(outwave[1:]-outwave[:-1])
ax.plot(outwave+dwave/2., fluxmedian, 'b', drawstyle='steps', linewidth=1)
ax.set_ylim(this_ylim)
ax.set_xlim(2760, 2870)
#ax.set_title('Composite Spectrum of Emission Line Galaxies (ELGs) from eBOSS', fontsize=15)
ax.set_xlabel(r'$\lambda$ [$\AA$]', fontsize=24)
ax.set_ylabel(r'Normalized $f(\lambda)$', fontsize=24)
for axis in ['top','bottom','left','right']:
ax.spines[axis].set_linewidth(2.0)
ax.tick_params(axis='both', which='minor', length=5, width=2, labelsize=20)
ax.tick_params(axis='both', which='major', length=10, width=2, labelsize=20)
this_nabslines = 3
this_absorption = zeros(this_nabslines, dtype=[('NAME','S20'),('XPOS','f4'),('YPOS','f4'),('WAVE', 'f4')])
this_absorption[0] = ('MgII 2796.35', 2796.35-4., 0.2, 2796.35)
this_absorption[1] = ('MgII 2803.53', 2803.53+1.5, 0.2, 2803.53)
this_absorption[2] = ('MgI 2852.96', 2852.96+1.5, 0.21, 2852.96)
for i in arange(this_nabslines):
atmp = this_absorption[i]
ax.text(atmp['XPOS'], atmp['YPOS'], atmp['NAME'], fontsize=16, rotation='vertical',va='bottom')
ax.plot([atmp['WAVE'], atmp['WAVE']], [this_ylim[0],this_ylim[1]], '--k', lw=2)
#plot([2344.21, 2344.21], [0.25, 1.25], 'g')
#plot([2374.46, 2374.46], [0.25, 1.25], 'g')
#plot([2382.77, 2382.77], [0.25, 1.25], 'g')
#plot([2365.55, 2365.55], [0.25, 1.25], 'r')
#plot([2396.35, 2396.35], [0.25, 1.25], 'r')
# Replot
ax.plot(outwave+dwave/2., fluxmedian, 'b', drawstyle='steps', linewidth=2)
yabs = 1.-(1.-absorberstack['FLUXMEDIAN'])
ax.plot(absorberstack['WAVE'], yabs, 'r', linewidth=2)
fig.savefig('/Users/Benjamin/Dropbox/Zhu_Projects/Fine Structure Emission/Version 1/eBOSS_composite_withqsoabsorbers_2800.eps')
In [208]:
fig = figure(figsize=(24,8))
ax = fig.add_subplot(111)
minorLocator = MultipleLocator(20)
ax.xaxis.set_minor_locator(minorLocator)
dwave = median(outwave[1:]-outwave[:-1])
ax.plot(outwave+dwave/2., oiifluxmedian, 'b', drawstyle='steps', linewidth=1)
this_ylim = [0.15, 2.29]
ax.set_ylim(this_ylim)
ax.set_xlim(3000, 4000)
#ax.set_title('Composite Spectrum of Emission Line Galaxies (ELGs) from eBOSS', fontsize=15)
ax.set_xlabel(r'$\lambda$ [$\AA$]', fontsize=24)
ax.set_ylabel(r'Normalized $f(\lambda)$', fontsize=24)
for axis in ['top','bottom','left','right']:
ax.spines[axis].set_linewidth(2.0)
ax.tick_params(axis='both', which='minor', length=5, width=2, labelsize=20)
ax.tick_params(axis='both', which='major', length=10, width=2, labelsize=20)
this_nabslines = 8
this_absorption = zeros(this_nabslines, dtype=[('NAME','S20'),('XPOS','f4'),('YPOS','f4'),('WAVE', 'f4')])
this_absorption[0] = ('TiII 3067.24', 3067.24-18., 0.22, 3067.24)
this_absorption[1] = ('TiII 3073.86', 3073.86+10., 0.22, 3073.86)
#this_absorption[2] = ('AlI 3083.05', 3083.05+1.5, 0.23, 3083.05)
this_absorption[3] = ('TiII 3230.12', 3230.12-18., 0.23, 3230.12)
this_absorption[4] = ('TiII 3242.92', 3242.92+10., 0.23, 3242.92)
this_absorption[5] = ('TiII 3384.73', 3384.73+10., 0.23, 3384.73)
#this_absorption[6] = ('CaII 3934.78', 3934.78-30., 0.23, 3934.78)
#this_absorption[7] = ('CaII 3969.59', 3969.59+10., 0.23, 3969.59)
this_nemlines = 4
this_emission = zeros(this_nemlines, dtype=[('NAME','S20'),('XPOS','f4'),('YPOS','f4'), ('WAVE','f4')])
this_emission[0] = ('[OII] 3727.10', 3727.1-23., 1.42+0.3, 3727.1)
this_emission[1] = ('[OII] 3729.86', 3729.8+10., 1.42+0.3, 3729.9)
this_emission[2] = ('[NeIII] 3869.77', 3869.77+6., 1.4+0.35, 3869.77)
this_emission[3] = ('HeI 3189.67', 3189.67+10., 1.4+0.3, 3189.67)
this_nbalmer = 11
this_balmer = zeros(this_nbalmer, dtype=[('NAME','S10'),('XPOS','f4'),('YPOS','f4'),('WAVE', 'f4')])
#this_balmer[0] = (r'$\alpha$', 6563.-35., 0.25, 6563.)
#this_balmer[1] = (r'$\beta$', 4861.-35., 0.25, 4861.)
#this_balmer[2] = (r'$\gamma$', 4341.-35., 0.265, 4341.)
#this_balmer[3] = (r'$\delta$', 4102.-35., 0.24, 4102.)
this_balmer[4] = (r'$\epsilon$', 3970.+12., 0.9+0.08, 3907.)
this_balmer[5] = (r'$\zeta$', 3889.-8., 0.85+0.08, 3889.)
this_balmer[6] = (r'$\eta$', 3835.38-8., 0.75+0.08, 3835.38)
this_balmer[7] = (r'$\theta$', 3797.90-8., 0.8+0.08, 3797.90)
this_balmer[8] = (r'$\iota$', 3770.63-6., 0.82+0.08, 3770.63)
this_balmer[9] = (r'$\kappa$', 3750.15-8., 0.77+0.08, 3750.15)
#this_balmer[10] = (r'break', 3647.15-10., 0.77, 3647.15)
this_nstellarabs = 3
this_stellarabs = zeros(this_nstellarabs, dtype=[('NAME','S20'),('XPOS','f4'),('YPOS','f4'), ('WAVE','f4')])
this_stellarabs[0] = ('CaII 3934.78', 3934.78-18., 0.23, 3934.78)
this_stellarabs[1] = ('CaII 3969.59', 3969.59+10., 0.23, 3969.59)
#this_stellarabs[2] = (r'Balmer break', 3647.15-10., 0.23, 3647.00)
for i in arange(this_nabslines):
atmp = this_absorption[i]
ax.text(atmp['XPOS'], atmp['YPOS'], atmp['NAME'], fontsize=16, rotation='vertical',va='bottom')
ax.plot([atmp['WAVE'], atmp['WAVE']], [1.1, this_ylim[0]], '--k', lw=2)
for i in arange(this_nbalmer):
btmp = this_balmer[i]
ax.text(btmp['XPOS'], btmp['YPOS'], btmp['NAME'], color='brown', fontsize=24)
for i in arange(this_nemlines):
etmp = this_emission[i]
ax.text(etmp['XPOS'], etmp['YPOS'], etmp['NAME'], color='g', rotation='vertical',va='bottom', fontsize=16)
ax.plot([etmp['WAVE'], etmp['WAVE']], [1, this_ylim[1]], '--g', linewidth=1)
for i in arange(this_nstellarabs):
atmp = this_stellarabs[i]
ax.text(atmp['XPOS'], atmp['YPOS'], atmp['NAME'], fontsize=16, rotation='vertical',va='bottom', color='brown')
ax.plot([atmp['WAVE'], atmp['WAVE']], [1, this_ylim[0]], '-', color='brown', lw=1)
# Replot
ax.plot(outwave+dwave/2., oiifluxmedian, 'b', drawstyle='steps', linewidth=1.5)
yabs = 1.-(1.-absorberstack['FLUXMEDIAN'])*20.+0.26
ax.plot(absorberstack['WAVE'], yabs, 'r', linewidth=2)
fig.savefig('/Users/Benjamin/Dropbox/Zhu_Projects/Fine Structure Emission/Version 1/eBOSS_composite_withqsoabsorbers2.eps')
In [200]:
Out[200]:
In [201]:
In [18]:
fig = figure(figsize=(24,8))
this_ylim = [0.15, 1.8]
ax = fig.add_subplot(111)
minorLocator = MultipleLocator(20)
ax.xaxis.set_minor_locator(minorLocator)
dwave = median(outwave[1:]-outwave[:-1])
ax.plot(outwave+dwave/2., fluxmedian, 'b', drawstyle='steps', linewidth=1)
ax.set_ylim(this_ylim)
ax.set_xlim(2200, 2900)
#ax.set_title('Composite Spectrum of Emission Line Galaxies (ELGs) from eBOSS', fontsize=15)
ax.set_xlabel(r'$\lambda$ [$\AA$]', fontsize=24)
ax.set_ylabel(r'Normalized $f(\lambda)$', fontsize=24)
for axis in ['top','bottom','left','right']:
ax.spines[axis].set_linewidth(3.0)
ax.tick_params(axis='both', which='minor', length=5, width=2, labelsize=20)
ax.tick_params(axis='both', which='major', length=10, width=2, labelsize=20)
#ax.text(2205, 1.90, 'Blue: Emission Line Galaxies at 0.6<z<1.0 (eBOSS 2015)', color='b', fontsize=18, fontname='serif')
#ax.text(2205, 1.83, 'Red: Local Star-burst Regions at z~0 (Leitherer 2011)', color='r', fontsize=18, fontname='serif')
#plot([2299., 2299.], this_ylim, 'k')
#plot([2297., 2297.], [0.6,0.85], 'k')
this_nabslines = 13
this_absorption = zeros(this_nabslines, dtype=[('NAME','S20'),('XPOS','f4'),('YPOS','f4'),('WAVE', 'f4')])
this_absorption[0] = ('FeII 2249.88', 2249.88-8.5, 0.2, 2249.88)
this_absorption[1] = ('FeII 2260.78', 2260.78+2.5, 0.2, 2260.78)
this_absorption[2] = ('FeII 2344.21', 2344.21+2.5, 0.2, 2344.21)
this_absorption[3] = ('FeII 2374.46', 2374.46-8.5, 0.2, 2374.46)
this_absorption[4] = ('FeII 2382.76', 2382.76+2.5, 0.2, 2382.76)
#this_absorption[5] = ('MnII 2576.88', 2576.88-3, 0.2, 2576.88)
this_absorption[6] = ('FeII 2586.65', 2586.65-8.5, 0.18, 2586.65)
#this_absorption[7] = ('MnII 2594.50', 2594.50-3, 0.2, 2594.50)
this_absorption[8] = ('FeII 2600.17', 2600.17+2.5, 0.18, 2600.17)
#this_absorption[9] = ('MnII 2606.46', 2606.46+1.5, 0.2, 2606.46)
this_absorption[10] = ('MgII 2796.35', 2796.35-10.5, 0.2, 2796.35)
this_absorption[11] = ('MgII 2803.53', 2803.53+3.5, 0.2, 2803.53)
this_absorption[12] = ('MgI 2852.96', 2852.96+3.5, 0.21, 2852.96)
this_nemlines = 11
this_emission = zeros(this_nemlines, dtype=[('NAME','S25'),('XPOS','f4'),('YPOS','f4'), ('WAVE','f4')])
this_emission[0] = ('CII] doublet', 2324.21-9.0, 1.37, 2324.21)
this_emission[1] = ('CII]* triplet', 2328.83+2.5, 1.37, 2328.83)
#this_emission[2] = ('', 2328.83+2.5, 1.11, 2328.83)
this_emission[3] = ('FeII* 2365.55', 2365.55-8.5, 1.35, 2365.55)
this_emission[4] = ('FeII* 2396.36', 2396.36+2.5, 1.35, 2396.36)
this_emission[5] = ('FeII* 2626.45', 2626.45+2.5, 1.35, 2626.45)
this_emission[6] = ('FeII* 2612.65', 2612.65-8.5, 1.35, 2612.65)
#this_emission[7] = ('[NeIV] doublet+FeIII', 2422.56-9.5, 1.2, 2422.56)
this_emission[7] = ('[NeIV] doublet', 2422.56-9.5, 1.35, 2422.56)
this_emission[8] = ('2422.56 2425.14', 2425.14+2.5, 1.33, 2425.14)
this_emission[9] = ('[OII] doublet', 2470.97-9.5, 1.35, 2470.97)
this_emission[10] = ('2470.97 2471.09', 2471.09+2.5, 1.335, 2471.09)
this_nstellarabs = 1
this_stellarabs = zeros(this_nstellarabs, dtype=[('NAME','S20'),('XPOS','f4'),('YPOS','f4'), ('WAVE','f4')])
this_stellarabs[0] = ('CIII 2297.58', 2297.58+2.5, 0.48, 2297.58)
# Replot
ax.plot(outwave+dwave/2., fluxmedian, 'b', drawstyle='steps', linewidth=1)
fig.savefig('/Users/Benjamin/Dropbox/Zhu_Projects/Fine Structure Emission/Version 1/Movies/eBOSS_composite_withlocalsfsb_0.jpg')
ax.plot(sboutwave, sbfluxmedian, 'r', linewidth=2)
fig.savefig('/Users/Benjamin/Dropbox/Zhu_Projects/Fine Structure Emission/Version 1/Movies/eBOSS_composite_withlocalsfsb_1.jpg')
for i in arange(this_nabslines):
atmp = this_absorption[i]
ax.text(atmp['XPOS'], atmp['YPOS'], atmp['NAME'], fontsize=16, rotation='vertical',va='bottom')
ax.plot([atmp['WAVE'], atmp['WAVE']], [this_ylim[0], 1.0], '--k', linewidth=2)
for i in arange(this_nemlines):
etmp = this_emission[i]
ax.text(etmp['XPOS'], etmp['YPOS'], etmp['NAME'], color='g', rotation='vertical',va='bottom', fontsize=16)
ax.plot([etmp['WAVE'], etmp['WAVE']], [1.0, this_ylim[1]], '--g', linewidth=2)
for i in arange(this_nstellarabs):
atmp = this_stellarabs[i]
ax.text(atmp['XPOS'], atmp['YPOS'], atmp['NAME'], fontsize=16, rotation='vertical',va='bottom', color='brown')
ax.plot([atmp['WAVE'], atmp['WAVE']], [0.43, 0.85], '-', color='brown')
# MnII
ax.plot([2576.88-0., 2576.88-0], [1, 0.53], '--k', lw=2)
ax.text(2576.88-9.5, 0.545, 'MnII 2576.88', fontsize=16, rotation='vertical',va='bottom')
ax.plot([2594.50-0., 2594.50-0.], [this_ylim[0], 1.48], '--k', lw=2)
ax.text(2594.50-9.5, 1.1, 'MnII 2594.50', fontsize=16, rotation='vertical',va='bottom')
ax.plot([2606.46-0., 2606.46-0.], [1, 0.53], '--k', lw=2)
ax.text(2606.46+2.5, 0.545, 'MnII 2606.46', fontsize=16, rotation='vertical',va='bottom')
fig.savefig('/Users/Benjamin/Dropbox/Zhu_Projects/Fine Structure Emission/Version 1/Movies/eBOSS_composite_withlocalsfsb_3.jpg')
In [30]:
fig = figure(figsize=(20,8))
ax = fig.add_subplot(111)
ax.plot(tmpwave, tmpmedian)
ax.set_xlim(2000, 2200)
ax.set_ylim(0.4, 0.8)
ax.set_title('Composite Spectrum of Emission Line Galaxies (ELGs) from eBOSS', fontsize=15)
ax.set_xlabel(r'$\lambda$ [$\AA$]', fontsize=20)
ax.set_ylabel(r'$f(\lambda)$ [arbitrary unit]', fontsize=20)
for axis in ['top','bottom','left','right']:
ax.spines[axis].set_linewidth(2.0)
ax.tick_params(axis='both', which='both', length=7, width=2, labelsize=15)
#emission_name = array(['FeII*', 'FeII*', '[OII]', '[NeIII]','[OIII]', '[OIII]', 'HeI', '[OI]',
# 'NII', 'NII', 'SII', 'SII', '[ArIII]'])
#emission_xpos = array([2300., 2550., 3727., 3868., 4363., 4959., 5876., 6300.,
# 6548., 6583., 6716., 6730., 7137.])
plot([5183.62,5183.62],[0.2,0.5])
plot([5172.70,5172.70],[0.2,0.5])
plot([5167.33,5167.33],[0.2,0.5])
plot([5200.33,5200.33],[0.2,0.5])
Out[30]:
In [22]:
index_wave = searchsorted(masterwave, [2300., 4001.])
index_oii = searchsorted(masterwave, 3727.)
# Selection needs to be revisited
ii = (where(logical_and(logical_and(logical_and(allivar[index_wave[0], :]>0,
allivar[index_wave[1], :]>0), zgood==1), galaxytype=='GALAXY')))[0]
oiisum = sum(allflux[index_oii-10:index_oii+10, ii], axis=0)
oiilum = oiisum*power(cosmo.luminosity_distance(objs_ori[ii]['Z']), 2)
oii_left = sum(allflux[index_oii-25:index_oii-15, ii], axis=0)
oii_right = sum(allflux[index_oii+15:index_oii+25, ii], axis=0)
oii_ew = oiisum/(oii_left+oii_right)*2.
xx = allflux[index_wave[0]:index_wave[1], ii]
In [35]:
sort_index = argsort(oii_ew)
#xmean1 = nanmean(xx[:,sort_index[100:2000]], 1)
xmean1 = nanmean(xx[:,sort_index[0:500]], 1)
xmean2 = nanmean(xx[:,sort_index[2000:3000]], 1)
xmean3 = nanmean(xx[:,sort_index[2000:4000]], 1)
xmean4 = nanmean(xx[:,sort_index[3000:4000]], 1)
xmean5 = nanmean(xx[:,sort_index[4000:5000]], 1)
xmean6 = nanmean(xx[:,sort_index[7000:8000]], 1)
xmean = nanmean(xx[:,sort_index[2000:-100]], 1)
xmeanall = nanmean(xx,1)
In [40]:
fig = figure(figsize=(10,7))
this_ylim = [0.15, 0.6]
ax = fig.add_subplot(111)
dwave = median(masterwave[index_wave[0]+1:index_wave[1]]-masterwave[index_wave[0]:index_wave[1]-1])
#plot(masterwave[index_wave[0]:index_wave[1]]+0.6, xmean4*1.1, 'g', drawstyle='steps')
ax.plot(masterwave[index_wave[0]:index_wave[1]]+dwave/2, xmean1*1.15, 'b', lw=2, drawstyle='steps')
ax.plot(masterwave[index_wave[0]:index_wave[1]]+dwave/2., xmean4*1.15, 'r', lw=2, drawstyle='steps')
ax.plot(masterwave[index_wave[0]:index_wave[1]]+dwave/2., xmean6*1.15, 'g', lw=2, drawstyle='steps')
ax.set_ylim(this_ylim)
ax.set_xlim(2760, 2880)
plot([2796.75, 2796.75], [0.0, 3.5], 'k')
plot([2803.27, 2803.27], [0.0, 3.5], 'k')
Out[40]:
In [206]:
tmploglam = log10(tmpwave)
# Get the Mask array
# Region Mg II
# Range
waveleft = 2760.
waveright = 2840.
# Lines intersted
this_nabslines = 3
this_absorption = zeros(this_nabslines, dtype=[('NAME','S20'),('XPOS','f4'),('YPOS','f4'),('WAVE', 'f4'),
('WAVELEFT', 'f4'), ('WAVERIGHT', 'f4')])
this_absorption[0] = ('MgII 2796.35', 2796.35-4., 0.2, 2796.35, 2780., 2810.)
this_absorption[1] = ('MgII 2803.53', 2803.53+1.5, 0.2, 2803.53, 2780., 2810. )
this_absorption[2] = ('MgI 2852.96', 2852.96+1.5, 0.21, 2852.96, 2840., 2860.)
# Mask out range and lines
mask = ones(tmpwave.size)
mask[(tmpwave<waveleft) | (tmpwave>waveright)] = 0
for i in arange(this_nabslines):
mask[(tmpwave>this_absorption[i]['WAVELEFT']) & (tmpwave<this_absorption[i]['WAVERIGHT'])] = 0
index1 = ii[sort_index[500:1200]]
index2 = ii[sort_index[1200:2000]]
index3 = ii[sort_index[2200:3000]]
index4 = ii[sort_index[3200:4000]]
index5 = ii[sort_index[4200:-100]]
(median_norm_median1, mean_norm_median1) = ebossspec.composite_engine(tmploglam, tmpflux[:,index1],
tmpivar[:,index1], mask, polyorder=3)
(median_norm_median2, mean_norm_median2) = ebossspec.composite_engine(tmploglam, tmpflux[:,index2],
tmpivar[:,index2], mask, polyorder=3)
(median_norm_median3, mean_norm_median4) = ebossspec.composite_engine(tmploglam, tmpflux[:,index3],
tmpivar[:,index3], mask, polyorder=3)
(median_norm_median4, mean_norm_median4) = ebossspec.composite_engine(tmploglam, tmpflux[:,index4],
tmpivar[:,index4], mask, polyorder=3)
(median_norm_median5, mean_norm_median5) = ebossspec.composite_engine(tmploglam, tmpflux[:,index5],
tmpivar[:,index5], mask, polyorder=3)
In [65]:
In [255]:
fig = figure(figsize=(20,8))
this_ylim = [0.35, 1.45]
ax = fig.add_subplot(111)
dwave = median(tmpwave[1:]-tmpwave[:-1])
ax.plot(tmpwave+dwave/2., median_norm_median1, 'r', drawstyle='steps', linewidth=3)
ax.set_ylim(this_ylim)
ax.set_xlim(2770, 2830)
#ax.set_title('Composite Spectrum of Emission Line Galaxies (ELGs) from eBOSS', fontsize=15)
ax.set_xlabel(r'$\lambda$ [$\AA$]', fontsize=20)
ax.set_ylabel(r'Normalized $f(\lambda)$', fontsize=20)
for axis in ['top','bottom','left','right']:
ax.spines[axis].set_linewidth(2.0)
ax.tick_params(axis='both', which='both', length=7, width=2, labelsize=15)
this_nabslines = 3
this_absorption = zeros(this_nabslines, dtype=[('NAME','S20'),('XPOS','f4'),('YPOS','f4'),('WAVE', 'f4')])
this_absorption[0] = ('MgII 2796.35', 2796.35+0.5, 0.4, 2796.35)
this_absorption[1] = ('MgII 2803.53', 2803.53+0.5, 0.4, 2803.53)
#this_absorption[2] = ('MgI 2852.96', 2852.96+1.5, 0.21, 2852.96)
for i in arange(this_nabslines):
atmp = this_absorption[i]
ax.text(atmp['XPOS'], atmp['YPOS'], atmp['NAME'], fontsize=14, rotation='vertical',va='bottom')
ax.plot([atmp['WAVE'], atmp['WAVE']], this_ylim, '--k')
# Replot
ax.plot(tmpwave+dwave/2., median_norm_median5, 'blue', drawstyle='steps', linewidth=3)
#ax.plot(tmpwave+dwave/2., median_norm_median4, 'brown', drawstyle='steps', linewidth=2)
#ax.plot(tmpwave+dwave/2., median_norm_median3, 'green', drawstyle='steps', linewidth=2)
ax.plot(tmpwave+dwave/2., median_norm_median2, 'green', drawstyle='steps', linewidth=3)
#ax.plot(tmpwave+dwave/2., median_norm_median1, 'blue', drawstyle='steps', linewidth=2)
ax.text(2771, 1.350, 'Blue: High [OII] EW', color='blue', fontsize=17, fontname='serif')
ax.text(2771, 1.300, 'Green: Medium [OII] EW', color='green', fontsize=17, fontname='serif')
ax.text(2771, 1.250, 'Red: Low [OII] EW', color='red', fontsize=17, fontname='serif')
nlines = 2
lines = zeros(nlines, dtype=[('SIGN', 'i'),('ELEMENT','S20'),('WAVE','f4'),('EW','f4'), ('WAVELEFT', 'f4')])
lines[0] = (-1, 'MgII', 2796.35, 2., 2789.)
lines[1] = (-1, 'MgII', 2803.53, 2., 2798.)
ew_profile1 = ebossspec.line_property(tmploglam, median_norm_median1-1., lines, npixels=20)
ew_profile2 = ebossspec.line_property(tmploglam, median_norm_median2-1., lines, npixels=20)
ew_profile3 = ebossspec.line_property(tmploglam, median_norm_median3-1., lines, npixels=20)
ew_profile4 = ebossspec.line_property(tmploglam, median_norm_median4-1., lines, npixels=20)
ew_profile5 = ebossspec.line_property(tmploglam, median_norm_median5-1., lines, npixels=20)
ew1 = ravel(ew_profile1[0]['EW'])
ew2 = -ravel(ew_profile2[0]['EW'])
ew3 = -ravel(ew_profile3[0]['EW'])
ew4 = -ravel(ew_profile4[0]['EW'])
ew5 = -ravel(ew_profile5[0]['EW'])
#frac1 = ew1/max(ew1)
frac2 = ew2/max(ew2)
frac3 = ew3/max(ew3)
frac4 = ew4/max(ew4)
frac5 = ew5/max(ew5)
#vel1 = ravel(ew_profile1[0]['VEL'])
vel2 = ravel(ew_profile2[0]['VEL'])
vel3 = ravel(ew_profile3[0]['VEL'])
vel4 = ravel(ew_profile4[0]['VEL'])
vel5 = ravel(ew_profile5[0]['VEL'])
#i1 = (where(logical_and(frac1>0.3, frac1<0.7)))[0]
#f = interp1d(frac1[i1], vel1[i1])
#vel501 = f(0.5)
i2 = (where(logical_and(frac2>0.3, frac2<0.7)))[0]
f = interp1d(frac2[i2], vel2[i2])
vel502 = f(0.5)
i3 = (where(logical_and(frac3>0.3, frac3<0.7)))[0]
f = interp1d(frac3[i3], vel3[i3])
vel503 = f(0.5)
i4 = (where(logical_and(frac4>0.3, frac4<0.7)))[0]
f = interp1d(frac4[i4], vel4[i4])
vel504 = f(0.5)
i5 = (where(logical_and(frac5>0.3, frac5<0.7)))[0]
f = interp1d(frac5[i5], vel5[i5])
vel505 = f(0.5)
MgIIEW_list = array([max(ew1), max(ew2), max(ew3), max(ew4), max(ew5)])
MgIIVEL50_list = array([vel501, vel502, vel503, vel504, vel505])
In [256]:
tmploglam = log10(tmpwave)
# Get the Mask array
# Region Mg II
# Range
waveleft = 2550.
waveright = 2650.
# Lines intersted
this_nabslines = 5
this_absorption = zeros(this_nabslines, dtype=[('NAME','S20'),('XPOS','f4'),('YPOS','f4'),('WAVE', 'f4'),
('WAVELEFT', 'f4'), ('WAVERIGHT', 'f4')])
this_absorption[0] = ('MnII 2576.88', 2576.88-3, 0.2, 2576.88, 2570., 2580.)
this_absorption[1] = ('FeII 2586.65', 2586.65-3, 0.2, 2586.65, 2583., 2589.)
this_absorption[2] = ('MnII 2594.50', 2594.50-3, 0.2, 2594.50, 2590., 2615.)
this_absorption[3] = ('FeII 2600.17', 2600.17+1.5, 0.2, 2600.17, 2590., 2615.)
this_absorption[4] = ('MnII 2606.46', 2606.46+1.5, 0.2, 2606.46, 2590., 2615.)
this_nemlines = 3
this_emission = zeros(this_nemlines, dtype=[('NAME','S20'),('XPOS','f4'),('YPOS','f4'), ('WAVE','f4'),
('WAVELEFT', 'f4'), ('WAVERIGHT', 'f4')])
this_emission[0] = ('FeII* 2626.45', 2626.45+1.5, 1.3, 2626.45, 2590., 2615.)
this_emission[1] = ('FeII* 2612.65', 2612.65+1.5, 1.3, 2612.65, 2621., 2631.)
# Mask out range and lines
mask = ones(tmpwave.size)
mask[(tmpwave<waveleft) | (tmpwave>waveright)] = 0
for i in arange(this_nabslines):
mask[(tmpwave>this_absorption[i]['WAVELEFT']) & (tmpwave<this_absorption[i]['WAVERIGHT'])] = 0
for i in arange(this_nemlines):
mask[(tmpwave>this_emission[i]['WAVELEFT']) & (tmpwave<this_emission[i]['WAVERIGHT'])] = 0
index1 = ii[sort_index[200:1000]]
index2 = ii[sort_index[1200:2000]]
index3 = ii[sort_index[2200:3000]]
index4 = ii[sort_index[3200:4000]]
index5 = ii[sort_index[4200:-100]]
(median_norm_median1, mean_norm_median1) = ebossspec.composite_engine(tmploglam, tmpflux[:,index1],
tmpivar[:,index1], mask, polyorder=3)
(median_norm_median2, mean_norm_median2) = ebossspec.composite_engine(tmploglam, tmpflux[:,index2],
tmpivar[:,index2], mask, polyorder=3)
(median_norm_median3, mean_norm_median4) = ebossspec.composite_engine(tmploglam, tmpflux[:,index3],
tmpivar[:,index3], mask, polyorder=3)
(median_norm_median4, mean_norm_median4) = ebossspec.composite_engine(tmploglam, tmpflux[:,index4],
tmpivar[:,index4], mask, polyorder=3)
(median_norm_median5, mean_norm_median5) = ebossspec.composite_engine(tmploglam, tmpflux[:,index5],
tmpivar[:,index5], mask, polyorder=3)
In [257]:
fig = figure(figsize=(20,8))
this_ylim = [0.35, 1.45]
ax = fig.add_subplot(111)
dwave = median(tmpwave[1:]-tmpwave[:-1])
ax.plot(tmpwave+dwave/2., median_norm_median1, 'r', drawstyle='steps', linewidth=3)
ax.set_ylim(this_ylim)
ax.set_xlim(2570, 2631)
#ax.set_title('Composite Spectrum of Emission Line Galaxies (ELGs) from eBOSS', fontsize=15)
ax.set_xlabel(r'$\lambda$ [$\AA$]', fontsize=20)
ax.set_ylabel(r'Normalized $f(\lambda)$', fontsize=20)
for axis in ['top','bottom','left','right']:
ax.spines[axis].set_linewidth(2.0)
ax.tick_params(axis='both', which='both', length=7, width=2, labelsize=15)
this_nabslines = 5
this_absorption = zeros(this_nabslines, dtype=[('NAME','S20'),('XPOS','f4'),('YPOS','f4'),('WAVE', 'f4')])
this_absorption[0] = ('MnII 2576.88', 2576.88-1.2, 0.4, 2576.88)
this_absorption[1] = ('FeII 2586.65', 2586.65+0.75, 0.4, 2586.65)
this_absorption[2] = ('MnII 2594.50', 2594.50+0.75, 0.4, 2594.50)
this_absorption[3] = ('FeII 2600.17', 2600.17+0.75, 0.4, 2600.17)
this_absorption[4] = ('MnII 2606.46', 2606.46+0.75, 0.4, 2606.46)
this_nemlines = 3
this_emission = zeros(this_nemlines, dtype=[('NAME','S20'),('XPOS','f4'),('YPOS','f4'), ('WAVE','f4')])
this_emission[0] = ('FeII* 2626.45', 2626.45+1.0, 1.2, 2626.45)
this_emission[1] = ('FeII* 2612.65', 2612.65+0.5, 1.2, 2612.65)
#this_emission[2] = ('FeII* 2632.11', 2632.11+10., 1.2, 2632.11)
for i in arange(this_nabslines):
atmp = this_absorption[i]
ax.text(atmp['XPOS'], atmp['YPOS'], atmp['NAME'], fontsize=14, rotation='vertical',va='bottom')
ax.plot([atmp['WAVE'], atmp['WAVE']], this_ylim, '--k')
for i in arange(this_nemlines):
etmp = this_emission[i]
ax.text(etmp['XPOS'], etmp['YPOS'], etmp['NAME'], color='g', rotation='vertical',va='bottom', fontsize=14)
ax.plot([etmp['WAVE'], etmp['WAVE']], this_ylim, ':g', linewidth=1)
# Replot
ax.plot(tmpwave+dwave/2., median_norm_median5, 'blue', drawstyle='steps', linewidth=3)
#ax.plot(tmpwave+dwave/2., median_norm_median4, 'brown', drawstyle='steps', linewidth=2)
#ax.plot(tmpwave+dwave/2., median_norm_median3, 'green', drawstyle='steps', linewidth=2)
ax.plot(tmpwave+dwave/2., median_norm_median2, 'green', drawstyle='steps', linewidth=3)
#ax.plot(tmpwave+dwave/2., median_norm_median1, 'blue', drawstyle='steps', linewidth=2)
ax.text(2571, 1.350, 'Blue: High [OII] EW', color='blue', fontsize=17, fontname='serif')
ax.text(2571, 1.300, 'Green: Medium [OII] EW', color='green', fontsize=17, fontname='serif')
ax.text(2571, 1.250, 'Red: Low [OII] EW', color='red', fontsize=17, fontname='serif')
#nlines = 2
#lines = zeros(nlines, dtype=[('SIGN', 'i'),('ELEMENT','S20'),('WAVE','f4'),('EW','f4'), ('WAVELEFT', 'f4')])
#lines[0] = (-1, 'MgII', 2796.35, 2., 2789.)
#lines[1] = (-1, 'MgII', 2803.53, 2., 2798.)
#ew_profile1 = ebossspec.line_property(tmploglam, median_norm_median1-1., lines, npixels=20)
#ew_profile2 = ebossspec.line_property(tmploglam, median_norm_median2-1., lines, npixels=20)
#ew_profile3 = ebossspec.line_property(tmploglam, median_norm_median3-1., lines, npixels=20)
#ew_profile4 = ebossspec.line_property(tmploglam, median_norm_median4-1., lines, npixels=20)
#ew_profile5 = ebossspec.line_property(tmploglam, median_norm_median5-1., lines, npixels=20)
#print(max(-ravel(ew_profile1[0]['EW'])))
#print(max(-ravel(ew_profile2[0]['EW'])))
#print(max(-ravel(ew_profile3[0]['EW'])))
#print(max(-ravel(ew_profile4[0]['EW'])))
#print(max(-ravel(ew_profile5[0]['EW'])))
#MgIIEW_list = array([max(-ravel(ew_profile1[0]['EW'])), max(-ravel(ew_profile2[0]['EW'])),
# max(-ravel(ew_profile3[0]['EW'])), max(-ravel(ew_profile4[0]['EW'])),
# max(-ravel(ew_profile5[0]['EW']))])
Out[257]:
In [258]:
tmploglam = log10(tmpwave)
# Get the Mask array
# Region Mg II
# Range
waveleft = 3500.
waveright = 3775.
# Lines intersted
#this_nabslines = 5
#this_absorption = zeros(this_nabslines, dtype=[('NAME','S20'),('XPOS','f4'),('YPOS','f4'),('WAVE', 'f4'),
# ('WAVELEFT', 'f4'), ('WAVERIGHT', 'f4')])
#this_absorption[0] = ('MnII 2576.88', 2576.88-3, 0.2, 2576.88, 2570., 2580.)
#this_absorption[1] = ('FeII 2586.65', 2586.65-3, 0.2, 2586.65, 2583., 2589.)
#this_absorption[2] = ('MnII 2594.50', 2594.50-3, 0.2, 2594.50, 2590., 2615.)
#this_absorption[3] = ('FeII 2600.17', 2600.17+1.5, 0.2, 2600.17, 2590., 2615.)
#this_absorption[4] = ('MnII 2606.46', 2606.46+1.5, 0.2, 2606.46, 2590., 2615.)
this_nemlines = 3
this_emission = zeros(this_nemlines, dtype=[('NAME','S20'),('XPOS','f4'),('YPOS','f4'), ('WAVE','f4'),
('WAVELEFT', 'f4'), ('WAVERIGHT', 'f4')])
this_emission[0] = ('[OII]', 3727.+20., 1.75, 3727., 3723., 3732.)
# Mask out range and lines
mask = ones(tmpwave.size)
mask[(tmpwave<waveleft) | (tmpwave>waveright)] = 0
#for i in arange(this_nabslines):
# mask[(tmpwave>this_absorption[i]['WAVELEFT']) & (tmpwave<this_absorption[i]['WAVERIGHT'])] = 0
for i in arange(this_nemlines):
mask[(tmpwave>this_emission[i]['WAVELEFT']) & (tmpwave<this_emission[i]['WAVERIGHT'])] = 0
index1 = ii[sort_index[500:1200]]
index2 = ii[sort_index[1200:2000]]
index3 = ii[sort_index[2200:3000]]
index4 = ii[sort_index[3200:4000]]
index5 = ii[sort_index[4200:-100]]
(median_norm_median1, mean_norm_median1) = ebossspec.composite_engine(tmploglam, tmpflux[:,index1],
tmpivar[:,index1], mask, polyorder=3)
(median_norm_median2, mean_norm_median2) = ebossspec.composite_engine(tmploglam, tmpflux[:,index2],
tmpivar[:,index2], mask, polyorder=3)
(median_norm_median3, mean_norm_median4) = ebossspec.composite_engine(tmploglam, tmpflux[:,index3],
tmpivar[:,index3], mask, polyorder=3)
(median_norm_median4, mean_norm_median4) = ebossspec.composite_engine(tmploglam, tmpflux[:,index4],
tmpivar[:,index4], mask, polyorder=3)
(median_norm_median5, mean_norm_median5) = ebossspec.composite_engine(tmploglam, tmpflux[:,index5],
tmpivar[:,index5], mask, polyorder=3)
In [259]:
fig = figure(figsize=(12,7))
ax = fig.add_subplot(111)
dwave = median(tmpwave[1:]-tmpwave[:-1])
ax.plot(tmpwave+dwave/2., median_norm_median1, 'r', drawstyle='steps', linewidth=2)
this_ylim = [0.15, 11.]
ax.set_ylim(this_ylim)
ax.set_xlim(3680, 3780)
#ax.set_title('Composite Spectrum of Emission Line Galaxies (ELGs) from eBOSS', fontsize=15)
ax.set_xlabel(r'$\lambda$ [$\AA$]', fontsize=20)
ax.set_ylabel(r'Normalized $f(\lambda)$', fontsize=20)
for axis in ['top','bottom','left','right']:
ax.spines[axis].set_linewidth(2.0)
ax.tick_params(axis='both', which='both', length=7, width=2, labelsize=15)
this_nabslines = 8
this_absorption = zeros(this_nabslines, dtype=[('NAME','S20'),('XPOS','f4'),('YPOS','f4'),('WAVE', 'f4')])
this_absorption[0] = ('TiII 3067.24', 3067.24-30., 0.22, 3067.24)
this_absorption[1] = ('TiII 3073.86', 3073.86+10., 0.22, 3073.86)
#this_absorption[2] = ('AlI 3083.05', 3083.05+1.5, 0.23, 3083.05)
this_absorption[3] = ('TiII 3230.12', 3230.12-30., 0.23, 3230.12)
this_absorption[4] = ('TiII 3242.92', 3242.92+10., 0.23, 3242.92)
this_absorption[5] = ('TiII 3384.73', 3384.73+10., 0.23, 3384.73)
this_absorption[6] = ('CaII 3934.78', 3934.78-30., 0.23, 3934.78)
this_absorption[7] = ('CaII 3969.59', 3969.59+10., 0.23, 3969.59)
this_nemlines = 3
this_emission = zeros(this_nemlines, dtype=[('NAME','S20'),('XPOS','f4'),('YPOS','f4'), ('WAVE','f4')])
this_emission[0] = ('[OII] 3727.1', 3727.1-3., 8, 3727.1)
this_emission[1] = ('[OII] 3729.8', 3729.8+2., 8, 3729.9)
#this_emission[2] = ('[NeIII] 3869.77', 3869.77+10., 1.4, 3869.77)
this_nbalmer = 10
this_balmer = zeros(this_nbalmer, dtype=[('NAME','S10'),('XPOS','f4'),('YPOS','f4'),('WAVE', 'f4')])
#this_balmer[0] = (r'$\alpha$', 6563.-35., 0.25, 6563.)
#this_balmer[1] = (r'$\beta$', 4861.-35., 0.25, 4861.)
#this_balmer[2] = (r'$\gamma$', 4341.-35., 0.265, 4341.)
#this_balmer[3] = (r'$\delta$', 4102.-35., 0.24, 4102.)
this_balmer[4] = (r'$\epsilon$', 3970.+10., 0.9, 3907.)
this_balmer[5] = (r'$\zeta$', 3889.-10., 0.85, 3889.)
this_balmer[6] = (r'$\eta$', 3835.38-10., 0.75, 3835.38)
this_balmer[7] = (r'$\theta$', 3797.90-10., 0.8, 3797.90)
this_balmer[8] = (r'$\iota$', 3770.63-7., 0.82, 3770.63)
this_balmer[9] = (r'$\kappa$', 3750.15-10., 0.77, 3750.15)
#for i in arange(this_nabslines):
# atmp = this_absorption[i]
# ax.text(atmp['XPOS'], atmp['YPOS'], atmp['NAME'], fontsize=14, rotation='vertical',va='bottom')
# ax.plot([atmp['WAVE'], atmp['WAVE']], this_ylim, '--k')
#for i in arange(this_nbalmer):
# btmp = this_balmer[i]
# ax.text(btmp['XPOS'], btmp['YPOS'], btmp['NAME'], color='brown', fontsize=20)
for i in arange(this_nemlines):
etmp = this_emission[i]
ax.text(etmp['XPOS'], etmp['YPOS'], etmp['NAME'], color='g', rotation='vertical',va='bottom', fontsize=15)
ax.plot([etmp['WAVE'], etmp['WAVE']], this_ylim, ':g', linewidth=3)
# Replot
ax.plot(tmpwave+dwave/2., median_norm_median5, 'blue', drawstyle='steps', linewidth=3)
#ax.plot(tmpwave+dwave/2., median_norm_median4, 'brown', drawstyle='steps', linewidth=2)
#ax.plot(tmpwave+dwave/2., median_norm_median3, 'green', drawstyle='steps', linewidth=2)
ax.plot(tmpwave+dwave/2., median_norm_median2, 'green', drawstyle='steps', linewidth=3)
#ax.plot(tmpwave+dwave/2., median_norm_median1, 'blue', drawstyle='steps', linewidth=2)
ax.text(3682, 10.40, 'Blue: High [OII] EW', color='blue', fontsize=17, fontname='serif')
ax.text(3682, 9.85, 'Green: Medium [OII] EW', color='green', fontsize=17, fontname='serif')
ax.text(3682, 9.30, 'Red: Low [OII] EW', color='red', fontsize=17, fontname='serif')
nlines = 1
lines = zeros(nlines, dtype=[('SIGN', 'i'),('ELEMENT','S20'),('WAVE','f4'),('EW','f4'), ('WAVELEFT', 'f4')])
lines[0] = (1, 'OII', 3728.45, 2., 3720.)
ew_profile1 = ebossspec.line_property(tmploglam, median_norm_median1-1., lines, npixels=20)
ew_profile2 = ebossspec.line_property(tmploglam, median_norm_median2-1., lines, npixels=20)
ew_profile3 = ebossspec.line_property(tmploglam, median_norm_median3-1., lines, npixels=20)
ew_profile4 = ebossspec.line_property(tmploglam, median_norm_median4-1., lines, npixels=20)
ew_profile5 = ebossspec.line_property(tmploglam, median_norm_median5-1., lines, npixels=20)
print(max(ravel(ew_profile1[0]['EW'])))
print(max(ravel(ew_profile2[0]['EW'])))
print(max(ravel(ew_profile3[0]['EW'])))
print(max(ravel(ew_profile4[0]['EW'])))
print(max(ravel(ew_profile5[0]['EW'])))
OIIEW_list = array([max(ravel(ew_profile1[0]['EW'])), max(ravel(ew_profile2[0]['EW'])),
max(ravel(ew_profile3[0]['EW'])), max(ravel(ew_profile4[0]['EW'])),
max(ravel(ew_profile5[0]['EW']))])
In [190]:
tmploglam = log10(tmpwave)
# Get the Mask array
# Region Mg II
# Range
waveleft = 2305.
waveright = 2410.
# Lines intersted
this_nabslines = 6
this_absorption = zeros(this_nabslines, dtype=[('NAME','S20'),('XPOS','f4'),('YPOS','f4'),('WAVE', 'f4'),
('WAVELEFT', 'f4'), ('WAVERIGHT', 'f4')])
#this_absorption[0] = ('FeII 2249.88', 2249.88-5, 0.2, 2249.88, )
#this_absorption[1] = ('FeII 2260.78', 2260.78+1.5, 0.2, 2260.78)
this_absorption[2] = ('FeII 2344.21', 2344.21+1.5, 0.2, 2344.21, 2341., 2350.)
this_absorption[3] = ('FeII 2374.46', 2374.46+1.5, 0.2, 2374.46, 2372., 2376.5)
this_absorption[4] = ('FeII 2382.76', 2382.76+1.5, 0.2, 2382.76, 2379., 2400.)
#this_absorption[5] = ('CIII 2297.58', 2297.58+1.5, 0.2, 2297.58)
this_nemlines = 3
this_emission = zeros(this_nemlines, dtype=[('NAME','S20'),('XPOS','f4'),('YPOS','f4'), ('WAVE','f4'),
('WAVELEFT', 'f4'), ('WAVERIGHT', 'f4')])
this_emission[0] = ('CII] 2327.64', 2327.64+1., 1.3, 2327.64, 2320., 2331.)
this_emission[1] = ('FeII* 2396.36', 2396.36+1., 1.3, 2396.36, 2379., 2400.)
this_emission[2] = ('FeII* 2365.55', 2365.55+1., 1.3, 2365.55, 2361., 2370.)
# Mask out range and lines
mask = ones(tmpwave.size)
mask[(tmpwave<waveleft) | (tmpwave>waveright)] = 0
for i in arange(this_nabslines):
mask[(tmpwave>this_absorption[i]['WAVELEFT']) & (tmpwave<this_absorption[i]['WAVERIGHT'])] = 0
for i in arange(this_nemlines):
mask[(tmpwave>this_emission[i]['WAVELEFT']) & (tmpwave<this_emission[i]['WAVERIGHT'])] = 0
index1 = ii[sort_index[200:1000]]
index2 = ii[sort_index[1200:2000]]
index3 = ii[sort_index[2200:3000]]
index4 = ii[sort_index[3200:4000]]
index5 = ii[sort_index[4200:-100]]
(median_norm_median1, mean_norm_median1) = ebossspec.composite_engine(tmploglam, tmpflux[:,index1],
tmpivar[:,index1], mask, polyorder=3)
(median_norm_median2, mean_norm_median2) = ebossspec.composite_engine(tmploglam, tmpflux[:,index2],
tmpivar[:,index2], mask, polyorder=3)
(median_norm_median3, mean_norm_median4) = ebossspec.composite_engine(tmploglam, tmpflux[:,index3],
tmpivar[:,index3], mask, polyorder=3)
(median_norm_median4, mean_norm_median4) = ebossspec.composite_engine(tmploglam, tmpflux[:,index4],
tmpivar[:,index4], mask, polyorder=3)
(median_norm_median5, mean_norm_median5) = ebossspec.composite_engine(tmploglam, tmpflux[:,index5],
tmpivar[:,index5], mask, polyorder=3)
In [191]:
fig = figure(figsize=(20,8))
this_ylim = [0.35, 1.45]
ax = fig.add_subplot(111)
dwave = median(tmpwave[1:]-tmpwave[:-1])
ax.plot(tmpwave+dwave/2., median_norm_median1, 'g', drawstyle='steps', linewidth=2)
ax.set_ylim(this_ylim)
ax.set_xlim(waveleft, waveright)
#ax.set_title('Composite Spectrum of Emission Line Galaxies (ELGs) from eBOSS', fontsize=15)
ax.set_xlabel(r'$\lambda$ [$\AA$]', fontsize=20)
ax.set_ylabel(r'Normalized $f(\lambda)$', fontsize=20)
for axis in ['top','bottom','left','right']:
ax.spines[axis].set_linewidth(2.0)
ax.tick_params(axis='both', which='both', length=7, width=2, labelsize=15)
this_nabslines = 6
this_absorption = zeros(this_nabslines, dtype=[('NAME','S20'),('XPOS','f4'),('YPOS','f4'),('WAVE', 'f4')])
#this_absorption[0] = ('FeII 2249.88', 2249.88-5, 0.2, 2249.88)
#this_absorption[1] = ('FeII 2260.78', 2260.78+1.5, 0.2, 2260.78)
this_absorption[2] = ('FeII 2344.21', 2344.21+1.5, 0.4, 2344.21)
this_absorption[3] = ('FeII 2374.46', 2374.46+1.5, 0.4, 2374.46)
this_absorption[4] = ('FeII 2382.76', 2382.76+1.5, 0.4, 2382.76)
this_absorption[5] = ('CIII 2297.58', 2297.58+1.5, 0.4, 2297.58)
this_nemlines = 3
this_emission = zeros(this_nemlines, dtype=[('NAME','S20'),('XPOS','f4'),('YPOS','f4'), ('WAVE','f4')])
this_emission[0] = ('CII] 2327.64', 2327.64+1., 1.2, 2327.64)
this_emission[1] = ('FeII* 2396.36', 2396.36+1., 1.2, 2396.36)
this_emission[2] = ('FeII* 2365.55', 2365.55+1., 1.2, 2365.55)
#this_emission[2] = ('FeII* 2632.11', 2632.11+10., 1.2, 2632.11)
for i in arange(this_nabslines):
atmp = this_absorption[i]
ax.text(atmp['XPOS'], atmp['YPOS'], atmp['NAME'], fontsize=14, rotation='vertical',va='bottom')
ax.plot([atmp['WAVE'], atmp['WAVE']], this_ylim, '--k')
for i in arange(this_nemlines):
etmp = this_emission[i]
ax.text(etmp['XPOS'], etmp['YPOS'], etmp['NAME'], color='g', rotation='vertical',va='bottom', fontsize=14)
ax.plot([etmp['WAVE'], etmp['WAVE']], this_ylim, ':g', linewidth=1)
# Replot
ax.plot(tmpwave+dwave/2., median_norm_median5, 'blue', drawstyle='steps', linewidth=2)
#ax.plot(tmpwave+dwave/2., median_norm_median4, 'brown', drawstyle='steps', linewidth=2)
#ax.plot(tmpwave+dwave/2., median_norm_median3, 'green', drawstyle='steps', linewidth=2)
ax.plot(tmpwave+dwave/2., median_norm_median2, 'red', drawstyle='steps', linewidth=2)
#ax.plot(tmpwave+dwave/2., median_norm_median1, 'blue', drawstyle='steps', linewidth=2)
ax.text(waveleft+1., 1.350, 'Blue: High [OII] EW', color='blue', fontsize=17, fontname='serif')
ax.text(waveleft+1., 1.300, 'Red: Medium [OII] EW', color='red', fontsize=17, fontname='serif')
ax.text(waveleft+1., 1.250, 'Green: Low [OII] EW', color='green', fontsize=17, fontname='serif')
In [157]:
print min(tmpwave), max(tmpwave)
In [227]:
fig = figure(figsize=(8,8))
ax = fig.add_subplot(111)
ax.plot(OIIEW_list[:], MgIIEW_list[:], 'o', ms=30)
#this_ylim = [0.15, 11.]
#ax.set_ylim(this_ylim)
#ax.set_xlim(3680, 3780)
ax.set_title(r'Correlations between UV lines and [OII] $\lambda$3727', fontsize=15)
ax.set_xlabel(r'$W_{\rm O\,II}^{\lambda3727}$ [$\AA$]', fontsize=20)
ax.set_ylabel(r'$W_{\rm UV\,Lines}$ [$\AA$]', fontsize=20)
for axis in ['top','bottom','left','right']:
ax.spines[axis].set_linewidth(2.0)
ax.tick_params(axis='both', which='both', length=7, width=2, labelsize=15)
In [179]:
rest_loc = searchsorted(tmpwave, [2770, 2830])
temp = vstack((tmpwave[rest_loc[0]:rest_loc[1]], median_norm_median5[rest_loc[0]:rest_loc[1]])).T
savetxt('temp.txt', temp)
In [254]:
fig = figure(figsize=(8,8))
ax = fig.add_subplot(111)
ax.plot(OIIEW_list[1:], MgIIVEL50_list[1:], 'o', ms=30)
this_ylim = [-90, -200.]
ax.set_ylim(this_ylim)
#ax.set_xlim(3680, 3780)
ax.set_title(r'Correlations between UV lines and [OII] $\lambda$3727', fontsize=15)
ax.set_xlabel(r'$W_{\rm O\,II}^{\lambda3727}$ [$\AA$]', fontsize=20)
ax.set_ylabel(r'$V_{50}$ [km/s]', fontsize=20)
for axis in ['top','bottom','left','right']:
ax.spines[axis].set_linewidth(2.0)
ax.tick_params(axis='both', which='both', length=7, width=2, labelsize=15)
ax.set_xscale('log')
In [180]:
plot(tmpwave, median_norm_median5)
xlim(2770,2830)
Out[180]:
In [233]:
fig = figure(figsize=(10,8))
ax = fig.add_subplot(111)
ax.plot(tmpwave, tmpmedian, lw=1)
ax.set_xlim(7100, 7200)
ax.set_ylim(0.30, 0.550)
ax.plot([2422.56, 2422.56], [0.3, 0.50])
ax.plot([4070, 4070], [0.4, 0.50])
ax.plot([4077, 4077], [0.4, 0.50])
Out[233]:
In [235]:
fig = figure(figsize=(9,7))
ax = fig.add_subplot(111)
n, bins, patches = ax.hist(objs_ori[objs_ori['zGOOD']==1]['Z'],
bins=arange(0, 2.0, 0.05), edgecolor='blue', fill=False)
this_ylim = [0, 1500]
ax.set_ylim(this_ylim)
#ax.set_xlim(3680, 3780)
ax.set_title(r'Redshift Distribution of Emission Line Galaxies (ELGs) from eBOSS', fontsize=15)
ax.set_xlabel(r'redshift z', fontsize=20)
ax.set_ylabel(r'$\Delta$ N ($\Delta$ z=0.2)', fontsize=20)
n, bins, patches = ax.hist(objs_ori[((objs_ori['zGOOD']==1) & (objs_ori['Z']>0.6)) & (objs_ori['Z']<1.2)]['Z'],
bins=arange(0, 2.0, 0.05), color='blue')
ax.text(1.33, 1300, ' solid (0.6<z<1.2)', color='blue', fontsize=18)
ax.text(1.33, 1230, ' used in this work', color='blue', fontsize=18)
ax.text(1.33, 1160, ' N = 8620', color='blue', fontsize=18)
fig.savefig('/Users/Benjamin/Dropbox/Zhu_Projects/Fine Structure Emission/Version 1/eBOSS_redshift_distribution.eps')
In [272]:
imgii = (where(logical_and(logical_and(objs_ori['zGOOD']==1, objs_ori['Z']>0.35), objs_ori['Z']<1.2)))[0]
ifeii2600 = (where(logical_and(logical_and(objs_ori['zGOOD']==1, objs_ori['Z']>0.43), objs_ori['Z']<1.2)))[0]
ifeii2350 = (where(logical_and(logical_and(objs_ori['zGOOD']==1, objs_ori['Z']>0.66), objs_ori['Z']<1.2)))[0]
iused = (where(logical_and(logical_and(objs_ori['zGOOD']==1, objs_ori['Z']>(3600./2200.-1.)),
objs_ori['Z']<10400./4050.-1.)))[0]
print imgii.size, ifeii2600.size, ifeii2550.size, iused.size
In [21]:
galaxytype = objs_ori['CLASS']
zgood = objs_ori['zGOOD']
z = objs_ori['Z']
In [27]:
from cookb_signalsmooth import smooth
In [41]:
filename = '/Users/Benjamin/AstroData/HST/IUE/HD63922/lp19251'
Odat = genfromtxt(filename, skip_header=19)
Owave = arange(12250)*0.1+1900.
Oflux = Odat[:,0]
iOwave = (where(logical_and(logical_and(Oflux>1E-11, Owave>2200.), Owave<2900.)))[0]
x = Owave[iOwave]
y = Oflux[iOwave]
z = np.polyfit(x, y, 3)
p = np.poly1d(z)
ycont = p(x)
yy = y/ycont
In [74]:
fig = figure(figsize=(20,8))
this_ylim = [0.85, 1.18]
ax = fig.add_subplot(111)
dwave = median(outwave[1:]-outwave[:-1])
#ax.plot(outwave+dwave/2., fluxmedian, 'b', drawstyle='steps', linewidth=1)
yabs = 1.-(1.-absorberstack['FLUXMEDIAN'])*2.
#ax.plot(absorberstack['WAVE'], yabs, 'r', linewidth=2)
ax.set_ylim(this_ylim)
ax.set_xlim(2800, 3600)
#ax.set_title('Composite Spectrum of Emission Line Galaxies (ELGs) from eBOSS', fontsize=15)
ax.set_xlabel(r'$\lambda$ [$\AA$]', fontsize=20)
ax.set_ylabel(r'Normalized $f(\lambda)$', fontsize=20)
for axis in ['top','bottom','left','right']:
ax.spines[axis].set_linewidth(2.0)
ax.tick_params(axis='both', which='both', length=7, width=2, labelsize=15)
#ax.text(2205, 1.90, 'Blue: Emission Line Galaxies at 0.6<z<1.0 (eBOSS 2015)', color='b', fontsize=16, fontname='serif')
#ax.text(2205, 1.83, r'Red: Quasar Absorption-line Systems at 0.4<z<2.2 (Zhu & Menard 2013)', color='r', fontsize=16, fontname='serif')
this_nabslines = 13
this_absorption = zeros(this_nabslines, dtype=[('NAME','S20'),('XPOS','f4'),('YPOS','f4'),('WAVE', 'f4')])
this_absorption[0] = ('FeII 2249.88', 2249.88-8.5, 0.2, 2249.88)
this_absorption[1] = ('FeII 2260.78', 2260.78+2.5, 0.2, 2260.78)
this_absorption[2] = ('FeII 2344.21', 2344.21+2.5, 0.2, 2344.21)
this_absorption[3] = ('FeII 2374.46', 2374.46-8.5, 0.2, 2374.46)
this_absorption[4] = ('FeII 2382.76', 2382.76+2.5, 0.2, 2382.76)
#this_absorption[5] = ('MnII 2576.88', 2576.88-3, 0.2, 2576.88)
this_absorption[6] = ('FeII 2586.65', 2586.65-8.5, 0.18, 2586.65)
#this_absorption[7] = ('MnII 2594.50', 2594.50-3, 0.2, 2594.50)
this_absorption[8] = ('FeII 2600.17', 2600.17+2.5, 0.18, 2600.17)
#this_absorption[9] = ('MnII 2606.46', 2606.46+1.5, 0.2, 2606.46)
this_absorption[10] = ('MgII 2796.35', 2796.35-10.5, 0.2, 2796.35)
this_absorption[11] = ('MgII 2803.53', 2803.53+3.5, 0.2, 2803.53)
this_absorption[12] = ('MgI 2852.96', 2852.96+3.5, 0.21, 2852.96)
this_nemlines = 11
this_emission = zeros(this_nemlines, dtype=[('NAME','S25'),('XPOS','f4'),('YPOS','f4'), ('WAVE','f4')])
this_emission[0] = ('CII] doublet', 2324.21-9.0, 1.35, 2324.21)
this_emission[1] = ('CII]* triplet', 2328.83+2.5, 1.35, 2328.83)
#this_emission[2] = ('', 2328.83+2.5, 1.11, 2328.83)
this_emission[3] = ('FeII* 2365.55', 2365.55-8.5, 1.3, 2365.55)
this_emission[4] = ('FeII* 2396.36', 2396.36+2.5, 1.3, 2396.36)
this_emission[5] = ('FeII* 2626.45', 2626.45+2.5, 1.3, 2626.45)
this_emission[6] = ('FeII* 2612.65', 2612.65-8.5, 1.3, 2612.65)
#this_emission[7] = ('[NeIV] doublet+FeIII', 2422.56-9.5, 1.2, 2422.56)
this_emission[7] = ('[NeIV] doublet', 2422.56-9.5, 1.3, 2422.56)
this_emission[8] = ('2422.56 2425.14', 2425.14+2.5, 1.28, 2425.14)
this_emission[9] = ('[OII] doublet', 2470.97-9.5, 1.3, 2470.97)
this_emission[10] = ('2470.97 2471.09', 2471.09+2.5, 1.285, 2471.09)
#this_emission[5] = ('FeII* 2632.11', 2632.11+2.5, 1.3, 2632.11)
#this_emission[5] = ('FeII* 2467.98', 2467.98+2.5, 1.3, 2467.98)
this_nstellarabs = 2
this_stellarabs = zeros(this_nstellarabs, dtype=[('NAME','S20'),('XPOS','f4'),('YPOS','f4'), ('WAVE','f4')])
this_stellarabs[0] = ('CIII 2297.58', 2297.58+2.5, 0.48, 2297.58)
this_stellarabs[1] = ('CoI 2295.87', 2295.87+2.5, 0.48, 2295.87)
for i in arange(this_nabslines):
atmp = this_absorption[i]
# ax.text(atmp['XPOS'], atmp['YPOS'], atmp['NAME'], fontsize=14, rotation='vertical',va='bottom')
ax.plot([atmp['WAVE'], atmp['WAVE']], [1.0, this_ylim[0]], '--k', linewidth=2)
for i in arange(this_nemlines):
etmp = this_emission[i]
# ax.text(etmp['XPOS'], etmp['YPOS'], etmp['NAME'], color='g', rotation='vertical',va='bottom', fontsize=14)
ax.plot([etmp['WAVE'], etmp['WAVE']], [1.0, this_ylim[1]], '--g', linewidth=2)
for i in arange(this_nstellarabs):
atmp = this_stellarabs[i]
# ax.text(atmp['XPOS'], atmp['YPOS'], atmp['NAME'], fontsize=14, rotation='vertical',va='bottom', color='brown')
ax.plot([atmp['WAVE'], atmp['WAVE']], [0.43, 0.85], '-', color='brown')
# MnII
ax.plot([2576.88-0., 2576.88-0], [1, 0.53], '--k', lw=2)
#ax.text(2576.88-9.5, 0.545, 'MnII 2576.88', fontsize=14, rotation='vertical',va='bottom')
ax.plot([2594.50-0., 2594.50-0.], [this_ylim[0], 1.48], '--k', lw=2)
#ax.text(2594.50-9.5, 1.1, 'MnII 2594.50', fontsize=14, rotation='vertical',va='bottom')
ax.plot([2606.46-0., 2606.46-0.], [1, 0.53], '--k', lw=2)
#ax.text(2606.46+2.5, 0.545, 'MnII 2606.46', fontsize=14, rotation='vertical',va='bottom')
#ax.text(2328.83+2.0, 1.17, '2326.11 2327.64 2328.83', color='g', rotation='vertical',va='bottom', fontsize=12)
# Replot
#ax.plot(outwave+dwave/2., fluxmedian, 'b', drawstyle='steps', linewidth=1.5)
yabs = 1.-(1.-absorberstack['FLUXMEDIAN'])*2.
ax.plot(absorberstack['WAVE'], yabs, 'r', linewidth=2)
#ax.plot(x-2., smooth(((yy-0.03)-1.)*1.2+1., 30), 'r', linewidth=2)
Out[74]:
In [63]:
reload(ebossspec)
Out[63]:
In [76]:
(newoutwave, newfluxmedian, newfluxmean) = ebossspec.new_feiimgii_composite()
In [80]:
fig = figure(figsize=(20,8))
this_ylim = [0.15, 1.8]
ax = fig.add_subplot(111)
dwave = median(outwave[1:]-outwave[:-1])
ax.plot(outwave+dwave/2., norm_fluxmedian, 'b', drawstyle='steps', linewidth=1)
yabs = 1.-(1.-absorberstack['FLUXMEDIAN'])*2.
#ax.plot(absorberstack['WAVE'], yabs, 'r', linewidth=2)
ax.set_ylim(this_ylim)
ax.set_xlim(2200, 2900)
#ax.set_title('Composite Spectrum of Emission Line Galaxies (ELGs) from eBOSS', fontsize=15)
ax.set_xlabel(r'$\lambda$ [$\AA$]', fontsize=20)
ax.set_ylabel(r'Normalized $f(\lambda)$', fontsize=20)
for axis in ['top','bottom','left','right']:
ax.spines[axis].set_linewidth(2.0)
ax.tick_params(axis='both', which='both', length=7, width=2, labelsize=15)
ax.text(2205, 1.90, 'Blue: Emission Line Galaxies at 0.6<z<1.0 (eBOSS 2015)', color='b', fontsize=16, fontname='serif')
ax.text(2205, 1.83, r'Red: Quasar Absorption-line Systems at 0.4<z<2.2 (Zhu & Menard 2013)', color='r', fontsize=16, fontname='serif')
this_nabslines = 13
this_absorption = zeros(this_nabslines, dtype=[('NAME','S20'),('XPOS','f4'),('YPOS','f4'),('WAVE', 'f4')])
this_absorption[0] = ('FeII 2249.88', 2249.88-8.5, 0.2, 2249.88)
this_absorption[1] = ('FeII 2260.78', 2260.78+2.5, 0.2, 2260.78)
this_absorption[2] = ('FeII 2344.21', 2344.21+2.5, 0.2, 2344.21)
this_absorption[3] = ('FeII 2374.46', 2374.46-8.5, 0.2, 2374.46)
this_absorption[4] = ('FeII 2382.76', 2382.76+2.5, 0.2, 2382.76)
#this_absorption[5] = ('MnII 2576.88', 2576.88-3, 0.2, 2576.88)
this_absorption[6] = ('FeII 2586.65', 2586.65-8.5, 0.18, 2586.65)
#this_absorption[7] = ('MnII 2594.50', 2594.50-3, 0.2, 2594.50)
this_absorption[8] = ('FeII 2600.17', 2600.17+2.5, 0.18, 2600.17)
#this_absorption[9] = ('MnII 2606.46', 2606.46+1.5, 0.2, 2606.46)
this_absorption[10] = ('MgII 2796.35', 2796.35-10.5, 0.2, 2796.35)
this_absorption[11] = ('MgII 2803.53', 2803.53+3.5, 0.2, 2803.53)
this_absorption[12] = ('MgI 2852.96', 2852.96+3.5, 0.21, 2852.96)
this_nemlines = 11
this_emission = zeros(this_nemlines, dtype=[('NAME','S25'),('XPOS','f4'),('YPOS','f4'), ('WAVE','f4')])
this_emission[0] = ('CII] doublet', 2324.21-9.0, 1.35, 2324.21)
this_emission[1] = ('CII]* triplet', 2328.83+2.5, 1.35, 2328.83)
#this_emission[2] = ('', 2328.83+2.5, 1.11, 2328.83)
this_emission[3] = ('FeII* 2365.55', 2365.55-8.5, 1.3, 2365.55)
this_emission[4] = ('FeII* 2396.36', 2396.36+2.5, 1.3, 2396.36)
this_emission[5] = ('FeII* 2626.45', 2626.45+2.5, 1.3, 2626.45)
this_emission[6] = ('FeII* 2612.65', 2612.65-8.5, 1.3, 2612.65)
#this_emission[7] = ('[NeIV] doublet+FeIII', 2422.56-9.5, 1.2, 2422.56)
this_emission[7] = ('[NeIV] doublet', 2422.56-9.5, 1.3, 2422.56)
this_emission[8] = ('2422.56 2425.14', 2425.14+2.5, 1.28, 2425.14)
this_emission[9] = ('[OII] doublet', 2470.97-9.5, 1.3, 2470.97)
this_emission[10] = ('2470.97 2471.09', 2471.09+2.5, 1.285, 2471.09)
#this_emission[5] = ('FeII* 2632.11', 2632.11+2.5, 1.3, 2632.11)
#this_emission[5] = ('FeII* 2467.98', 2467.98+2.5, 1.3, 2467.98)
this_nstellarabs = 2
this_stellarabs = zeros(this_nstellarabs, dtype=[('NAME','S20'),('XPOS','f4'),('YPOS','f4'), ('WAVE','f4')])
this_stellarabs[0] = ('CIII 2297.58', 2297.58+2.5, 0.48, 2297.58)
this_stellarabs[1] = ('CoI 2295.87', 2295.87+2.5, 0.48, 2295.87)
for i in arange(this_nabslines):
atmp = this_absorption[i]
ax.text(atmp['XPOS'], atmp['YPOS'], atmp['NAME'], fontsize=14, rotation='vertical',va='bottom')
ax.plot([atmp['WAVE'], atmp['WAVE']], [1.0, this_ylim[0]], '--k', linewidth=2)
for i in arange(this_nemlines):
etmp = this_emission[i]
ax.text(etmp['XPOS'], etmp['YPOS'], etmp['NAME'], color='g', rotation='vertical',va='bottom', fontsize=14)
ax.plot([etmp['WAVE'], etmp['WAVE']], [1.0, this_ylim[1]], '--g', linewidth=2)
for i in arange(this_nstellarabs):
atmp = this_stellarabs[i]
ax.text(atmp['XPOS'], atmp['YPOS'], atmp['NAME'], fontsize=14, rotation='vertical',va='bottom', color='brown')
ax.plot([atmp['WAVE'], atmp['WAVE']], [0.43, 0.85], '-', color='brown')
# MnII
ax.plot([2576.88-0., 2576.88-0], [1, 0.53], '--k', lw=2)
ax.text(2576.88-9.5, 0.545, 'MnII 2576.88', fontsize=14, rotation='vertical',va='bottom')
ax.plot([2594.50-0., 2594.50-0.], [this_ylim[0], 1.48], '--k', lw=2)
ax.text(2594.50-9.5, 1.1, 'MnII 2594.50', fontsize=14, rotation='vertical',va='bottom')
ax.plot([2606.46-0., 2606.46-0.], [1, 0.53], '--k', lw=2)
ax.text(2606.46+2.5, 0.545, 'MnII 2606.46', fontsize=14, rotation='vertical',va='bottom')
#ax.text(2328.83+2.0, 1.17, '2326.11 2327.64 2328.83', color='g', rotation='vertical',va='bottom', fontsize=12)
# Replot
ax.plot(outwave+dwave/2., norm_fluxmean, 'b', drawstyle='steps', linewidth=1.5)
yabs = 1.-(1.-absorberstack['FLUXMEDIAN'])*2.
#ax.plot(absorberstack['WAVE'], yabs, 'r', linewidth=2)
ax.plot(newoutwave+dwave/2., newfluxmedian, 'r', linewidth=2)
Out[80]:
In [14]:
fig, axes = subplots(figsize=(20,18), ncols=2, nrows=6)
axesall = axes.ravel()
fig.subplots_adjust(hspace=0, wspace=0)
minorLocator = MultipleLocator(100)
for i, ax in zip(arange(12), axesall[0:10]):
if i<=1:
ax.xaxis.tick_top()
else:
setp(ax.get_xticklabels(), visible=False)
for ax in axesall[1:13:2]:
ax.yaxis.tick_right()
#setp(ax.get_yticklabels(), visible=False)
xlimits = [-2490, 1990]
wave0 = array([2852.96, 3728.48, 2803.53, 2626.45, 2600.17, 2471.03, 2382.76, 2396.36, 2344.21, 2365.55, 2260.78, 2326.17])
text0 = array(['MgI 2852.96', '[OII] 3728.48',
'MgII 2803.53', 'FeII* 2626.45',
'FeII 2600.17', '[OII] 2471.03',
'FeII 2382.76', 'FeII* 2396.36',
'FeII 2344.21', 'FeII* 2365.55',
'FeII 2260.78', 'CII]+CII]*'])
[3727.10, 3729.86]
[2612.65, 2626.45]
[2586]
ylimits = array([[0.71, 1.19], [0.10, 11.19],
[0.41, 1.19], [0.81, 1.49],
[0.36, 1.26], [0.81, 1.21],
[0.51, 1.26], [0.71, 1.29],
[0.41, 1.19], [0.81, 1.29],
[0.81, 1.09], [0.81, 1.39],])
xpos0 = 700
ypos0 = array([0.76, 9,
0.5, 1.35,
0.45, 1.13,
0.6, 1.15,
0.5, 1.15,
0.86, 1.25])
tmpvel = zeros(outwave.size)
linecolor = ['black', 'green']
for i, ax in zip(arange(12), axesall):
tmpvel = zeros(outwave.size)
tmpvel[1:] = (outwave[1:]-wave0[i])/outwave[1:]*3E5
tmpvel[0] = tmpvel[1]
ax.plot(tmpvel+69./2., fluxmedian, 'b', drawstyle='steps', lw=2)
icolor = mod(i,2)
ax.plot(xlimits, [1,1], ':k', lw=1)
ax.plot([0,0], ylimits[i,:], '--', color=linecolor[icolor], lw=1)
ax.set_ylim(ylimits[i,:])
ax.text(xpos0, ypos0[i], text0[i], color=linecolor[icolor], fontsize=18)
if i>=10:
ax.set_xlabel('Velocity [km/s]', fontsize=22)
# [OII]
plotoii = True
if plotoii:
i = 1
ax = axesall[1]
tmpvel = zeros(outwave.size)
tmpvel[1:] = (outwave[1:]-wave0[i])/outwave[1:]*3E5
tmpvel[0] = tmpvel[1]
ax.plot(tmpvel+69./2., oiifluxmedian, 'b', drawstyle='steps', lw=2)
icolor = mod(i,2)
ax.plot(xlimits, [1,1], ':k', lw=1)
#linewave = array([3727.10, 3729.86])
#linevel = (linewave-wave0[i])/linewave*3E5
#for j in arange(linewave.size):
# ax.plot([linevel[j], linevel[j]], ylimits[i,:], '--', color=linecolor[icolor], lw=1)
ax.set_ylim(ylimits[i,:])
#ax.text(600, 9, '[OII] 3727.10, 3729.86', color=linecolor[icolor], fontsize=15)
for ax in axesall:
ax.tick_params(axis='x', which='major', length=10, width=2, labelsize=20)
ax.tick_params(axis='x', which='minor', length=5, width=2, labelsize=20)
ax.tick_params(axis='y', which='major', length=6, width=2, labelsize=18)
ax.tick_params(axis='y', which='minor', length=3, width=2, labelsize=18)
ax.set_xlim(xlimits)
ax.xaxis.set_minor_locator(minorLocator)
fig.savefig('/Users/Benjamin/Dropbox/Zhu_Projects/Fine Structure Emission/Version 1/eBOSS_composite_velocity.eps')
In [65]:
count_nonzero(newfluxmean)
Out[65]:
In [7]:
out_dtype = np.dtype({'names': ['wave', 'flux'], 'formats': ['(5786,)float', '(5786,)float']})
In [8]:
out_dtype
Out[8]:
In [9]:
outstr = np.zeros(1, dtype=out_dtype)
outstr['wave'] = tmpwave
outstr['flux'] = tmpmedian
In [12]:
fits = fitsio.FITS('/Users/Benjamin/AstroData/SDSS/eBOSS/stacks/eBOSS_composite_full.fits', 'rw', clobber=True)
In [13]:
fits.write(outstr)
fits.close()
In [28]:
count_nonzero(logical_and(logical_and((z>0.6),(z<1.0)),zgood))
Out[28]:
In [ ]: