File tree Expand file tree Collapse file tree 1 file changed +3
-0
lines changed Expand file tree Collapse file tree 1 file changed +3
-0
lines changed Original file line number Diff line number Diff line change @@ -210,6 +210,7 @@ def collapse_by_hour_of_day(
210
210
cube = collapse_by_lead_time (
211
211
cube , method , additional_percent = additional_percent
212
212
)
213
+
213
214
# Categorise the time coordinate by hour of the day.
214
215
iris .coord_categorisation .add_hour (cube , "time" , name = "hour" )
215
216
# Aggregate by the new category coordinate.
@@ -219,13 +220,15 @@ def collapse_by_hour_of_day(
219
220
)
220
221
else :
221
222
collapsed_cube = cube .aggregated_by ("hour" , getattr (iris .analysis , method ))
223
+
222
224
# Remove unnecessary time coordinates.
223
225
collapsed_cube .remove_coord ("time" )
224
226
collapsed_cube .remove_coord ("forecast_period" )
225
227
# Remove forecast_reference_time if a single case, as collapse_by_lead_time
226
228
# will have effectively done this if multi_case is True.
227
229
if not multi_case :
228
230
collapsed_cube .remove_coord ("forecast_reference_time" )
231
+
229
232
# Promote "hour" to dim_coord if monotonic.
230
233
if collapsed_cube .coord ("hour" ).is_monotonic ():
231
234
iris .util .promote_aux_coord_to_dim_coord (collapsed_cube , "hour" )
You can’t perform that action at this time.
0 commit comments