goesaodc_plotScanRaster: Plot a GOES scan raster

Description Usage Arguments Value Examples

View source: R/goesaodc_plotScanRaster.R

Description

Plot a GOES scan raster

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
goesaodc_plotScanRaster(
  raster = NULL,
  bbox = bbox_CONUS,
  fun = mean,
  rasterAlpha = NULL,
  paletteColors = c("#FFFFB2", "#BD0026"),
  naColor = "gray50",
  paletteName = "YlOrRd",
  paletteBreaks = NULL,
  legendLimits = NULL,
  includeMap = FALSE,
  zoom = NULL,
  stateCodes = NULL,
  title = NULL,
  legendTitle = NULL
)

Arguments

raster

RasterLayer with an AOD variable.

bbox

Bounding box for the visible region. Defaults to CONUS.

fun

Function used to summarize multiple point values within a single cell. Defaults to mean.

rasterAlpha

Transparency of the raster. If not explicitly defined, it will default to 1.0 when includeMap=FALSE and 0.75 when includeMap=TRUE.

paletteColors

Vector of colors to use as a gradient for the color legend. Will be ignored if breaks is set. Defaults to c("#FFFFB2", "#BD0026").

naColor

Color to shade cells with NA AOD values.

paletteName

The name of an RColorBrewer palette. Defaults to 'YlOrRd'.

paletteBreaks

Vector of AOD values to use as palette breaks.

legendLimits

Upper and lower AOD values for the fill legend. Setting this guarantees that the legend is displayed even if the scan has nothing but NA AOD values. All values outside the range will be set to NA.

includeMap

Logical flag to draw a topographic map image under the raster. Since the image is Mercator projected, the plot coordinate system will be Mercator projected to match. This significantly slows down the drawing of rasters. Defaults to FALSE.

zoom

Zoom level of the topographic map, if it is included. Must be an integer from 1 to 15.

stateCodes

Codes of state outlines to draw.

title

Title of the plot.

legendTitle

Title of the plot legend.

Value

ggplot of a RasterLayer.

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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
library(MazamaSatelliteUtils)
library(MazamaSpatialUtils)

setSatelliteDataDir("~/Data/Satellite")
setSpatialDataDir("~/Data/Spatial")

loadSpatialData("NaturalEarthAdm1")

bboxKingcadeFire <- c(-124, -120, 36, 39)

scanFile <- goesaodc_listScanFiles(
  satID = "G17",
  datetime = "2019-10-27 10:00",
  timezone = "America/Los_Angeles"
)

scanRaster <- goesaodc_createScanRaster(
  filename = scanFile,
  bbox = bboxKingcadeFire,
  cellSize = 0.05
)

faultyScanRaster <- goesaodc_createScanRaster(
  filename = "OR_ABI-L2-AODC-M6_G17_s20202522231174_e20202522233547_c20202522235327.nc",
  bbox = bboxKingcadeFire,
  cellSize = 0.05
)

# Plot a raster for a scan
goesaodc_plotScanRaster(
  raster = scanRaster,
  bbox = bboxKingcadeFire,
  paletteBreaks = c(-Inf, 0, 1, 2, 3, 4, 5, Inf),
  includeMap = TRUE,
  zoom = 8,
  stateCodes = "CA",
  title = "Kincade fire"
)

# Plot a raster for a scan filled with NA AOD values
goesaodc_plotScanRaster(
  raster = faultyScanRaster,
  bbox = bboxKingcadeFire,
  legendLimits = c(-1, 6),
  stateCodes = "CA"
)

MazamaScience/MazamaSatelliteUtils documentation built on Dec. 17, 2021, 3:20 a.m.