Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Date period specification #43

Closed
danielreispereira opened this issue Sep 27, 2019 · 3 comments
Closed

Date period specification #43

danielreispereira opened this issue Sep 27, 2019 · 3 comments

Comments

@danielreispereira
Copy link

danielreispereira commented Sep 27, 2019

Documentation says:

For those familiar to ECMWFs mars syntax: CDS does not accept date = "2000-01-01/to/2000-12-> 31" specifications at the moment. It is possible to specify one specific date via date = "2000-01-> >01" or multiple days via date = ["2000-01-01","2000-01-02","2000-10-20"] but not via ".../to/...".

So, how should the "date" piece of request be built when I need to extract date1 to date2?

date = "[2018-01-30 , 2019-02-01]", #does not work
date = "['2018-01-30', '2019-02-01']", #does not work
date = '["2018-01-30", "2019-02-01"]', #does not work

@khufkens
Copy link
Member

Try:
date = ["2000-01-01","2000-01-02","2000-10-20"]
no quotes

@danielreispereira
Copy link
Author

See image below.
RStudio will complain that I'm not building a list with "QuotedStrings" if I try that.

Looks like I'll have to build the character string with paste(), not sure. Thoughts?

image

image

@khufkens
Copy link
Member

khufkens commented Oct 1, 2019

Try converting the request from python to R using the addin.

A query similar to this should work.

request <- list(
  product_type = "reanalysis",
  format = "netcdf",
  variable = "temperature",
  pressure_level = "850",
  year = "1980",
  month = "02",
  day = c("02", "03"),
  time = "01:00",
  area = "70/-20/30/60",
  dataset = "reanalysis-era5-pressure-levels",
  target = "download.nc"
)

@khufkens khufkens closed this as completed Oct 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants