Site icon R-bloggers

El niño anomaly

[This article was first published on r.iresmi.net, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Surf – CC-BY-NC-ND by Al Case

Day 16 of 30DayMapChallenge: « Oceania » (previously).

Using data from NOAA. Tried different combinations of {terra}/{stars}/{raster} and {ggplot2}/{tmap}/base::plot and between glitches, projection problems, slow plotting, limited customization, that’s not very satisfying…

library(terra)
library(viridis)
ssta_file <- "ct5km_ssta_v3.1_20231115.nc"

if (!file.exists(ssta_file)) {
  download.file(paste0("https://www.star.nesdis.noaa.gov/pub/sod/mecb/crw/data/5km/v3.1_op/nc/v1.0/daily/ssta/2023/",
                       ssta_file), 
                ssta_file)
}

ssta <- rast(ssta_file) |> 
  project(
   'PROJCS["Sphere_Equal_Earth_Asia_Pacific",
    GEOGCS["GCS_Sphere_GRS_1980_Mean_Radius",
        DATUM["D_Sphere_GRS_1980_Mean_Radius",
            SPHEROID["Sphere_GRS_1980_Mean_Radius",6371008.7714,0.0]],
        PRIMEM["Greenwich",0.0],
        UNIT["Degree",0.0174532925199433]],
    PROJECTION["Equal_Earth"],
    PARAMETER["False_Easting",0.0],
    PARAMETER["False_Northing",0.0],
    PARAMETER["Central_Meridian",200.0],
    UNIT["Meter",1.0]]')
plot(ssta$sea_surface_temperature_anomaly, 
     col = viridis(256), axes = FALSE, 
     main = "Sea surface temperature anomaly 2023-11-15",)

Figure 1: Sea surface temperature anomaly 2023-11-15 from NOAA Daily Global 5km Satellite Sea Surface Temperature (a.k.a. CoralTemp)
< !-- -->
To leave a comment for the author, please follow the link and comment on their blog: r.iresmi.net.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
Exit mobile version