def get_interval_mask(domain, lower_limit=None, upper_limit=None):
    """Given a domain and limits, returns a boolean mask with True values within the limits."""
    if lower_limit is None:
        lower_limit = -float('inf')
    if upper_limit is None:
        upper_limit = float('inf')

    return (domain >= lower_limit) & (domain <= upper_limit)