Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,8 @@
//"args": ["--auv_name", "dorado", "--mission", "2023.123.00", "-v", "1"],
//"args": ["-v", "2", "--log_file", "brizo/missionlogs/2025/20250916_20250922/20250916T230652/202509162306_202509180305.nc4"]
//"args": ["--auv_name", "dorado", "--mission", "2025.316.02", "-v", "1"],
//"args": ["-v", "1", "--log_file", "pontus/missionlogs/2025/20250604_20250616/20250608T020852/202506080209_202506081934.nc4"],
"args": ["-v", "1", "--log_file", "ahi/missionlogs/2025/20250414_20250418/20250414T205440/202504142054_202504150400.nc4"],
"args": ["-v", "1", "--log_file", "pontus/missionlogs/2025/20250604_20250616/20250608T020852/202506080209_202506081934.nc4"],
//"args": ["-v", "1", "--log_file", "ahi/missionlogs/2025/20250414_20250418/20250414T205440/202504142054_202504150400.nc4"],
},
{
"name": "5.0 - archive.py",
Expand Down
11 changes: 11 additions & 0 deletions src/data/resample.py
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,12 @@ def add_profile(self, depth_threshold: float) -> None:
self.resampled_nc["profile_number"].attrs["coordinates"] = "time depth latitude longitude"
self.resampled_nc["profile_number"].attrs = {
"long_name": "Profile number",
"comment": (
f"Sequential profile counter identifying individual vertical casts. "
f"Profiles are detected from depth vertices using scipy.signal.find_peaks "
f"with prominence={depth_threshold}m threshold. Increments when vehicle "
f"transitions between upcast and downcast with sufficient vertical displacement."
),
}

def set_proxy_parameters(self, mission_start: datetime) -> tuple[float, float]:
Expand Down Expand Up @@ -1711,6 +1717,11 @@ def resample_mission( # noqa: C901, PLR0912, PLR0915, PLR0913
for icount, (instr, variables) in enumerate(
self.instruments_variables(nc_file).items(),
):
# Omit LRAUV "instruments" whose coordinates are confusing
# to have in the final resampled file
if instr in ("deadreckonusingmultiplevelocitysources", "nal9602", "nudged"):
self.logger.info("Skipping resampling for instrument %s", instr)
continue
if icount == 0:
self.df_o = pd.DataFrame() # original dataframe
self.df_r = pd.DataFrame() # resampled dataframe
Expand Down
12 changes: 6 additions & 6 deletions src/data/test_process_dorado.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ def test_process_dorado(complete_dorado_processing):
# but it will alert us if a code change unexpectedly changes the file size.
# If code changes are expected to change the file size then we should
# update the expected size here.
EXPECTED_SIZE_GITHUB = 621408
EXPECTED_SIZE_ACT = 621406
EXPECTED_SIZE_LOCAL = 621456
EXPECTED_SIZE_GITHUB = 621716
EXPECTED_SIZE_ACT = 621714
EXPECTED_SIZE_LOCAL = 621764
if str(proc.args.base_path).startswith("/home/runner"):
# The size is different in GitHub Actions, maybe due to different metadata
assert nc_file.stat().st_size == EXPECTED_SIZE_GITHUB # noqa: S101
Expand All @@ -50,9 +50,9 @@ def test_process_dorado(complete_dorado_processing):
check_md5 = True
if check_md5:
# Check that the MD5 hash has not changed
EXPECTED_MD5_GITHUB = "7c7a3e844988d3bb6ec2a951824bc0d5"
EXPECTED_MD5_ACT = "fac632c321b4956b6015d6de97958f8a"
EXPECTED_MD5_LOCAL = "c4a13d6e7ec7f35ae5aafa97ea9a2279"
EXPECTED_MD5_GITHUB = "bbb9e7e9129c19e39895218d35cc474f"
EXPECTED_MD5_ACT = "1fb192c144f6f4f8f06b555a339587ed"
EXPECTED_MD5_LOCAL = "aec48d0abb58d9e831e5b22180eebd8f"
if str(proc.args.base_path).startswith("/home/runner"):
# The MD5 hash is different in GitHub Actions, maybe due to different metadata
assert hashlib.md5(open(nc_file, "rb").read()).hexdigest() == EXPECTED_MD5_GITHUB # noqa: PTH123, S101, S324, SIM115
Expand Down
6 changes: 3 additions & 3 deletions src/data/test_process_i2map.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ def test_process_i2map(complete_i2map_processing):
# but it will alert us if a code change unexpectedly changes the file size.
# If code changes are expected to change the file size then we should
# update the expected size here.
EXPECTED_SIZE_GITHUB = 52686
EXPECTED_SIZE_ACT = 52656
EXPECTED_SIZE_LOCAL = 52786
EXPECTED_SIZE_GITHUB = 52994
EXPECTED_SIZE_ACT = 52964
EXPECTED_SIZE_LOCAL = 53094
if str(proc.args.base_path).startswith("/home/runner"):
# The size is different in GitHub Actions, maybe due to different metadata
assert nc_file.stat().st_size == EXPECTED_SIZE_GITHUB # noqa: S101
Expand Down