I'm trying to explore/pre-process some of the USGS's landsat data. currently I have downloaded two scenes through python's pylandsat module. These scenes are:
LE07_L1TP_205050_19991104_20170216_01_T1
LE07_L1TP_206050_19991111_20170216_01_T1
I am then just trying to print and play with some of the information contained in the files which I have sourced from here: https://pypi.org/project/pylandsat/#description. But when I do I get an error related to rasterio, which is a module that I am unfamiliar with. The current code that I am running is from the pylandsat documentation, it looks like the following:
import numpy as np
import rasterio
import matplotlib.pyplot as plt
from pylandsat import Scene
# Access data
scene = Scene('toydata/LE07_L1TP_206050_19991111_20170216_01_T1')
print(scene.available_bands())
print(scene.product_id)
print(scene.sensor)
print(scene.date)
# Access MTL metadata
print(scene.mtl['IMAGE_ATTRIBUTES']['CLOUD_COVER_LAND'])
# Quality band
plt.imshow(scene.quality.read())
The current error is related to the last line plt.imshow(scene.quality.read())
. The file path is correct to the scene and my current output looks like the following:
['pan', 'blue', 'tirs', 'green', 'tirs2', 'red', 'swir2', 'nir', 'swir']
LE07_L1TP_206050_19991111_20170216_01_T1
ETM
1999-11-11 00:00:00
2.0
ERROR 4: No driver registered.
Traceback (most recent call last):
File "rasterio/_base.pyx", line 308, in rasterio._base.DatasetBase.__init__
File "rasterio/_base.pyx", line 219, in rasterio._base.open_dataset
File "rasterio/_err.pyx", line 221, in rasterio._err.exc_wrap_pointer
rasterio._err.CPLE_OpenFailedError: No driver registered.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/josephpate/Documents/EEPS 1720/code/preprocess_image_data.py", line 17, in <module>
plt.imshow(scene.quality.read())
File "/Users/josephpate/Documents/EEPS 1720/code/lib/python3.10/site-packages/pylandsat/scene.py", line 214, in quality
return Band(self, 'BQA')
File "/Users/josephpate/Documents/EEPS 1720/code/lib/python3.10/site-packages/pylandsat/scene.py", line 235, in __init__
super().__init__(parse_path(self.fpath))
File "rasterio/_base.pyx", line 310, in rasterio._base.DatasetBase.__init__
rasterio.errors.RasterioIOError: No driver registered.
I am not exactly sure what this means, and there isn't a lot of answers as to how to deal with any similar error that I could find on here.
Also:
python version: Python 3.10.9
rio version: 1.3.6
I had a similar error that contained the same chunk after updating rasterio from 1.3.7->1.3.8:
I just downgraded to 1.3.7 and it works fine again. Maybe that will help you as well.