import functools


def _validate_satellite(func):
    """A decorator that checks to see if the satellite is in the dataset."""
    @functools.wraps(func)
    def wrapper(self, satellite, *args, **kwargs):
        # First argument has to be satellite
        if satellite not in self.ds['satellite']:
            raise IndexError("Satellite not in dataset, must be one of: "
                             "{}".format(self.ds['satellite'].values))

        return func(self, satellite, *args, **kwargs)
    return wrapper