reafill: Fill in gaps of missing data. 'reafill' is an alternative to...

View source: R/reafill.R

reafillR Documentation

Fill in gaps of missing data. 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.

Description

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.

Usage

reafill(
  x,
  file,
  anomaly = TRUE,
  plot = FALSE,
  delta = 0.3,
  method = "linreg",
  verbose = FALSE
)

Arguments

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

Details

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.

Author(s)

R.E. Benestad

See Also

pcafill reafill test.reafill


metno/esd documentation built on April 29, 2024, 3:34 p.m.