monitor_toRaster: Create a Raster from monitor object

Description Usage Arguments Value Examples

View source: R/monitor_toRaster.R

Description

Create a Raster from monitor object

Usage

1
monitor_toRaster(ws_monitor = NULL, raster = NULL, FUN = mean)

Arguments

ws_monitor

PWFSLSMoke ws_monitor object.

raster

Raster* object defining the output grid.

FUN

Function used to collapse values when multiple monitors lie within a single grid cell.

Value

A RasterBrick object.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# library(AirFireModeling)
setModelDataDir('~/Data/BlueSky')

# Load model data
rasterList <- raster_load(
  modelName = c("PNW-4km"),
  modelRun = c(2020091300),
  xlim = c(-125, -117),
  ylim = c(45.5, 49)
)

# Load monitor data
ws_monitor <-
  PWFSLSmoke::monitor_load(
    startdate = 2020091301,
    enddate = 2020091600
  ) %>%
  PWFSLSmoke::monitor_subset(stateCodes = "WA")

monitor_rasterBrick <- monitor_toRaster(ws_monitor, rasterList[[1]], mean)

raster_facet(
  monitor_rasterBrick,
  index = 1:6,
  title = "Monitoring data",
  palette = 'Spectral',
  col_county = 'gray95',
  direction = -1,
  breaks = c(-Inf, 0, 12, 35, 55, 150, 250, 350, Inf)
)

MazamaScience/AirFireModeling documentation built on March 13, 2021, 12:02 a.m.