diff --git a/pyspatialml/raster.py b/pyspatialml/raster.py index 2b3a2c9..d5f099e 100644 --- a/pyspatialml/raster.py +++ b/pyspatialml/raster.py @@ -501,10 +501,17 @@ def __init__( src_layers.append(RasterLayer(band)) self._layers = src_layers return + + # from a list of rasterio.band objects + elif all(isinstance(x, rasterio.Band) for x in src): + src_layers = [] + for band in src: + src_layers.append(RasterLayer(band)) + self._layers = src_layers + return else: raise ValueError("Cannot create a Raster object from a mixture of inputs") - # normal # try: # src_layers = [] # for band in src: