from ....bliss_globals import setup_globals
from .pyfai_calib import DEFAULT_CALIB


def lima_image_is_padded(lima_name: str) -> bool:
    if DEFAULT_CALIB[lima_name]["detector"] == "Pilatus1M":
        # lima-camera-simulator<1.9.10 does not support odd image widths
        # so Pilatus1M data is padded with one pixel to make it even.
        lima = getattr(setup_globals, lima_name)
        return not bool(lima.image.width % 2)
    return False
