request_results: Retrieve model results from the StreamPULSE server

View source: R/request_results.R

request_resultsR Documentation

Retrieve model results from the StreamPULSE server

Description

Uses StreamPULSE API to retrieve .rds objects containing the outputs of streamMetabolizer runs for specific siteyears. To view available model results, see query_available_results. Visit the data portal at http://data.streampulse.org:3838/streampulse_diagnostic_plots/ to visualize model results via a browser.

Usage

request_results(sitecode, year, token = NULL)

Arguments

sitecode

underscore-separated region and site code, e.g. 'NC_Eno'. Full list of regions and site codes available at https://data.streampulse.org/sitelist. Or, you can use the query_available_data function in this package.

year

string or numeric representing year, e.g. '2015' or 2015.

token

a unique alphanumeric string for each registered user of StreamPULSE. Only necessary for accessing embargoed results. Email StreamPULSE developer Mike Vlah (vlahm13@gmail.com) to receive your token.

Details

Request results for a single region, site, and year. Some sites are "embargoed," meaning results from those sites are kept private and can only be accessed by authorized users. If you are authorized, you can access your embargoed results using a unique token, which currently you can only receive by emailing StreamPULSE developer Mike Vlah (vlahm13@gmail.com).

Value

returns a list containing an unfortunately limited collection of information about the "best" model result we have on record for the site and year requested. The two main items in this list are model_results and predictions. The former contains a subset of the details returned by streamMetabolizer::metab. The latter contains the output of streamMetabolizer::predict_metab. Following is a bit more information about the former.

If the output of streamMetabolizer::metab is a variable called x, model_results includes x@fit, x@data, and x@data_daily. Likewise, if the output of StreamPULSE::fit_metabolism (which calls metab) is a variable called y, model_results includes y$fit@fit, y$fit@data, and y$fit@data_daily.

In the future, this function may return a lot more relevant information, but at the moment only these elements are stored on our server for each "best" model run.

Model "bestness" is determined by an automatic comparison of five criteria each time a new model is fit: 1) proportion of daily GPP estimates that go negative; 2) proportion of daily ER estimates that go positive; 3) correlation between daily ER and K600; 4) maximum daily K600; and 5) temporal coverage. A score is assigned for each of these criteria, and an aggregate score is determined.

Author(s)

Mike Vlah, vlahm13@gmail.com

See Also

query_available_results for determining which models are available for download.

Examples

res = request_results(sitecode='FL_NR1000', year=2016)
res$predictions
res$model_results$fit$daily

streampulse/StreamPULSE documentation built on Nov. 2, 2024, 9:54 p.m.