This function helps to create the training dataset of specific variable type and locations for downscaling. TODO: Add a ratio argument (training sample size/total sample size) so that we could calculate the out-of-sample accuracy.
Arguments
- pts
spatialpoints: spatial points returned by `terra::vectors` function.
- analysis
numeric: data frame (rows: ensemble member; columns: site*state_variables) of updated ensemble analysis results from the `sda_enkf` function.
- covariates.dir
character: path to the exported covariates GeoTIFF file.
- variable
character: name of state variable. It should match up with the column names of the analysis data frame.