def mosaic(self):
"""
If more than two tiles are input by the user, this function mosaics the tiles
together.
"""
if len(self.tiles) > 1:
hdflist = sorted(glob.glob(self.fullPath + '/*.hdf'))
for i in range(0,len(hdflist),2):
ms = pymodis.convertmodis_gdal.createMosaicGDAL(hdfnames = [hdflist[i], hdflist[i+1]], subset = self.subset, outformat = 'GTiff')
ms.run(str(hdflist[i].split('.h')[0]) + 'mos.tif')
ms.write_vrt(output = str(hdflist[i].split('.h')[0]), separate = True)
mosaicCount = len(glob.glob(self.fullPath + '/*mos.tif'))
logger.log('SUCCESS', 'Mosaic complete! MODIS tiles %s were successfully mosaicked into %d mosaic images.' % (str(self.tiles), mosaicCount))
评论列表
文章目录