From 44986a9f4aca385890811a03a059f017a1941923 Mon Sep 17 00:00:00 2001 From: Tamas Gal <tgal@km3net.de> Date: Fri, 4 Oct 2019 11:53:35 +0200 Subject: [PATCH] only show day and month when time ranger bigger than 24hours --- scripts/ahrs_calibration.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/ahrs_calibration.py b/scripts/ahrs_calibration.py index 3ff7090..78d6071 100755 --- a/scripts/ahrs_calibration.py +++ b/scripts/ahrs_calibration.py @@ -108,7 +108,10 @@ class CalibrateAHRS(kp.Module): def create_plot(self): print(self.__class__.__name__ + ": updating plot.") - xfmt = md.DateFormatter('%Y-%m-%d %H:%M') + if self.time_range > 24: + xfmt = md.DateFormatter('%Y-%m-%d %H:%M') + else: + xfmt = md.DateFormatter('%H:%M') xlim = (datetime.utcfromtimestamp(time.time() - self.time_range * 60 * 60), datetime.utcnow()) -- GitLab