This function creates a GeoPressureR map object from a spatio-temporal dataset.
The data needs to be discretized according to scale, extent (space) and stap (time).
This function is used by geopressure_map() and graph_marginal().
Arguments
- data
list of matrices of the same size, one for each stationary period.
- extent
geographical extent of the map on which the likelihood and graph model will be computed. Vector of length 4
c(xmin, xmax, ymin, ymax)orc(W, E, S, N).- scale
number of pixels per 1° latitude-longitude. For instance,
scale = 10for a resolution of 0.1° (~10km) andscale=4for a resolution of 0.25° (~30km). To avoid interpolating the ERA5 single-levels data, the scale should be equal to or smaller than 4 (the default intag_set_map()).tag_set_map()warns for higher values. Read more about scale on the Google Earth Engine documentation .- stap
a data.frame of stationary periods with columns
stap_id,startandend. If the logical columnincludeis missing, it is set toTRUEfor stationary periods with data.- id
tag identifier.
- type
map type used for default palettes in plots. One of:
"unknown","pressure","light","preslight","magnetic","pressure_mse","pressure_mask","magnetic_intensity","magnetic_inclination","marginal","twilight".
See also
Other map:
map_add_mask_water(),
print.map(),
rast,map-method
Examples
data <- lapply(1:10, \(x) matrix(runif(5000), nrow = 50, ncol = 100))
scale <- 10
extent <- c(0, 10, 0, 5)
stap <- data.frame(
stap_id = 1:10,
start = seq(as.POSIXct("2023-01-01", tz = "UTC"),
as.POSIXct("2023-01-10 UTC", tz = "UTC"),
by = "day"
),
include = TRUE
)
stap$end <- stap$start + sample(1:10) * 10000
# Create the map
map <- map_create(
data = data,
extent = extent,
scale = scale,
stap = stap,
id = "18LX",
type = "pressure"
)
print(map)
#>
#> ── GeoPressureR `map` object of pressure for 18LX ──────────────────────────────
#>
#> ── Map
#> • Extent (W, E, S, N): 0°, 10°, 0°, 5°
#> • Dimensions (lat x lon): 50 x 100 (res. 0.1°)
#>
#> ── Stationary periods stap (n=10)
#> Run `map$stap` to display full table
plot(map)
