- xlandsat.composite(scene, bands=('red', 'green', 'blue'), rescale_to=None)#
Create a composite using the given bands.
The composite will be an RGBA array if NaNs are present in any band (with transparency of the NaN pixels set to full), or RGB is no NaNs are present. The RGB(A) array is encoded as unsigned 8-bit integers for easier plotting with matplotlib and smaller memory footprint.
Optionally rescale each band to the given range for improved contrast.
bands (list of str) – A list of variable names from the scene that will be used as the composite’s red, green, and blue channels, respectively.
rescale_to (None or list) – If not None, then should be a list/tuple with the minimum and maximum reflectance ranges to use for rescaling. The same values are used for each band. Bands are rescaled separately. Example:
rescale_to=[0, 0.5]. Default is None.
xarray.DataArray) – The composite as a 3D
DataArrayof type uint8. The first 2 dimensions are the same as the scene with the
"channel"added as third dimension. Metadata from the scene is copied to the composite.
xarray.DataArray.plot.imshowmethod to plot the composite using matplotlib.