knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "readmefigs/README-" )
Obtain Antarctic and Southern Ocean Sea Ice imagery from the BOM
This is a rough prototype and only some of the parameters are built in and generalized properly. Work in progress.
Install with devtools.
devtools::install_github("mdsumner/asosi")
library(asosi) library(rworldxtra) library(rgdal) data(countriesHigh) library(graticule)
library(asosi) library(rworldxtra) data(countriesHigh) library(rgdal) ant <- subset(countriesHigh, SOVEREIGNT == "Antarctica") library(graticule) durv <- asosi(as.Date("2015-07-30"), region = "durville") durvmap <- spTransform(ant, projection(durv)) durvgrat <- graticule(seq(135, 160, by = 5), seq(-70, -60, by = 2), proj = projection(durv)) plot(durv, addfun = function() {plot(durvmap, add = TRUE); plot(durvgrat, add = TRUE)}, maxpixels = ncell(durv)) #writeRaster(durv, gsub(".gif", ".tif", basename(durv))) regions <- c( "casey", "davis", "durville", "mawson", "shackleton", "terranova", "westice", "ragnhild", "enderby", "capeadare", "sabrina" ) for (jj in seq_along(regions)) { simap <- asosi(region = regions[jj]) elx <- extent(projectExtent(simap, "+proj=longlat +ellps=WGS84")) lon <- seq((xmin(elx) %/% 5) * 5, ((xmax(elx) %/% 5) + 1) * 5, by = 5) lat <- seq((ymin(elx) %/% 2) * 2, (ymax(elx) %/% 2 + 1) * 2, by = 2) ## put this in the function as a return property date <- as.Date(paste(format(Sys.Date(), "%Y"), substr(basename(filename(simap)), 10, 13)), "%Y %m%d") map <- spTransform(ant, projection(simap)) grat <- graticule(lon, lat, proj = projection(simap), nverts = 80) plot(simap, addfun = function() {plot(map, add = TRUE); plot(grat, add = TRUE)}, maxpixels = ncell(simap)) title(sprintf("%s %s", regions[jj], format(date)), line = -1.5, bg = "grey") }
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.