Skip to content

Commit

Permalink
Merge 7bfdfe4 into b8d8ded
Browse files Browse the repository at this point in the history
  • Loading branch information
Duncan Macleod committed Mar 11, 2019
2 parents b8d8ded + 7bfdfe4 commit 00dc5e2
Showing 1 changed file with 9 additions and 5 deletions.
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

0 comments on commit 00dc5e2

Please sign in to comment.