如何使用CDO气候命令?
我想将NETCDF文件子集以用CDO提取子页面。
我在Spyder中运行以下代码,
from cdo import *
cdo = Cdo()
cdo.select('startdate=2003-01-01,end_date=2016-12-31', input='PATH/temperature.nc', output='output.nc')
我使用Spyder 3.10并传达消息:
TypeError:预期的str,字节或OS.Pathike对象,而不是非型
当我运行 cdo = cdo()
时,
- 不是非电视,也许我不应该在spyder中运行cdo?
- 命令正确吗?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我在Mac上进行自制升级后与
cdo()
命令有一个问题最近, 在
cdo = cdo()
命令中?我注意到您在“ end_date”中有一个下划线,这是您的问题中的错字还是代码中的错字?如果仅选择日期,使用
seldate
怎么办?I recently had an issue with the
Cdo()
command after a homebrew upgrade on a mac, and uninstalling the cdo package and then reinstalling it solved it for me...However, are you sure the error is in the
cdo=Cdo()
command? I notice you have an underscore in "end_date", is that a typo in your question or also in your code?What about using
seldate
if you are only selecting dates?我遇到了一个非常相似的问题,就我的情况而言,问题是关于窗口的,因为无法使用CDO。目前,Windows系统中不支持CDO,并且Windows Conda存储库中的二进制文件不可用。
克服这一障碍的可能方法是WSL,它模仿了Windows系统中的UNIX。然后,应下载CDO的UNIX。更详细的说明是在CDO用户指南中 - > 1.1安装。
还有网站的链接:
I have experienced a very similar problem, in my case problem is about the Windows as it is not possible to use CDO. Right now CDO is not supported in Windows system and the binary is not available in the windows conda repository.
Possible ways to overcome this obstacle is WSL, which emulates Unix in your Windows system. Then CDO should be downloaded for Unix. More detailed explanation is in CDO user guide -> 1.1 Installation.
Also the link of website: https://code.mpimet.mpg.de/projects/cdo/embedded/index.html#x1-30001.1