Skip to content
Snippets Groups Projects
Commit e1069143 authored by Colin Clark's avatar Colin Clark
Browse files

Adding pulsars-by-time graph

parent fa7a8a4d
Branches
No related tags found
No related merge requests found
import matplotlib.pyplot as plt
from matplotlib.ticker import ScalarFormatter
import numpy as np
plt.rc('text',usetex=True)
plt.rc('font',family='serif')
# Timeline of pulsar discoveries: [month since launch, total psrs]
# -------------------------------------------------------------------------------------
# By T_obs
# psr_timeline = np.array([[0,0],
# [2,1], # CTA 1
# [5,15], # 16 PSRs - CTA1, Abdo et al., 2009
# [11,8], # 8 PSRs, Saz Parkinson et al., 2010
# [23,2], # 2 PSRs, Saz Parkinson et al., 2010
# [32,10], # 9 Pulsars + J1838, Pletsch et al. 2012
# [36,4], # 4 E@H Pulsars, 2013
# [47,1], # J1311-3430
# [68,10], # First bunch of FGRP4 pulsars - 2 MSPs
# [74, 4], # Next bunch of FGRP4 pulsars - J1208
# [91, 0]] ) # Now
# FGRP1_idx = 6
# FGRP4_idx = 8
# -------------------------------------------------------------------------------------
# By publication date
psr_timeline = np.array([[0,0],
[4,1], # CTA 1
[12,15], # 16 PSRs - CTA1, Abdo et al., 2009
[27,8], # 8 PSRs, Saz Parkinson et al., 2010
[33,2], # 2 PSRs, Saz Parkinson et al., 2010
[39,9], # 9 Pulsars, Pletsch et al. 2012
[47,1], # J1838
[47,1], # J1311-3430
[64,4], # 4 E@H Pulsars, 2013
[84,1], # J1906
[91, 13], # Next bunch of FGRP4 pulsars without J1208
[95, 0]] ) # Now
FGRP1_idx = 8
FGRP4_idx = 9
AEI_idx = 5
# -------------------------------------------------------------------------------------
start = 54682
mjd2008 = 54466
months = 2008 + (psr_timeline[:,0] * (365.25 / 12) + (start - mjd2008))/365.25
psrs = np.cumsum(psr_timeline[:,1])
xfmt = ScalarFormatter(useOffset=False)
fig = plt.figure(figsize=(10,5.5))
ax = fig.add_subplot(111)
plt.step(months, psrs,where='post',color='red',linewidth=2.0)
plt.xticks(np.arange(2009,2017))
plt.ylabel('Total number of pulsars discovered')
plt.title('Timeline of gamma-ray pulsar discoveries in blind searches with Fermi LAT')
ax.xaxis.set_major_formatter(xfmt)
plt.xlim(months[0],months[-1])
# Survey labels
plt.text(months[FGRP1_idx] + 0.8, psrs[FGRP1_idx]/2.0,'E@H\nFGRP1',ha='center')
plt.text(months[FGRP4_idx] + 0.5, psrs[-1]/2.0,'E@H\nFGRP4',ha='center')
plt.text(months[AEI_idx] + 1.0, psrs[AEI_idx]/2.0,'ATLAS Cluster\n AEI Hannover',ha='center')
# Survey shading
ax.fill_between([months[FGRP1_idx],months[FGRP1_idx+1]],[0,0],[psrs[FGRP1_idx],psrs[FGRP1_idx]],color='darkgrey')
ax.fill_between([months[FGRP4_idx],months[FGRP4_idx+1],months[FGRP4_idx+1],months[-1]],
[0,0,0,0],
[psrs[FGRP4_idx],psrs[FGRP4_idx],psrs[FGRP4_idx+1],psrs[-1]],
color='grey')
ax.fill_between([months[AEI_idx],months[AEI_idx + 1],months[AEI_idx + 1],months[FGRP1_idx]],
[0,0,0,0],
[psrs[AEI_idx],psrs[AEI_idx],psrs[AEI_idx + 2],psrs[AEI_idx + 2]],color='lightgrey')
ax.spines['right'].set_visible(False)
ax.spines['top'].set_visible(False)
ax.xaxis.set_ticks_position('bottom')
ax.yaxis.set_ticks_position('left')
plt.savefig('img/psrs_vs_time.png',bbox_inches='tight')
plt.show()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment