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

deriving time dimension from metadata #99

Open
jorritscholze opened this issue Jul 22, 2024 · 2 comments
Open

deriving time dimension from metadata #99

jorritscholze opened this issue Jul 22, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@jorritscholze
Copy link

Currently, zappend requires a time dimension to be present within the product itself or a custom slice source needs to be given to create the time dimension. It would be beneficial for zappend to also utilize the metadata fields for creating the time dimension.

@jorritscholze jorritscholze added the enhancement New feature or request label Jul 22, 2024
@forman
Copy link
Member

forman commented Sep 13, 2024

@jorritscholze Good point! How would you like to see that implemented/configured? Names of time metadata fields may differ, and the format of time values as well.

@forman
Copy link
Member

forman commented Sep 13, 2024

For maximum flexibility we may use Python expressions in the configuration, see also here. Suggestion:

{
  "append_dim": "time",
  "append_coords": {
    "time": {
        "dims": ["time"],
        "values": "{{ [to_datetime(ds.attrs['START_TIME'])] }}",
    },
    "time_bnds": {
        "dims": ["time", "bnds"],
        "values": "{{ [to_datetime(ds.attrs['START_TIME']), to_datetime(ds.attrs['STOP_TIME'])] }}",
    }
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants