File tree Expand file tree Collapse file tree 1 file changed +5
-9
lines changed
src/nwp_consumer/internal/entities Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -350,16 +350,12 @@ def _calc_null_percentage(data: np.typing.NDArray[np.float32]) -> float:
350350 f"Got: { store_da .dims } ." ,
351351 ))
352352
353- result = xr .apply_ufunc (
354- _calc_null_percentage ,
355- store_da ,
356- input_core_dims = [spatial_dims ],
357- vectorize = True ,
358- dask = "parallelized" ,
359- )
353+ nan_percentage_per_step : xr .DataArray = store_da .isnull ().mean (
354+ dim = spatial_dims ,
355+ ).mean ("step" )
360356
361- failed_image_count : int = (result > nans_in_image_threshold ).sum ().values
362- total_image_count : int = result .size
357+ failed_image_count : int = (nan_percentage_per_step > nans_in_image_threshold ).sum ().values
358+ total_image_count : int = nan_percentage_per_step .size
363359 failed_image_percentage : float = failed_image_count / total_image_count
364360 if failed_image_percentage > images_failing_nan_check_threshold :
365361 log .warning (
You can’t perform that action at this time.
0 commit comments