areaSource | R Documentation |
Calculate the spatial distribution by a raster masked by shape/model grid information.
areaSource(s, r, grid = NA, name = "", as_frac = FALSE, verbose = TRUE)
s |
input shape object |
r |
input raster object |
grid |
grid with the output format |
name |
area name |
as_frac |
return a fraction instead of the raster value |
verbose |
display additional data |
About the DMSP and example data https://en.wikipedia.org/wiki/Defense_Meteorological_Satellite_Program
a raster object containing the spatial distribution of emissions
Data avaliable https://www.nesdis.noaa.gov/current-satellite-missions/currently-flying/defense-meteorological-satellite-program
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")
raster::plot(SP,ylab="Lat",xlab="Lon",
main ="Spatial Distribution by Lights for Sao Paulo - Brazil")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.