DimensionalData.jl
DimensionalData.jl copied to clipboard
new, explicit-like, lookup for explicit but continuous bounds
Think of the bounds of a histogram which can be represented by LinRange(minval, maxval, n_bins+1). There's no good way to do this in DD at the moment that is not Explicit, which loses the idea that you don't need to duplicate the lookup values. Specifically, the "bounds" of the interval at index i are given by (range[i], range[i+1]). This is a pretty standard strategy (perhaps the most standard) and has the advantage of allowing a natural way to reproject intervals lookups - as this kind of explicit lookup where we still know it's continuous.
Spherical cellarea is still too slow for my tastes so I want to optimize it by chunking where possible. Would some
fyi, this is for https://github.com/rafaqz/Rasters.jl/issues/945 - I am doing some sketchy stuff there which would be made way easier if we had this!
Have you tried intervalbounds ?
(we should probably document it and internalise most of the methods...)
But you can do intervalbounds(lookup::Lookup, i::Int) for each interval to be returned as a Tuple
I ended up using that! But it still feels pretty ugly.
Why is it ugly?
It's generic over all span types. What youre talking about will only apply to Regular lookups that are actually ranges