knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

Based on this NCL

library(eixport)
library(raster)
library(stars)
library(cptcity)
library(sf)

Reading Temperature

wrfo <- "/home/sergio/R/x86_64-pc-linux-gnu-library/4.3/helios/extras/wrfout_d01_2020-01-01_01%3A00%3A00_sub.nc"
t2 <- wrf_get(wrfo, "T2", as_raster = T)
t2[] <- t2[] -273.15# we select one

Find colour palette for temperature

find_cpt("temperature")

Based on NCL:

plot(t2[[1]], main = "Temperature using plot", col = cpt("arendal_temperature"))
contour(t2[[1]], add = T)
#spplot(t2, main = "Temperature 2m using spplot", scales=list(draw = TRUE),
#       col.regions = cpt("idv_temperature"),
#       sp.layout = list("sp.lines", as_Spatial(cl), col = "black"))


atmoschem/eixport documentation built on June 12, 2025, 6:25 p.m.