combine_gauges: Function to combine gauges within grid cells for kriging

Description Usage Arguments Details Value Examples

Description

This function identifies if multiple gauges are located in the same grid cell (e.g. GPM pixel) and averages their time-series to obtain a single best ground-based estimate to compare and merge with the satellite data.

Usage

1
combine_gauges(gauge.sp, gauge.ts)

Arguments

gauge.sp

A SpatialPointsDataFrame object containing the gauge locations and additional gauge attributes.

gauge.ts

A zoo object containing the gauge observations.

Details

This function averages (simple mean) multiple gauges if these are located in the same grid cell (i.e. GPM pixel) such that a single time-series for the ground-based estimate is obtained for every grid node. In order for this function to work, the function colocate needs to be run previously such that the required GPM pixel identifiers are assigned to each gauge location.

Value

Object gauge.list A list with two entries: the gauge spatial data identical to that in the object gauge.sp and a revised time-series object with a single unique time-series corresponding to each GPM grid node that contained gauges.

Examples

1
2
3
4
5
6
7
8
9
data(gpm) # STFDF object with gpm imerg observations
data(gauges) # STFDF object with gauge observations
gauges <- colocate(gauges,gpm,resolution=0.1,longlat=TRUE)
gauge.sp <- gauges@sp
gauge.ts <- as(gauges[,,1],"xts")
colnames(gauge.ts) <- gauge.sp$estacion
gauge.list <- combine_gauges(gauge.sp,gauge.ts)
gauge.sp <- gauge.list$sp
gauge.ts <- gauge.list$ts

bastianmanz/GPM_rain documentation built on May 11, 2019, 9:20 p.m.