【发布时间】:2016-07-12 02:33:59
【问题描述】:
我的问题很简单。
以 wrfout 文件“out.nc”为例。
该文件包含 Geo2D、Geo3D 和 1D 变量。
在 Python 2.7 中使用 GDAL 包,我可以像这样轻松提取 Geo2D 变量:
## T2 is 2-d variable means temperature 2 m above the ground
temp = gdal.Open('NETCDF:"'+"out.nc"+'":T2')
但是当我想使用这段代码提取一维数组时,它失败了。
## Time is 1-d array represent the timeseries throught the simulation period
time = gdal.Open('NETCDF:"'+"out.nc"+'":Time')
什么都没发生!希望有人提供一些建议以轻松读取任意维度的 WRF 输出变量!
【问题讨论】:
-
你试过用 python-netcdf4 代替 gdal 吗?
标签: python gdal netcdf matplotlib-basemap