with_rasterio.py 388 bytes
import rasterio
from functions_for_rasterio import pansharpen

xs_path = 'xs.tif'
pan_path = 'pan.vrt'
cloud_path = 'cloud_mask.GML'

# Reading multispectral
with rasterio.open(xs_path) as xs_src:
    xs = xs_src.read()

# Reading panchromatic
with rasterio.open(pan_path) as pan_src:
    pan = pan_src.read()

print(xs.shape)
print(pan.shape)

# Pansharpening
pxs = pansharpen(xs, pan)