From 60399ca71e143f524e531e4b75ddf042cdf51330 Mon Sep 17 00:00:00 2001 From: Mikko Partio Date: Tue, 7 May 2024 10:22:32 +0300 Subject: [PATCH] HIMAN-359: Add 3x3 filtering to POT --- himan-plugins/source/pot.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/himan-plugins/source/pot.cpp b/himan-plugins/source/pot.cpp index dfdb4f79..52d6113d 100644 --- a/himan-plugins/source/pot.cpp +++ b/himan-plugins/source/pot.cpp @@ -255,6 +255,13 @@ void pot::Calculate(shared_ptr> myTargetInfo, unsigned short thread POT = PoLift * PoThermoDyn * PoColdTop * PoMixedPhase * PoDepth * 100; } + const himan::matrix filter_kernel(3, 3, 1, MissingDouble(), 1 / 9.); + + const auto smooth_pot = + numerical_functions::Filter2D(myTargetInfo->Data(), filter_kernel, itsConfiguration->UseCuda()); + + myTargetInfo->Base()->data = move(smooth_pot); + myThreadedLogger.Info("[" + deviceType + "] Missing values: " + to_string(myTargetInfo->Data().MissingCount()) + "/" + to_string(myTargetInfo->Data().Size())); }