From ea45b3eea49571154d6a19a7ceef75ab34de2ede Mon Sep 17 00:00:00 2001 From: Mike McCann Date: Mon, 23 Jun 2025 12:39:40 -0700 Subject: [PATCH] Special fix for GoMx 2010.151.04 mission. Copy from archive AUVCTD/missionnetcdfs/YYYY/YYYYJJJ the usbl.nc file. --- .vscode/launch.json | 3 ++- src/data/calibrate.py | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 7bc29cae..71db7357 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -270,7 +270,8 @@ //"args": ["-v", "1", "--noinput", "--no_cleanup", "--mission", "2020.337.00", "--clobber"] //"args": ["-v", "1", "--noinput", "--no_cleanup", "--mission", "2008.010.10"] //"args": ["-v", "2", "--mission", "2004.029.03", "--noinput", "--no_cleanup"], - "args": ["-v", "1", "--mission", "2023.192.01", "--noinput", "--no_cleanup"], + //"args": ["-v", "1", "--mission", "2023.192.01", "--noinput", "--no_cleanup"], + "args": ["-v", "1", "--mission", "2010.151.04", "--noinput", "--no_cleanup", "--clobber"], }, { diff --git a/src/data/calibrate.py b/src/data/calibrate.py index a5c113cb..704597e4 100755 --- a/src/data/calibrate.py +++ b/src/data/calibrate.py @@ -31,6 +31,7 @@ import logging import os import shlex +import shutil import subprocess import sys import time @@ -1968,6 +1969,23 @@ def _gps_process(self, sensor): self.args.mission, "usbl.nc", ) + if not usbl_file.exists(): + # Copy from archive AUVCTD/missionnetcdfs/YYYY/YYYYJJJ the usbl.nc file + from archive import AUVCTD_VOL + + year = self.args.mission.split(".")[0] + YYYYJJJ = "".join(self.args.mission.split(".")[:2]) + missionnetcdfs_dir = Path( + AUVCTD_VOL, + MISSIONNETCDFS, + year, + YYYYJJJ, + self.args.mission, + ) + shutil.copyfile( + Path(missionnetcdfs_dir, "usbl.nc"), + usbl_file, + ) self.logger.info( "Just for the GoMx mission 2010.151.04 use data from %s " "that came from the missionlogs/usbl.dat file",