Skip to contents

This function download the wind data from ERA5 hourly pressure level with the Climate Data Store (CDS) and through the ecmwfr R package.

Usage

graph_download_wind(
  pam,
  area,
  sta_id = seq_len(nrow(pam$sta) - 1),
  cds_key = Sys.getenv("cds_key"),
  cds_user = Sys.getenv("cds_user"),
  path = paste0("data/5_wind_graph/", pam$id, "/")
)

Arguments

pam

PAM logger dataset list with pam$sta computed. See pam_read() and pam_sta().

area

Geographical extent of the map to query. Either a raster (e.g. static_prob) or a list ordered by North, West, South, East (e.g. c(50,-16,0,20)).

sta_id

Stationary period identifier of the start of the flight to query as defined in pam$sta. Be default, download for all the flight.

cds_key

User (email address) used to sign up for the ECMWF data service. See wf_set_key().

cds_user

Token provided by ECMWF. See wf_set_key().

path

Path were to store the downloaded data.

Value

The path of the downloaded (requested file).

Details

The flight are determined from the stationary periods classified pam$sta (see pam_classify()). It request a single file for each flight using the exact time (hourly basis) and pressure (altitude). To make the download more efficient, wf_request_batch() is used to download all wind file at the same time (up to 20 requests in parallel).

To be able to download data from the Climate Data Store (CDS), you will need to create an account on https://cds.climate.copernicus.eu. You can then save your credential (cds_key and cds_user) in your .Rprofile (see GeoPressureManual | Wind graph).