File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -959,11 +959,11 @@ def _convert_precipitation_units_callback(cube: iris.cube.Cube):
959959 if cube .long_name == "surface_microphysical_rainfall_rate" :
960960 if cube .units == "kg m-2 s-1" :
961961 logging .info ("Converting precipitation units from kg m-2 s-1 to mm hr-1" )
962- # manually convert from kg m-2 s-1 to mm hr -1 assuming 1kg water = 1l water = 1dm^3 water
963- cube . data = cube . data * 3600.0
964-
965- # update the units
966- cube .units = "mm hr-1"
962+ # Convert from kg m-2 s-1 to mm s -1 assuming 1kg water = 1l water = 1dm^3 water.
963+ # This is a 1:1 conversion, so we just change the units.
964+ cube . units = "mm s-1"
965+ # Convert the units to per hour.
966+ cube .convert_units ( "mm hr-1" )
967967 else :
968968 logging .warning (
969969 "Precipitation units are not in 'kg m-2 s-1', skipping conversion"
You can’t perform that action at this time.
0 commit comments