spacetime_gauge: Function to convert gauge information from a data.frame to...

Description Usage Arguments Details Value Examples

Description

This function converts gauge information including names, codes, coordinates and time-series from a typical spread-sheet layout (in .csv, .xls, or .txt) to a STFDF (spacetime) object. The time-stamps are also converted from the local time-zone to UTC. Use data(gauges.hh.piura) to obtain an example of the format of the data-frame for which this function is designed.

Usage

1

Arguments

gauges

A dataframe containing gauge information in a typical format. Type data (gauges.piura) to see an example.

projection

A character string detailing the projection CRS. See the sp package for details on this, in particular the function proj4string therein. The default(projection="+proj=longlat +ellps=WGS84 +datum=WGS84") is suitable if coordinates are in latitude/ longitude, using a WGS84 datum.

timezone

a numeric value, describing the timezone difference to UTC (all GPM-IMERG data is in UTC) so that the gauge time-series can be converted to UTC. Negative value imply western hemisphere, e.g. Peru = -5.

Details

This function converts gauge information including names, codes, coordinates and time-series from a typical spread-sheet layout (in .csv, .xls, or .txt) to a STFDF (spacetime) object. The time-stamps are also converted from the local time-zone to UTC. Use data(gauges.hh.piura) to obtain an example of the format of the data-frame for which this function is designed.

Value

Object gauges A STFDF (spacetime) object containing the spatial information (i.e. gauge locations with attributes) and temporal information (i.e. precipitation time-series for each gauge location).

Examples

1
2
3
4
5
6
7
8
data(gpm.hh.piura) # STFDF object with gpm imerg observations for the Piura region in Peru
gpm <- gpm.hh.piura
data(gauges.hh.piura) # STFDF object with gauge observations for the Piura region in Peru
gauges <- gauges.hh.piura
gauges <- spacetime_gauge(gauges,projection="+proj=longlat +ellps=WGS84 +datum=WGS84", timezone=-5)
str(gauges)
gauges.sp <- gauges@sp # extract spatial information of gauge locations
gauges.ts <- as(gauges[,,1],"xts") # extract gauges time-series

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