所有 ecCodes 函数在出错时都会抛出下面的异常:
CodesInternalError
所有 GRIB API 函数在出错时都会抛出下面的异常:
GribInternalError
上面的异常都包含 C API 的错误信息。
更高层面,更加 pythonic 的接口。
with GribFile(filename) as grib:
# Iterate through each message in the file
for msgin grib:
# Access a key from each message
print(msg[key_name])
# Report message size in bytes
msg.size()
# Report keys in message
msg.keys()
# Set scalar value
msg[scalar_key] = 5
# Array values are set transparently
msg[array_key] = [1, 2, 3]
# Messages can be written to file
with open(testfile, "w") as test:
msg.write(test)
# Messages can be cloned from other messages
msg2 = GribMessage(clone=msg)
http://www.scipy.org/Numpy_Functions_by_Category
http://docs.scipy.org/numpy/docs/numpy/
http://www.scipy.org/NumPy_for_Matlab_Users
http://matplotlib.sourceforge.net/
https://software.ecmwf.int/wiki/display/ECC/ecCodes+Home