ulmo-dev / ulmo

clean, simple and fast access to public hydrology and climatology data.
http://ulmo.readthedocs.org
Other
169 stars 63 forks source link

NCDS GSOD stations file is deprecated #102

Closed vklepikovskiy closed 9 years ago

vklepikovskiy commented 9 years ago

Trying to get stations list using ulmo.ncdc.gsod.get_stations you can see the exception like:

Traceback (most recent call last):
  File "../afi.py", line 6, in <module>
    pprint.pprint(gsod.get_stations(country='UP'))
  File "/home/victor/afi/ulmo/ulmo/ncdc/gsod/core.py", line 174, in get_stations
    state=state, start_str=start_str, end_str=end_str)
  File "/home/victor/afi/ulmo/ulmo/ncdc/gsod/core.py", line 227, in _passes_row_filter
    if not country is None and row['CTRY'] not in country:
KeyError: 'CTRY'

After some investigation I've noticed that http://www1.ncdc.noaa.gov/pub/data/gsod/ish-history.csv station list has been deprecated and http://www1.ncdc.noaa.gov/pub/data/noaa/isd-history.csv should be used instead. There are also changes in file format like removed and new fields and floating point format changes.

dharhas commented 9 years ago

closed in pr #103