flget_area {FjordLight} | R Documentation |
Extract pixel surface area data from a NetCDF file downloaded by FjordLight
.
Description
This functions will conveniently extract the pixel surface area data stored within a
NetCDF file downloaded via fl_DownloadFjord
. The user may choose to
load the data in either raster or data.frame formats. It is useful to combine these
data with others, e.g. bathymetry data loaded via fl_DownloadFjord
Usage
flget_area(fjord, mode = "raster")
Arguments
fjord |
Expects the object loaded via |
mode |
Determines the format to be loaded into the R environment.
The default |
Value
Depending on which arguments the user chooses, this function will return the
surface area data as a RasterLayer
(mode = "raster"
) or
data.frame (mode = "df"
). The data.frame will contain the following columns:
longitude |
degree decimals |
latitude |
degree decimals |
PixelArea_km2 |
the surface area of the grid cell [km^2] |
Author(s)
Bernard Gentili & Robert Schlegel
Examples
# Load data
fjord_code <- "test"
fjorddata <- fl_LoadFjord(fjord_code, dirdata = system.file("extdata", package = "FjordLight"))
# Load area data
area <- flget_area(fjorddata, mode = "df")