ms_fill_missing_precip: Fill gaps in precipitation gauge data

View source: R/ms_fill_missing_precip.R

ms_fill_missing_precipR Documentation

Fill gaps in precipitation gauge data

Description

Fill precipitation gauges based on relationship to surrounding gauges.

Usage

ms_fill_missing_precip(
  precip,
  precip_gauge,
  fill_method = "strongest_cor",
  distance_threshold = NULL,
  out_path = NULL,
  verbose = TRUE
)

Arguments

precip

data.frame. A data.frame or path to data.frame in macrosheds format of precipitation gauge data

precip_gauge

a sf object or path to a sf object of precipitation gauge locations

fill_method

One of strongest_cor, closest_gauge, or distance_weight. See details

distance_threshold

When distance_weight is selected, the distance in km other gauges will be used to fill each gauge of interest

out_path

Optional. path to save filled precipitation data

verbose

Optional logical. Should information be printed to console, default TRUE.

Details

ms_fill_missing_precip uses other gauges in a network to fill gaps in gauges when they are not reported data. Three different methods can be chosen.

  1. strongest_cor uses the gauge with the strongest correlation to the gauge with missing data, and then uses a linear regression between the two gauges to fill in times of missing data. 2) closest_gauge uses a linear regression between the nearest gauge to the gauge with missing data. 3) distance_weight uses all gauges withing the selected distance_threshold and inverse distance weighting to fill the missing values.

Value

returns a tibble with filled precipitation data.

Author(s)

Spencer Rhea

Mike Vlah, vlahm13@gmail.com

Wes Slaughter


MacroSHEDS/macrosheds documentation built on Oct. 30, 2024, 11:15 a.m.