GetCRN: Get the US Climate Reference Network data from the NCEP ftp...

Description Usage Arguments Details Value Examples

View source: R/get_USCRN.R

Description

GetCRN Given the information provided to the function will download the data from NCEP ftp serverr and then subset the data to meet the criteria defined such as being in a domian or being in specific time period. Return a dataframe containing.

Usage

1
2
3
4
GetCRN(gageNames = NULL, siteIds = NULL, elements = NULL,
  timestep = "hourly", domain = NULL, startDate = Sys.time() - 10 *
  24 * 3600, endDate = Sys.time(), realTime = FALSE,
  parallel = FALSE)

Arguments

gageNames

Character vector of the gage names which is used in the file names (or any part of the file name)

siteIds

Characcter vector of the stations IDs so called WBANNO.

elements

Character vector containing all elements required from the data.

timestep

Character (DEFAULT = "hourly"). It can be subhourly, hourly, daily and monthly

domain

data.frame, containing four columns named lonmax, latmin, latmax, latmin. It will be used to subset the data to only those gauges falling into the rectangle domain

startDate

POSIXct, ending date

endDate

POSIXct, strating date

realTime

Logical (DEFAULT = FALSE)

parallel

Logical (DEFAULT = FALSE)

Details

The contiguous U.S. network of 114 stations was completed in 2008. There are two USCRN stations in Hawaii and deployment of a network of 29 stations in Alaska continues. The vision of the USCRN program is to maintain a sustainable high-quality climate observation network.

These data are provided in 4 different temporal resolution (subhourly, hourly, daily and monthly), and depending on the temporal resolution, the variables provided changes. Below is a summary of all the variables in each temporal resolution and their units.

subhourly data contains:

hourly data contains:

daily data contains:

monthly data contains:

Value

A data.table containing the US CRN data.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
## Not run: 
# example 1: getting the precipition data at the subhourly time steps, 
# for the first three months of 2016
startDate = as.POSIXct("2016-01-01 00:00:00", format= "%Y-%m-%d %H:%M:%S", tz = "UTC")
endDate   = as.POSIXct("2016-04-01 00:00:00", format= "%Y-%m-%d %H:%M:%S", tz = "UTC")
output <- GetCRN(elements = "P_CALC", timestep = "hourly", 
startDate = startDate, endDate= endDate)

# choose only gauge in the following domain
domain <- data.frame(minlon = -80, maxlon = -60, minlat = 30, maxlat = 50)
output <- GetCRN(elements = "P_CALC", timestep = "hourly", 
startDate = startDate, endDate= endDate, domain = domain)

# choose only gauges in the Colorado 
outputHourly <- GetCRN(gageNames = "CO", elements = "P_CALC", timestep = "hourly", 
startDate = startDate, endDate= endDate)

# get daily data only for basins in colorado
outputDaily <- GetCRN(gageNames = "CO", elements = "P_DAILY_CALC", timestep = "daily", 
startDate = startDate, endDate= endDate)

# get monthly data only for basins in colorado
outputMonthly <- GetCRN(gageNames = "CO", elements = "P_MONTHLY_CALC", timestep = "monthly", 
startDate = startDate, endDate= endDate)

# get subhourly data only for basins in colorado
outputsubhourly <- GetCRN(gageNames = "CO", elements = "PRECIPITATION", 
timestep = "subhourly", startDate = startDate, endDate= endDate)

# get hourly soik moisure data
outputHourly <- GetCRN(gageNames = "CO", elements = c("SOIL_MOISTURE_5", 
"SOIL_MOISTURE_10", "SOIL_MOISTURE_20", "SOIL_MOISTURE_50", "SOIL_MOISTURE_100"), 
timestep = "hourly")

## End(Not run)

NCAR/rwrfhydro documentation built on Feb. 28, 2021, 12:47 p.m.