-
Notifications
You must be signed in to change notification settings - Fork 0
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
A reordering function for stmtools #34
Comments
Example notebook has been made by Thijs. The next step is to implement the Morton order as a function |
So, a function for reordering should be made part of the stm extension to xarray (in stmtools.git: stmtools/stm.py). Ideally, only evaluate the point coordinates to reduce the strain on memory (delayed processing). |
It could be that any reordering operation on an xarray will have to evaluate all the point attributes. In this case, we may have to also implement some sort of redirection array (with only x, y, and index in the original array). |
I looked at a few light-weight Morton ordering python tools. A very generic and simple one is trevorprater/pymorton. This one has two disadvantages though:
There are several geohashing python tools. The one that is currently most popular is https://pypi.org/project/python-geohash/ I will have to check whether computation time could be a limiting factor for either tool. |
Once the ordering hash/index is computed, the sorting can be done by the In case the single column of the ordering hash/index is too big to persist in the memory, we can first write the ordering index using the older chunks to disk, then reload the whole dataset lazily, finally sort by the lazy index. |
We also decided to (initially) sort by image (pixel) coordinate. |
Also, we briefly discussed the timing of the sorting procedure. Ideally this should be done immediately after pixel selection to prevent writing data chunks that will have to be overwritten after sorting. However, we also need to be able to work with pre-existing data that is already chunked. Maybe this means there should be two sorting procedures, or at least two ways of commencing the sorting. |
Example delayed funtion: stm/py:enrich_from_polygon -> xr.map_blocks(...) Better yet: sarxarray/stack.py:_get_phase(...) -> da.apply_gufunc(...) |
We would like to have a reordering function for stmtools, to make the spatially close-by points also close in the points orders. This will benefit the enrichment function.
requirements:
point
dimension.Example application:
Example dataset can be retrieved from here
The text was updated successfully, but these errors were encountered: