陆地卫星光栅文件I/O
espatools的Python项目详细描述
一个开源的python包,用于简单地将landsat图像加载为numpy数组。 从USGS Earth Explorer下载陆地卫星图像时,数据集包含 许多波段(.tif文件)和一些元数据文件(.txt和.xml文件)。 espatools是用来分析.xml元数据文件以读取所有带区的 为该数据集提供了方便直观的访问方法 python环境中原始数据旁边的元数据。 espatools可以在GitHub和PyPI上找到。
连接
- 包大量使用properties以一致的声明性方式创建强类型对象。
- PVGeo实现了espatools通过xml元数据文件读取landsat图像的接口。查看pvgeo的Landsat Reader了解更多详细信息。
开始
espatools可从PyPI
$ pip install espatools
使用量
我们认为espatools易于使用;请尝试一下,让我们知道您的想法,因为这只是alpha版本!
- 首先,看一下this example对于PVGeo,其中espatools有一个在paraview中直接使用的接口。
- 然后在python环境中阅读landsat图像后,查看this Jupyter Notebook以演示一些简单的绘图。
示例错误颜色
importespatoolsimportmatplotlib.pyplotasplt# Create the reader to manage I/Oreader=espatools.RasterSetReader(filename='metadata.xml')# Perform the read and yield a raster setraster=reader.Read()# Get an RGB color schemecolor=raster.GetRGB('false_a')# Now plot the false color imageplt.imshow(color)
上述代码的结果产生以下假彩色图像: