Skip to content

Commit

Permalink
Add conversion docstring.
Browse files Browse the repository at this point in the history
  • Loading branch information
truth-quark committed Sep 6, 2024
1 parent 0cf8fd4 commit 05238cd
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions umpost/um2netcdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -738,6 +738,13 @@ def fix_level_coord(cube, z_rho, z_theta, tol=1e-6):


def convert_32_bit(cube):
"""
Convert 64 bit int/float data to 32 bit (in place).
Parameters
----------
cube : iris.cube object to modify.
"""
if cube.data.dtype == 'float64':
cube.data = cube.data.astype(np.float32)
elif cube.data.dtype == 'int64':
Expand Down

0 comments on commit 05238cd

Please sign in to comment.