-
Notifications
You must be signed in to change notification settings - Fork 14
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
resample_cube_spatial
should not crop the data spatially
#257
Comments
@ValentinaHutter the latest implementation of resample_cube_spatial breaks our notebook, could you please have a look? The returned error is: but the process is designed exactly to align different resolutions/projections. |
I now created a new PR to fix this: #314 I used the following code to test the process directly in openeo-processes-dask, but will not merge it in, because for these tests, we do not want to depend on an external stac collection:
I put this into a python file like In this test, the resample_cube_spatial should run through successfully and create the matching coordinates - however since the Another thing to mention, that I was not sure about, was, what to do if the resampled coordinates are exactly shifted by half the resolution compared to the target, so arrays would be for example: a = [ 687450. 687480. 687510. 687540. 687570 ] where a[0] is as close to b[0] as a[0] to b[1] - so the shilf is exactly resolution/2. |
Hi @ValentinaHutter. I'm trying to understand your implementation of the process. To me it appears that you are firstly resampling/reprojecting and then forcing the result to be on a different grid, which should be the same of the target, am I wrong? Because if it is like that, it's conceptually wrong, since the computed values correspond to different points and we can't just modify the associated coordinates. Please correct me if I'm wrong!
That would be fine, it would be enough to add a |
What I was trying to do was to solve the problem mentioned in #300 (comment) So, basically the old implementation took the coordinates from the target, resampled the data and cropped it to the target. My first update #300, I did to stop the cropping, and what it did was that it took crs and resolution from the target and resampled the data based on this. This would result in coordinates like the ones in the example above: So, what I did in the next PR #306 was to align the coordinates based on the target coordinates. Writing this, I notice that what I did is kind of like an approximation to the exact values. So, I guess depending on the method this would need to be updated, right? So, the method I used is basically the "nearest" pixel to the target pixel. Does this make sense to you? |
I think, I see, where my misunderstanding came from - my first thought was that if I reproject my data with the a = [ 687450. 687480. 687510. 687540. 687570 ] where a are the coordinates of the target and b are the coordinates of the data, after applying a = [ 687450. 687480. 687510. 687540. 687570 ] |
See here: Open-EO/openeo-processes#509
The text was updated successfully, but these errors were encountered: