-
Notifications
You must be signed in to change notification settings - Fork 37
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
construct RasterSeries from AbstractBasicDimArray #826
construct RasterSeries from AbstractBasicDimArray #826
Conversation
So slick. Especially with RDS climate types as lookups. |
RasterSeries(data::DD.AbstractBasicDimArray; kw...) = | ||
RasterSeries(data, dims(data); kw...) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RasterSeries(data::DD.AbstractBasicDimArray; kw...) = | |
RasterSeries(data, dims(data); kw...) | |
RasterSeries(data::DD.AbstractBasicDimArray{<:Union{AbstractRasterStack,AbstractRaster}}; kw...) = RasterSeries(data, dims(data); |
Has to hold a Raster or RasterStack
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't want to limit it to that, in principle it could hold strings (of filenames) as well. If it holds something that isn't allowed then RasterSeries(data, dims(data)
will fail anyway
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh right because strings will work too. Ok makes sense
Maybe a test? |
We really should include an example like this in the docs somewhere. It's not a super intuitive way to use dimensions but it is just such as nice way to keep track of your data. It just gets rid of all the for-loops in the rest of your workflow. |
Did you want to add docs in this PR? Or just merge? |
Just merge! I'll make a docs example in a separate PR. |
Just to clarify here - is a RasterSeries essentially a lazy concatenation of multiple dimarrays of dimension n, along some dimension n+1 (and maybe also n+2 etc)? If so, can a RasterSeries be used as a vector of dimvectors as well as a dimmatrix? That would be super interesting for some of the vector data cube stuff. |
It's basically just a Raster of Rasters or RastersStacks with some helper methods. It's not a lazy concatenation, but using |
Just a small quality of life improvement that makes it possible to get a
RasterSeries
from aDimArray
using a pipe.Things works nicely together with
@d
to make things like this possiblewhich returns a
Raster
with dimsX
,ssp
, andgcm