Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
c9f58d6
Remove unused methods, override coordinates attribute with just '<var…
MBARIMike Nov 6, 2025
b06fafe
Use all fixed dimensions (no unlimited) and add attributes so that cf…
MBARIMike Nov 7, 2025
8367bd4
Add nudged longitude and latitude variables to the combined_nc dataset.
MBARIMike Nov 7, 2025
fb8a446
Use cf_xarray accessors by axis to avoid using actual names for the t…
MBARIMike Nov 7, 2025
18a631b
Add combine().
MBARIMike Nov 7, 2025
bab2134
Add _analyze_original_time_coordinates() to log warnings for log_file…
MBARIMike Nov 7, 2025
31c4030
Handle exceptions more explicitely, improve warning messages.
MBARIMike Nov 7, 2025
40d0610
Add --log_file option and generalize for doroado or lrauv processing.
MBARIMike Nov 10, 2025
060f097
Get seg_min as float(seconds) / 60.0.
MBARIMike Nov 10, 2025
8bcfeb1
Update docstring, remove unused methods, convert lon & lat from radia…
MBARIMike Nov 10, 2025
3c7ccde
Have combine.py write a *_combined.nc file.
MBARIMike Nov 10, 2025
e18d5de
Start testing align.py for lrauv log_files.
MBARIMike Nov 10, 2025
475cbec
Add additional diagnostic mesages for severe dead reckoned time sync …
MBARIMike Nov 10, 2025
455ccc5
Read in Group files with decode_cf=False, use xr.DataArray() to const…
MBARIMike Nov 11, 2025
b31fb8d
Add _consolidate_group_time_coords() and set dims and coords from its…
MBARIMike Nov 11, 2025
e956d03
Only set units to radians for lat & lon in the / group.
MBARIMike Nov 11, 2025
50376aa
Add required metadata for cf decoding, write intermediate file so tha…
MBARIMike Nov 11, 2025
019bdb1
WIP: Add time coordinate(s) to combined_nc - still having problems in…
MBARIMike Nov 12, 2025
d34cf2b
Factor out several small methods to make combine_groups() less comple…
MBARIMike Nov 12, 2025
38be49b
Shift dead reckoned nav data by 1 for shared nudge_positions() to wor…
MBARIMike Nov 12, 2025
3c77dfd
WIP: Making work for data from *_combined.nc
MBARIMike Nov 13, 2025
a8eb98f
Update numbers for tests to pass locally.
MBARIMike Nov 13, 2025
71445ce
Look for upstream summary metadata in the correct data member.
MBARIMike Nov 13, 2025
794eed8
Set create_plots to False - change back to True for debugging.
MBARIMike Nov 13, 2025
d389dc1
Add setting of HOST_NAME environment variable for more meaningful met…
MBARIMike Nov 13, 2025
8643e7d
Update numbers for tests to pass in Actions.
MBARIMike Nov 13, 2025
2da3e11
Try again with EXPECTED_SIZE_GITHUB.
MBARIMike Nov 13, 2025
fbe620a
Update EXPECTED_MD5_GITHUB.
MBARIMike Nov 13, 2025
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
13 changes: 9 additions & 4 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,12 @@
"console": "integratedTerminal",
// A small log_file that has a reasonable amount of data, and known_hash to verify download
//"args": ["-v", "1", "--log_file", "ahi/missionlogs/2025/20250908_20250912/20250911T201546/202509112015_202509112115.nc4", "--known_hash", "d1235ead55023bea05e9841465d54a45dfab007a283320322e28b84438fb8a85"]
// Has bad latitude and longitude values and lots of bad Universal latitude_time values
// brizo 20250914T080941 has bad latitude and longitude values and lots of bad Universal latitude_time and longitude_time values
//"args": ["-v", "2", "--log_file", "brizo/missionlogs/2025/20250909_20250915/20250914T080941/202509140809_202509150109.nc4"]
"args": ["-v", "2", "--log_file", "brizo/missionlogs/2025/20250909_20250915/20250914T080941/202509140809_202509150109.nc4", "--plot_time", "/latitude_time"]
//"args": ["-v", "2", "--log_file", "brizo/missionlogs/2025/20250909_20250915/20250914T080941/202509140809_202509150109.nc4", "--plot_time", "/longitude_time"]
//"args": ["-v", "1", "--log_file", "brizo/missionlogs/2025/20250909_20250915/20250914T080941/202509140809_202509150109.nc4", "--plot_time", "/latitude_time"]
// brizo 20250916T230652 has several ESP Samples from stoqs_lrauv_sep2025
"args": ["-v", "2", "--log_file", "brizo/missionlogs/2025/20250916_20250922/20250916T230652/202509162306_202509180305.nc4", "--plot_time", "/longitude_time"]
},
{
"name": "2.0 - calibrate.py",
Expand Down Expand Up @@ -112,7 +115,8 @@
"program": "${workspaceFolder}/src/data/combine.py",
"console": "integratedTerminal",
"justMyCode": false,
"args": ["-v", "1", "--log_file", "brizo/missionlogs/2025/20250909_20250915/20250914T080941/202509140809_202509150109.nc4"]
//"args": ["-v", "1", "--log_file", "brizo/missionlogs/2025/20250909_20250915/20250914T080941/202509140809_202509150109.nc4"]
"args": ["-v", "1", "--log_file", "brizo/missionlogs/2025/20250916_20250922/20250916T230652/202509162306_202509180305.nc4"]
},
{
"name": "3.0 - align.py",
Expand Down Expand Up @@ -321,7 +325,8 @@
"console": "integratedTerminal",
//"args": ["-v", "1", "--log_file", "brizo/missionlogs/2025/20250909_20250915/20250914T080941/202509140809_202509150109.nc4"]
//"args": ["-v", "2", "--log_file", "brizo/missionlogs/2025/20250909_20250915/20250914T080941/202509140809_202509150109.nc4", "--clobber"]
"args": ["-v", "2", "--log_file", "brizo/missionlogs/2025/20250909_20250915/20250914T080941/202509140809_202509150109.nc4", "--clobber", "--no_cleanup"]
//"args": ["-v", "2", "--log_file", "brizo/missionlogs/2025/20250909_20250915/20250914T080941/202509140809_202509150109.nc4", "--clobber", "--no_cleanup"]
"args": ["-v", "2", "--log_file", "brizo/missionlogs/2025/20250916_20250922/20250916T230652/202509162306_202509180305.nc4", "--no_cleanup"]
//"args": ["-v", "1", "--auv_name", "tethys", "--start", "20120901", "--end", "20121101", "--noinput"]
},

