def potential_cloud_layer(pcp, water, tirs1, tlow, land_cloud_prob,
    land_threshold, water_cloud_prob, water_threshold=0.5):
    """Final step of determining potential cloud layer

    Equation 18 (Zhu and Woodcock, 2012)

    Parameters
    ----------
    pcps: ndarray
        potential cloud pixels
    water: ndarray
        water mask
    tirs1: ndarray
    tlow: float
        low percentile of land temperature
    land_cloud_prob: ndarray
        probability of cloud over land
    land_threshold: float
        cutoff for cloud over land
    water_cloud_prob: ndarray
        probability of cloud over water
    water_threshold: float
        cutoff for cloud over water

    Output
    ------
    ndarray:
        potential cloud layer, boolean
    """
    part1 = pcp & water & (water_cloud_prob > water_threshold)
    part2 = pcp & ~water & (land_cloud_prob > land_threshold)
    temptest = tirs1 < tlow - 35
    return part1 | part2 | temptest
