def npix_above_threshold(pix, thr):
    """
    Calculate number of pixels above a given threshold

    Parameters
    ----------
    pix: array-like
        array with pixel content, usually pe
    thr: float
        threshold for the pixels to be counted

    Returns
    ------
    npix_above_threshold: float
        Number of pixels above threshold
    """

    return (pix > thr).sum()