Skip to content

Commit

Permalink
Add fix_time_coord() docstring.
Browse files Browse the repository at this point in the history
  • Loading branch information
truth-quark committed Oct 10, 2024
1 parent b956933 commit 7a12392
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions umpost/um2netcdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -965,6 +965,23 @@ def convert_32_bit(cube):


def fix_time_coord(cube, verbose):
"""
Ensures cube has a 'time' coordinate dimension.
Coordinate dimensions are reordered to ensure 'time' is the first dimension.
Cubes are modified in place, although it is possible iris will return new
copies of cubes. UM ancillary files are ignored.
Parameters
----------
cube : iris Cube object
verbose : True to display information on stdout
Returns
-------
A (cube, unlimited_dimensions) tuple. Unlimited dimensions is None for
ancillary files.
"""
try:
# If time is a dimension but not a coordinate dimension, coord_dims('time')
# returns empty tuple
Expand Down

0 comments on commit 7a12392

Please sign in to comment.