Currently there is a ValueError being raised because the ds.count statement in the error message is executed on a closed file. So
File ~/apps/miniforge3/envs/devseed/lib/python3.11/site-packages/stackstac/rio_reader.py:340, in AutoParallelRioReader._open(self)
337 if ds.count != 1:
338 ds.close()
339 raise RuntimeError(
--> 340 f"Assets must have exactly 1 band, but file {self.url!r} has {ds.count}. "
341 "We can't currently handle multi-band rasters (each band has to be "
342 "a separate STAC asset), so you'll need to exclude this asset from your analysis."
343 )
With the following error
ValueError: Can't read closed raster file
Proposed solution: compute count before clsoing file.
Currently there is a
ValueError
being raised because theds.count
statement in the error message is executed on a closed file. SoWith the following error
Proposed solution: compute count before clsoing file.