Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create_mosaic/convert_modis is returning an empty list #140

Open
manapshymyr-OB opened this issue May 15, 2021 · 0 comments
Open

create_mosaic/convert_modis is returning an empty list #140

manapshymyr-OB opened this issue May 15, 2021 · 0 comments

Comments

@manapshymyr-OB
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant