本文整理汇总了Python中nansat.Nansat.resize_lite方法的典型用法代码示例。如果您正苦于以下问题:Python Nansat.resize_lite方法的具体用法?Python Nansat.resize_lite怎么用?Python Nansat.resize_lite使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nansat.Nansat
的用法示例。
在下文中一共展示了Nansat.resize_lite方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: array
# 需要导入模块: from nansat import Nansat [as 别名]
# 或者: from nansat.Nansat import resize_lite [as 别名]
# -- Get data from 1st band as numpy array
a = n[1]
# -- Plot the array (pyplot image is save to a PNG file)
plt.imshow(a);plt.colorbar();plt.savefig(oFileName + '01_imshow.png');plt.close()
# -- Save as Matlab file
savemat(oFileName + '01.mat', {'band_1': a})
# Resize the data to 50%
n.resize(0.5)
# make simple indexed image from 1st band with default colormap
n.write_figure(oFileName + '02.png', clim='hist')
# undo resize
n.resize()
# Resize the data to 50% using CubicSpline
n.resize_lite(0.5, eResampleAlg=3)
# make simple indexed image from 1st band with default colormap
n.write_figure(oFileName + '02CubicSpline.png', clim='hist')
# undo resize
n.resize()
# make image with map of the file location
n.write_map(oFileName + '04_map.png')
# Writes an 8-bit GeoTiff image for a given band
n.write_geotiffimage(oFileName + '05_geotiff.tif', bandID=1)
# create a NetCDF file with all bands
n.export(oFileName + '06a.nc')
n.export(oFileName + '06b.nc', bottomup=True)