flget_climatology {FjordLight} | R Documentation |
Extract climatology data from a NetCDF file downloaded by FjordLight
.
Description
This functions will conveniently extract the climatology data stored within a
NetCDF file downloaded via fl_DownloadFjord
. To extract the monthly
bottom PAR data instead one must use flget_PARbottomMonthlyTS
.
There are options for how the user would like to subset the data, which data format the
data should be extracted to, and if the user would like to plot the data in the process.
Usage
flget_climatology(
fjord,
optics = "PARbottom",
period = "Global",
month = NULL,
year = NULL,
mode = "raster",
PLOT = FALSE
)
Arguments
fjord |
Expects the object loaded via |
optics |
The PAR variable that the user would like to load. The option are:
|
period |
Here the user determines which time period of data should be loaded. To load
the total average values (default) use |
month |
The monthly climatology to extract. Accepts an integer value from 3 to 10.
This argument is ignored if |
year |
The yearly average to extract. Currently accepts an integer value from 2003 to 2022.
This argument is ignored if |
mode |
Determines the format of the data loaded into the R environment.
The default |
PLOT |
Boolean argument (default = |
Value
Depending on which arguments the user chooses, this function will return the
chosen, global, annual, or monthly climatology 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 |
optics_month|year |
The column name is determined by the arguments for
|
Author(s)
Bernard Gentili
Examples
# Load data
fjord_code <- "test"
fjorddata <- fl_LoadFjord(fjord_code, dirdata = system.file("extdata", package = "FjordLight"))
# PAR0m and PARbottom for July
P07 <- flget_climatology(fjorddata, "PAR0m", "Clim", month = 7, PLOT = TRUE)
Pb7 <- flget_climatology(fjorddata, "PARbottom", "Clim", month = 7, PLOT = TRUE)
# PARbottom Global
PbG <- flget_climatology(fjorddata, "PARbottom", "Global", PLOT = TRUE)
# PAR0m and kdpar for year 2012 as 3 columns data frame
P02012 <- flget_climatology(fjorddata, "PAR0m", "Yearly", year = 2012, mode = "df")
k2012 <- flget_climatology(fjorddata, "Kpar", "Yearly", year = 2012, mode = "df")
# For more examples see: https://face-it-project.github.io/FjordLight/articles/fl_example.html