def require_atlas(f):
    """Decorator that ensures a subject (the first argument) is from the ATLAS
    survey.
    """
    def g(subject, *args, **kwargs):
        if subject['metadata']['survey'] != 'atlas':
            raise ValueError('Subject not from ATLAS survey.')

        return f(subject, *args, **kwargs)

    return g