SelectGhcnGauges: Read the daily GHCN-D metadata and select gauges based on the...

Description Usage Arguments Value Selection criteria See Also Examples

View source: R/ghcn_get.R

Description

SelectGhcnGauges is designed to create a dataframe of the selected gauges based on the user's criteria. The dataframe stores important information about each gauge such as country, network type, stationID, lat/lon, elevation, state, description, GSN flag, HCN/CRN flag, WMO ID and siteIds=[country,ntework,stationID]

Usage

1
2
3
SelectGhcnGauges(countryCode = NULL, networkCode = NULL,
  states = NULL, domain = FALSE, minLat = NULL, maxLat = NULL,
  minLon = NULL, maxLon = NULL, fileAdd = NULL)

Arguments

countryCode

A vector of desired countries, e.g., countryCode=c("US","UK").

networkCode

A vector of desired network types, e.g., for COOP and CoCoRaHS use networkCode=c("C","1").

states

A vector of desired states if country is US, e.g., states=c("OK","TX").

domain

Logical. Set to TRUE if you want to cut over a rectangle domain. (DEFAULT=FALSE)

minLat, maxLat, minLon, maxLon

Numerics defining the boundary of the rectangle if domain=TRUE.

fileAdd

Provide the address to the daily GHCN ghcnd-states.txt. Default is "ftp://ftp.ncdc.noaa.gov/pub/data/ghcn/daily/ghcnd-stations.txt".

Value

A dataframe of the selected gauges based on the user's criteria containing the following fields: country, network type, stationID, lat/lon, elevation, state, description, GSN flag, HCN/CRN flag, WMO ID and siteIds=[country,ntework,stationID]

Selection criteria

Selection can be based on the following criteria:

  1. A list of countries. For the full list of countries refer to http://www1.ncdc.noaa.gov/pub/data/ghcn/daily/ghcnd-countries.txt, example: countryCode=c("US","UK")

  2. A list of states (in this case the country will be automatically set to US). For the full list of states refer to http://www1.ncdc.noaa.gov/pub/data/ghcn/daily/ghcnd-states.txt, example: states=c("OK","TX")

  3. A specific type of the network. For a list of network codes, please refer to http://www1.ncdc.noaa.gov/pub/data/ghcn/daily/readme.txt The options are as follows:

    • 0 = unspecified (station identified by up to eight alphanumeric characters)

    • 1 = Community Collaborative Rain, Hail,and Snow (CoCoRaHS) based identification number. To ensure consistency with GHCN Daily, all numbers in the original CoCoRaHS IDs have been left-filled to make them all four digits long. In addition, the characters "-" and "_" have been removed to ensure that the IDs do not exceed 11 characters when preceded by "US1". For example, the CoCoRaHS ID "AZ-MR-156" becomes "US1AZMR0156" in GHCN-Daily

    • C = U.S. Cooperative Network identification number (last six characters of the GHCN-Daily ID)

    • E = Identification number used in the ECA&D non-blended dataset

    • M = World Meteorological Organization ID (last five characters of the GHCN-Daily ID)

    • N = Identification number used in data supplied by a National Meteorological or Hydrological Center

    • R = U.S. Interagency Remote Automatic Weather Station (RAWS) identifier

    • S = U.S. Natural Resources Conservation Service SNOwpack TELemtry (SNOTEL) station identifier

    • W = WBAN identification number (last five characters of the GHCN-Daily ID)

    • example: networkCode=c("C","1")

  4. Based on a domain. If domain is true, then you need min and max latitude and logitude for the enclosing rectangle.

See Also

Other GHCN: CalcDailyGhcn, GetGhcn2, GetGhcn

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
countryCodeList=c("US")
networkCodeList=c("1")
statesList=c("WY")
selectedGauges<-SelectGhcnGauges(countryCode=countryCodeList,
                                 networkCode=networkCodeList,
                                 states=statesList)

## End(Not run)

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