xlandsat.pansharpen#
- xlandsat.pansharpen(scene, panchromatic, weights=(1, 1, 0.2))[source]#
Pansharpen the red, green, and blue bands of a scene.
The pansharpened scene will have the same coordinate values of the given panchromatic band. Uses a weighted version of the Brovey Transform [Pohl_and_VanGenderen1998] to account for the smaller blue footprint in Landsat 8/9 panchromatic band, following mapbox/rio-pansharpen (MIT license).
- Parameters:
scene (
xarray.Dataset
) – A Landsat scene, as read withxlandsat.load_scene
. The scene must contain the red, green, and blue bands. Other bands are ignored.panchromatic (
xarray.DataArray
) – A Landsat panchromatic band, as read withxlandsat.load_panchromatic
.weights (tuple) – The weights applied to the red, green, and blue bands, respectively.
- Returns:
scene_sharpened (
xarray.Dataset
) – The pandsharpened scene including the red, green, and blue bands only. Metadata from the original scene is copied into the pandsharpened version.