dbW_getWeatherData: Extracts daily weather data from a registered weather...

View source: R/sw_dbW_WeatherDatabase.R

dbW_getWeatherDataR Documentation

Extracts daily weather data from a registered weather database

Description

Weather data for the soil water simulation run can be stored in the input data or it can be separate to keep the input data size down for multiple variations of the same site. This function is used to return the weather data from a predefined weather database. Using the database was faster then reading in multiple weather files from disk.

Usage

dbW_getWeatherData(
  Site_id = NULL,
  lat = NULL,
  long = NULL,
  tol_xy = 1e-04,
  Label = NULL,
  startYear = NULL,
  endYear = NULL,
  Scenario = "Current",
  Scenario_id = NULL,
  ignore.case = FALSE,
  stop_if_missing = TRUE,
  verbose = FALSE
)

Arguments

Site_id

An integer value. The IDs/database key of the queried site.

lat

A numeric vector or NULL. The latitude in decimal degrees of WGS84. Northern latitude are positive, sites on the southern hemisphere have negative values.

long

A numeric vector or NULL. The longitude in decimal degrees of WGS84. Eastern longitudes are positive, sites on the western hemisphere have negative values.

tol_xy

A numeric value. The tolerance used to match requested longitude and latitude values.

Label

A character string. The name/label of the queried site.

startYear

A numeric value. First calendar year of the weather data.

endYear

A numeric value. Last calendar year of the weather data.

Scenario

A character string. The name/label of a climate scenario.

Scenario_id

An integer value The ID/database key of the queried scenario.

ignore.case

A logical value.

stop_if_missing

A logical value. If TRUE, then throws an error if at least one requested weather data object is not available in the current weather database. If FALSE, then returns NULL for those requested site scenario combinations.

verbose

A logical value.

Details

If there is missing data, then impute or use the built-in Markov weather generator (see examples for sw_exec).

Value

If one site and one scenario were requested, then returns weather data as list. Each element is an object of class swWeatherData and contains data for one year. If more than one site or more than scenario were requested, then returns a list of such weather data lists. Elements of the returned list may be NULL if there is no weather data object for the requested site scenario combination and if stop_if_missing is FALSE.

Notes

This function returns the first record of weather data for a site x scenario combination even if duplicate entries match the query.

See Also

getWeatherData_folders


DrylandEcology/rSOILWAT2 documentation built on Jan. 12, 2024, 9:06 p.m.