-
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
Add basic handling for X,Y,band,time dimensions for transpose and rep… #244
Conversation
…rojection in the resample_spatial process
…s to fetch process specs
we don't do adding other dimensions, resample spatial just acts upon the x and y dimensions. The t and bands dimension are of course supported and basically left untouched. |
I didn't mean that you add dimensions within this process, but I was wondering if you support as input datacubes with arbitrary number of dimensions (additional to x and y), which seems so from your reply! Thanks |
to be clear: our backend does not at all support adding arbitrary number of dimensions. |
data_cp = data.transpose('y', 'x') | ||
except Exception: | ||
raise OpenEOException( | ||
f"Data cube has unexpected dimensions: {dims}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your inputs on the process and adding the align parameter!
I think, we can keep using the data.openeo
here, as this checks the dimensions in the dataset - and for example uses t
instead of time
if the temporal dimension is called like that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, sure but using data.openeo limits you to using band
, time
, x
and y
only now no? Because the moment you add a dimension and run resample it fails. We are looking into ways to extend the support of other dimensions. We can certainly reuse data.openeo for something but ultimately extend the resample_spatial
dim support.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we could do something like this maybe:
dims = list(data.dims)
known_dims = [
data.openeo.band_dims[0],
data.openeo.temporal_dims[0],
data.openeo.y_dim,
data.openeo.x_dim,
]
other_dims = [dim for dim in dims if dim not in known_dims]
data_cp = data.transpose(*other_dims, *known_dims)
This way we can keep the data.openeo
features plus add other dimensions. Of course, some limits and checks would need to be performed on the other
dimensions as we cannot realistically allow and support everything.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Valentina!
I updated the latest commit based on your suggestion to keep the data.openeo
functionality. The dummy align is set as well to prevent errors from occurring. Let me know what you think!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
The tests are currently failing because you need to pre-commit run --all-files
on the branch.
… N dimensional transpose support to keep the data.openeo functionality
Thanks for the contribution! Will add this to the latest release! |
Hi all,
Corresponding issue which this will cover as well: #243.
I am currently working on adding the
align
parameter to the resample_spatial function as per the OpenEO processes documentation.Part of this also involves handling cubes with different dimensions setups. For now, I edited the original fixed transpose to check the shape in the 4 basic dimensions.
Currently I added the
align
as a dummy parameter which does not do anything but allows us to use the function.Couple of questions and ideas:
anchor
available which appears to do a similar operation to align link to the docsAny feedback, ideas and suggestions are welcome!
Thanks!