0
我正在使用一個python 2.6腳本,我已經使用了很長一段時間了,並且我得到一個錯誤,它不應該在那裏。該Python腳本運行形成的,其中netCDF文件所在的位置,這裏是代碼Python和NetCDF sciprt不再運行
from numpy import *
import numpy as numpy
from netCDF4 import Dataset
import datetime as DT
from time import strftime
import os
floc ='/media/USB-HDD/NCEP_NCAP data/data_2010/' #location of directory that the file resides
fname ='cfsr_Scotland_2010' # name of the netCDF file
in_ext = '.nc' # ending extentsion of the netCDF
basetime = DT.datetime(2010,01,01,0,0,0) # Initial time (start) for the netCDF
ncfile = Dataset(floc+fname+in_ext,'r') # netCDF assigned name
time = ncfile.variables['time']
lon = ncfile.variables['lon']
lat = ncfile.variables['lat']
uwind = ncfile.variables['10u']
vwind = ncfile.variables['10v']
ht = ncfile.variables['height']
我得到的NCFILE命名,這是奇怪的,因爲我簽了書面的方式錯誤
Traceback (most recent call last):
File "CFSR2WIND.py", line 24, in <module>
ncfile = Dataset(floc+fname+in_ext,'r') # netCDF assigned name
File "netCDF4.pyx", line 1317, in netCDF4.Dataset.__init__ (netCDF4.c:14608)
RuntimeError: No such file or directory
有誰知道爲什麼以及是什麼原因導致這一點,以及它如何可以解決
謝謝
喬治