@@ -306,12 +306,12 @@ def _read_geotiff(tif_file, grayscale=False):
306
306
tif_bbox = (lonmin , lonmax , latmin , latmax )
307
307
# Read the raster as a 3D array (bands, rows, columns)
308
308
if not grayscale and src .count >= 3 :
309
- basemap = src .read ([1 , 2 , 3 ]) # Read the first three bands (RGB)
309
+ tif_raster = src .read ([1 , 2 , 3 ]) # Read the first three bands (RGB)
310
310
# Transpose to (rows, columns, bands) for plotting
311
- basemap = basemap .transpose ((1 , 2 , 0 ))
311
+ tif_raster = tif_raster .transpose ((1 , 2 , 0 ))
312
312
else :
313
- basemap = src .read (1 )
314
- return basemap , tif_bbox
313
+ tif_raster = src .read (1 )
314
+ return tif_raster , tif_bbox
315
315
316
316
317
317
def _add_geotiff (config , ax ):
@@ -330,7 +330,7 @@ def _add_geotiff(config, ax):
330
330
# pylint: disable=import-outside-toplevel
331
331
from rasterio .errors import RasterioError
332
332
try :
333
- basemap , tif_bbox = _read_geotiff (tif_file , grayscale )
333
+ tif_raster , tif_bbox = _read_geotiff (tif_file , grayscale )
334
334
except (RasterioError , OSError ) as msg :
335
335
logger .warning (
336
336
f'Error reading GeoTIFF file "{ tif_file } ": { msg } . '
@@ -339,11 +339,11 @@ def _add_geotiff(config, ax):
339
339
# Plot the raster
340
340
if grayscale :
341
341
ax .imshow (
342
- basemap , extent = tif_bbox , origin = 'upper' , cmap = 'gray' ,
342
+ tif_raster , extent = tif_bbox , origin = 'upper' , cmap = 'gray' ,
343
343
transform = ccrs .PlateCarree (), zorder = ZORDER_BASEMAP )
344
344
else :
345
345
ax .imshow (
346
- basemap , extent = tif_bbox , origin = 'upper' ,
346
+ tif_raster , extent = tif_bbox , origin = 'upper' ,
347
347
transform = ccrs .PlateCarree (), zorder = ZORDER_BASEMAP )
348
348
349
349
0 commit comments