nmc_met_io icon indicating copy to clipboard operation
nmc_met_io copied to clipboard

nmc_met_io.retrieve_micaps_server.get_station_data读取站点资料时的问题

Open liuxunx1993 opened this issue 4 years ago • 1 comments

使用get_station_data读取站点资料时,如果时间超过当前时间,会出现报错。

data = get_station_data("SURFACE/TMP_MAX_24H_NATIONAL/", "20220118080000.000")
data

IndexError Traceback (most recent call last) Untitled-2 in ----> 1 data = get_station_data("SURFACE/PLOT_NATIONAL/", "20220118080000.000") 2 data

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()')

liuxunx1993 avatar Jan 17 '22 01:01 liuxunx1993

嗯,Micaps Cassandra服务qi2对文件读取时间有一定限制。

NMC-DAVE avatar Jun 01 '22 16:06 NMC-DAVE