Skip to content

Commit

Permalink
balmer.HbHgHd_fits: Compute EBV and annotate plots (iss #10)
Browse files Browse the repository at this point in the history
  • Loading branch information
astrochun committed Jun 5, 2020
1 parent 9d9097f commit 7ed3945
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Metallicity_Stack_Commons/plotting/balmer.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from matplotlib.backends.backend_pdf import PdfPages

from ..analysis.fitting import gauss, double_gauss
# from ..analysis.attenuation import compute_EBV
from ..analysis.attenuation import compute_EBV

from .. import scalefact, wavelength_dict

Expand Down Expand Up @@ -144,6 +144,10 @@ def HbHgHd_fits(stack_name, astropy_table_file, out_pdf):
fit_result_in = [wave, y_norm, wave_delta, Hd_fit, Hd_fit_neg]
Dgauss0, Dresid, Dx_sigsnip_2, Dflux_g, Dflux_s = fitting_result(*fit_result_in)

# Calculate E(B-V)
EBV_HgHb = compute_EBV(Gflux_g/Bflux_g, source='HgHb')
EBV_HdHb = compute_EBV(Dflux_g/Bflux_g, source='HdHb')

row = ii % n_rows

# Label in upper left once
Expand All @@ -165,7 +169,7 @@ def HbHgHd_fits(stack_name, astropy_table_file, out_pdf):

txt1 = r'+$\sigma$: %.3f, -$\sigma$: %.3f ' % (Hg_fit[1], Hg_fit_neg[1]) + '\n'
txt1 += 'F_G: %.3f F_S: %.3f' % (Gflux_g, Gflux_s) + '\n'
txt1 += r'H$\gamma$/H$\beta$ = %.2f' % (Gflux_g/Bflux_g)
txt1 += r'H$\gamma$/H$\beta$: %.2f E(B-V): %.2f' % (Gflux_g/Bflux_g, EBV_HgHb)

ax_arr[row][1].plot(wave, y_norm, 'k', linewidth=0.3, label='Emission')
ax_arr[row][1].plot(wave, Ggauss0, 'm', linewidth=0.25, label='Gamma Fit')
Expand All @@ -178,7 +182,7 @@ def HbHgHd_fits(stack_name, astropy_table_file, out_pdf):

txt2 = r'+$\sigma$: %.3f, -$\sigma$: %.3f ' % (Hd_fit[1], Hd_fit_neg[1]) + '\n'
txt2 += 'F_G: %.3f F_S: %.3f' % (Dflux_g, Dflux_s) + '\n'
txt2 += r'H$\delta$/H$\beta$ = %.2f' % (Dflux_g/Bflux_g)
txt2 += r'H$\delta$/H$\beta$: %.2f E(B-V): %.2f' % (Dflux_g/Bflux_g, EBV_HdHb)

ax_arr[row][0].plot(wave, y_norm, 'k', linewidth=0.3, label='Emission')
ax_arr[row][0].plot(wave, Dgauss0, 'm', linewidth=0.25, label='Delta Fit')
Expand Down

0 comments on commit 7ed3945

Please sign in to comment.