agpredict.py 文件源码

python
阅读 18 收藏 0 点赞 0 评论 0

项目:forecastVeg 作者: JohnNay 项目源码 文件源码
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))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号