reafill | R Documentation |
reafill
is an alternative to pcafill
, using ERA5 to fill in missing data and to evaluate
the station data based on an ordinary linear regression between data from the
reanalysis interpolated to the coordinates of the station data.The reanalysis is usually more complete than the station data and the final result
keeps the original data wherever valid and fills in the gaps and extends the coverage
with informatino from the reanalysis wherever appropriate. This function is an alternative
to pcafill
and using DS to downscale local data. Whereas pcafill
is more suited
for aggregated (monthly/seasonal/annual) data for a group of stations within a region with common
variabiliet, the reafill
function is more geared to daily data. pcafill
does not make
use of additional infromation other than assuming a stable spatio-temporal covariance structure whereas
reafill
makes use of addtional information from reanalyses.
reafill(
x,
file,
anomaly = TRUE,
plot = FALSE,
delta = 0.3,
method = "linreg",
verbose = FALSE
)
x |
the station data with gaps that need interpolation |
file |
Name of the reanalysis data file (netCDF) or a field object containing reanalysis data. NB use daily data if x contains daily data. |
anomaly |
(Not yet working) subtract the mean annual cycle before interpolation and then add it back for recovering original form. |
plot |
Graphical diagnostics |
delta |
Distance (in degrees) from edge of station domain to reanalysis domain |
method |
If 'linreg': use linear regression to fit station data based on reanalysis data; If 'direct', replace missing station data directly with values from the closest grid points of the reanalysis data. |
verbose |
Print out checks for diagnosing |
test.reafill
provides a testing routine for reafill
on sample data
(Oslo monthly temperature) where gaps of missing data have been introduced. The test
consists of comparing with the data that has been removed before applying reafill
.
R.E. Benestad
pcafill reafill test.reafill
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.