diff --git a/src/compass/utils/helpers.py b/src/compass/utils/helpers.py index cefef985..ab7e62dc 100644 --- a/src/compass/utils/helpers.py +++ b/src/compass/utils/helpers.py @@ -15,6 +15,7 @@ import compass +gdal.UseExceptions() WORKFLOW_SCRIPTS_DIR = os.path.dirname(compass.__file__) OPERA_OPERATION_CONTACT_EMAIL = 'opera-sds-ops@jpl.nasa.gov' @@ -351,7 +352,7 @@ def open_raster(filename, band=1): ds = gdal.Open(filename, gdal.GA_ReadOnly) arr = ds.GetRasterBand(band).ReadAsArray() return arr - except AttributeError: + except RuntimeError: # GDAL reads 1st 2 bytes of ENVI binary to determine file type. If 1st # bytes of flat binary is that of a jpeg but the binary is not then # GDAL throws a libjpeg runtime error. Follow specifically tries to