Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

plot.aquadopp doesn't work #1773

Closed
richardsc opened this issue Jan 21, 2021 · 4 comments
Closed

plot.aquadopp doesn't work #1773

richardsc opened this issue Jan 21, 2021 · 4 comments

Comments

@richardsc
Copy link
Collaborator

richardsc commented Jan 21, 2021

plot(d)
Error in z[, y.look] : incorrect number of dimensions

@richardsc
Copy link
Collaborator Author

Since I just sent a sample file (to be used for the orientation discussion in #1761), I wonder if @dankelley could take a look here too -- I don't have as much time today as I planned, and the plotting code in adp.R that handles all the various different cases and instruments is quite a tangle.

One thing I'm confused about is that there seems to be some blocks in the code that are checking the instrumentType field from the @metadata, but with the current version of oce reading the sample aquadopp file I see that instrumentType doesn't exist. I tried manually adding it (d@metadata$instrumentType <- 'aquadopp') but that didn't fix the issue.

@dankelley
Copy link
Owner

Thanks. I'll likely take a look tomorrow. The code is pretty complex, as you say, and it will require a bit of time to become (re)submerged in it.

@dankelley
Copy link
Owner

I think I have it working in the "develop" branch, commit 72c3d91 ; below is a reprex. I did a quick check, and plot() still works for data(adp).

Please have a look, @richardsc, whenever you get a chance. (This was a simple fix, so no worries about delays in getting back to me, because there's no need for me to retain memory of the steps in a more complex recoding.)

library(oce)
#> Loading required package: gsw
#> Loading required package: testthat
#> Loading required package: sf
#> Linking to GEOS 3.9.0, GDAL 3.2.0, PROJ 7.2.1
d <- read.oce("~/aqd9330.aqd")
#> Warning in decodeHeaderNortek(buf, type = type, debug = debug - 1): using fixed
#> cell size and blanking distance for Aquadopp, since cannot infer these from the
#> file
plot(d)

Created on 2021-01-22 by the reprex package (v0.3.0)

dankelley added a commit that referenced this issue Jan 22, 2021
See #1773

I need to see if this still works for other types of adp, but I'm
guessing it will be okay.  Basically, I just check to see if the
subsetting thing is a matrix or not, and tweaked the max(abs()) call
accordingly to set a scale.
@dankelley
Copy link
Owner

This issue has been closed, since it seems to have been addressed, and since discussion has stalled. The original reporter should feel free to reopen it, though, or to open new issues that might be related. Thanks.

PS. This is a standardized reply.

@dankelley dankelley mentioned this issue Jan 27, 2021
37 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants