pyModis icon indicating copy to clipboard operation
pyModis copied to clipboard

createMosaicGDAL takes longer to make a single multi-band output than to make multiple single-band outputs

Open nartb opened this issue 4 years ago • 0 comments

Expected behavior and actual behavior.

I'm mosiacking tiles into a global raster using pyModis.createMosaicGDAL() and ran into a weird situation. I needed three bands for my processing so I decided to create a single mosaic containing all three bands. This took ~45 minutes. I decided to try mosaicking each band separately and saving as a separate file in order to optimize some other part of my code. Interestingly, the same mosaicking now only took ~8 minutes.

I'm not sure if this is necessarily a bug. Perhaps there's a good reason. But I definitely think it's something that could likely be improved or at least documented so that people are aware of this limitation.

Steps to reproduce the problem.

Running this all in a notebook but the core script in question is below (for the multi-band case).

mosaic_generator = createMosaicGDAL(
    files,
    '1, 1, 1' ,
    'GTiff'
)
mosaic_generator.run(SOME_PATH)

Operating system

macOS Catalina 10.15.4

Version

2.1.0 installed using pip 20.3.3

nartb avatar Jan 08 '21 18:01 nartb