-
Notifications
You must be signed in to change notification settings - Fork 24
add_dimension
: Define behaviour for spatial dimensions better
#496
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
base: draft
Are you sure you want to change the base?
Conversation
Why can't x and y be added? A possible use case scenario could consist in: |
I agree with @clausmichele , is there a particular reason or background story to add this constraint? |
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. |
maybe use the |
That seems a little to implicit for me, what would a user get that specifies lat, lon, long, height, etc. I think defaulting to |
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
or
|
…mension for the `z` axis.
This makes sense. I've added:
The axis depends on the type (according to the cube:dimensions axis property). This makes it irrelevant whether it's named x, lat, lon, y or whatever. Anyone available for a review? @soxofaan @clausmichele |
add_dimension
: Type spatial always is always for z
axisadd_dimension
: Define behaviour for spatial dimensions better
@m-mohr what if I ask to add a spatial dimension but x,y,z already exist? Return DimensionExists exception? |
Would it make sense to allow multiple z-dimensions? Not sure :-) |
Stacking multiple "other" or "band" dimensions is something imaginable I think: e.g. one dimension with labels "NDVI" and "EVI", and another dimension with "mean", "min", "max", "stddev", which would be orthogonal to that. But spatial dimensions are tied to an axis (x, y or z), and I don't think it make sense, mathematically, to have for example multiple x axes |
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.
Apart from also adding a note on some DimensionExists
error, I think this is already fine
For x and y, I agree. I'm just unsure about the z dimension. Could we repesent e.g. altitude and pressure at the same time in a dataucbe, which afaik in climate are both related to z?! I'm not really into these climate/atmosphere details and how they handle this. |
"altitude" sounds like a spatial dimension along a spatial axis with a spatial resolution (meter or kilometer). But I would think "pressure" is a dimension of type "other" with a non-spatial unit (Pascal or bar or whatever is most common in practice) |
I think I tend to agree, I just don't want us to block any usecases from Climate or similar domains. |
@pierocampa maybe could help here, from our recent discussion he seemed to be fine using |
Clarified that type spatial always adds a spatial dimension for the
z
axis.