jinfan0931 / meic2wrf

Interpolating & distributing MEIC 0.25*0.25 emission inventory onto WRF-Chem grids
GNU General Public License v3.0
87 stars 33 forks source link

程序运行中出现了list index out of range请问怎么解决呢? #8

Open QingLuo-github opened 3 years ago

QingLuo-github commented 3 years ago

在运行meic2wrf_GUI.py时候,出现了 Exception in Tkinter callback Traceback (most recent call last): File "~/miniconda3/envs/pyn_2/lib/python3.7/tkinter/init.py", line 1705, in __cal return self.func(args) File "meic2wrf_GUI.py", line 92, in merge_meic_dept fn_act=ent_dir.get()+'/'+fnmatch.filter(fnmatch.filter(os.listdir(ent_dir.get()), i), 'agr*nc')[0] IndexError: list index out of range 看样子好像是循坏的问题?

jinfan0931 commented 3 years ago

好的,我这边查看一下。


发件人: catherine-2020 @.> 发送时间: Friday, April 30, 2021 3:56:52 PM 收件人: jinfan0931/meic2wrf @.> 抄送: Subscribed @.***> 主题: [jinfan0931/meic2wrf] 程序运行中出现了list index out of range请问怎么解决呢? (#8)

在运行meic2wrf_GUI.py时候,出现了 Exception in Tkinter callback Traceback (most recent call last): File "~/miniconda3/envs/pyn_2/lib/python3.7/tkinter/init.py", line 1705, in __cal return self.func(*args) File "meic2wrf_GUI.py", line 92, in merge_meic_dept fn_act=ent_dir.get()+'/'+fnmatch.filter(fnmatch.filter(os.listdir(ent_dir.get()), i), 'agrnc')[0] IndexError: list index out of range 看样子好像是循坏的问题?

― You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/jinfan0931/meic2wrf/issues/8, or unsubscribehttps://github.com/notifications/unsubscribe-auth/APQEEB2B3LMTYN3BWRLZFELTLJPEJANCNFSM433VQ3XA.

jinfan0931 commented 3 years ago

好的,我这边查看一下


发件人: Jin Fan @.> 发送时间: Friday, April 30, 2021 10:37:20 PM 收件人: jinfan0931/meic2wrf @.>; jinfan0931/meic2wrf @.> 抄送: Subscribed @.> 主题: Re: [jinfan0931/meic2wrf] 程序运行中出现了list index out of range请问怎么解决呢? (#8)

好的,我这边查看一下。


发件人: catherine-2020 @.> 发送时间: Friday, April 30, 2021 3:56:52 PM 收件人: jinfan0931/meic2wrf @.> 抄送: Subscribed @.***> 主题: [jinfan0931/meic2wrf] 程序运行中出现了list index out of range请问怎么解决呢? (#8)

在运行meic2wrf_GUI.py时候,出现了 Exception in Tkinter callback Traceback (most recent call last): File "~/miniconda3/envs/pyn_2/lib/python3.7/tkinter/init.py", line 1705, in __cal return self.func(*args) File "meic2wrf_GUI.py", line 92, in merge_meic_dept fn_act=ent_dir.get()+'/'+fnmatch.filter(fnmatch.filter(os.listdir(ent_dir.get()), i), 'agrnc')[0] IndexError: list index out of range 看样子好像是循坏的问题?

― You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/jinfan0931/meic2wrf/issues/8, or unsubscribehttps://github.com/notifications/unsubscribe-auth/APQEEB2B3LMTYN3BWRLZFELTLJPEJANCNFSM433VQ3XA.

QingLuo-github commented 3 years ago

修改原有的脚本(即# new:2016_1_agriculture_BC.nc

old:2016_01agricultureBC.nc)后,运行程序报错为:

fatal:Could not create (/merged/BC.nc) Exception in Tkinter callback Traceback (most recent call last): File "~/miniconda3/envs/pyn_2/lib/python3.7/tkinter/init.py", line 1705, in call return self.func(*args) File "meic2wrf_GUI_0506.py", line 88, in merge_meic_dept f=Nio.open_file(ent_dir.get()+'/merged/'+j+'.nc','w') File "~/miniconda3/envs/pyn_2/lib/python3.7/site-packages/PyNIO/Nio.py", line 751, in open_file file = _nio.open_file(filename,mode,options,history,format) Nio.NIOError: Unable to open file 这是函数的问题吗?

QingLuo-github commented 3 years ago

修改原有的脚本(即# new:2016_1_agriculture_BC.nc

old:2016_01agricultureBC.nc)后,运行程序报错为:

fatal:Could not create (/merged/BC.nc) Exception in Tkinter callback Traceback (most recent call last): File "~/miniconda3/envs/pyn_2/lib/python3.7/tkinter/init.py", line 1705, in call return self.func(*args) File "meic2wrf_GUI_0506.py", line 88, in merge_meic_dept f=Nio.open_file(ent_dir.get()+'/merged/'+j+'.nc','w') File "~/miniconda3/envs/pyn_2/lib/python3.7/site-packages/PyNIO/Nio.py", line 751, in open_file file = _nio.open_file(filename,mode,options,history,format) Nio.NIOError: Unable to open file 这是函数的问题吗?

IncubatorShokuhou commented 3 years ago

修改原有的脚本(即# new:2016_1_agriculture_BC.nc

old:2016_01agricultureBC.nc)后,运行程序报错为:

fatal:Could not create (/merged/BC.nc) Exception in Tkinter callback Traceback (most recent call last): File "~/miniconda3/envs/pyn_2/lib/python3.7/tkinter/init.py", line 1705, in call return self.func(*args) File "meic2wrf_GUI_0506.py", line 88, in merge_meic_dept f=Nio.open_file(ent_dir.get()+'/merged/'+j+'.nc','w') File "~/miniconda3/envs/pyn_2/lib/python3.7/site-packages/PyNIO/Nio.py", line 751, in open_file file = _nio.open_file(filename,mode,options,history,format) Nio.NIOError: Unable to open file 这是函数的问题吗?

最近的更新应该已经解决了 list index out of range的问题。主要原因是meic更新后,pm2.5相关变量的文件名变更了。您可以尝试pull一下,再重新跑一下。 至于下一个问题,我猜测可能是进程终端导致文件损坏。您可以尝试删除所有中间文件然后重新运行。

Qianjk818 commented 8 months ago

修改原有的脚本(即# new:2016_1_agriculture_BC.nc

old:2016_01agricultureBC.nc)后,运行程序报错为:

fatal:Could not create (/merged/BC.nc) Exception in Tkinter callback Traceback (most recent call last): File "~/miniconda3/envs/pyn_2/lib/python3.7/tkinter/init.py", line 1705, in call return self.func(*args) File "meic2wrf_GUI_0506.py", line 88, in merge_meic_dept f=Nio.open_file(ent_dir.get()+'/merged/'+j+'.nc','w') File "~/miniconda3/envs/pyn_2/lib/python3.7/site-packages/PyNIO/Nio.py", line 751, in open_file file = _nio.open_file(filename,mode,options,history,format) Nio.NIOError: Unable to open file 这是函数的问题吗?

最近的更新应该已经解决了 list index out of range的问题。主要原因是meic更新后,pm2.5相关变量的文件名变更了。您可以尝试pull一下,再重新跑一下。 至于下一个问题,我猜测可能是进程终端导致文件损坏。您可以尝试删除所有中间文件然后重新运行。

不知道工具是否还有人维护,最好还是能再更新一下,MEIC的PM2.5和PM10文件名都变更了,CO2数据也需要单独下载,当然目前的版本也还是可以用的,就是使用门槛更高了需要自己改一下代码,不过直接把下载数据的文件名改回以前的也是比较简单的办法