xlandsat.adjust_l1_colors

Contents

xlandsat.adjust_l1_colors#

xlandsat.adjust_l1_colors(composite, percentile=0.1)[source]#

Adjust the colors in an RGB composite from Level 1 data

Corrects the balance of the red, green, and blue bands in an RGB (true color) composite made from Level 1 data (without atmospheric correction). This is not as accurate as atmospheric correction but can lead to nicer images in places where the atmospheric correction causes artifacts.

Do not use the output for calculating indices.

Parameters:
  • composite (xarray.DataArray) – A composite, as generated by xlandsat.composite.

  • percentile (float) – The percentile range to use for the intensity rescaling. Will use the percentile as the lower bound and 100 - percentile for the upper bound. Default is 0.1%.

Returns:

adjusted_composite (xarray.DataArray) – The composite after color adjustment, scaled back to the range of the original composite.

Notes

The correction raises each channel to the power of 1/2.2 (inverse of the sRGB gamma function) and then rescales the transformed intensity to the given percentile range.