Skip to content

Dual profile naming scheme and running (dolfyn.adp) cleaning functions #373

@willcoxe

Description

@willcoxe

Hello,

I am using the dual profile option in dolfyn to read an ad2cp file and then attempting to perform some basic operations according to
the adcp example. For dual profiles sda and sdb, sda functions perfectly but because the names are appended with an _avg in sdb, the second profile, many of the operations do not run correctly, such as rotating the frame and/or cleaning data based on pressure & on correlation. Also in the second profile the dsb.attrs["cell_size"] is missing which leads to issues with some of the operations described in the example.

May of these work once the _avg is removed from the name and the time dimension is adjusted to dsb["time"] instead of dsb["time_avg"] (e.g. dsb = dsb.swap_dims({'time_avg': 'time'}) ) and I make sure to manually set dsb.attrs["cell_size"].

One exception (there might be others), which I have not yet fully debugged is api.clean.remove_surface_interference(dsb).

>>> api.clean.remove_surface_interference(dsb)
Traceback (most recent call last):
  File "~/code/python/venvs/adcp2/lib/python3.13/site-packages/mhkit/dolfyn/adp/clean.py", line 397, in remove_surface_interference
    a[..., bds] = val
    ~^^^^^^^^^^
IndexError: too many indices for array: array is 1-dimensional, but 2 were indexed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "myscript.py", line 95, in <module>
    dsb = api.clean.remove_surface_interference(dsb)
  File "~/code/python/venvs/adcp2/lib/python3.13/site-packages/mhkit/dolfyn/adp/clean.py", line 399, in remove_surface_interference
    a[..., bds] = 0
    ~^^^^^^^^^^
IndexError: too many indices for array: array is 1-dimensional, but 2 were indexed

I am guessing that others may run into this also when using dual profiles with Nortek instruments. I will continue to try to debug the problem and would appreciate any hints you might have.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions