def date_to_yyyydoy(date):
    """
    Convert a datetime.date object to a string in the form 'yyyy.doy',
    where yyyy is the 4 character year number and doy is the 3 character
    day of year
    :param date: datetime.date object
    :type date: datetime.date
    :return: string with date in the form 'yyyy.doy'
    :rtype: str
    """
    try:
        return (str(date.timetuple().tm_year) + '.' +
                str(date.timetuple().tm_yday).zfill(3))
    except AttributeError:
        raise AttributeError('Invalid date: date must be datetime.date object')