Skip to content
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_dimension: Type spatial always is always for z axis #496

Open
wants to merge 1 commit into
base: draft
Choose a base branch
from

Conversation

m-mohr
Copy link
Member

@m-mohr m-mohr commented Jan 24, 2024

Clarified that type spatial always adds a spatial dimension for the z axis.

@m-mohr m-mohr added this to the 2.0.0 milestone Jan 24, 2024
@m-mohr m-mohr marked this pull request as ready for review January 24, 2024 10:46
@clausmichele
Copy link
Member

Why can't x and y be added? A possible use case scenario could consist in:
load_collection over an AOI -> reduce_dimension over x (or y) -> add_dimension x (or y) with an "aggregated" label representing that area.

@soxofaan
Copy link
Member

I agree with @clausmichele , is there a particular reason or background story to add this constraint?

@m-mohr
Copy link
Member Author

m-mohr commented Jan 24, 2024

There's no way to specify the actual axis for the spatial dimensions, so just adding a spatial dimension without axis is ambiguous. The most reasonable (and presumably most common) way out for me was to specify that it's z.

@soxofaan
Copy link
Member

maybe use the name argument as axis identifier in some way?

@m-mohr
Copy link
Member Author

m-mohr commented Jan 25, 2024

That seems a little to implicit for me, what would a user get that specifies lat, lon, long, height, etc. I think defaulting to z is fine. If we ever encounter a usecase for x/y (has anyone encountered one?) we could just add an axis parameter to add_dimension that defaults to z.

@soxofaan
Copy link
Member

what would a user get that specifies lat, lon, long, height, etc.

yeah, but when adding a dimension with name "lat" or "lon" or "long" it also does not make sense to do that with axis "z".

Also what if the cube already has an axis "z"?

What about something like

... If the type is spatial, the axis is the first option that does not exist yet from "x", "y", "z"

or

... If the type is spatial, the axis depends on the dimension name: names "x", "lon", "long" map to axis "x", names "y", "lat" map to "y", and all other options map to "z"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants