Skip to contents

This function checks the input data, ensuring that the required date and carbon pool exist, and that the site coordinates are valid.

Usage

SDA_downscale_preprocess(ensemble_data, site_coords, date, carbon_pool)

Arguments

ensemble_data

List where each element is a data.frame indexed by date.

site_coords

A data.frame with `lon` and `lat` columns, or an sf object with point geometries.

date

Date. The date for the run, which must occur within `ensemble_data`.

carbon_pool

Character. Carbon pool of interest. Name must match a column in `ensemble_data`.

Value

A list containing the input data, cleaned site coordinates, and preprocessed carbon data.

Details

This function ensures that the specified date and carbon pool are present in the input data. It also checks the validity of the site coordinates and requires site coordinates and carbon data to have the same number of rows.

Author

Sambhav Dixit

David LeBauer