Skip to content

datetime object in earthkit does not handle sub minute resolution #844

@uandrae

Description

@uandrae

What happened?

In the attached jupyter notebook example the data.datetime() returns values only to the resolution of minutes although data with a resolution of 30s is retrieved from fdb.

sub_minute_bug.ipynb

What are the steps to reproduce the bug?

Run the attached jupter notebook on atos.

Version

v0.13.2

Platform (OS and architecture)

https://jupyterhub.ecmwf.int the HPC resource

Relevant log output

The following
vars(data[0:4])
{'observer': <function earthkit.data.core.<lambda>()>,
 'fields': [GribField(t,90,20230820,1200,0s,None),
  GribField(t,90,20230820,1200,30s,None),
  GribField(t,90,20230820,1200,1m,None),
  GribField(t,90,20230820,1200,90s,None)]}
but the datetime object contains
data[0:4].datetime()
{'base_time': [datetime.datetime(2023, 8, 20, 12, 0)],
 'valid_time': [datetime.datetime(2023, 8, 20, 12, 0),
  datetime.datetime(2023, 8, 20, 12, 1)]}

Accompanying data

request= { "class": "d1", "dataset": "on-demand-extremes-dt", "expver": "aac6", "stream": "oper", "date": "2023-08-20", "time": "1200", "type": "fc", "georef": "u09tvk", "levtype": "ml", "step": "0/to/15m/by/30s", "levelist": 90, "param": 130, }

Organisation

DE330 / UrbanAir / SMHI

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions