-
Notifications
You must be signed in to change notification settings - Fork 18
Change grid level #18
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
Comments
Just had an in depth chat with @surgura about this. These are our thoughts:
Our proposal:
Anticipating questions:
Can I get cracking on this feature? Thoughts? |
Yes please go ahead! I like your proposal very much. |
I think there's two distinct (but interdependent) operations that both would make sense:
(to be clear, I think 1 depends on 2, so I'd start with that) The exact API will probably need some refinement (not everything that |
Apologies to intervene here very briefly, but I see the terminology that is being used above quite critical: 'upscaling' and 'downscaling' are terms used in opposite way by different geoscience user communities. A much clearer choice would be 'coarsening' and 'refining'. 'resolution' is simply the wrong term to use when it comes to 'grid spacing'. The resolution of gridded data is to same extent related (and limited) by the grid spacing, but the grid spacing is no useful indication for resolution (and there is no such thing as a 'grid resolution'). E.g. if you interpolate data into a finer grid (smaller spacing) you do NOT change the resolution!!! I see an increasing misuse of these terms which undermines basic data understanding. A suitable neutral term would be re-gridding. Please consider that words matter and help (or hamper) to understand concepts correctly. If possible stick as close as possible to DGGS terminology as proposed in the standard. If unsure please ask around before jumping on some jargon which might lead to further confusion and misunderstanding in our science. Thanks! |
I think this would be a good feature. However I also agree that naming matters, and up/down isn't obviously defined. |
I also like (note about @keewis by API refinement are you thinking about Agreed for supporting weights, this will also be useful if we eventually support DGGSs where the cell structures are not congruent across refinement levels (e.g., ISEA3H). Probably we'd need it too for |
cc @allixender, If you have comment from OGC DGGS SWG point of view for the naming issue. |
Agreed. Rescale is not particularly needed. I'll look to update my PR draft when I have more time (next weekend). |
What about a |
My proposal was only talking about absolute, but if we want to also support relative I think the following API would be nice (instead of a new method)
|
nit: |
what if we used |
'coarsen to' of course implies that you know which level you're at otherwise it might be void. BTW 'refinement level' is the correct term for a specific grid instance in a DGGS from the SWG perspective. A possible issue with shortening it to 'level' is that there are many 'levels' in EO terminology. E.g. changing the 'refinement level' is different from changing the 'processing level'. I believe I remember a discussion on 'resolution' somewhere on Github, but the issue tends to be forgotten and the term is hard to kill now that's so widely (and wrongly) used. Regarding changing the gridding of data (aka 're-sampling'), that is always critical and requires certain conditions to be done safely. E.g. is coarsening only allowed if the coarser zone is populated in a representative way by finer samples (ideally it is continuously sampled). If some samples are missing that is okay as long as the remainder is not biased (no longer representative). Refining is even more complex, leads to far here... Generally, please keep in mind that in the near future we will have to consider uncertainty in all operations we do with values (in fact 'data' consists always of 'value' and 'uncertainty', although the latter is often neglected). The effect of re-sampling on uncertainty is actually more important than the one on the values, and even if the values change only slightly, the uncertainty always increases which each re-sampling. That's why it should be limited to a minimum and done only with utmost care. |
@strobpr is also an trusty advisor/contributor/member in the OGC DGGS SWG, his comments on The wording of level for implies a better logic, because really we don't change the original data, we are also not regridding in the traditional/conservative sense, we are mostly resampling and stay within the same DGGS grid logic. Thus, a user is in data fidelity sense only moving/zooming up or down. My 2 cents. |
indeed, the discussion was mostly in #62, but also in #64 and #65. The conclusion was that in the context of a grid (and |
Uh oh!
There was an error while loading. Please reload this page.
It would be useful to have utility methods to change the grid resolution, very much like this and this.
Proposed behavior
This would be pretty similar to Xarray
.reindex()
, but here DGGS-aware.When downgrading the resolution, only the cell coordinate would change with child cell ids replaced by their parent cell id at the given resolution. The resulting coordinate has the same size but may have duplicate labels. Users could then perform aggregation with the method of their choice just by using Xarray's
.groupby()
.When upgrading the resolution, the new cell coordinate has new labels (child cell ids) and the cell dimension may have an increased size, in which case the values of the data variables must be repeated according to the new cell ids along the cell dimension.
These
.change_resolution()
utility functions might be actually just what we need in order to align, merge or do other operations with multiple Datasets / DataArrays on the same DGGS but at different resolutions. Those are pretty simple and composable functions.For simplicity, there would be no regridding or resampling involved here. There are two caveats, though:
The text was updated successfully, but these errors were encountered: