Skip to content

create_mosaic/convert_modis is returning an empty list #140

@manapshymyr-OB

Description

@manapshymyr-OB

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions