pyModis icon indicating copy to clipboard operation
pyModis copied to clipboard

create_mosaic/convert_modis is returning an empty list

Open manapshymyr-OB opened this issue 3 years ago • 0 comments

Hello everyone!

I am trying to create mosaic and reproject the created mosiac. However, after the creation of the mosaic I am getting an empty list for layers which results in an error for reprojection.

`only_hdf = [] subset = [1,0,0] for file in hdf: if file.endswith('.hdf'): only_hdf.append(os.path.join(r'D:\CAMP4ASB\MOLT\MOD17A2H.006\2021.03.14', file))

mosaic = convertmodis_gdal.createMosaicGDAL(only_hdf, [1,0,0], 'GTiff') mosaic.run(prefix)`

So this code creates the mosaic successfully, however, the reprojection is not working with following error:

File "C:/Users/Gigabyte/PycharmProjects/CAMP4ASB/test.py", line 14, in <module> rep.run() File "C:\Users\Gigabyte\PycharmProjects\pythonProject\DSP\lib\site-packages\pymodis\convertmodis_gdal.py", line 289, in run self._createWarped(self.layers[0][0]) IndexError: list index out of range

and src_ds = gdal.Open('geo123_Gpp_500m.tif') layers = src_ds.GetSubDatasets() showing an empty list.

Can you please help on that? Why is the reason? Qgis is opening correctly. Python version 3.7.7 and GDAL 2.4.1

manapshymyr-OB avatar May 15 '21 18:05 manapshymyr-OB