0

I tried to get ET and PET layer for MOD16A2 by using convertmodis_gdal.convertModisGDAL:

modisconv = convertmodis_gdal.convertModisGDAL(hdf, output, "(1 0 0)", 500, outformat='GTiff', epsg=32647, wkt=None, resampl='NEAREST_NEIGHBOR', vrt=False)

modisconv = convertmodis_gdal.convertModisGDAL(hdf, output, '(0 0 1)', 500, outformat='GTiff', epsg=32647, wkt=None, resampl='NEAREST_NEIGHBOR', vrt=False)

The result is the same, is there anything I missed?

1 Answer 1

0

You need to specify the layer number for each band, not just 0 or 1. The ET layer is band 1 and the PET layer is band 2, so you need to use ‘(1 0 0)’ for ET and ‘(0 1 0)’ for PET. Also, you don’t need to use quotes around the subset parameter, just use parentheses. Like this:

modisconv = convertmodis_gdal.convertModisGDAL(hdf, output, (1 0 0), 500, outformat=‘GTiff’, epsg=32647, wkt=None, resampl=‘NEAREST_NEIGHBOR’, vrt=False)

modisconv = convertmodis_gdal.convertModisGDAL(hdf, output, (0 1 0), 500, outformat=‘GTiff’, epsg=32647, wkt=None, resampl=‘NEAREST_NEIGHBOR’, vrt=False)

That should give you the correct output.

2
  • I already tried your suggestion but I still get the same output, and in case "you don’t need to use quotes around the subset parameter" i got an error when i do it
    – taam
    Commented Nov 2, 2023 at 8:46
  • anyway thank you for helping me
    – taam
    Commented Nov 2, 2023 at 8:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.