Using FRBGalaxy objects

v1 - Repeater only so far

In [10]:
%matplotlib notebook

In [16]:
# imports
from pkg_resources import resource_filename
from matplotlib import pyplot as plt
import numpy as np

from frb.galaxies import frbgalaxy

Load a Host galaxy by FRB


In [6]:
host121102 = frbgalaxy.FRBHost.by_name('121102')

Inspect it


In [7]:
host121102.z


Out[7]:
0.19273

In [8]:
host121102.morphology


Out[8]:
{'b/a': 0.25,
 'b/a_err': 0.13,
 'n': 2.2,
 'n_err': 1.5,
 'reff_ang': 0.41,
 'reff_ang_err': 0.06}

In [9]:
host121102.neb_lines


Out[9]:
{'Ha': 2.6082162461507154e-16,
 'Ha_err': 3.600298499287797e-18,
 'Hb': 9.611031647379592e-17,
 'Hb_err': 8.959436281455551e-18,
 '[NII] 6583': 1.192101555659964e-17,
 '[NII] 6583_err': -999.0,
 '[OIII] 5007': 4.3804209229532963e-16,
 '[OIII] 5007_err': 8.379935678693262e-18}

Let's use it on a plot

e.g. BPT


In [21]:
plt.clf()
ax_BPT = plt.gca()
# Plot FRB 121102
ax_BPT.plot([np.log10(host121102.neb_lines['[NII] 6583']/host121102.neb_lines['Ha'])],
        [np.log10(host121102.neb_lines['[OIII] 5007']/host121102.neb_lines['Hb'])], 'bo',
           label='Repeater')
# Axes
ax_BPT.set_xlabel(r"$\log \, ({\rm [NII]/H_\alpha)}$")
ax_BPT.set_ylabel(r"$\log \, ({\rm [OIII]/H_\beta)}$")
ax_BPT.set_xlim(-1.5, 0.5)
ax_BPT.set_ylim(-1, 1.2)
# Standard curves
demarc = lambda x: 0.61 / (x - 0.05) + 1.3  # Kauffman et al 2003, MNRAS, 346, 4, pp. 1055-1077. Eq 1
demarc_kewley = lambda x: 0.61 / (
            x - 0.47) + 1.19  # Kewley F., Dopita M., Sutherland R., Heisler C., Trevena J., 2001, ApJ, 556,121
demarc_liner = lambda x: 1.01 * x + 0.48  # Cid Fernandes et al 2010, MNRAS, 403,1036 Eq 10
ax_BPT.plot(np.linspace(-2, 0), demarc(np.linspace(-2, 0)), "k-", lw=2)#, label="Kauffman et al 2003")
ax_BPT.plot(np.linspace(-2, 0.25), demarc_kewley(np.linspace(-2, 0.25)), "k--", lw=2)#, label="Kewley et al 2001")
ax_BPT.plot(np.linspace(-0.43, 0.5), demarc_liner(np.linspace(-0.43, 0.5)), "k:", lw=2)#, label="Cid Fernandes et al 2010")
# Labels
lsz = 13.
ax_BPT.annotate("Star-forming", (-1.30, 0), fontsize=lsz)
ax_BPT.annotate("LINER", (0.23, 0), fontsize=lsz)
ax_BPT.annotate("Seyfert", (-0.5, 1), fontsize=lsz)
# Legend
ax_BPT.legend(loc="lower left")
# 
plt.show()



In [ ]: