satpy.readers.core.landsat module

Landsat reader.

Details of the data format can be found here:

https://d9-wret.s3.us-west-2.amazonaws.com/assets/palladium/production/s3fs-public/media/files/LSDS-1822_Landsat8-9-OLI-TIRS_C2_L1_DataFormatControlBook-v7.pdf https://d9-wret.s3.us-west-2.amazonaws.com/assets/palladium/production/s3fs-public/atoms/files/LSDS-1414_Landsat7ETM-C2-L1-DFCB-v3.pdf https://d9-wret.s3.us-west-2.amazonaws.com/assets/palladium/production/s3fs-public/atoms/files/LSDS-1415_Landsat4-5-TM-C2-L1-DFCB-v3.pdf https://d9-wret.s3.us-west-2.amazonaws.com/assets/palladium/production/s3fs-public/atoms/files/LSDS-1416_LandsatMSS-C2-L1-DFCB-v3.pdf https://d9-wret.s3.us-west-2.amazonaws.com/assets/palladium/production/s3fs-public/media/files/LSDS-1328_Landsat8-9_OLI-TIRS-C2-L2_DFCB-v7.pdf https://d9-wret.s3.us-west-2.amazonaws.com/assets/palladium/production/s3fs-public/media/files/LSDS-1337_Landsat7ETM-C2-L2-DFCB-v6.pdf https://d9-wret.s3.us-west-2.amazonaws.com/assets/palladium/production/s3fs-public/atoms/files/LSDS-1336_Landsat4-5-TM-C2-L2-DFCB-v4.pdf https://d9-wret.s3.us-west-2.amazonaws.com/assets/palladium/production/s3fs-public/media/files/LSDS-1927_Landsat7-Data-Users-Handbook-v3.pdf https://www.usgs.gov/landsat-missions/using-usgs-landsat-level-1-data-product https://www.usgs.gov/landsat-missions/landsat-collection-2-level-2-science-products

NOTE: The scene geometry data (SZA, VZA, SAA, VAA) is retrieved from the L1 TIFF files, which are derived from Band 04. The geometry differs between bands, so if you need precise geometry you should calculate this from the metadata instead.

class satpy.readers.core.landsat.BaseLandsatL1Reader(filename, filename_info, filetype_info, mda, **kwargs)[source]

Bases: BaseLandsatReader

Basic file handler for Landsat L1 files (tif).

Initialize the reader.

calibrate(data, calibration)[source]

Calibrate the data from counts into the desired units.

class satpy.readers.core.landsat.BaseLandsatL2Reader(filename, filename_info, filetype_info, mda, **kwargs)[source]

Bases: BaseLandsatReader

Basic file handler for Landsat L2 files (tif).

Initialize the reader.

calibrate(data, calibration)[source]

Calibrate the data from counts into the desired units.

class satpy.readers.core.landsat.BaseLandsatMDReader(filename, filename_info, filetype_info)[source]

Bases: BaseFileHandler

Metadata file handler for Landsat files (tif).

Init the reader.

__init__(filename, filename_info, filetype_info)[source]

Init the reader.

property band_calibration

Return per-band saturation flag.

property band_saturation

Return per-band saturation flag.

build_area_def(bname)[source]

Build area definition from metadata.

property center_time

Return center time.

property cloud_cover

Return estimated granule cloud cover percentage.

earth_sun_distance()[source]

Return Earth-Sun distance.

property end_time

Return end time.

This is actually the scene center time, as we don’t have the end time. It is constructed from the observation date (from the filename) and the center time (from the metadata).

get_cal_params(top_key, key_1, key_2)[source]

Read the requested calibration parameters.

property start_time

Return start time.

This is actually the scene center time, as we don’t have the start time. It is constructed from the observation date (from the filename) and the center time (from the metadata).

class satpy.readers.core.landsat.BaseLandsatReader(filename, filename_info, filetype_info, mda, **kwargs)[source]

Bases: BaseFileHandler

Basic file handler for Landsat files (tif).

Initialize the reader.

__init__(filename, filename_info, filetype_info, mda, **kwargs)[source]

Initialize the reader.

