diff --git a/src/data/gulper.py b/src/data/gulper.py index 35069b93..ff29fd5f 100755 --- a/src/data/gulper.py +++ b/src/data/gulper.py @@ -50,13 +50,15 @@ def mission_start_esecs(self) -> float: ) try: self.logger.info("Reading mission start time from url = %s", url) - ds = xr.open_dataset(url, decode_times=False) - return ds.time[0].to_numpy().astype("float64") / 1e9 + ds = xr.open_dataset(url) except OSError: self.logger.info("%s not available yet", url) self.logger.info("Reading mission start time from file_path = %s", file_path) - ds = xr.open_dataset(file_path, decode_times=False) - return ds.time[0].to_numpy().astype("float64") + ds = xr.open_dataset(file_path) + + epoch_seconds = ds.time[0].astype("datetime64[s]").astype("int64") + self.logger.info("Mission start time = %s epoch seconds", epoch_seconds) + return epoch_seconds def parse_gulpers(self, sec_delay: int = 1) -> dict: # noqa: C901, PLR0912, PLR0915 """Parse the Gulper times and bottle numbers from the auvctd syslog file. @@ -114,6 +116,11 @@ def parse_gulpers(self, sec_delay: int = 1) -> dict: # noqa: C901, PLR0912, PLR lines = [line.decode(errors="ignore") for line in resp.iter_lines()] mission_start_esecs = self.mission_start_esecs() + self.logger.info( + "Mission %s start time = %s epoch seconds", + self.args.mission, + mission_start_esecs, + ) # Starting with 2005.299.12 and continuing through 2022.286.01 and later # Used to get mission elapsed time (etime) - matches 'changed state' messages too