nmc_met_io icon indicating copy to clipboard operation
nmc_met_io copied to clipboard

第一类数据读取过程中遇到的bug

Open Yes-Maaan opened this issue 2 years ago • 1 comments

在读取第一类数据时,出现如下bug: File D:\Software\Miniconda3\envs\data_get\Lib\site-packages\nmc_met_io\read_micaps.py:84, in read_micaps_1(fname, limit)
82 if (len(txt) % 24) == 0:
83 txt = np.array(txt)
---> 84 txt.shape = [number, 24]
85 else:
86 txt = np.array(txt)
ValueError: cannot reshape array of size 80184 into shape (3084,24)

原因是number=80184既是24也是26的公倍数,我的文件中有26列数据。因此应该将txt的shape变为(3084,26)。

将报错描述中的“if (len(txt) % 24) == 0: ”代码修改如下,即可正常运行 if (len(txt) % 24 == 0) & (number * 24 == len(txt)):

Yes-Maaan avatar Nov 15 '23 08:11 Yes-Maaan

已经修复这个逻辑错误

NMC-DAVE avatar Dec 10 '25 13:12 NMC-DAVE