Skip to content
Snippets Groups Projects

Symlinks for DQ Summary pages

Merged Rachael Huxford requested to merge rachael.huxford/iDQ:symlink-summary-pages into main
1 file
+ 14
0
Compare changes
  • Side-by-side
  • Inline
+ 14
0
@@ -3,6 +3,7 @@ import logging
import os
import time
from gpstime import gpstime
import numpy as np
from gwpy.timeseries import TimeSeries
@@ -77,6 +78,7 @@ class Report(object):
self.event_page = self._config.report.get("event_page", True)
self.plot_qscan = self._config.report.get("plot_qscan", True)
self.plot_map_coverage = self._config.report.get("plot_map_coverage", False)
self.symlink_sum_pages = self._config.report.get("symlink_sum_pages", True)
# check frequency bounds
if "frequency" in self.config.features:
@@ -241,10 +243,15 @@ class Report(object):
def report(self, nicknames, reportdir):
"""Generate a full report."""
# act like a DiskReporter...
if self.symlink_sum_pages:
sum_start = gpstime.fromgps(self.start).strftime("%Y%m%d")
symlinkdir = os.path.join(reportdir, f"summary_pages/{sum_start}")
reportdir = names.start_end2fragmented_dir(
self.start, self.end, rootdir=reportdir
)
os.makedirs(reportdir, exist_ok=True)
os.makedirs(os.path.join(reportdir, 'summary_pages'), exist_ok=True)
logger.info(
"generating report for %s within [%.3f, %.3f) with %s"
@@ -547,6 +554,13 @@ class Report(object):
logger.info("writing report to {}".format(reportdir))
thisreport.save(reportdir, config_name="report_test")
# symlink the summary page
if self.symlink_sum_pages:
sum_start = gpstime.fromgps(self.end).strftime("%H:%M:%S")
sum_end = gpstime.fromgps(self.end).strftime("%H:%M:%S")
if (sum_start == "00:00:00" and sum_end == "00:00:00"):
os.symlink(reportdir, symlinkdir)
def classifier_report(
self,
nicknames,
Loading