ArgoCanada / argoFloats

Tools for analyzing collections of oceanographic Argo floats
https://argocanada.github.io/argoFloats/index.html
17 stars 7 forks source link

Proposal: mapControl should have latitudelim and longitudelim arguments #539

Closed j-harbin closed 2 years ago

j-harbin commented 2 years ago

I was looking at Argo data for the last month, and then I wanted to zoom in on a specific area. Similar to mapPlot in oce, I expected to be able to set my latitudelim or longitudelim. I searched in the docs thinking they must be named something else in argoFloats (ie. xlim and xlim), but based on the docs it seems the user actually doesn't have that option.

It is true that the user could simply use mapPlot and then mapPoints to display the desired points, but that kind of defeats the purpose of the specialized map plot for argoFloats. Thoughts on this, Team?

library(argoFloats)
ai <- getIndex(age=30)
index2021 <- subset(ai, time=list(from="2021-11-13", to="2021-12-13"))
plot(index2021, mapControl=list(bathymetry=FALSE, latitudelim=c(15,40)))
dankelley commented 2 years ago

The values of longitudelim and latitudelim are not being propagated to mapPlot(). They could be, though. Note that you did not give projection=TRUE and so you are not getting a call to mapPlot(). If you give projection=TRUE you get Molleweide proj (sp?); here is how to get Robinson

plot(index2021, mapControl=list(bathymetry=FALSE, longitudelim=c(-100,0), latitudelim=c(0,80),projection="+proj=robin"))

but note, as I said that the lon and lat limits are not being sent to mapPlot(). Using mapPlot() is really quite tricky, because a lot of projections need extra parameters to not look terrible in a particular region, and also because coastlines can be drawn terribly in many projections.

It would be easy to add longitudelim and latitudelim. You could try, @j-harbin, and make a PR, if you like. Obviously, it requires both coding and documentation writing. The latter can be trickier than the former.

For myself, I'd be very happy to use the argoFloats methodology to find a region but then to draw diagrams separately with oce calls. Once you have lons and lats, it's no longer an argofloat-specific problem, but a general one, and oce has tools for that.

richardsc commented 2 years ago

@dankelley wrote:

For myself, I'd be very happy to use the argoFloats methodology to find a region but then to draw diagrams separately with oce calls. Once you have lons and lats, it's no longer an argofloat-specific problem, but a general one, and oce has tools for that.

I agree with this -- we should try to avoid duplicating tools too much. The plot method for argoFloats is handy, but it isn't necessarily made to be 100% general tool for everything up to publication-quality plots.

github-actions[bot] commented 2 years ago

The Stale-bot has marked this issue as Stale, because no new comments have been added in the past 30 days. Unless a comment is added within the next 7 days, the Stale-bot will close the issue. The purpose of these automated actions is to prevent the developers from forgetting about unattended tasks. Note that adding a "pinned" label will turn this action off for a given issue.

j-harbin commented 2 years ago

Hi All -

I've finally found some time to look at these dated issues. I agree with all of your above comments. Also, the user has the option to do the following, so I'm totally okay with that. I'm (re)-closing this issue.

library(argoFloats)
data(index)
plot(index, which="map", ylim=c(27,28))

Created on 2022-01-20 by the reprex package (v2.0.0)