Add .downscale(), .upscale(), and .rescale() methods#141
Add .downscale(), .upscale(), and .rescale() methods#141VeckoTheGecko wants to merge 3 commits intoxarray-contrib:mainfrom
.downscale(), .upscale(), and .rescale() methods#141Conversation
.downscale() .upscale() and .rescale()` methods.downscale(), .upscale(), and .rescale() methods
| if offset == 0: | ||
| return obj | ||
|
|
||
| upper_cell_membership = np.floor(obj.cell_ids / (4**offset)) |
There was a problem hiding this comment.
Hmm, not sure how expensive this line is with high offsets?
There was a problem hiding this comment.
there should be a constant cost (a binary right-shift), so I wouldn't worry too much about it. This implementation doesn't do that, so I'd recommend switching to healpix_geo.nested.zoom_to (nothing for ring, as hierarchy operations don't really make sense there)
|
I forgot to mention this before, but usually we create new methods on the I'd also either return the |
Agreed, I think that sounds good now that we aren't considering I'm still interested in this issue, but I have quite a bit on my plate with work and can't dedicate much to hobbyist coding. Might only get around to this again end June. Feel free to take over if this is blocking - otherwise I can pick this back up down the line. |
Scratch that - mainly focussing on work, Rust learning, and other learning so i don't think I have time to get around to this. |
changelog.mdapi.rstJust done downscale for now. Logging off for tonight. Will work on upscale tomorrow (and incorporate #18 (comment) - thanks for the info about hierarchical tooling @keewis , was just looking for that)
Will add tests tmrw as well