neonutilities.load_by_product

neonutilities.load_by_product(dpid, site='all', startdate=None, enddate=None, package='basic', release='current', timeindex='all', tabl='all', check_size=True, include_provisional=False, cloud_mode=False, progress=True, token=None)

This function downloads product-site-month data package files from NEON, unzips and stacks the data files, and loads to the environment.

Parameters

dpid: str

Data product identifier in the form DP#.#####.###

site: str

Either the string ‘all’, or one or more 4-letter NEON site codes. Defaults to ‘all’.

startdate: str, optional

Earliest date of data to download, in the form YYYY-MM

enddate: str, optional

Latest date of data to download, in the form YYYY-MM

package: str, optional

Download package to access, either basic or expanded. Defaults to ‘basic’.

release: str, optional

Data release to download. Defaults to the most recent release.

timeindex: str, optional

Either ‘all’, or the time index of data to download, in minutes. Only applicable to sensor (IS) data. Defaults to ‘all’.

tabl: str, optional

Either ‘all’, or the name of a single data table to download. Only applicable to observational (OS) data. Defaults to ‘all’.

check_size: bool, optional

True or False, should the user approve the total file size before downloading? Defaults to True. When working in batch mode, or other non-interactive workflow, use check_size=False.

include_provisional: bool, optional

Should Provisional data be returned in the download? Defaults to False. See https://www.neonscience.org/data-samples/data-management/data-revisions-releases for details on the difference between provisional and released data.

cloud_mode: bool, optional

Use cloud mode to transfer files cloud-to-cloud? Should only be used if the destination location is in the cloud. Defaults to False.

progress: bool, optional

Should the function display progress bars as it runs? Defaults to True.

token: str, optional

User-specific API token from data.neonscience.org user account. See https://data.neonscience.org/data-api/rate-limiting/ for details about API rate limits and user tokens. If omitted, download uses the public rate limit.

Return

A dictionary of data and metadata tables, as pandas tables.

Example

Download water quality data from COMO (Como Creek) in 2018

>>> wq = load_by_product(dpid="DP1.20288.001", site="COMO",
                         startdate="2018-01", enddate="2018-12",
                         token=None)

Notes

Windows Path Length Limitations: When using this function, you may encounter path length limitations on Windows systems. Windows has a default maximum path length of 260 characters, which can cause download and unzip functions to fail if this limit is exceeded. If the file path exceeds 260 characters on a Windows system, the package will issue a warning.You can choose to ignore or filter these warnings using Python’s warnings module if you prefer not to see them. If the function is unable to unzip a folder due to path length limitations, an OSError will be raised.

Created on June 12 2024

@author: Claire Lunch