-
Notifications
You must be signed in to change notification settings - Fork 237
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
document and lazy-load BADM and soil_class
- Loading branch information
Showing
12 changed files
with
259 additions
and
967 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
#' Biomass and soil data from FluxNet sites | ||
#' | ||
#' Contains data from 246 Fluxnet sites. | ||
#' Variables include aboveground and belowground biomass in various pools, | ||
#' plus soil texture/chemistry/horizonation/C&N stocks. | ||
#' | ||
#' @format ## `BADM` | ||
#' A data frame with 12,300 rows and 13 columns: | ||
#' \describe{ | ||
#' \item{SITE_ID}{Fluxnet code for the site} | ||
#' \item{LOCATION_ELEV, LOCATION_LAT, LOCATION_LON}{site coordinates} | ||
#' \item{Date}{Measurement date} | ||
#' \item{GROUP_ID}{TODO} | ||
#' \item{VARIABLE_GROUP}{category, eg abovground biomass or soil chemistry} | ||
#' \item{VARIABLE, DATAVALUE}{key and value for each measured variable} | ||
#' \item{NA_L1CODE, NA_L1NAME, NA_L2CODE, NA_L2NAME}{ | ||
#' numeric IDs and names for the Level 1 and level 2 ecoregions where | ||
#' this site is located} | ||
#' } | ||
#' @source Originally from Fluxnet <https://fluxnet.org/badm-data-product/>, | ||
#' but the provenence and age of this specific file is not clear. | ||
"BADM" | ||
|
||
|
||
#' Default parameters for calculating soil properties from sand & clay content | ||
#' | ||
#' | ||
#' @format ## `soil_class` | ||
#' A list with 26 entries: | ||
#' \describe{ | ||
#' \item{air.cond, h2o.cond, sand.cond, silt.cond, clay.cond}{ | ||
#' thermal conductivity, W m^-1 K^-1} | ||
#' \item{air.hcap, sand.hcap, silt.hcap, clay.hcap}{heat capacity, | ||
#' J m^-3 K^-1} | ||
#' \item{kair, ksand, ksilt, kclay}{relative conductivity factor} | ||
#' \item{fieldcp.K}{hydraulic conductance at field capacity, mm day^-1} | ||
#' \item{grav}{gravity acceleration, m s^-2} | ||
#' \item{soil.key}{Abbreviations for each of 18 soil texture classes, e.g. | ||
#' "SiL", "LSa"} | ||
#' \item{soil.name}{Names for 18 soil texture classes, e.g. "Sand", | ||
#' "Silty clay"} | ||
#' \item{soilcp.MPa}{soil water potential when air-dry, MPa} | ||
#' \item{soilld.MPa}{soil water potential at critical water content, MPa} | ||
#' \item{soilwp.MPa}{soil water potential at wilting point, MPa} | ||
#' \item{stext.lines}{list of 18 lists, each giving minimum and maximum | ||
#' sand/silt/clay contents for a soil texture class} | ||
#' \item{stext.polygon}{list of 18 lists, each giving corner points in the | ||
#' soil texture triangle for a soil texture class} | ||
#' \item{texture}{data frame with 13 rows and 21 columns, giving default | ||
#' parameter values for 13 named soil textures} | ||
#' \item{theta.crit}{critical water content (fractional soil moisture at | ||
#' which plants start dropping leaves), m^3 m^-3} | ||
#' \item{xclay.def}{default volume fraction of sand in each of 18 soil | ||
#' texture classes} | ||
#' \item{xsand.def}{default volume fraction of clay in each of 18 soil | ||
#' texture classes} | ||
#' } | ||
#' @source | ||
#' The hydraulic parameters are derived from Cosby et al 1984, "A Statistical | ||
#' Exploration of the Relationships of Soil Moisture Characteristics to the | ||
#' Physical Properties of Soils", Water Resources Research 20(6): 682-690. | ||
#' This implementation comes from one provided by the ED2 model, | ||
#' plus `texture.csv` from a source not recorded. Package `PEcAn.linkages` | ||
#' contains an identical texture.csv, also with no obvious source label. | ||
#' See also comments in soil_utils.R | ||
"soil_class" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
|
||
## BADM | ||
|
||
Various ancillary data from Fluxnet. | ||
Provenence of this particular file not clear, but it contains data from | ||
246 Fluxnet sites. Variables include aboveground and belowground biomass | ||
in various pools, plus soil texture/chemistry/horizonation/C&N stocks. | ||
|
||
`load_BADM.R` simply reads `BADM.csv` and writes it as `../data/BADM.rda`. | ||
|
||
|
||
# Soil variables | ||
|
||
Default parameter values for soil of various texture classes. | ||
The values are apparently derived from Cosby et al 1984, | ||
"A Statistical Exploration of the Relationships of Soil Moisture | ||
Characteristics to the Physical Properties of Soils", | ||
Water Resources Research 20(6): 682-690. | ||
This implementation comes from one provided by the ED2 model. | ||
Not clear if texture.csv came from there or another source. | ||
PEcAn.linkages contains an identical texture.csv, | ||
also with no obvious source label. | ||
|
||
`build_soil_texture_variables.R` hardcodes the values for many parameters | ||
in a list named `soil_class` and saves it to `../data/soil_class.rda`, | ||
from which it is lazy-loaded when `soil_class` is used inside | ||
package functions. | ||
The saved file includes all of `texture.csv`, hence why that lives in | ||
`data-raw` rather than directly in `data/`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Binary file not shown.
Binary file not shown.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.