nmc_met_io.retrieve_micaps_server.get_station_data读取站点资料时的问题
使用get_station_data读取站点资料时,如果时间超过当前时间,会出现报错。
data = get_station_data("SURFACE/TMP_MAX_24H_NATIONAL/", "20220118080000.000")
data
IndexError Traceback (most recent call last)
Untitled-2 in
D:\Anaconda3\envs\metdig\lib\site-packages\nmc_met_io\retrieve_micaps_server.py in get_station_data(directory, filename, suffix, dropna, cache, cache_clear) 674 675 # read the number of stations --> 676 station_number = np.frombuffer( 677 byteArray[ind:(ind+4)], dtype='i4')[0] 678 ind += 4
IndexError: index 0 is out of bounds for axis 0 with size 0
尝试寻找原因时发现,可能是当时间超过当前时间时,服务器返回代码仍为200,导致解码时出错
service.getData("SURFACE/TMP_MAX_24H_NATIONAL/", "20220120080000.000")
(200, b'\x08\x01\x12\x13NotFoundException()')
嗯,Micaps Cassandra服务qi2对文件读取时间有一定限制。