bluesky_load: Load data for a single BlueSky model

Description Usage Arguments Value Note Examples

View source: R/bluesky_load.R

Description

This function encapsulates the process of downloading, and formatting necessary for BlueSky model outputs. Additionally, it checks already existing models and loads those if available.

Loads BlueSky model output as a raster brick. The directory previously set with setModelDataDir() is searched for "v2" formatted model output. If data are not found locally, data are downloaded from baseUrl and converted.

The returned dataBrick object is of class raster::RasterBrick and can be manipulated with appropriate functions from the raster package or any of the raster_~() functions provided by AirFireModeling.

On 2019-10-11, available model identifiers include the following:

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
bluesky_load(
  modelName = NULL,
  modelRun = NULL,
  modelMode = "forecast",
  baseUrl = "https://haze.airfire.org/bluesky-daily/output/standard",
  localPath = NULL,
  level = 1,
  xlim = NULL,
  ylim = NULL,
  clean = TRUE,
  verbose = TRUE
)

Arguments

modelName

Model identifier.

modelRun

Model initialization datestamp as "YYYYMMDDHH".

modelMode

Subdirectory path containing BlueSky output, i.e. 'forcast'.

baseUrl

Base URL for BlueSky output.

localPath

Absolute path to a NetCDF file not found in 'modelDataDir'.

level

Elevation level.

xlim

A vector of coordinate longitude bounds.

ylim

A vector of coordinate latitude bounds.

clean

Logical specifying removal of original model data after conversion to "v2" format.

verbose

Logical to display messages.

Value

A raster package RasterBrick object.

Note

The regurned RasterBrick object will contain all grid cells within the area defined by xlim and ylim.

If localPath is used, clean = FALSE is automatically set. The package will never remove original model output that it has not downloaded.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
library(AirFireModeling)
setModelDataDir('~/Data/BlueSky')

# Load model data
raster <- bluesky_load(
  modelName = "PNW-4km",
  modelRun = 2020091300,
  xlim = c(-125, -115),
  ylim = c(42, 50)
)

raster_ggmap(raster, index = 3)

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