-
Notifications
You must be signed in to change notification settings - Fork 42
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
[POC] : subdivision by bloc size #601
Comments
@adehecq, @rhugonnet |
This is a great idea! Being only able to specify a "number of blocks" is definitely a limitation. Having the option of specifying a "number of blocks" could be retained just for the specific use case (immediately translating it into a size). For the subdivision of the array: To avoid edge effects during transformations of the chunks, it is usually necessary to use an overlap. I have some old code that does this here (which does not have proper tests written, but was used a lot and checked qualitatively), if can be useful: https://github.com/iamdonovan/pyddem/blob/main/pyddem/fit_tools.py#L1390 (the The problem is slightly different as a classic split/stitch here, as we don't know in advance the horizontal shift that the coregistration will find for each chunk. So we'd need some kind of @erikmannerfelt could have more ideas/insights as he implemented the original functionality 🙂. |
After more thinking, I'm wondering if directly using https://docs.dask.org/en/latest/generated/dask.array.overlap.map_overlap.html would make more sense, even if for now our input arrays are not chunked in-memory. It would:
The only downside is that Dask is more complex. For instance, we likely won't be able to use directly |
After quick reading, I am not sure to understand completely all. Maybe in two phases:
I have discussed with @guillaumeeb from CNES who have more knowledge on dask usage than me. Do you have some insights on this dask impact proposed by @rhugonnet ? A good way to be compatible with dask would benefit the project, i agree. |
An additional point I just thought of: If resolving the bug involves removing the Agree on the two phases. |
Hi everyone, sorry for the delay in response. I totally concur with @rhugonnet analysis!! When I first read the original post of this issue, I directly thought of Dask and The important point, even if doing this in two phases, would be to already think of Dask as a design goal. For example, subdivisions as expressed as chunk shapes (nbrows, nbcols) in Dask, but I think this is what you are aiming at. One last warning about map_overlap, this can complexify a Dask graph in big cases, there might be optimizations to look for on Dask side, but let's see that afterwards. |
Context
The CNES QI team is interested in the possibility of performing block-based coregistration, which is why studies are currently being conducted to test this functionality, referred to as blockwise. At the moment, users must specify the number of subdivisions they wish to apply. However, the QI team would prefer to specify block sizes instead. The goal of this ticket is to propose an implementation of this capability.
We will start the process of managing the size of an overlap between tiles. In this ticket, it will have a default value, and another ticket will be opened later to better manage this overlap.
Proposed Code
Currently, subdivision is handled by the
subdivide_array
function, so we propose managing block sizes at this level.Extend Subdivision:
Currently, users input a number, but instead, we could allow them to input a dictionary or list containing two integers for rows and columns, and then calculate the number of subdivisions based on these values.
For example, for an image of size 985x1332:
Update the Following:
[row, col]
: there is an exempleUpdate the associated docstring.
Copy a function that allow blocks to overlap
Tests
patchify
functionDocumentation
/ estimate 5d
The text was updated successfully, but these errors were encountered: