Skip to content

Commit f0b3d5a

Browse files
committed
Better name for the tif_raster variable
1 parent 8647249 commit f0b3d5a

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

sourcespec/ssp_plot_stations.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -306,12 +306,12 @@ def _read_geotiff(tif_file, grayscale=False):
306306
tif_bbox = (lonmin, lonmax, latmin, latmax)
307307
# Read the raster as a 3D array (bands, rows, columns)
308308
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)
310310
# Transpose to (rows, columns, bands) for plotting
311-
basemap = basemap.transpose((1, 2, 0))
311+
tif_raster = tif_raster.transpose((1, 2, 0))
312312
else:
313-
basemap = src.read(1)
314-
return basemap, tif_bbox
313+
tif_raster = src.read(1)
314+
return tif_raster, tif_bbox
315315

316316

317317
def _add_geotiff(config, ax):
@@ -330,7 +330,7 @@ def _add_geotiff(config, ax):
330330
# pylint: disable=import-outside-toplevel
331331
from rasterio.errors import RasterioError
332332
try:
333-
basemap, tif_bbox = _read_geotiff(tif_file, grayscale)
333+
tif_raster, tif_bbox = _read_geotiff(tif_file, grayscale)
334334
except (RasterioError, OSError) as msg:
335335
logger.warning(
336336
f'Error reading GeoTIFF file "{tif_file}": {msg}. '
@@ -339,11 +339,11 @@ def _add_geotiff(config, ax):
339339
# Plot the raster
340340
if grayscale:
341341
ax.imshow(
342-
basemap, extent=tif_bbox, origin='upper', cmap='gray',
342+
tif_raster, extent=tif_bbox, origin='upper', cmap='gray',
343343
transform=ccrs.PlateCarree(), zorder=ZORDER_BASEMAP)
344344
else:
345345
ax.imshow(
346-
basemap, extent=tif_bbox, origin='upper',
346+
tif_raster, extent=tif_bbox, origin='upper',
347347
transform=ccrs.PlateCarree(), zorder=ZORDER_BASEMAP)
348348

349349

0 commit comments

Comments
 (0)