18 Reference Runs

The purpose of the reference run record in BETY is to store all the settings from a run that are necessary in exactly recreating it.

The pecan.xml file is the home of absolutely all the settings for a particular run in pecan. However, much of the information in the pecan.xml file is server and user specific and more importantly, the pecan.xml files are stored on individual servers and may not be available to the public.

When a run that is performed using pecan is registered as a reference run, the settings that were used to make that run are made available to all users through the database.

All completed runs are not automatically registered as reference runs. To register a run, navigate to the benchmarking section of the workflow visualizations Shiny app.

18.1 Editing records

  • Models
  • Species
  • PFTs
  • Traits
  • Inputs
  • DB files
  • Variables
  • Formats
  • (Link each section to relevant Bety tables)

18.2 Standalone tools (modules)

  • RTM
  • Photosynthesis
  • Allometry
  • benchmark::load_data

(Link to vignettes)

18.3 Loading Data in PEcAn

If you are loading data in to PEcAn for benchmarking, using the Benchmarking shiny app [provide link?] is recommended.

Data can be loaded manually using the load_data function which in turn requires providing data format information using query.format.vars and the path to the data using query.file.path.

Below is a description of the load_data function an a simple example of loading data manually.

18.3.1 Function load_data

18.3.1.1 Inputs

Required

  • data.path: path to the data that is the output of the function query.file.path (see example below)
  • format: R list object that is the output of the function query.format.vars (see example below)

Optional

  • start_year = NA:
  • end_year = NA:
  • site = NA
  • vars.used.index=NULL

18.3.1.2 Output

  • R data frame containing the requested variables converted in to PEcAn standard name and units and time steps in POSIX format.

18.3.2 Example

The data for this example has already been entered in to the database. To add new data go to new data documentation.

To load the Ameriflux data for the Harvard Forest (US-Ha1) site.

  1. Create a connection to the BETY database. This can be done using R function

    where the complete path to the config.php is specified. See here for an example config.php file.

  2. Look up the inputs record for the data in BETY.

    Input_ID_name

    Input_ID_name

    To find the input ID, either look at

  3. Additional arguments to query.format.vars are optional

    1. If you only want to load a subset of dates in the data, specify start and end year, otherwise all data will be loaded.
    2. If you only want to load a select list of variables from the data, look up their IDs in BETY, otherwise all variables will be loaded.
  4. In R run

    Examine the resulting R list object to make sure it returned the correct information.

    The example format contains the following objects:

    The first 4 rows of the table format$vars looks like this:

    bety_name variable_id input_name input_units storage_type column_number bety_units mstmip_name mstmip_units pecan_name pecan_units
    air_pressure 554 PA kPa 19 Pa Psurf Pa Psurf Pa
    airT 86 TA celsius 4 degrees C Tair K Tair K
    co2atm 135 CO2_1 umol mol-1 20 umol mol-1 CO2air micromol mol-1 CO2air micromol mol-1
    datetime 5000000001 TIMESTAMP_START ymd_hms %Y%m%d%H%M 1 ymd_hms NA NA datetime ymd_hms
  5. Get the path to the data

  6. Load the data