Skip to content

Add realtime SBD shore.nc4 processing pipeline#182

Merged
MBARIMike merged 8 commits into
mbari-org:mainfrom
MBARIMike:main
May 18, 2026
Merged

Add realtime SBD shore.nc4 processing pipeline#182
MBARIMike merged 8 commits into
mbari-org:mainfrom
MBARIMike:main

Conversation

@MBARIMike
Copy link
Copy Markdown
Collaborator

Summary

  • New sbd2netcdf.py: discovers shore.nc4 files by YYYYMM month directory, reads each variable via the shore.nc4 parallel-time pattern, interpolates all variables to a common 1S grid, computes profile_number using the same scipy peak-detection as delayed-mode data, and writes shore_1S.nc alongside each source file
  • New process_lrauv_sbd.py: entry point that calls SbdExtract.process(), concatenates the month's shore_1S.nc files, and drives CreateProducts for quick-look plots
  • create_products.py: resolve bin_median_/bin_mean_ SBD variable names; skip gulpers for realtime missions; fix distnav NaN propagation from sparse GPS by pre-filling lat/lon gaps before distance computation; use np.nanmedian for UTC offset; align scatter arrays to distnav length
  • resample.py: extract add_profile() logic into a standalone compute_profile_number() shared by both pipelines

Test plan

  • Run process_lrauv_sbd.py --auv_name ahi --start 20260406 --end 20260412 -v 1 and confirm shore_1S.nc files are written alongside each shore.nc4
  • Confirm shore_1S.nc is readable with xr.open_dataset() and variables follow <group>_<variable> naming with bin_median_ prefix preserved
  • Confirm profile_number is present and monotonically non-decreasing
  • Confirm quick-look PNG plots are produced in the YYYYMM output directory
  • Confirm delayed-mode resample.py pipeline still produces correct profile_number (regression check)

🤖 Generated with Claude Code

MBARIMike added 8 commits May 18, 2026 10:51
## Summary
- New `sbd2netcdf.py`: discovers `shore.nc4` files by YYYYMM month
  directory, reads each variable via the shore.nc4 parallel-time pattern,
  interpolates all variables to a common 1S grid, computes `profile_number`
  using the same scipy peak-detection as delayed-mode data, and writes
  `shore_1S.nc` alongside each source file
- New `process_lrauv_sbd.py`: entry point that calls `SbdExtract.process()`,
  concatenates the month's `shore_1S.nc` files, and drives `CreateProducts`
  for quick-look plots
- `create_products.py`: resolve `bin_median_`/`bin_mean_` SBD variable
  names; skip gulpers for realtime missions; fix `distnav` NaN propagation
  from sparse GPS by pre-filling lat/lon gaps before distance computation;
  use `np.nanmedian` for UTC offset; align scatter arrays to `distnav` length
- `resample.py`: extract `add_profile()` logic into a standalone
  `compute_profile_number()` shared by both pipelines

## Test plan
- [ ] Run `process_lrauv_sbd.py --auv_name ahi --start 20260406 --end 20260412 -v 1`
      and confirm `shore_1S.nc` files are written alongside each `shore.nc4`
- [ ] Confirm `shore_1S.nc` is readable with `xr.open_dataset()` and variables
      follow `<group>_<variable>` naming with `bin_median_` prefix preserved
- [ ] Confirm `profile_number` is present and monotonically non-decreasing
- [ ] Confirm quick-look PNG plots are produced in the YYYYMM output directory
- [ ] Confirm delayed-mode `resample.py` pipeline still produces correct
      `profile_number` (regression check)

🤖 Generated with [Claude Code](https://claude.com/claude-code)
…ecks, and pyxis CBIT variable

Add --current_month, --previous_month, --last_n_days date modes (mutually exclusive with --start); --auv_name now accepts multiple names and defaults to all known LRAUVs via ALL_LRAUV_NAMES in common_args.py; main() loops over vehicles

Skip shore_1S.nc, per-log plots, and monthly plots when outputs are newer than their source files; --clobber bypasses all freshness checks

Add CBIT/ampHoursUsed to SBD_PARMS; substitute cbit_amphoursused for elevator angle in the engineering plot for pyxis realtime only; add "Ah Used" short label; fix _resolve_label to read units from dataset attrs when no long_name is present

Write shore_1S.nc as NETCDF4_CLASSIC to match the delayed-mode pipeline

Use vehicle-relative paths in log messages; remove plt.show() from plot methods to prevent macOS backend timer crash; demote several per-variable warnings to debug
@MBARIMike MBARIMike merged commit dceb08d into mbari-org:main May 18, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant