# Import the espatools module for raster I/O
import espatools
# Use matplotlib for simple plotting
import matplotlib.pyplot as plt
xmlfile = 'LC081210652018073101RT-SC20180802013328/LC08_L1TP_121065_20180731_20180731_01_RT.xml'
# xmlfile = 'LC081210652018073101RT-SC20180802013328/simple.xml'
reader = espatools.RasterSetReader(filename=xmlfile)
raster = reader.Read()
bands = raster.bands
pixel_qa radsat_qa sr_band1 sr_band2 sr_band3 sr_band4 sr_band5 sr_band6 sr_band7 sr_aerosol
b = bands.get('sr_aerosol')
plt.figure(figsize=(10,10))
plt.imshow(b.data)
plt.title(b.name)
plt.savefig('aer.png')
plt.show()
color = raster.GetRGB()
plt.figure(figsize=(10,10))
plt.imshow(color)
plt.title('RGB Color')
plt.savefig('RGB.png')
plt.show()
raster.global_metadata.satellite
u'LANDSAT_8'
raster.nsamps
7581
raster.nlines
7721
color.shape
(7721, 7581, 3)
raster.global_metadata.projection_information.corner_point[0].x
108900.0