Replacing NaN with 3x3 average

works great if the NaN areas are small, otherwise you need a larger filter

0 read your NaN value

In my case it is -32768, leaved it checked for the filtering
grafik

1 Filter the image

original with NaNs (left) and 3x3 filtered (right)

2 disable NaN value in the properties

3 band maths

calculate the corrected band (replacing -32768)

4 result

original (left) and corrected (middle) band, Only the NaNs were replaced, the rest is the original file (as seen in the cyan maximum in the middle and the patterns on the right.

2 Likes