def METHOD_NAME(self, z: np.ndarray, levels: Tuple[float, float]) -> np.ndarray:
    scale = levels[1] - levels[0]
    if scale > 0:
        return (z - levels[0]) / scale
    else:
        return np.ones(z.size) * 0.5