ErikKusch / KrigR

An R Package for downloading, preprocessing, and statistical downscaling of the European Centre for Medium-range Weather Forecasts ReAnalysis 5 (ERA5) family provided by the European Centre for Medium‐Range Weather Forecasts (ECMWF).
Other
97 stars 23 forks source link

Question about era5 pressure levels #50

Closed Doltrix closed 1 year ago

Doltrix commented 1 year ago

Hello. Is there a possibility to download information from era5 pressure levels at some pressure level that I can specify? At some point I managed to use era5 pressure levels with downlad_krig but I think there is no argument to specify the desired level. Thanks in advance for your help.

ErikKusch commented 1 year ago

Hiya,

I am afraid that functionality was not implemented so far. That being said, I have received several E-emails about this issue as well and your issue was the thing to finally push me over the edge and implement it - I am sure the E-mailers are thankful to you. ;-)

With the latest development (#51) this has now been rectified. Please reinstall for the new functionality.

You are 100% right that this is due to the missing argument for specification of the pressure level. This is now targetable with the ... argument in the function call to download_ERA(...).

In addition, we also need to specify the pressure-level data set. This is done via DataSet = "era5-pressure-levels".

This is a minimal working example to demonstrate the new use:

Pressure <-download_ERA(
  Variable = 'divergence',
  Type = "reanalysis",
  DataSet = "era5-pressure-levels", # this is a hacky implementation for targeting the pressure levels
  DateStart = "2000-01-01",
  DateStop = "2000-01-31",
  TResolution = "hour",
  TStep = 1,
  Cores = 1,
  Extent = extent(-78.83, -77.87, -0.73, 0.34),
  FileName = 'Pressure_hour',
  API_Key = API_Key,
  API_User = API_User,
  pressure_level = 1 # this comes in in place of the ... argument
  )

This is a hacky solution and I plan to implement this more elegantly when I get around to #26. Until then, this should do, please note that:

1. Pressure level information is lost in the final output, please make it a part of your filename or keep track of it otherwise

2. Pressure level specification is not supported in the pipeline download+kriging call executed via the krigR() function