Skip to content

Coordinate description can't be extracted as formatted date-time #4177

@alastair-gemmell

Description

@alastair-gemmell

Submitted on behalf of an Iris user who isn't on GitHub:​

The code for generating this this string:

DimCoord([2020-08-13 00:00:00], standard_name='time', calendar='gregorian', long_name='time', var_name='time')

... is a complex combination of cf_units and numpy, and there is no public API for just getting 2020-08-13 00:00:00 alone.

It is possible to generate the string using your own code:

coord = cube.coord('time')
dt = coord.units.num2date(coord.points[i])
desired_string = str(dt)

...but it would be more useful if there was a public API for doing it.

Metadata

Metadata

Assignees

Labels

Good First IssueA good issue to take on if you're just getting started with Iris developmentType: Enhancement

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions