def _get_gsod_file(year): url = 'http://www1.ncdc.noaa.gov/pub/data/gsod/%s/gsod_%s.tar' % (year, year) filename = url.split('/')[-1] path = os.path.join(NCDC_GSOD_DIR, filename) util.download_if_new(url, path, check_modified=True) return path
def _get_ghcn_file(filename, check_modified=True): base_url = 'http://www1.ncdc.noaa.gov/pub/data/ghcn/daily/' if 'ghcnd-' in filename: url = base_url + filename else: url = base_url + 'all/' + filename path = os.path.join(GHCN_DAILY_DIR, url.split('/')[-1]) util.download_if_new(url, path, check_modified=check_modified) return path