Skip to content

Commit

Permalink
analysis.attenuation.compute_EBV: Add Balmer decrement line ratios an…
Browse files Browse the repository at this point in the history
…d use Columns to later incorporate in tables (iss #10)
  • Loading branch information
astrochun committed Jun 3, 2020
1 parent 2daa8ab commit 9fb7a2f
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions Metallicity_Stack_Commons/analysis/attenuation.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from astropy.io import ascii as asc
from astropy.table import Table
from astropy.table import Table, Column
import numpy as np
from os.path import join

Expand All @@ -11,6 +11,7 @@

HB = line_name_short['HB']
HG = line_name_short['HG']
HG = line_name_short['HD']

k_HBETA = k_dict[HB]
k_HGAMMA = k_dict[HG]
Expand All @@ -32,11 +33,18 @@ def compute_EBV(fitspath):
ID = combine_asc['bin_ID'].data
HBETA = combine_asc[HB+'_Flux_Observed'].data
HGAMMA = combine_asc[HG+'_Flux_Observed'].data
HDELTA = combine_asc[HG+'_Flux_Observed'].data

EBV = -2.5 * np.log10((HGAMMA / HBETA) / HgHb_CaseB) / (k_HGAMMA - k_HBETA)
HgHb = HGAMMA / HBETA
HdHb = HGAMMA / HBETA

out_ascii = join(fitspath, 'dust_attenuation_values.tbl')
EBV = -2.5 * np.log10(HgHb/HgHb_CaseB)/(k_HGAMMA - k_HBETA)

col1 = Column(HgHb, name=dust0[1])
col2 = Column(HdHb, name=dust0[1])
col3 = Column(EBV, name=dust0[0])

out_ascii = join(fitspath, 'dust_attenuation_values.tbl')
tab1 = Table([ID, EBV], names=('bin_ID', dust0[0]))
asc.write(tab1, out_ascii, format='fixed_width_two_line')

Expand Down

0 comments on commit 9fb7a2f

Please sign in to comment.