colocate: Function to colocate gauges with corresponding GPM pixel

Description Usage Arguments Details Value Examples

Description

This function finds the closest ("colocated") GPM-IMERG pixel within a pre-defined radius to the provided gauge locations. This allows for comparing corresponding gauge and satellite time-series.

Usage

1
colocate(gauges, gpm, resolution, longlat = TRUE)

Arguments

gauges

A STFDF object containing the gauge spatial information and time-series data.

gpm

a STFDF object containing the GPM-IMERG spatial information and time-series data.

resolution

An integer describing the satellite spatial resolution.

longlat

A logical object indicating if object is in long/lat or not. TRUE by default.

Details

The closest GPM-IMERG pixel to each gauge is found by iteratively calculating the Euclidian (if longlat=FALSE) or Great Circle distance between each gauge location and all GPM-IMERG pixel locations using the spDistsN1() function from the sp package. The closest GPM pixel is then identified as the colocated pixel. The parameter "resolution" defines the satellite grid resolution, which is used to define the allowable tolerance limit for the distance between the gauge and the colocated GPM pixel use the pythagoras theorem.

Value

Object gauges A STFDF object identical to the input object with an additional spatial data column ("GPM_PIXEL" that defines the ID of the colocated GPM pixel for each gauge location.

Examples

1
2
3
data(gpm) # STFDF object with gpm imerg observations
data(gauges) # STFDF object with gauge observations
gauges <- colocate(gauges,gpm,resolution=0.1,longlat=TRUE)

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