dolfyn icon indicating copy to clipboard operation
dolfyn copied to clipboard

Bin mapping

Open jessecusack opened this issue 2 years ago • 6 comments

Thank you for developing a nice package! I am trying to process a TRDI workhorse that pitched 10 - 15 degrees and needs bin mapping prior to coordinate rotations. Correct me if I am wrong, but it doesn't seem like you have bin mapping functionality in here? If I were to attempt to add this, where would be the appropriate place?

jessecusack avatar Apr 21 '22 14:04 jessecusack

@jessecusack Thank you! You are correct, we have not tried to tackle bin mapping. I appreciate you wanting to attempt this; it would fall under the 'ADP' api, so would be added as a new file in the dolfyn/adp directory.

jmcvey3 avatar Apr 22 '22 17:04 jmcvey3

Just found this issue. Thank you for developing DOLfYN!

@jessecusack, @jmcvey3, I started implementing bin-mapping following Dewey & Stringer (2007)'s Equation B1 here a while ago. It could use more testing, but some sanity checks with simple synthetic velocity fields and different pitch/roll angles seem to give qualitatively correct results. Do you think this function might be useful as a starting point?

apaloczy avatar Aug 12 '22 22:08 apaloczy

Let's get a PR for this ASAP!

lkilcher avatar Dec 21 '22 20:12 lkilcher

I ended up implementing bin mapping in a different package, the code is here:

https://github.com/modscripps/velosearaptor/blob/9c70a0b9ab376ca14a416d4e5fae07340b65a0b0/velosearaptor/madcp.py#L897

One advantage of the linear interpolation method I use in the above is that it is vectorized and therefore quite fast. A downside is that it creates a rather large arrays that hog RAM.

I guess parts of this or @apaloczy's package could be copied into dolfyn relatively easily, but I don't have time to figure it myself.

jessecusack avatar Jan 05 '23 04:01 jessecusack

Thanks @jessecusack. The MODScripps code is implemented in TRDI's coordinate system, correct?

The copying in should be easy, yes; testing and making sure the coordinate systems are correct would be the hard part.

jmcvey3 avatar Jan 05 '23 17:01 jmcvey3

Yes it does use the TRDI coordinate system.

jessecusack avatar Jan 05 '23 17:01 jessecusack