modscripps / velosearaptor

python ADCP routines
https://modscripps.github.io/velosearaptor
GNU General Public License v3.0
8 stars 3 forks source link

Bin mapping? #8

Closed jessecusack closed 2 years ago

jessecusack commented 2 years ago

Is there bin mapping functionality in here or pycurrents? I dug around a little but couldn't find any. The ADCP I'm dealing with has some pretty extreme tilting so bin mapping seems unavoidable.

gunnarvoet commented 2 years ago

Yes, this is currently not part of the software. I don't think it was implemented in the Matlab processing toolbox I was using prior to this (https://github.com/modscripps/madcp) but I don't think so.

jessecusack commented 2 years ago

It doesn't seem to be in there either. It needs to be applied to beam coordinate data instead of instrument coords. I was trying to figure out when pycurrents does the rotation. It seems like it automatically rotates into instrument coordinates when loading a data file?

gunnarvoet commented 2 years ago

We read raw data (all pings of one ensemble) in read_ensemble() using an instance of pycurrents Multiread() and its read() method here: https://github.com/gunnarvoet/gadcp/blob/c7c1e03e1906b8ef94d8f6618bc961f417f90963/gadcp/madcp.py#L586 This spits out a dict, or rather a pycurrents.adcp.rdiraw.Bunch, that has both raw data and velocities in instrument reference frame in xyze. Multiread.read() calls _process_ppdlist() which then calls Transform.beam_to_xyz(). As far as I can see this does not apply any mapping to correct for any pitch or roll.

I have never worried about this too much for moorings because the tilt is usually small. Even when a mooring is knocked down, it usually bends into knee-type shape that usually lets the ADCP still stand pretty upright. I am surprised though that the UH software doesn't have this feature. I would imagine that ship roll can impact shipboard ADCP angles quite a bit. Maybe it is worth asking Eric Fiering about this.

gunnarvoet commented 2 years ago

I think this has been addressed by #17.