Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added HDF5 to omicron-status plots #89

Merged
merged 2 commits into from
Mar 11, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions bin/omicron-status
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ proddir = args.production_directory.format(group=args.group)
outdir = args.output_directory
tag = args.latency_archive_tag.format(group=args.group)

filetypes = ['xml.gz', 'root']
filetypes = ['h5', 'xml.gz', 'root']

if not os.path.isdir(outdir):
os.makedirs(outdir)
Expand Down Expand Up @@ -451,15 +451,16 @@ for c in channels:
plot = Plot(figsize=[12, 5])
lax = plot.add_subplot(grid[0, 0], xscale="auto-gps")
sax = plot.add_subplot(grid[1, 0], sharex=lax, projection='segments')
colors = ['dodgerblue', 'black']
colors = ['lightblue', 'dodgerblue', 'black']

for y, ft in enumerate(filetypes):
# find files
cache = io.find_omicron_files(c, start, end, archive, ext=ft)
cpend = sieve_cache(io.find_pending_files(c, proddir, ext=ft),
segment=Segment(start, end))
# get available segments
found = segments.cache_segments(cache) & segs
avail = segments.cache_segments(cache)
found = avail & segs
pending[c][ft] = segments.cache_segments(cpend) & segs
# remove gaps at the end that represent latency
try:
Expand Down Expand Up @@ -505,6 +506,9 @@ for c in channels:
sax.plot_segmentlist(pending[c][ft], y=y,
facecolor=leg['Pending'].get_facecolor(),
edgecolor=leg['Pending'].get_edgecolor())
sax.plot_segmentlist(avail, y=y, label=ft, alpha=.2, height=.1,
facecolor=leg['Available'].get_facecolor(),
edgecolor=leg['Available'].get_edgecolor())
sax.plot_segmentlist(found, y=y, label=ft, alpha=.5,
facecolor=leg['Available'].get_facecolor(),
edgecolor=leg['Available'].get_edgecolor())
Expand Down Expand Up @@ -537,7 +541,7 @@ for c in channels:
ax.set_xlim(args.gps_start_time, args.gps_end_time)
ax.set_epoch(ax.get_xlim()[1])
sax.xaxis.labelpad = 5
sax.set_ylim(-.5, 1.5)
sax.set_ylim(-.5, len(filetypes) - .5)
sax.legend(leg.values(), leg.keys(), handlelength=1, fontsize=12.4,
loc='lower left', bbox_to_anchor=(1.01, 0), borderaxespad=0)
plots[c] = png = os.path.join(
Expand All @@ -561,7 +565,7 @@ logger.debug("Stored latency data as HDF in %s" % latencyfile)
status = []
for segset, tag in zip([gaps, overlap], ['gaps', 'overlap']):
chans = [(c, segset[c]) for c in segset
if abs(operator.or_(*segset[c].values()))]
if abs(reduce(operator.or_, segset[c].values()))]
jsonfp = os.path.join(outdir, 'nagios-%s-%s.json' % (tag, group))
status.append((tag, jsonfp))
if chans:
Expand Down