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

apply_dimension: Clarification of behaviour #357

Closed
Ardweaden opened this issue Mar 23, 2022 · 4 comments · Fixed by #400
Closed

apply_dimension: Clarification of behaviour #357

Ardweaden opened this issue Mar 23, 2022 · 4 comments · Fixed by #400
Assignees
Milestone

Comments

@Ardweaden
Copy link
Contributor

Process ID: apply_dimension

Describe the issue:
Documentation states:

The target dimension is the source dimension if not specified otherwise in the target_dimension parameter. The pixel values in the target dimension get replaced by the computed pixel values. The name, type and reference system are preserved.

There are three cases how the dimensions can change:
...
2. The source dimension is not the target dimension and the latter exists:
The number of dimensions decreases by one as the source dimension is dropped.
The target dimension properties name and type remain unchanged. All other dimension properties change as defined in the list below.

We don't understand how this is supposed to work.

For example what would the result be in the following case:

data = DataCube([[1,2],[3,4]], dimensions=("temporal", "band"))
apply_dimension(data=data, process, dimension="band", target_dimension="temporal") -> ?
@soxofaan
Copy link
Member

good point, you can not just "drop" a dimension without describing how the values along that dimension are "reduced"

@m-mohr m-mohr self-assigned this Apr 4, 2022
@m-mohr
Copy link
Member

m-mohr commented Jul 19, 2022

Yes, I think this was meant to say something like that:

The source dimension is not the target dimension. The target dimension exists with a single label only:
The number of dimensions decreases by one as the source dimension is "dropped" and the target dimension is filled with the processed data that originates from the source dimension.

So this is essentially: Move the data from source to target after processing it, but target must basically be empty / have a single label only.

@soxofaan
Copy link
Member

soxofaan commented Aug 2, 2022

Just wondering: what is the use case that makes this "target_dimension" feature in apply_dimension necessary? It can be implemented with drop_dimension + rename_dimension anyway, right?

@m-mohr
Copy link
Member

m-mohr commented Aug 2, 2022

I think the initial use-case was to "convert" data, e.g. you go in with a e.g. temporal dimension and your result is non-termporal data. So you'd need to specify another dimension that could hold the data. I think that is still valid.

As far as I know, apply_dimension was spec'ed before drop and rename were defined so the alternative was not present.

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

Successfully merging a pull request may close this issue.

3 participants