Skip to content
Snippets Groups Projects
Commit a361256e authored by Nico Vermaas's avatar Nico Vermaas
Browse files

adding functionality to directly read qbx files

parent 1ca195e0
No related branches found
No related tags found
No related merge requests found
......@@ -215,17 +215,19 @@ def do_sky_plot(plot_engine, title, x,y, duration, sizes, output_html,y_axis_tit
plt.show()
def do_speed_plot(title, y_axis_title, subtitle, datapoints):
def do_speed_plot(title, y_axis_title, subtitle, annotate, datapoints):
"""
:param title: Title of Plot
:param x: dict with data for x-axis (time)
:param y: dict with data for y_axix (usage)
:return:
"""
print('do_speed_plot()')
fig = plt.figure(figsize=(12,6))
#fig, ax = plt.subplots()
plt.text(x=0.5, y=0.94, s=title, fontsize=14, ha="center", transform=fig.transFigure)
plt.text(x=0.5, y=0.90, s='query: '+subtitle, fontsize=10, ha="center", transform=fig.transFigure)
......@@ -254,6 +256,9 @@ def do_speed_plot(title, y_axis_title, subtitle, datapoints):
# plot start and end points
plt.plot(datapoint['timestamp'], datapoint['speed_bps'], 'r.',
datapoint['timestamp_end'], datapoint['speed_bps'], 'r.')
if annotate is not None:
plt.text(datapoint['timestamp'], datapoint['speed_bps'], datapoint[annotate]+'...',
rotation='vertical', fontsize=8)
if datapoint['type']=='ingesting':
ingesting_x.append(datapoint['timestamp'])
......@@ -263,7 +268,9 @@ def do_speed_plot(title, y_axis_title, subtitle, datapoints):
plt.plot(datapoint['timestamp'], datapoint['speed_bps'], 'g.',
datapoint['timestamp_end'], datapoint['speed_bps'], 'g.')
if annotate is not None:
plt.text(datapoint['timestamp'], datapoint['speed_bps'], datapoint[annotate]+'...',
rotation='vertical', fontsize=8)
# plot lines
# connect a line
for i in range(0,len(observing_x),2):
......
......@@ -448,11 +448,11 @@ def main():
# --------------------------------------------------------------------------------------------------------
if (args.version):
print('--- atdb_plot.py - version 1.0.0 - 28 mar 2019 ---')
print('--- atdb_stats.py - version 1.0.0 - 9 jun 2019 ---')
print('Copyright (C) 2019 - Nico Vermaas - ASTRON. This program comes with ABSOLUTELY NO WARRANTY;')
return
print('--- atdb_plot.py - version 1.0.0 - 28 mar 2019 ---')
print('--- atdb_stats.py - version 1.0.0 - 9 jun 2019 ---')
print('Copyright (C) 2019 - Nico Vermaas - ASTRON. This program comes with ABSOLUTELY NO WARRANTY;')
if args.starttime != None:
starttime = datetime.datetime.strptime(args.starttime, TIME_FORMAT)
......
--presentation=ingest_speed
--atdb_host=http://192.168.22.22/atdb
--title=I/O speeds on wcudata1 from ATDB
--observing_mode=imaging
--y_axis_title=I/O Speed in Gbps
--starttime=2019-06-08 00:00
--endtime=2019-06-09 00:00
--query=taskID__contains=190608
--query=starttime__gt=2019-06-07T00:00:00Z&starttime__lt=2019-06-10T00:00:00Z
--annotate=taskid
--plot_engine=mathplotlib
\ No newline at end of file
......@@ -6,6 +6,6 @@
--starttime=2019-06-08 00:00
--endtime=2019-06-09 00:00
--query=taskID__contains=190608
--query=starttime__gt=2019-06-07T00:00:00Z&starttime__lt=2019-06-11T00:00:00Z
--query=starttime__gt=2019-06-07T00:00:00Z&starttime__lt=2019-06-10T00:00:00Z
--annotate=taskid
--plot_engine=mathplotlib
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment