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 more options to time handling in combine_metadata #2447

Closed
gerritholl opened this issue Apr 13, 2023 · 1 comment · Fixed by #2737
Closed

add more options to time handling in combine_metadata #2447

gerritholl opened this issue Apr 13, 2023 · 1 comment · Fixed by #2737
Labels
enhancement code enhancements, features, improvements

Comments

@gerritholl
Copy link
Collaborator

Feature Request

Is your feature request related to a problem? Please describe.

We are looking into combining metadata in MultiFiller when producing a world composite (see #2446 for additional context). If we use combine_metadata as is, we would either get the start_time and end_time of the first dataset to be combined, or we would get the average. Neither are correct for producing a world composite. Rather, we would want the minimum of all start_times and the maximum of all end_times.

Describe the solution you'd like

We would like that combine_metadata gets more flexibility in how to handle differing times. The user should be able to pass a mapping of time variables to actions, where actions can be (for example) "first", "average", "minimum", "maximum", or maybe others.

Describe any changes to existing user workflow

The current API can be retained for backward compatibility.

Additional context

See #2446 for additional context. We could refrain from using combine_metadata or accept its limitations.

@gerritholl gerritholl added the enhancement code enhancements, features, improvements label Apr 13, 2023
@djhoese
Copy link
Member

djhoese commented Apr 13, 2023

I completely agree that the averaging of start/end time is probably never the right way of handling it. As mentioned in slack (I think?) the the MultiScene's stack blend function handles start/end with min/max and so does the metadata handling inside the base file handler when readers need to concatenate multiple granules or segments into a single DataArray. In this file handler case it also does this with start/end orbit metadata. I guess it is time this functionality moves into the combine_metadata function.

I personally don't think we should add the ability to choose first/average/min/max. I'm not sure that would ever be needed. I think we add special handling for start/end prefixed metadata and leave the rest as an average. Oh I suppose we'd need special handling for all time_parameters time metadata.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement code enhancements, features, improvements
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants