comet-licsar / LiCSBAS

LiCSBAS: InSAR time series analysis package using LiCSAR products
https://doi.org/10.3390/RS12030424
GNU General Public License v3.0
22 stars 6 forks source link

h5 to netCDF convert problem #50

Open suatcoskun opened 4 months ago

suatcoskun commented 4 months ago

Hi: I use last version of the LiCSBAS (main). I tried to convert .h5 file to netCDF with LiCSBAS_out2nc.py. But i took this error message;

LiCSBAS_out2nc.py ver1.05 20240420 M.Lazecky LiCSBAS_out2nc.py -i TS_GEOCml1GACOSclip/cum.h5 Traceback (most recent call last): File "/home/suat/Downloads/LiCSBAS-main/bin/LiCSBAS_out2nc.py", line 361, in sys.exit(main()) ^^^^^^ File "/home/suat/Downloads/LiCSBAS-main/bin/LiCSBAS_out2nc.py", line 271, in main cube = loadall2cube(cumfile) ^^^^^^^^^^^^^^^^^^^^^ File "/home/suat/Downloads/LiCSBAS-main/bin/LiCSBAS_out2nc.py", line 96, in loadall2cube cum = xr.load_dataset(cumfile) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/suat/tools/miniforge/envs/licsbas/lib/python3.12/site-packages/xarray/backends/api.py", line 274, in load_dataset with open_dataset(filename_or_obj, **kwargs) as ds: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/suat/tools/miniforge/envs/licsbas/lib/python3.12/site-packages/xarray/backends/api.py", line 547, in open_dataset engine = plugins.guess_engine(filename_or_obj) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/suat/tools/miniforge/envs/licsbas/lib/python3.12/site-packages/xarray/backends/plugins.py", line 197, in guess_engine raise ValueError(error_msg) ValueError: found the following matches with the input file in xarray's IO backends: ['netcdf4', 'h5netcdf']. But their dependencies may not be installed, see: https://docs.xarray.dev/en/stable/user-guide/io.html https://docs.xarray.dev/en/stable/getting-started-guide/installing.html

Any advice thank you.

mnergizci commented 4 months ago

Hi,

As the error suggests, it seems the necessary dependencies (like netcdf4 or h5netcdf) are not installed yet. Please try installing these libraries into your environment. You can use either pip or conda, depending on where you are using LiCSBAS:

You can use pip:

pip install netcdf4 h5netcdf

or conda:

conda install -c conda-forge netcdf4 h5netcdf

After downloading the dependencies, it might work properly...

suatcoskun commented 4 months ago

Thank you for quick response and efficent suggestion. It is done. I export my h5 to netCDF

Best. Suat