def epsilon_mean(eps, limit=0.999):
    """Compute mean of the ellipticity distribution.

    Args:
        eps: A numpy array of real or complex ellipticity (epsilon) estimates.
        limit: The truncation limit, a positive number.
    
    Returns: 
        Compute the mean of the eps samples, subject to the requirement 
        |eps| < limit.
    """
    mask = (abs(eps) < limit)
    return eps[mask].mean()