act.discovery.download_ameriflux_data#
- act.discovery.download_ameriflux_data(user_id, user_email, site_ids, data_product='FLUXNET', data_policy=None, data_variant='FULLSET', agree_policy=True, intended_use=None, description=None, out_dir=None, **kwargs)[source]#
This tool will allows users to download Ameriflux data. This code is based on the original R code found here: chuhousen/amerifluxr
- Parameters:
user_id (str) – The user’s Ameriflux user ID.
user_email (str) – The user’s email address.
site_ids (list) – A list of valid site_ids to download data from. List of available sites can be found here: https://ameriflux.lbl.gov/sites/site-search/
data_product (str) – Data product type. Options are BASE-BADM, BIF, or FLUXNET. Default is FLUXNET. For more on data products: https://ameriflux.lbl.gov/data/flux-data-products/ https://ameriflux.lbl.gov/data/badm/
data_policy (str) – Data policy under which data has been licensed by the PI. Options are CCBY4.0 or LEGACY.
data_variant (str or None) – Variant used for FLUXNET data product. Options are SUBSET, FULLSET, or None. Default is FUllSET
agree_policy (bool) – Acknowledge you read and agree to the AmeriFlux Data use policy. Data policy can be found here: https://ameriflux.lbl.gov/data/data-policy/
intended_use (str) – Planned use for data downloaded. Select best match. Shorter code options are available’ and when provided will be used to provide full intended use, examples of user codes and what they correlate to: “synthesis”: “Research - Multi-site synthesis”, “remote_sensing”: “Research - Remote sensing”, “model”: “Research - Land model/Earth system model”, “other_research”: “Research - Other”, “education”: “Education (Teacher or Student)”, “other”: “Other”
description (str) – Brief description of intended use. This will be recorded in the data download log and emailed to site’s PI.
out_dir (str) – The output directory for the data. Set to None to make a folder in the current working directory with the same name as datastream to place the files in.
Notes
This programmatic interface allows users to query and automate machine-to-machine downloads of Ameriflux data. This tool uses a REST URL and specific parameters mentioned above and data files matching the criteria will be returned to the user and downloaded.
To login/register for an Ameriflux account: https://ameriflux-data.lbl.gov/Pages/RequestAccount.aspx
Examples
This code will download a zip file for BASE-BADM data product at site US-A37. See the Notes for information on how to obtain a username and token.
act.discovery.download_ameriflux_data( user_id, user_email, data_product="BASE-BADM", data_policy="CCBY4.0", data_variant="FULLSET", site_ids=["US-A37"], agree_policy=True, intended_use="synthesis", description="I intend to use this data for research", out_dir="/home/user/ameriflux_data/", )
- Returns:
files (list) – Returns list of files retrieved