From 872a17d817f09b831d9746370461d3b9dd4e5f95 Mon Sep 17 00:00:00 2001 From: Mike McCann Date: Mon, 22 Dec 2025 10:50:10 -0800 Subject: [PATCH] Hard code add_seconds value for mission 2025.316.02, don't rely on user input. --- .vscode/launch.json | 5 ++++- src/data/logs2netcdfs.py | 9 +++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 47bb8014..adc43d2e 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -352,7 +352,10 @@ // File "/src/data/create_products.py", line 997, in _plot_var AttributeError: 'NoneType' object has no attribute 'get_index' //"args": ["-v", "1", "--mission", "2010.257.00", "--noinput", "--no_cleanup" ], // File "/src/data/create_products.py", line 806, ValueError: max() iterable argument is empty - "args": ["-v", "1", "--mission", "2013.079.00", "--noinput", "--no_cleanup" ], + //"args": ["-v", "1", "--mission", "2013.079.00", "--noinput", "--no_cleanup" ], + // Add --add_seconds argument for 2025.316.02 mission when procss_missions is used + "args": ["-v", "1", "--noinput", "--start_year", "2025", "--end_year", "2025", "--start_yd", "316", "--num_cores", "1", "--no_cleanup"] + }, { diff --git a/src/data/logs2netcdfs.py b/src/data/logs2netcdfs.py index d49b873e..5d923a43 100755 --- a/src/data/logs2netcdfs.py +++ b/src/data/logs2netcdfs.py @@ -645,8 +645,13 @@ def correct_times(self, log_data, add_seconds: int = 0): def write_variables(self, log_data, netcdf_filename): log_data = self._correct_dup_short_names(log_data) - if self.mission == "2025.316.02" and self.add_seconds: - # So far only this mission is known to suffer from GPS Week Rollover bug + if self.mission == "2025.316.02": + # Hard code add_seconds value for mission 2025.316.02, don't rely on user input + self.add_seconds = 1024 * 7 * 24 * 3600 + self.logger.info( + "Overriding add_seconds to 1024*7*24*3600 = %d for mission 2025.316.02", + self.add_seconds, + ) log_data = self.correct_times(log_data, self.add_seconds) self.nc_file.createDimension(TIME, len(log_data[0].data)) for variable in log_data: