【发布时间】:2017-05-18 18:29:30
【问题描述】:
我想使用为海洋学和气象学开发的 python Iris 模块沿经度绘制横截面,我正在使用他们的示例: http://scitools.org.uk/iris/docs/v1.4/examples/graphics/cross_section.html 我试图将他们的代码更改为我的示例,但我的代码输出为空。
数据:http://data.nodc.noaa.gov/thredds/fileServer/woa/WOA09/NetCDFdata/temperature_annual_1deg.nc
import iris
import iris.plot as iplt
import iris.quickplot as qplt
# Enable a future option, to ensure that the netcdf load works the same way
# as in future Iris versions.
iris.FUTURE.netcdf_promote = True
# Load some test data.
fname = 'temperature_annual_1deg.nc'
theta = iris.load_cube(fname, 'sea_water_temperature')
# Extract a single depth vs longitude cross-section. N.B. This could
# easily be changed to extract a specific slice, or even to loop over *all*
# cross section slices.
cross_section = next(theta.slices(['longitude',
'depth']))
qplt.contourf(cross_section, coords=['longitude', 'depth'],
cmap='RdBu_r')
iplt.show()
【问题讨论】:
-
我不认为海洋标签在这里是正确的;与油气开发平台无关,见stackoverflow.com/questions/tagged/ocean
-
没错,我以为是通用标签
标签: python contour netcdf netcdf4