EcoJulia / RasterDataSources.jl

Easily download and use raster data sets in Julia
MIT License
21 stars 10 forks source link

Incorporate all the CHELSA data sources #18

Open rafaqz opened 3 years ago

rafaqz commented 3 years ago

CHELSA has an interesting range of datasets https://chelsa-climate.org/

Future projections, whole 20th century weather data, and high res data sets for Europe could all be wrapped here.

tpoisot commented 3 years ago

I was thinking about the CHELSA futures for bioclim - we should maybe have a more complex type with fields for the scenario, model, and years range -- happy to work on this one as a proof of concept

rafaqz commented 3 years ago

Currently we have CHELSA{BioClim}. We could also just use the type system, like CHELSA{Future{:model}} ?

I did something similar here with a more complex type, where the interval of the data can be Day/Month/Year and the values can be in raw values or deciles: https://github.com/cesaraustralia/RasterDataSources.jl/blob/master/src/alwb/alwb.jl#L19

But it was kind of an experiment with how to get nice syntax for specifying something this complicated, I was also thinking to use Symbol instead of types to specify Values or Deciles, and have a branch with that structure as well. The types can be useful for getting the path segments to construct the url/filepath (which I try to keep the same as much as possible).

For the actual date period I've been using a date argument to getraster:

https://github.com/cesaraustralia/RasterDataSources.jl/blob/master/src/alwb/alwb.jl#L88 https://github.com/cesaraustralia/RasterDataSources.jl/blob/master/src/worldclim/weather.jl

I guess the division I've been loosely working with is the type object specifies which source, dataset, and some format options, and the other arguments like layer and date select which part of the dataset to download. But don't think I've been completely consistent as it wasn't planned out. We should probably clarify that division to make things more streamlined in future. It's totally up for debate the best way to do this, but I think we should be consistent for all the datasets so the syntax is as predictable as possible. That probably means changing how some datasets are currently written as well.

tpoisot commented 3 years ago

Chelsa has more than one model - there's the actual model, years, and the RCP used - I'm think about a way to convey all this as a type, as it's a good dozen combinations, I think, but it all comes down to building a standard url.

rafaqz commented 3 years ago

That's what I mean, you can use a different type or symbol to select the model, where I have :model. Then add more type parameters for other things. In alwb there are three time resolutions and two formats, so six options in the type. But I have the actual dates as an argument.