areaSource: Distribution of emissions by area

Description Usage Arguments Format Details Source Examples

View source: R/areaSouce.R

Description

Calculate the spatial distribution by a raster kasked by shape/model grid information.

Usage

1
areaSource(s, r, grid = NA, name = "", as_frac = F, verbose = T)

Arguments

s

input shape object

r

input raster object

grid

grid with the output format

name

area name

as_frac

return a fraction instead of a raster

verbose

display additional data

Format

a raster

Details

About the DMSP and example data https://en.wikipedia.org/wiki/Defense_Meteorological_Satellite_Program

Source

Data avaliable http://www.ospo.noaa.gov/Operations/DMSP/index.html

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
shape  <- raster::shapefile(paste(system.file("extdata", package = "EmissV"),
                            "/BR.shp",sep=""),verbose = FALSE)
shape  <- shape[22,1] # subset for Sao Paulo - BR
raster <- raster::raster(paste(system.file("extdata", package = "EmissV"),
                         "/dmsp.tiff",sep=""))
grid   <- gridInfo(paste(system.file("extdata", package = "EmissV"),"/wrfinput_d02",sep=""))
SP     <- areaSource(shape,raster,grid,name = "SPMA")

sp::spplot(SP,scales = list(draw=TRUE),ylab="Lat",xlab="Lon",
           main=list(label="Spatial Distribution by Lights for Sao Paulo - Brazil"),
           col.regions = c("#031638","#001E48","#002756","#003062",
                           "#003A6E","#004579","#005084","#005C8E",
                           "#006897","#0074A1","#0081AA","#008FB3",
                           "#009EBD","#00AFC8","#00C2D6","#00E3F0"))

EmissV documentation built on May 2, 2019, 7:16 a.m.