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",