@staticmethod
def get_range_from_function(function):
    """
        Examines the ranges in PolarizationWCS.axis.function and returns a
        range from 1 to Naxis+1 if the function is defined, else returns
        None. The upper bound of the range is incremented by 1 (refer to
        comments for get_range above)
        """
    if function is not None:
        if function.naxis >= 1:
            return range(1, function.naxis + 1)
        else:
            raise ValueError('Invalid naxis value: {}'.format(function.naxis))
    return None
