Let’s use EOReader with Dask.

Note: This is experimental for now, use it at your own risk !

# Imports
import os
from dask.distributed import Client, LocalCluster
from eoreader.reader import Reader
from eoreader.bands import RED
from eoreader.env_vars import USE_DASK

# Ensure EOReader uses dask
os.environ[USE_DASK] = "1"

# Create local cluster
with LocalCluster(
        n_workers=4, threads_per_worker=4, processes=True
) as cluster, Client(cluster):
    # Create the reader
    reader = Reader()

    # Open your product
    path = os.path.join("/home", "data", "DATA", "PRODS", "LANDSATS_COL2",
    prod = reader.open(path, remove_tmp=True)

    # Load this band
    red = prod.load(RED)[RED]

# Plot band
red[:, ::10, ::10].plot(cmap="Reds_r")
/opt/conda/lib/python3.11/site-packages/distributed/client.py:3163: UserWarning: Sending large graph of size 12.95 MiB.
This may cause some slowdown.
Consider scattering data ahead of time and using futures.
<matplotlib.collections.QuadMesh at 0x7f8ad1d13ad0>