From 8173cfb56fb02a65b0c40317f35a2bd42f59708e Mon Sep 17 00:00:00 2001 From: Warisa Date: Mon, 16 Sep 2024 10:57:27 +0700 Subject: [PATCH] thread the NaN replacing function --- src/shock_point_detectors/2D/image_processing.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shock_point_detectors/2D/image_processing.jl b/src/shock_point_detectors/2D/image_processing.jl index def090e..6da7b30 100644 --- a/src/shock_point_detectors/2D/image_processing.jl +++ b/src/shock_point_detectors/2D/image_processing.jl @@ -3,7 +3,7 @@ using Statistics: mean # Function to replace NaNs with the mean of neighboring values for cells near obstacles and obstacles cells function replace_nan_with_mean!(matrix) - for i in 1:size(matrix, 1) + @threads for i in 1:size(matrix, 1) for j in 1:size(matrix, 2) if isnan(matrix[i, j]) # Get the neighborhood (3x3 window) around the NaN value since the kernel size is 3x3