本文整理汇总了Python中nansat.Nansat.write_map方法的典型用法代码示例。如果您正苦于以下问题:Python Nansat.write_map方法的具体用法?Python Nansat.write_map怎么用?Python Nansat.write_map使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nansat.Nansat
的用法示例。
在下文中一共展示了Nansat.write_map方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testio
# 需要导入模块: from nansat import Nansat [as 别名]
# 或者: from nansat.Nansat import write_map [as 别名]
from nansat import Nansat, Domain
from testio import testio
# Set input and output file names
iPath, oPath = testio()
iFileName = os.path.join(iPath, 'gcps.tif')
oFileName = os.path.join(oPath, 'tutor_')
# Open an input satellite image with Nansat
n = Nansat(iFileName)
# List bands and georeference of the object
print n
# Write picture with map of the file location
n.write_map(oFileName + 'map.png')
# Write indexed picture with data from the first band
n.write_figure(oFileName + '.png', clim='hist')
# Reproject input image onto map of Norwegian Coast
# 1. Create domain describing the desired map
# 2. Transform the original satellite image
# 3. Write the transfromed image into RGB picture
dLatlong = Domain("+proj=latlong +datum=WGS84 +ellps=WGS84 +no_defs",
"-te 27 70.2 31 71.5 -ts 500 500")
n.reproject(dLatlong)
n.write_figure(oFileName + 'pro.png', bands=[1, 2, 3], clim=[0, 100])
# Export projected satelite image into NetCDF format
n.export(oFileName + '.nc')
示例2: borders
# 需要导入模块: from nansat import Nansat [as 别名]
# 或者: from nansat.Nansat import write_map [as 别名]
# make indexed image with legend
n.write_figure(oPath + fileName + '_legend.png', bands='radiance_900', clim='hist', ratio=0.7, legend=True, titleString='NANSAT Tutorial', fontSize=40)
# make small preview in three steps:
# 1. Reduce size of the Nansat object ten times
# 2. Make simple grayscaled image with brightness correction
# 3. Resize back to original resolution
n.resize(0.1)
n.write_figure(oPath + fileName + '_preview.png', clim='hist', ratio=0.7, cmapName='gray')
n.resize()
# make KML file with image borders (to be opened in Googe Earth)
n.write_kml(kmlFileName=oPath + fileName + '_preview.kml')
# make image with map of the file location
n.write_map(oPath + fileName + '_map.png')
# Make image, reprojected onto map of Northern Europe in three steps:
# 1. Create Domain object. It describes the desired grid of reprojected image:
# projection, resolution, size, etc. In this case it is geographic projection;
# -10 - 30 E, 50 - 70 W; 2000 x 2000 pixels
# 2. Reproject the Nansat object
# 3. Make simple image
d = Domain("+proj=latlong +datum=WGS84 +ellps=WGS84 +no_defs", "-lle -10 50 30 70 -ts 2000 2000")
print d
n.reproject(d)
n.write_figure(oPath + fileName + '_pro_latlon.png')
# Reprojected image into stereographic projection
# 1. Cancel previous reprojection