Learn R Programming

rWind (version 1.1.7)

wind.dl_2: Wind-data download

Description

wind.dl_2 downloads time-series wind data from the Global Forecast System (GFS) of the USA's National Weather Service (NWS) (https://www.ncei.noaa.gov/products/weather-climate-models/global-forecast). Wind data are taken from NOAA/NCEP Global Forecast System (GFS) Atmospheric Model collection. Geospatial resolution is 0.5 degrees (approximately 50 km), and wind is calculated for Earth surface, at 10 m. More metadata information: http://oos.soest.hawaii.edu/erddap/info/NCEP_Global_Best/index.html

Usage

wind.dl_2(time, lon1, lon2, lat1, lat2, type = "read-data", trace = 1)

# S3 method for rWind_series [[(x, i, exact = TRUE)

Arguments

time

a scalar or vector of POSIXt or Date objects or an character which can transformed into those, see example below. There are currently these options at the GFS database for the hours: 00:00 - 03:00 - 06:00 - 09:00 - 12:00 - 15:00 - 18:00 - 21:00 (UTC) (TO).

lon1

Western longitude

lon2

Eastern longitude

lat1

Southern latitude

lat2

Northern latitude

type

Output type. "read-data" is selected by default, creating an R object. If you choose "csv", wind.dl create a a CSV file in your work directory named "wind_yyyy_mm_dd_tt.csv".

trace

if trace = 1 (by default) track downloaded files

x

object from which to extract element(s).

i

indices specifying elements to extract.

exact

Controls possible partial matching (not used yet).

Value

an object of class rWind_series or .csv file/s with U and V vector components and wind direction and speed for each coordinate in the study area defined by lon1/lon2 and lat1/lat2.

Details

To get the same format as wind.dl, you should run tidy function from wind.dl_2 output. The output type is determined by type="csv" or type="read-data". If type="csv" is selected, the function creates a "wind_yyyy_mm_dd_tt.csv" file that is downloaded at the work directory. If type="read-data" is selected, an rWind_series object is created.

References

http://www.digital-geography.com/cloud-gis-getting-weather-data/#.WDOWmbV1DCL

http://oos.soest.hawaii.edu/erddap/griddap/NCEP_Global_Best.graph

See Also

wind.mean, wind2raster, wind.dl, as_datetime, as.POSIXct

Examples

Run this code
# NOT RUN {
# Download wind for Iberian Peninsula region at 2015, February 12, 00:00
# }
# NOT RUN {
wind.dl_2("2018/3/15 9:00:00", -10, 5, 35, 45)

library(lubridate)
dt <- seq(ymd_hms(paste(2018, 1, 1, 00, 00, 00, sep = "-")),
  ymd_hms(paste(2018, 1, 2, 21, 00, 00, sep = "-")),
  by = "3 hours"
)
ww <- wind.dl_2(dt, -10, 5, 35, 45)
tidy(ww)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab