def upscale_field(precip, metadata, scale_factor):
    """Upscale the precipitation field by a given scale factor."""
    upscaled_resolution = metadata["xpixelsize"] * scale_factor
    precip_lr, metadata_lr = aggregate_fields_space(
        precip, metadata, upscaled_resolution
    )
    return precip_lr, metadata_lr
Upscale the precipitation field by a given scale factor.
examples/rainfarm_downscale.py