SILOCorrectSite: Correct a slope change in a rainfall data set based on...

View source: R/SILOCorrectSite.R

SILOCorrectSiteR Documentation

Correct a slope change in a rainfall data set based on another site

Description

If the break point of a non-homogenous rainfall station has been identified (potentially using SILOCheckConsistency), correct the data on one side of the breakpoint

Usage

SILOCorrectSite(
  X,
  s_correct,
  s_reference,
  year_break,
  year_start = NULL,
  year_end = NULL,
  after = TRUE,
  plot = NA
)

Arguments

X

A list of SILO station data, in the format created by SILOLoad

s_correct

Station number that exists in X to correct

s_reference

Station number that exists in X to used for the correction

year_break

year in the time series that the break points exists

year_start

first year of data (before year_break) to to develop the first linear regression between s_correct and s_reference. Defaults to the start of the dataset

year_end

last year of data (after year_break) to to develop the second linear regression between s_correct and s_reference. Defaults to the end of the dataset

after

TRUE/FALSE value, indicating if the homogeneous data to develop the relationship to correct the non-homogeneous data is after the breakpoint (TRUE) or before (FALSE).

plot

if specified, the file (including path if necessary) to save a scatter plot of the annual rainfall totals, including regression equations used to correct the non-homogeneous data.

Details

The method of cumulative residuals outlined in [Annex 4](https://www.fao.org/3/x0490e/x0490e0l.htm#annex That is, two linear regressions between the annual rainfall totals are calculated P_s_correct~P_s_reference over the periods year_start:year_break and year_break:year_end For the period to correct (after the breakpoint if after=TRUE) an annual scaling factor is calculated from the ratio of the predicted rainfall total from the two regression equations, based on the rainfall total for each year at the reference site. This scaling factor is then applied to the daily rainfall data for that year.

Value

A list with the same structure as X, with the element for s_correct updated with the corrections on one side of the breakpoint year.

References

Chang, M., and Lee, R. (1974) Objective double-mass analysis, Water Resour. Res., 10( 6), 1123– 1126, doi:10.1029/WR010i006p01123.

See Also

SILOLoad, SILOSiteSummary, SILOQualityCodes,SILOCorrectSite

Examples

## Not run: 
stations<-c("23313","23302","23300","23317","23725","23705")
SILODownload(stations)
X<-SILOLoad(stations,startdate="1891-01-01",enddate="2020-12-31")
X<-SILOCorrectSite(X,"23313","23705",1970,after=FALSE)

## End(Not run)


SWTools documentation built on May 31, 2023, 6:24 p.m.