Skip to content

Commit

Permalink
Use line_name_sort for HB and HG name conventions (iss #10)
Browse files Browse the repository at this point in the history
  • Loading branch information
astrochun committed May 30, 2020
1 parent 542c646 commit cd02279
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
3 changes: 2 additions & 1 deletion Metallicity_Stack_Commons/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
'OIII_5007']

line_name_short = {"OII": line_name[0], "4363": line_name[3],
"HB": line_name[4], "OIII": line_name[-1]}
"HB": line_name[4], "OIII": line_name[-1],
"HG": line_name[2], "HD": line_name[1]}

fitting_lines_dict = {"lambda0": lambda0, "line_type": line_type, "line_name": line_name}

Expand Down
14 changes: 8 additions & 6 deletions Metallicity_Stack_Commons/analysis/attenuation.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@
import numpy as np
from os.path import join

from .. import k_dict

from .. import k_dict, line_name_short

HgHb_CaseB = 0.468 # Hg/Hb ratio for zero reddening
HaHb_CaseB = 2.86 # Ha/Hb ratio for zero reddening

k_HBETA = k_dict['HBETA']
k_HGAMMA = k_dict['HGAMMA']
HB = line_name_short['HB']
HG = line_name_short['HG']

k_HBETA = k_dict[HB]
k_HGAMMA = k_dict[HG]


def compute_EBV(fitspath, combine_asc):
Expand All @@ -23,8 +25,8 @@ def compute_EBV(fitspath, combine_asc):
"""

ID = combine_asc['ID']
HBETA = combine_asc['HBETA_Flux_Observed'].data
HGAMMA = combine_asc['HGAMMA_Flux_Observed'].data
HBETA = combine_asc[HB+'_Flux_Observed'].data
HGAMMA = combine_asc[HG+'_Flux_Observed'].data

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

Expand Down

0 comments on commit cd02279

Please sign in to comment.