Expand Down
20 changes: 11 additions & 9 deletions LRAUV_WORKFLOW.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,26 @@ on the local file system's work directory is as follows:
│ │ ├── <auv_name> <- e.g.: ahi, brizo, pontus, tethys, ...
│ │ │ ├── missionlogs/year/dlist_dir
│ │ │ │ ├── <log_dir> <- e.g.: ahi/missionlogs/2025/20250908_20250912/20250911T201546/202509112015_202509112115.nc4
│ │ │ │ │ ├── <nc4> <- .nc4 file containing original data
│ │ │ │ │ ├── <nc4> <- .nc4 file containing original data - created by unserialize
│ │ │ │ │ ├── <nc> <- .nc files, one for each group from the .nc4 file
| | | | | | data identical to original in NETCDF4 format
│ │ │ │ │ ├── <_cal> <- A single NETCDF3 .nc file containing all the
| | | | | | varibles from the .nc files along with nudged
| | | | | | latitudes and longitudes - created by combine.py
| | | | | | data identical to original in NetCDF4 format,
| | | | | | but in more interoperable NetCDF3 format
| | | | | | - created by nc42netcdfs.py
│ │ │ │ │ ├── <_combined> <- A single NetCDF3 .nc file containing all the
| | | | | | varibles from the .nc files along with nudged
| | | | | | latitudes and longitudes - created by combine.py
│ │ │ │ │ ├── <_align> <- .nc file with all measurement variables
| | | | | | having associated coordinate variables
| | | | | | at original instrument sampling rate -
| | | | | | created by align.py
| | | | | | at original instrument sampling rate
| | | | | | - created by align.py
│ │ │ │ │ ├── <_nS> <- .nc file with all measurement variables
resampled to a common time grid at n
Second intervals - created by resample.py

nc42netcdfs.py
Extract the groups and the variables we want from the groups into
individual .nc files. These data are saved using NETCDF4 format as
there are many unlimited dimensions that are not allowed in NETCDF3.
individual .nc files. These data are saved using NetCDF4 format as
there are many unlimited dimensions that are not allowed in NetCDF3.
The data in the .nc files are identical to what is in the .nc4 groups.

combine.py
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,11 @@ First time use with Docker on a server using a service account:
* git clone git&#xFEFF;@github.com:mbari-org/auv-python.git
* cd auv-python
* Create a .env file in `/opt/auv-python` with the following contents:
`M3_VOL=<mount_location>`
`AUVCTD_VOL=<mount_location>`
`CALIBRATION_VOL=<mount_location>`
`WORK_VOL=<auv-python_home>/data`

`M3_VOL=<mount_location>`
`AUVCTD_VOL=<mount_location>`
`CALIBRATION_VOL=<mount_location>`
`WORK_VOL=<auv-python_home>/data`
`HOST_NAME=<name_of_host>`
After installation and when logging into the server again mission data can be processed thusly:
* Setting up environment and printing help message:
`sudo -u docker_user -i`
Expand Down
14 changes: 8 additions & 6 deletions src/data/AUV.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import logging
from datetime import datetime

import cf_xarray # Needed for the .cf accessor # noqa: F401
import numpy as np
import xarray as xr

Expand Down Expand Up @@ -88,22 +89,23 @@ def nudge_positions( # noqa: C901, PLR0912, PLR0913, PLR0915
if lon[:][segi].any():
lon_nudged_array = lon[segi]
lat_nudged_array = lat[segi]
dt_nudged = lon.get_index("navigation_time")[segi]
dt_nudged = lon.cf["T"][segi]
logger.debug(
"Filled _nudged arrays with %d values starting at %s "
"which were before the first GPS fix at %s",
len(segi),
lat.get_index("navigation_time")[0],
lat_fix.get_index("gps_time")[0],
lat.cf["T"].data[0],
lat_fix.cf["T"].data[0],
)
else:
lon_nudged_array = np.array([])
lat_nudged_array = np.array([])
dt_nudged = np.array([], dtype="datetime64[ns]")
if segi.any():
seg_min = (
lat.get_index("navigation_time")[segi][-1] - lat.get_index("navigation_time")[segi][0]
).total_seconds() / 60
# Return difference of numpy timestamps in units of minutes
seg_min = (lat.cf["T"].data[segi][-1] - lat.cf["T"].data[segi][0]).astype(
"timedelta64[s]"
).astype(float) / 60.0
else:
seg_min = 0
logger.info(
Expand Down
Loading