maschette / somap Goto Github PK
View Code? Open in Web Editor NEWSouthern Ocean round maps
Southern Ocean round maps
A rhetorical question, but should be interesting to explore different approaches.
How would you make this map?
The chlorophyll-a data:
u <- "https://oceandata.sci.gsfc.nasa.gov/cgi/getfile/A20022132017243.L3m_MC_CHL_chl_ocx_9km.nc"
download.file(u, basename(u), mode = "wb")
The chlorophyll-a palette (breaks and colours):
pal <- palr::chlPal(palette = TRUE)
The projection and extents:
xx <- c(0, 90, 180, 270, 360); yy <- c(-60, -40)
"+proj=laea +lat_0=-90 +lon_0=180 +datum=WGS84 +ellps=WGS84 +no_defs +towgs84=0, 0, 0"
The fronts are from orsifronts::orsifronts
:
subset(orsifronts::orsifronts, front %in% c("pf", "saf"))
Insert options for subticks with SOleg.
Currently no option for legends in default_somap
Try
Prototype:
library(sospatial) ## devtools::install_github("AustralianAntarcticDivision/sospatial")
library(SOmap)
SOcool <- function(xs, ys, icedate = "2017-09-01") {
ice <- tibble::tibble(lon = rep_len(seq(-180, 179), length.out = length(packed_lats)),
lat = packed_lats/10,
day = as.Date(rep(ice_dates, each = 360)))
icedate <- as.Date(icedate)
f <- "%Y-%m-%d"
if (icedate < min(ice$day) || icedate > max(ice$day)) {
stop(sprintf("sorry, available range of icedate is %s : %s", format(min(icedate), f), format(max(icedate), f)))
}
ind <- which(icedate == ice$day)
x <- default_somap(xs, ys)
ice <- dplyr::slice(ice, ind)
ice[c("x", "y")] <- rgdal::project(as.matrix(ice[c("lon", "lat")]), projection(x$bathy))
ix <- which(ice$x >= xmin(x$bathy) & ice$x <= xmax(x$bathy) &
ice$y >= ymin(x$bathy) & ice$y <= ymax(x$bathy))
ice <- dplyr::slice(ice, ix)
lines(ice[c("x", "y")], lty = 2)
x$ice <- ice
invisible(x)
}
SOcool(xs, ys)
I expect sospatial will get incorporated into this package, though first we need a way to keep the ice data up to date - it's about a year out atm.
A rhetorical question, but might be interesting to explore. How would you make this map?
The chlorophyll-a data:
u <- "https://oceandata.sci.gsfc.nasa.gov/cgi/getfile/A20022132017243.L3m_MC_CHL_chl_ocx_9km.nc"
download.file(u, basename(u), mode = "wb")
The chlorophyll-a palette (breaks and colours):
pal <- palr::chlPal(palette = TRUE)
The projection and extents:
xx <- c(0, 90, 180, 270, 360); yy <- c(-60, -40)
"+proj=laea +lat_0=-90 +lon_0=180 +datum=WGS84 +ellps=WGS84 +no_defs +towgs84=0, 0, 0"
The fronts are from orsifronts::orsifronts
:
subset(orsifronts::orsifronts, front %in% c("pf", "saf"))
zzz
Why?
data("albatross", package = "adehabitatLT")
track <- rgdal::project(as.matrix(purrr::map_df(albatross, ~rbind(.x[c("x", "y")], NA))), "+proj=utm +zone=42 +south +datum=WGS84", inv = TRUE)
SOauto_map(track[,1], track[,2])
Error in st_cast_sfc_default(x) : list item(s) not of class sfg
Why not just coord_proj("+proj=laea")?
A rhetorical question, but should be interesting to explore different approaches.
How would you make this map?
The chlorophyll-a data:
u <- "https://oceandata.sci.gsfc.nasa.gov/cgi/getfile/A20022132017243.L3m_MC_CHL_chl_ocx_9km.nc"
download.file(u, basename(u), mode = "wb")
The chlorophyll-a palette (breaks and colours):
pal <- palr::chlPal(palette = TRUE)
The projection and extents:
xx <- c(0, 90, 180, 270, 360); yy <- c(-60, -40)
"+proj=laea +lat_0=-90 +lon_0=180 +datum=WGS84 +ellps=WGS84 +no_defs +towgs84=0, 0, 0"
The fronts are from orsifronts::orsifronts
:
subset(orsifronts::orsifronts, front %in% c("pf", "saf"))
aaa
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.