lucadelu / pyModis

python library to work with MODIS data
http://www.pymodis.org/
Other
165 stars 84 forks source link

Error when convert the MOD13Q1.006 to GTIFF format #153

Open xeno0 opened 1 year ago

xeno0 commented 1 year ago

The command line is

modis_convert.py MOD13Q1.A2021353.h10v05.006.2022004235331.hdf -o test.tif -s "(1 0)" -g 0.0025 -e 4326 -r NEAREST_NEIGHBOR

the test data can be found in

https://drive.google.com/drive/folders/1zuDwN0j3mfwGf_pDw9p3aQbDAjiCigmX?usp=sharing

and errors are:

Traceback (most recent call last):
  File "/Users/xeno/miniconda3/envs/co2/lib/python3.9/site-packages/pymodis/convertmodis_gdal.py", line 265, in _reprojectOne
    gdal.ReprojectImage(l_src_ds, dst_ds, l_src_ds.GetProjection(),
  File "/Users/xeno/miniconda3/envs/co2/lib/python3.9/site-packages/osgeo/gdal.py", line 4502, in ReprojectImage
    return _gdal.ReprojectImage(*args, **kwargs)
RuntimeError: HDF4_EOS:EOS_GRID:"MOD13Q1.A2021353.h10v05.006.2022004235331.hdf":MODIS_Grid_16DAY_250m_500m_VI:"250m 16 days NDVI", band 1: IReadBlock failed at X offset 0, Y offset 0: GDreadfield() failed for block.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/xeno/miniconda3/envs/co2/bin/modis_convert.py", line 166, in <module>
    main()
  File "/Users/xeno/miniconda3/envs/co2/bin/modis_convert.py", line 160, in main
    modisConver.run()
  File "/Users/xeno/miniconda3/envs/co2/lib/python3.9/site-packages/pymodis/convertmodis_gdal.py", line 296, in run
    self._reprojectOne(self.layers[n][0], quiet=quiet)
  File "/Users/xeno/miniconda3/envs/co2/lib/python3.9/site-packages/pymodis/convertmodis_gdal.py", line 271, in _reprojectOne
    raise Exception('Not possible to reproject dataset '
Exception: Not possible to reproject dataset HDF4_EOS:EOS_GRID:"MOD13Q1.A2021353.h10v05.006.2022004235331.hdf":MODIS_Grid_16DAY_250m_500m_VI:"250m 16 days NDVI"
hotuns commented 1 year ago

Did you solve this problem? I encountered the same problem, I want or NDVI information and load it to Cesium