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

Download time-series data for a given coordinates #8

Closed
alexdum opened this issue Feb 25, 2019 · 4 comments
Closed

Download time-series data for a given coordinates #8

alexdum opened this issue Feb 25, 2019 · 4 comments

Comments

@alexdum
Copy link

alexdum commented Feb 25, 2019

Is it possible to use wf_request() function to download time-series data for a given list of coordinates?

Thanks,
Alexandru

@khufkens
Copy link
Member

No and this isn't the goal of the APIs I fear.

They are meant to query gridded data explicitly. Although you could do this by looping over a custom query you adjust, you will run into performance issues quickly. In general queries are quite slow. This isn't an issue if you in the end download a lot of data, but through my experience on the unit checks of the code I noticed that query size (mainly spatial extent) isn't the limiting factor in terms of speed, i.e. if you query say Germany or 1 location in Germany might end up taking the same amount of time. Subsequent queries aren't necessarily faster either.

So, it is better to download larger gridded data and subset the locations from this data. If your cover multiple areas separated by larger areas of data not of interest divide the queries into meaningful sections. For example, say the EU and conterminous US, or Spain and Germany.

Hope this helps.

@alexdum
Copy link
Author

alexdum commented Feb 25, 2019

What about downloading a gridded time-series dataset as nc. I tried, without success, to download data for two days, by adding in the request list for "day" = "04:05".

request <- list("dataset" = "reanalysis-era5-pressure-levels",
"product_type" = "reanalysis",
"variable" = "temperature",
"pressure_level" = "850",
"year" = "2001",
"month" = "05",
"day" = "04:05",
"time" = "00",
"area" = "70/-20/30/60",
"format" = "netcdf",
"target" = "era5-demo.nc")

@khufkens
Copy link
Member

khufkens commented Feb 25, 2019

Your syntax isn't correct, use:
"day" = c("04","05")
or
"day" = 4:5

Use proper R list elements and syntax.

@khufkens
Copy link
Member

To recap, If you want a time series create a query covering the correct months, days, years. Then subset using the raster or stars library in R, as I mentioned above. This should give you spatial and temporal coverage.

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