In [ ]:
# Import the espatools module for raster I/O
import espatools
# Use matplotlib for simple plotting
import matplotlib.pyplot as plt
In [2]:
xmlfile='/Users/bane/Documents/OpenGeoVis/Data/data-testing/Readers/Landsat/Golden/LC080340322018062701T1-SC20180922164434/LC08_L1TP_034032_20180627_20180704_01_T1.xml'
reader = espatools.RasterSetReader(filename=xmlfile)
In [3]:
raster = reader.Read()#cast=True, allowed=['sr_aerosol', 'sr_band7'])
bands = raster.bands
bands
Out[3]:
{'pixel_qa': <espatools.raster.Band at 0x11389e2e8>,
 'radsat_qa': <espatools.raster.Band at 0x11389e940>,
 'sr_band1': <espatools.raster.Band at 0x11389edd8>,
 'sr_band2': <espatools.raster.Band at 0x113a99278>,
 'sr_band3': <espatools.raster.Band at 0x113a996d8>,
 'sr_band4': <espatools.raster.Band at 0x113a99b38>,
 'sr_band5': <espatools.raster.Band at 0x113a99f98>,
 'sr_band6': <espatools.raster.Band at 0x1104b2438>,
 'sr_band7': <espatools.raster.Band at 0x1104b2898>,
 'sr_aerosol': <espatools.raster.Band at 0x1104b2da0>}
In [4]:
for n,b in bands.items():
    print(b.data.dtype)
uint16
uint16
int32
int32
int32
int32
int32
int32
int32
uint8
In [5]:
b = bands.get('sr_band3')

plt.figure(figsize=(10,10))
plt.imshow(b.data, vmin=0., vmax=2000)
plt.title(b.name)
plt.savefig('aer.png')
plt.show()
In [19]:
color = raster.GetRGB('false_a')
In [20]:
plt.figure(figsize=(10,10))
plt.imshow(color)
plt.title('RGB Color')
plt.savefig('RGB.png')
plt.show()