- xlandsat.load_scene(path, bands=None, region=None, dtype='float16')#
Load a Landsat scene downloaded from USGS EarthExplorer.
Can read from a folder with
*.TIFfiles and an
*_MTL.txtfile or directly from a tar archive (compressed or not) without the need to first unpack the archive. The bands are converted to reflectance/temperature units using appropriate scaling parameters and UTM coordinates are set in the returned
Do not rename the TIF or MTL files. The folder/archive can have any name but TIF and MTL files need their original names.
Only supports Landsat 8 and 9 Collection 2 Level 2 scenes.
path (str or
pathlib.Path) – The path to a folder or tar archive containing the files for a given scene. Must include the
*_MTL.txtmetadata file. Not all band files need to be present.
bands (None or list) – List of band names to load. If None, will load all bands present in the folder/archive. See below for valid band names. Default is None.
region (None or list) – Crop the scene to this bounding box given as a list of West, East, South, and North coordinate values (UTM in meters). If None, no cropping is performed on the scene. Default is None.
dtype (str or numpy dtype object) – The type used for the band arrays. Integer types will result in rounding so floating point is recommended. Default is float16.
xarray.Dataset) – The loaded scene including UTM easting and northing as dimensional coordinates, bands as 2D arrays of the given type as variables, and metadata read from the MTL file and other CF compliant fields in the
The valid band names for Landsat 8 and 9 are: