简体   繁体   English

使用ncdump时出错-NetCDF4 Python

[英]Error using ncdump - NetCDF4 Python

I am using python to read a netcdf dataset. 我正在使用python读取netcdf数据集。 I have installed netcdf and I am trying to read the data by typing, ncdump("sample.nc",header_only=0). 我已经安装了netcdf,并且尝试通过键入ncdump(“ sample.nc”,header_only = 0)读取数据。 And I get the below error: /bin/sh: 1: ncdump.exe: not found. 而且我得到以下错误:/ bin / sh:1:ncdump.exe:找不到。

sample.nc is a netcdf file created using the following code: sample.nc是一个使用以下代码创建的netcdf文件:

from netCDF4 import Dataset    
import numpy as np

sfile = Dataset('sample.nc',mode='w', format='NETCDF4') 

Can anyone help me understand this error. 谁能帮助我了解此错误。 I am quite new to this concept. 我对这个概念很陌生。 Thanks 谢谢

I had this problem today, and I came across your question during my research to solve my problem. 我今天遇到了这个问题,在研究解决问题时遇到了您的问题。 You don't have the ncdump command installed most likely. 您最有可能没有安装ncdump命令。

Download netCDF4.3.3.1-NC4-64.exe or the 32 bit version from the http://www.unidata.ucar.edu/software/netcdf/docs/winbin.html . http://www.unidata.ucar.edu/software/netcdf/docs/winbin.html下载netCDF4.3.3.1-NC4-64.exe或32位版本。

I installed them to my program files. 我将它们安装到我的程序文件中。 Add the path to the ncdump commands to your system path. 将ncdump命令的路径添加到系统路径。 I believe they are located in the bin folder once you have run the install. 我相信一旦运行安装,它们便位于bin文件夹中。 My path was... 我的路是...

C:\\Program Files (x86)\\netCDF 4.3.3.1\\bin C:\\ Program Files(x86)\\ netCDF 4.3.3.1 \\ bin

Good Luck. 祝好运。

ncdump -h filename 

in command prompt should work 在命令提示符下应该工作

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM