tilezilla.sensors.landsat module¶
Module for dealing with Landsat sensors
-
class
tilezilla.sensors.landsat.ESPAMetadata(path, data)[source]¶ Bases:
objectESPA Metadata parsing
Parameters: - path (str) – Path to metadata file
- data (BeautifulSoup) – A BeautifulSoup of the XML metadata
-
acquired¶ Arrow: date and time of acquisition
The time of this acquisition is taken as the scene center time.
-
bands¶
-
bounds¶
-
instrument¶ str: instrument taking acquisition measurement
-
platform¶ str: platform holding instrument for this acquisition
-
processed¶ Arrow: date and time of processing
-
scene_id¶ Landsat scene ID (e.g., LT50120312002300LGS01)
-
solar_azimuth¶ float: solar azimuth angle during acqusition
-
solar_zenith¶ float: solar zenith angle during acquisition
-
class
tilezilla.sensors.landsat.MTL(path, data)[source]¶ Bases:
objectLandsat “MTL” metadata file
Parameters: - path (str) – Path to the metadata file
- data (OrderedDict) – metadata contained within the MTL file
-
classmethod
from_file(path)[source]¶ Parameters: path (str) – path to the MTL file Returns: Instance of MTL Return type: MTL
-
LPGS¶ Level-1 Product Generation System version number
-
cloud_cover¶ ACCA cloud cover score
-
path_row¶ WRS-2 path and row
-
product_level¶ Level-1 product level (L1G, L1T, etc.)
-
scene_id¶ Landsat scene ID (e.g., LT50120312002300LGS01)
-
sensor¶ Landsat sensor (e.g., LT4, LT5)
-
tilezilla.sensors.landsat.description_to_friendly_name(sensor, desc)[source]¶ Return friendly name of band given description and sensor
Parameters: sensor (str) – Landsat sensor [LM, LT, LE, LC] Returns: Return converted friendly name or original description if could not convert Return type: str
-
tilezilla.sensors.landsat.parse_MTL(filename)[source]¶ Return an ordered dict from a Landsat “MTL” metadata file
Parameters: filename (str) – MTL filename Returns: dict of MTL file Return type: OrderedDict
-
tilezilla.sensors.landsat.HDF_PATH= 'HDF4_EOS:EOS_GRID:"{hdf_root}":Grid:{variable}'¶ str: HDF path formatting
-
tilezilla.sensors.landsat.SENSOR_BAND_FRIENDLY_NAMES= {'LT5': {'swir1': 5, 'blue': 1, 'green': 2, 'red': 3, 'swir2': 7, 'nir': 4, 'thermal': 6}, 'LM2': {'nir': 4, 'red': 3, 'blue': 1, 'green': 2}, 'LE7': {'swir1': 5, 'blue': 1, 'green': 2, 'red': 3, 'swir2': 7, 'nir': 4, 'thermal': 6}, 'LC8': {'swir1': 6, 'blue': 2, 'green': 3, 'red': 4, 'swir2': 7, 'nir': 5, 'thermal': 10}, 'LM1': {'nir': 4, 'red': 3, 'blue': 1, 'green': 2}, 'LT4': {'swir1': 5, 'blue': 1, 'green': 2, 'red': 3, 'swir2': 7, 'nir': 4, 'thermal': 6}}¶ dict[sensor=dict[friedly_name=band number]]