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
6 changes: 5 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,11 @@
//"args": ["-v", "1", "--log_file", "brizo/missionlogs/2025/20250903_20250903/20250903T202626/202509032026_202509032030.nc4", "--no_cleanup"]
// Fails in nudge_positions, maybe bad GPS data?
//"args": ["-v", "1", "--log_file", "brizo/missionlogs/2025/20250909_20250915/20250911T073640/202509110736_202509120809.nc4", "--no_cleanup"]
"args": ["-v", "1", "--auv_name", "brizo", "--start", "20250901T000000", "--end", "20251001T000000", "--noinput", "--num_cores", "1", "--no_cleanup"]
// Raises InvalidCombinedFile error
//"args": ["-v", "1", "--log_file", "brizo/missionlogs/2025/20250916_20250922/20250921T001456/202509210014_202509221430.nc4", "--no_cleanup"]
// A depth coordinate was not found for instrument navigation in
//"args": ["-v", "1", "--log_file", "brizo/missionlogs/2025/20250903_20250903/20250903T175939/202509031759_202509032026.nc4", "--no_cleanup"]
"args": ["-v", "1", "--auv_name", "brizo", "--start", "20250901T000000", "--end", "20251001T000000", "--no_cleanup"]
},

]
Expand Down
29 changes: 4 additions & 25 deletions src/data/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ def wrapper(self, log_file: str):
return func(self, log_file)
except (TestMission, FailedMission, EOFError) as e:
self.logger.info(str(e))
except (FileNotFoundError, InvalidCalFile, InvalidCombinedFile, InvalidAlignFile) as e:
self.logger.warning(str(e))
except Exception:
# Catch all other exceptions and log full traceback
self.logger.exception("Exception occurred while processing %s", log_file)
Expand Down Expand Up @@ -525,9 +527,8 @@ def calibrate(self, mission: str) -> None:
try:
netcdf_dir = cal_netcdf.process_logs()
cal_netcdf.write_netcdf(netcdf_dir)
except (FileNotFoundError, EOFError) as e:
cal_netcdf.logger.error("%s %s", mission, e) # noqa: TRY400
cal_netcdf.logger.removeHandler(self.log_handler)
finally:
cal_netcdf.logger.removeHandler(self.log_handler)

def align(self, mission: str = "", log_file: str = "") -> None:
self.logger.info("Alignment steps for %s", mission or log_file)
Expand All @@ -548,15 +549,6 @@ def align(self, mission: str = "", log_file: str = "") -> None:
else:
netcdf_dir = align_netcdf.process_cal()
align_netcdf.write_combined_netcdf(netcdf_dir)
except (FileNotFoundError, EOFError) as e:
align_netcdf.logger.error("%s %s", mission or log_file, e) # noqa: TRY400
error_message = f"{mission or log_file} {e}"
raise InvalidCalFile(error_message) from e
except Exception:
align_netcdf.logger.exception(
"Exception occurred during alignment of %s", mission or log_file
)
raise
finally:
align_netcdf.logger.removeHandler(self.log_handler)

Expand Down Expand Up @@ -611,13 +603,6 @@ def resample(self, mission: str = "", log_file: str = "") -> None:
subprocess.run([wget_path, dap_file_str, "-O", nc_file_str], check=True) # noqa: S603
try:
resamp.resample_align_file(nc_file)
except (FileNotFoundError, InvalidAlignFile) as e:
self.logger.error("%s %s", nc_file, e) # noqa: TRY400
except Exception:
resamp.logger.exception(
"Exception occurred during resampling of %s", mission or log_file
)
raise
finally:
resamp.logger.removeHandler(self.log_handler)

Expand Down Expand Up @@ -1001,9 +986,6 @@ def extract(self, log_file: str) -> None:
extract.logger.info("Downloading %s", url)
input_file = extract.download_with_pooch(url, output_dir)
return extract.extract_groups_to_files_netcdf4(input_file)
except Exception:
extract.logger.exception("Exception occurred during extraction of %s", log_file)
raise
finally:
extract.logger.removeHandler(self.log_handler)

Expand All @@ -1025,9 +1007,6 @@ def combine(self, log_file: str) -> None:
try:
combine.combine_groups()
combine.write_netcdf()
except Exception:
combine.logger.exception("Exception occurred during combine of %s", log_file)
raise
finally:
combine.logger.removeHandler(self.log_handler)

Expand Down
2 changes: 1 addition & 1 deletion src/data/resample.py
Original file line number Diff line number Diff line change
Expand Up @@ -1807,7 +1807,7 @@ def resample_align_file( # noqa: C901, PLR0912, PLR0915, PLR0913
# 'seabird25p' if needed for i2map missions. Early LRAUV missions
# had only CTD_NeilBrown instruments, later ones had CTD_Seabird.
pitch_corrected_instr = self._get_pitch_corrected_instrument()
if pitch_corrected_instr in instrs_to_pad:
if pitch_corrected_instr == "seabird25p" and pitch_corrected_instr in instrs_to_pad:
# Use navigation if seabird25p failed to record
# data all the way to the end of the mission
pitch_corrected_instr = "navigation"
Expand Down