Various Figure methods in the FRB Repository


In [1]:
%matplotlib inline

In [2]:
# suppress warnings for these examples
import warnings
warnings.filterwarnings('ignore')

In [3]:
# imports
from matplotlib import pyplot as plt
from frb import frb

from frb.figures import dm as ffdm
from frb.figures import utils as ffutils
from frb.figures import galaxies as ffgalaxies

Load up


In [4]:
frb121102 = frb.FRB.by_name('FRB121102')
frb180924 = frb.FRB.by_name('FRB180924')
frbs = [frb121102, frb180924]

DM Cartoon


In [5]:
plt.clf()
# Fonts
ffutils.set_mplrc()
#
fig = plt.figure(figsize=(7., 5))
f, (ax1,ax2) = plt.subplots(1,2,sharey=True)
#
ffdm.sub_cartoon(ax1, ax2, frb180924.coord, frb180924.z, host_DM=50., halos=False,
                FRB_DM=frb180924.DM.value, yscl=0.88)
#
plt.show()


<Figure size 432x288 with 0 Axes>
<Figure size 504x360 with 0 Axes>

BPT

Requires that SDSS_DR14_PM.fits has been downloaded

Host galaxies


In [6]:
hosts = [ifrb.grab_host() for ifrb in frbs]

Figure


In [7]:
plt.clf()
# Fonts
ffutils.set_mplrc()
#
fig = plt.figure(figsize=(7., 5))
ax = plt.gca()
#
ffgalaxies.sub_bpt(ax, hosts, ['b','r'], ['s','o'], SDSS_clr='Greys')
#
plt.show()


Not making a dust correction of the SFR.  Set AV_nebular to do so or input AV to this method
read_sets: Using set file -- 
  /data/Projects/Python/linetools/linetools/lists/sets/llist_v1.2.ascii
Not making a dust correction of the SFR.  Set AV_nebular to do so or input AV to this method
Not making a dust correction of the SFR.  Set AV_nebular to do so or input AV to this method
Not making a dust correction of the SFR.  Set AV_nebular to do so or input AV to this method
Using AV=1.0045498154718946 for a dust correction of the SFR
Using AV=1.0045498154718946 for a dust correction of the SFR
Using AV=1.0045498154718946 for a dust correction of the SFR
Using AV=1.0045498154718946 for a dust correction of the SFR
<Figure size 432x288 with 0 Axes>

SFR vs. M*

Requires PRIMUS data

In [8]:
plt.clf()
# Fonts
ffutils.set_mplrc()
#
fig = plt.figure(figsize=(7., 5))
ax = plt.gca()
#
ffgalaxies.sub_sfms(ax, hosts, ['b','r'], ['s','o'])
#
plt.show()


<Figure size 432x288 with 0 Axes>

Color-magnitude

Requires PRIMUS

In [9]:
plt.clf()
# Fonts
ffutils.set_mplrc()
#
fig = plt.figure(figsize=(7., 5))
ax = plt.gca()
#
ffgalaxies.sub_color_mag(ax, [hosts[1]], ['r'], ['o'])
#
plt.show()


<Figure size 432x288 with 0 Axes>

In [ ]: