HTTP REQUEST

    GET https://api.nasa.gov/planetary/earth/temperature/coords

    QUERY PARAMETERS

    Parameter	Type	Default	Description
    lat	float	n/a	Latitude
    lon	float	n/a	Longitude
    begin	int	1880	beginning year for date range, inclusive
    end	int	2014	end year for date range, inclusive
    api_key	string	DEMO_KEY	api.nasa.gov key for expanded usage
    EXAMPLE QUERY

    https://api.nasa.gov/planetary/earth/temperature/coords?lon=100.3&lat=1.6&begin=1990&end=2005&api_key=DEMO_KEY

def coordinate(lon=None, lat=None, begin=None, end=None):
    '''
    HTTP REQUEST

    GET https://api.nasa.gov/planetary/earth/temperature/coords

    QUERY PARAMETERS

    Parameter	Type	Default	Description
    lat	float	n/a	Latitude
    lon	float	n/a	Longitude
    begin	int	1880	beginning year for date range, inclusive
    end	int	2014	end year for date range, inclusive
    api_key	string	DEMO_KEY	api.nasa.gov key for expanded usage
    EXAMPLE QUERY

    https://api.nasa.gov/planetary/earth/temperature/coords?lon=100.3&lat=1.6&begin=1990&end=2005&api_key=DEMO_KEY


    '''
    base_url = "https://api.nasa.gov/planetary/earth/temperature/coords?"

    if not lon or not lat:
        raise ValueError(
            "temp/coordinate endpoint expects lat and lon, type has to be float. Call the method with keyword args. Ex : lon=100.75, lat=1.5")
    else:
        try:
            validate_float(lon, lat)
            # Floats are entered/displayed as decimal numbers, but your computer 
            # (in fact, your standard C library) stores them as binary. 
            # You get some side effects from this transition:
            # >>> print len(repr(0.1))
            # 19
            # >>> print repr(0.1)
            # 0.10000000000000001
            # Thus using decimal to str transition is more reliant
            lon = decimal.Decimal(lon)
            lat = decimal.Decimal(lat)
            base_url += "lon=" + str(lon) + "&" + "lat=" + str(lat) + "&"
        except:
            raise ValueError(
                "temp/coordinate endpoint expects lat and lon, type has to be float. Call the method with keyword args. Ex : lon=100.75, lat=1.5")

    if not begin:
        raise ValueError(
            "Begin year is missing, which is mandatory. Format : YYYY")
    else:
        try:
            validate_year(begin)
            base_url += "begin=" + begin + "&"
        except:
            raise ValueError("Incorrect begin year format, should be YYYY")

    if end:
        try:
            validate_year(end)
            base_url += "end=" + end + "&"
        except:
            raise ValueError("Incorrect end year format, should be YYYY")
    req_url = base_url + "api_key=" + nasa_api_key()

    return dispatch_http_get(req_url)