wind.dl_2: Wind-data download

View source: R/wind_functions2.R

wind.dl_2R Documentation

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 for current data: https://pae-paha.pacioos.hawaii.edu/erddap/griddap/ncep_global.html Historical data are obtained from the official NOAA/NCEI GFS 0.5 degree archive.

Usage

wind.dl_2(
  time,
  lon1,
  lon2,
  lat1,
  lat2,
  type = "read-data",
  trace = 1,
  source = c("auto", "pacioos", "ncei")
)

## S3 method for class '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

source

Data provider. "auto" selects PacIOOS for dates in its current coverage and NOAA/NCEI for older dates. Use "pacioos" or "ncei" to force one provider.

x

object from which to extract element(s).

i

indices specifying elements to extract.

exact

Controls possible partial matching (not used yet).

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.

Value

With type = "read-data", wind.dl_2() returns an object of classes rWind_series and list, with one element per requested time. Each element stores a data frame of U and V wind components (m/s); element names encode UTC times and the lat_lon attribute stores the shared grid coordinates in degrees. Extracting a time step with [[ returns an object of classes rWind and data.frame, with columns time, lat, lon, ugrd10m, vgrd10m, dir, and speed, as described in wind.dl(). With type = "csv", wind.dl_2() writes one CSV file per time step in the working directory and returns NULL invisibly.

Note

wind.dl_2 requires two dates that represent the boundaries of the time lapse to download wind series data. U and V vector components allow you to create wind averages or tendencies for each coordinate at the study area. Longitude coordinates are provided by GFS dataset in 0/360 notation and transformed internally into -180/180. "dir" denotes where the wind/sea current is going (toward), not from where is coming. With source = "auto", dates before the current PacIOOS coverage are requested from NOAA/NCEI.

Author(s)

Javier Fernández-López (jflopez.bio@gmail.com)

References

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

https://pae-paha.pacioos.hawaii.edu/erddap/griddap/ncep_global.graph

See Also

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

Examples


# Download two time steps for a small region in southern Iberia

dt <- as.POSIXct(c("2015-02-12 09:00:00", "2015-02-12 12:00:00"),
  tz = "UTC")
ww <- wind.dl_2(dt, -7, -4, 34.5, 37.5)
tidy(ww)



rWind documentation built on Oct. 18, 2026, 5:08 p.m.