TimHessels / SEBAL

The Surface Energy Balance Algorithm for Land
Apache License 2.0
27 stars 28 forks source link

Run on Linux #3

Closed anikfal closed 3 years ago

anikfal commented 3 years ago

Running pySEBAL for the Landsat images was successful. But for Proba-V, the gdal command (gdal_translate) fails to convert the hdf file to geotiff:

The fullCmd argument used in SEBAL.Run_command_window(fullCmd) is as follows:

gdal_translate.exe -of GTiff HDF5:"/home/anikfal/sebal/Input/VIIRS-PROBAV/PROBAV_S5_TOC_X21Y04_20160621_100M_V001.HDF5"://LEVEL3/QUALITY/SM /home/anikfal/sebal/Input/VIIRS-PROBAV/PROBAV_S5_TOC_X21Y04_20160621_100M_V001_test.tif

The error for the above command is as follows:

Input file size is 10080, 10080 0HDF5-DIAG: Error detected in HDF5 (1.10.5) thread 140626654562624:

000: H5Dio.c line 199 in H5Dread(): can't read data

major: Dataset minor: Read failed

001: H5Dio.c line 601 in H5D__read(): can't read data

major: Dataset minor: Read failed

002: H5Dchunk.c line 2259 in H5D__chunk_read(): unable to read raw data chunk

major: Low-level I/O minor: Read failed

003: H5Dchunk.c line 3624 in H5D__chunk_lock(): data pipeline read failed

major: Dataset minor: Filter operation failed

004: H5Z.c line 1301 in H5Z_pipeline(): required filter 'szip' is not registered

major: Data filters minor: Read failed

005: H5PLint.c line 270 in H5PL_load(): search in path table failed

major: Plugin for dynamically loaded library minor: Can't get value

006: H5PLpath.c line 604 in H5PL__find_plugin_in_path_table(): search in path /home/anikfal/miniconda2/envs/myeto2/lib/hdf5/plugin encountered an error

major: Plugin for dynamically loaded library minor: Can't get value

007: H5PLpath.c line 656 in H5PL__find_plugin_in_path(): can't open directory: /home/anikfal/miniconda2/envs/myeto2/lib/hdf5/plugin

major: Plugin for dynamically loaded library minor: Can't open directory or file ERROR 1: H5Dread() failed for block. ERROR 1: HDF5:/home/anikfal/app/sebal/Input/VIIRS-PROBAV/PROBAV_S5_TOC_X21Y04_20160621_100M_V001.HDF5://LEVEL3/QUALITY/SM, band 1: IReadBlock failed at X offset 0, Y offset 0: H5Dread() failed for block.

Similar problems occur while running the model for MODIS, which are relevant to the gdalwrap command.

TimHessels commented 3 years ago

This is not a real pySEBAL issue, but your python cannot find a library to open HDF files. Maybe try to reinstall HDF5 module, can solve the issue. Another solve could be to rewrite this part into gdal.Translate(/home/anikfal/sebal/Input/VIIRS-PROBAV/PROBAV_S5_TOC_X21Y04_20160621_100M_V001_test.tif, HDF5:"/home/anikfal/sebal/Input/VIIRS-PROBAV/PROBAV_S5_TOC_X21Y04_20160621_100M_V001.HDF5"://LEVEL3/QUALITY/SM), but I think your system has some problems in how to deal with HDF files and above option will also result in the same error.

anikfal commented 3 years ago

Thank you. After installing the HDF plugin, this error disappears. But new error comes up, complaining that the SZIP library is missing (required filter 'szip' is not registered) in HDF5. It seems that the PROBA-V data is a special compressed HDF5 data format, that the HDF5 library cannot read without SZIP.

Input file size is 10080, 10080 0HDF5-DIAG: Error detected in HDF5 (1.10.5) thread 139981980080448:

000: H5Dio.c line 199 in H5Dread(): can't read data

major: Dataset minor: Read failed

001: H5Dio.c line 601 in H5D__read(): can't read data

major: Dataset minor: Read failed

002: H5Dchunk.c line 2259 in H5D__chunk_read(): unable to read raw data chunk

major: Low-level I/O minor: Read failed

003: H5Dchunk.c line 3624 in H5D__chunk_lock(): data pipeline read failed

major: Dataset minor: Filter operation failed

004: H5Z.c line 1301 in H5Z_pipeline(): required filter 'szip' is not registered

major: Data filters minor: Read failed ERROR 1: H5Dread() failed for block. ERROR 1: HDF5:PROBAV_S5_TOC_X21Y04_20160621_100M_V001.HDF5://LEVEL3/QUALITY/SM, band 1: IReadBlock failed at X offset 0, Y offset 0: H5Dread() failed for block.