_check_channel_and_reader(name)[source]
_check_channel_availability(name)[source]
_check_oli_tirs_spectral(name)[source]
_check_oli_tirs_thermal(name)[source]
_collect_attrs(data, name, info)[source]
_mask_data(data, name)[source]
_scale_angle_data(data, name)[source]
calibrate(data, calibration)[source]

Calibrate the data from counts into the desired units.

property end_time

Return end time.

get_area_def(dsid)[source]

Get area definition of the image from the metadata.

static get_btype(file_type)[source]

Return the band type from the file type.

get_dataset(key, info)[source]

Load a dataset.

property sensor

Sensor name.

property spectral_bands

Landsat bands.

property start_time

Return start time.

property thermal_bands

Landsat thermal bands.

class satpy.readers.core.landsat.ETMCHReader(filename, filename_info, filetype_info, mda, **kwargs)[source]

Bases: BaseLandsatL1Reader

File handler for Landsat ETM+ L1 files (tif).

Initialize the reader.

property sensor

Sensor name.

property spectral_bands

Landsat bands.

property thermal_bands

Landsat thermal bands.

class satpy.readers.core.landsat.ETML2CHReader(filename, filename_info, filetype_info, mda, **kwargs)[source]

Bases: BaseLandsatL2Reader

File handler for Landsat ETM+ L2 files (tif).

Initialize the reader.

property sensor

Sensor name.

property spectral_bands

Landsat bands.

property thermal_bands

Landsat thermal bands.

class satpy.readers.core.landsat.LandsatL1MDReader(filename, filename_info, filetype_info)[source]

Bases: BaseLandsatMDReader

Metadata file handler for Landsat L1 files (tif).

Init the reader.

property band_calibration

Return per-band calibration parameters.

class satpy.readers.core.landsat.LandsatL2MDReader(filename, filename_info, filetype_info)[source]

Bases: BaseLandsatMDReader

Metadata file handler for Landsat L2 files (tif).

Init the reader.

property band_calibration

Return per-band calibration parameters.

class satpy.readers.core.landsat.MSSCHReader(filename, filename_info, filetype_info, mda, **kwargs)[source]

Bases: BaseLandsatL1Reader

File handler for Landsat MSS L1 files (tif).

Initialize the reader.

_get_dataset_info(ds_info, is_avail)[source]
_get_matched_dataset_info(ds_info)[source]
_get_modified_wavelength_info(ds_info)[source]
available_datasets(configured_datasets=None)[source]

Set up wavelength to B4 band.

property sensor

Sensor name.

property spectral_bands

Landsat bands.

property thermal_bands

Landsat thermal bands.

class satpy.readers.core.landsat.OLITIRSCHReader(filename, filename_info, filetype_info, mda, **kwargs)[source]

Bases: BaseLandsatL1Reader

File handler for Landsat OLI-TIRS L1 files (tif).

Initialize the reader.

property sensor

Sensor name.

property spectral_bands

Landsat bands.

property thermal_bands

Landsat thermal bands.

class satpy.readers.core.landsat.OLITIRSL2CHReader(filename, filename_info, filetype_info, mda, **kwargs)[source]

Bases: BaseLandsatL2Reader

File handler for Landsat OLI-TIRS L2 files (tif).

Initialize the reader.

property sensor

Sensor name.

property spectral_bands

Landsat bands.

property thermal_bands

Landsat thermal bands.

class satpy.readers.core.landsat.TMCHReader(filename, filename_info, filetype_info, mda, **kwargs)[source]

Bases: BaseLandsatL1Reader

File handler for Landsat TM L1 files (tif).

Initialize the reader.

property sensor

Sensor name.

property spectral_bands

Landsat bands.

property thermal_bands

Landsat thermal bands.

class satpy.readers.core.landsat.TML2CHReader(filename, filename_info, filetype_info, mda, **kwargs)[source]

Bases: BaseLandsatL2Reader

File handler for Landsat TM L2 files (tif).

Initialize the reader.

property sensor

Sensor name.

property spectral_bands

Landsat bands.

property thermal_bands

Landsat thermal bands.

satpy.readers.core.landsat._parse_band_num(elem, key)[source]