Skip to content

Commit

Permalink
balmer.HbHgHd_fits: Plot aesthetics, include Balmer decrements in ann…
Browse files Browse the repository at this point in the history
…otation (iss #10)
  • Loading branch information
astrochun committed Jun 5, 2020
1 parent 92a4616 commit 2165c50
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions Metallicity_Stack_Commons/plotting/balmer.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from matplotlib.backends.backend_pdf import PdfPages

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

from .. import scalefact, wavelength_dict

Expand Down Expand Up @@ -145,9 +146,12 @@ def HbHgHd_fits(stack_name, astropy_table_file, out_pdf):

row = ii % n_rows

# Label in upper left once
ax_arr[row][0].annotate(f'ID: {ID[ii]}', [0.05, 0.95], va='top', ha='left',
xycoords='axes fraction', fontsize='8')

# The below code could be refactored or simplified
txt0 = r'ID: %i' % (ID[ii]) + '\n'
txt0 += r'+$\sigma$: %.3f, -$\sigma$: %.3f ' % (Hb_fit[1], Hb_fit_neg[1]) + '\n'
txt0 = r'+$\sigma$: %.3f, -$\sigma$: %.3f ' % (Hb_fit[1], Hb_fit_neg[1]) + '\n'
txt0 += 'F_G: %.3f F_S: %.3f' % (Bflux_g, Bflux_s)

ax_arr[row][2].plot(wave, y_norm, 'k', linewidth=0.3, label='Emission')
Expand All @@ -159,10 +163,10 @@ def HbHgHd_fits(stack_name, astropy_table_file, out_pdf):
ax_arr[row][2].plot(wave[Bx_sigsnip_2], Bresid, 'r', linestyle='dashed',
linewidth=0.2, label='Residuals')

txt1 = r'ID: %i' % (ID[ii]) + '\n'
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)
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)

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')
ax_arr[row][1].set_xlim(wave_gamma-50, wave_gamma+50)
Expand All @@ -172,9 +176,9 @@ def HbHgHd_fits(stack_name, astropy_table_file, out_pdf):
ax_arr[row][1].plot(wave[Gx_sigsnip_2], Gresid, 'r', linestyle='dashed',
linewidth=0.2, label='Residuals')

txt2 = r'ID: %i' % (ID[ii]) + '\n'
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)
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)

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 2165c50

Please sign in to comment.