RSGISLib Sensor Tools

Landsat

rsgislib.tools.sensors.read_landsat_mtl_to_dict(in_mtl_file)

A function which can read a Landsat MTL header file and return a structured dict with the information from the MTL file.

Parameters:

in_mtl_file – the file path to MTL header file (*MTL.txt)

Returns:

dict structure.

import pprint
import rsgislib.tools.sensors

ls_header = rsgislib.tools.sensors.read_landsat_mtl_to_dict("landsat_MTL.txt")
pprint.pprint(ls_header)

Sentinel-2

rsgislib.tools.sensors.read_sen2_l2a_mtd_to_dict(mtd_header_file: str)

A function which parses the top level Sentinel-2 Level2A XML MTD header file to create a dict with the information to make it easier to use.

Parameters:

mtd_header_file – file path to the MTD header file (MTD_MSIL2A.xml)

Returns:

dict structure with the header information