This function downloads AmeriFlux BASE and BADM data files. Note: Access to AmeriFlux data requires creating an AmeriFlux account first. Register an account through the link https://ameriflux-data.lbl.gov/Pages/RequestAccount.aspx.

For details about BASE and BADM data files, see AmeriFlux web pages https://ameriflux.lbl.gov/data/data-processing-pipelines/base-publish/ and https://ameriflux.lbl.gov/data/aboutdata/badm-data-product/.

amf_download_base(
  user_id,
  user_email,
  site_id,
  data_product = "BASE-BADM",
  data_policy,
  agree_policy,
  intended_use,
  intended_use_text,
  out_dir = tempdir(),
  verbose = TRUE
)

Arguments

user_id

AmeriFlux account username (character)

user_email

AmeriFlux account user email (character)

site_id

A scalar or vector of character specifying the AmeriFlux Site ID (CC-Sss)

data_product

AmeriFlux data product. Currently, only "BASE-BADM" is supported and used as default. (character)

data_policy

"CCBY4.0" or "LEGACY" (character). AmeriFlux data are shared under two tiers of licenses as chosen by site's PI. See https://ameriflux.lbl.gov/data/data-policy/#data-use for data use guidelines under each license. Note: Data use policy selected affects which sites’ data are available for download.

agree_policy

Acknowledge you read and agree to the AmeriFlux Data use policy (TRUE/FALSE)

intended_use

The intended use category. Currently, it needs to be one of the followings:

  • "synthesis" (i.e., Multi-site synthesis)

  • "model" (i.e., Land model/Earth system model)

  • "remote_sensing" (i.e., Remote sensing research)

  • "other_research" (i.e., Other research) "

  • "education" (i.e., Education (Teacher or Student))

  • "other"

intended_use_text

Enter a brief description of intended use. This will be recorded in the download log and emailed to site's PI (character).

out_dir

Output directory for downloaded data, default tempdir()

verbose

Show feedback on download progress (TRUE/FALSE)

Value

A vector of download file names on the local drive

Examples


if (FALSE) {
## Download a single site, under CCBY4.0 policy
amf_download_base(user_id = "test",
 user_email = "test _at_ mail.com",
 site_id = "US-CRT",
 data_product = "BASE-BADM",
 data_policy = "CCBY4.0",
 agree_policy = TRUE,
 intended_use = "other",
 intended_use_text = "testing download",
 out_dir = tempdir())

## Download several sites, under LEGACY data policy
#  When finished, return a list of downloaded files
#  in your local drive.
file.ls <- amf_download_base(user_id = "test",
 user_email = "test _at_ mail.com",
 site_id = c("US-CRT", "US-WPT", "US-Oho"),
 data_product = "BASE-BADM",
 data_policy = "LEGACY",
 agree_policy = TRUE,
 intended_use = "other",
 intended_use_text = "testing download",
 out_dir = tempdir())
}