lhapdf

view plotnsets @ 1110:2ba52dbf2312

Add release instructions for new sets
author Andy Buckley <andy@insectnation.org>
date Tue, 17 Oct 2017 17:12:04 +0100
parents b727d3f3fad3
children
line source
1 #! /usr/bin/env python
3 import optparse
4 op = optparse.OptionParser()
5 opts, args = op.parse_args()
6 datfile = args[0] #"nsets.dat"
8 import datetime
9 revs, dates, nsets = [], [], []
10 with open(datfile) as f:
11 for line in f:
12 items = line.split()
13 revs.append(items[0])
14 ts = float(items[1].replace("-3600", "").replace("-7200", ""))
15 dates.append(datetime.date.fromtimestamp(ts))
16 nsets.append(int(items[2]))
18 import os.path
19 import matplotlib
20 import matplotlib.pyplot as plt
21 # import matplotlib.dates as mdates
22 # import matplotlib.cbook as cbook
23 plt.plot(dates, nsets)
24 stabledate = datetime.date.fromtimestamp(1375890958.00) #< 6.0.0 release at revision 413
25 plt.axvline(stabledate, color="r", linestyle="--")
26 plt.xlim(left=stabledate)
27 plt.xlabel("Year")
28 plt.ylabel("# PDF sets in LHAPDF6 library")
29 # plt.locator_params(axis='x',nbins=5)
30 plt.gca().xaxis.set_major_locator(matplotlib.dates.YearLocator())
31 plt.gca().xaxis.set_minor_locator(matplotlib.dates.MonthLocator())
32 plt.savefig(os.path.splitext(datfile)[0] + ".pdf")
33 # plt.show()