CalcDailyGhcn: Aggregate hourly precipitation data into daily values to be...

Description Usage Arguments Value See Also Examples

View source: R/calculate_aggregations.R

Description

This function inputs the hourly forcing / model output data and aggregate then to daily. GHCN gauges report data usually at 7:00 AM, however, that is not the case for all gauges. The reporting time may even differ for the same gauge but different elements. One can obtain the report time using GetGhcn2.

Usage

1
CalcDailyGhcn(sg, prcp, reportTime = 700, parallel = FALSE)

Arguments

sg

A dataframe of the selectedGauges, it should have a column called siteIds, which refer to the name of the station. siteIds should match the the standardized GHCN IDs (for example : ACW00011604). See http://www1.ncdc.noaa.gov/pub/data/ghcn/daily/ghcnd-stations.txt for a list of siteIds. It also should have a timeZone column or if not available it should have latitude and longitude which will be used whithin the function to find the timeZone.

prcp

A dataframe of hourly data. It should have at least three columns: POSIXct, statArg, and DEL_ACCPRCP. POSIXct has the time in UTC, statArg has the site ID, and DEL_ACCPRCP is the depth of rainfall for that hour. The DEL_ACCPRCP column will be with the same name if you use GetMultiNcdf, ReshapeMultiNcdf and CalcNoahmpFluxes to get the precipitation from WRF-Hydro output files. Otherwise, rename the your datafram accordingly to have POSIXct, DEL_ACCPRCP and statArg.

reportTime

A vector of reportTime matching with sg$siteIds. reportTime is a unique reporting time for each elelment of each gauge. It may vary for different elements for a single gauge. The report time values are retrived when reading the daily GHCN data using GetGhcn2. Note, use 700 wherever the report time is missing. It will be overwritten if sg$reportTime exits.

parallel

Logical (DEFAULT=FALSE)

Value

A dataframe having 4 columns, the Daily precipitation comparable with daily GHCN data.

See Also

Other GHCN: GetGhcn2, GetGhcn, SelectGhcnGauges

Examples

1
2
3
4
## Not run: 
#ADD EXAMPLE HERE

## End(Not run)

mccreigh/rwrfhydro documentation built on Feb. 28, 2021, 1:53 p.m.