xlandsat.interpolate_missing(scene, pixel_radius=20)[source]#

Fill missing values (NaNs) in a scene by cubic interpolation

Each missing value is filled by interpolating the pixels within a neighboring region (controlled by pixel_radius) using a piecewise cubic 2D interpolator. Interpolation is done for each band in a scene separately.

Note that this is mostly good if there are a few missing values, not large regions of the scene.

  • scene (xarray.Dataset) – A Landsat scene, as read with xlandsat.load_scene.

  • pixel_radius (int) – Number of pixels to the east, west, south, and north of a missing value that will be used for interpolation. Smaller values make for faster interpolation but may lead to bad results if many missing values are grouped together.


filled_scene (xarray.Dataset) – The scene with missing values filled in.