def retrieveCommonDatesHDF(support_data_filename, key_list, in_date_list):
'''
Get a list of all dates that have data available
@support_data_filename: Filename of support data
@in_date_list: Input date list to check
@return dictionary of dates with data
'''
valid_dates = OrderedDict()
support_full_path = resource_filename('skdaccess',os.path.join('support',support_data_filename))
for key in key_list:
try:
available_dates = pd.read_hdf(support_full_path, key)
except KeyError:
print('Unknown station:',key)
common_dates = list(set(in_date_list).intersection(set(available_dates)))
common_dates.sort()
valid_dates[key] = common_dates
return valid_dates
评论列表
文章目录