acolite / acolite_ls2

ACOLITE: Atmospheric correction for aquatic applications of Landsat and Sentinel-2 (obsolete)
GNU General Public License v3.0
42 stars 27 forks source link

Fixed gdal import in nc_to_geotiff #8

Closed tvoirand closed 3 years ago

tvoirand commented 3 years ago

I have encountered an error lately with geotiff output files.

Traceback (most recent call last):
  File "/home/thibaut/thibaut/acolite/acolite/launch_acolite.py", line 30, in <module>
    launch_acolite()
  File "/home/thibaut/thibaut/acolite/acolite/launch_acolite.py", line 25, in launch_acolite
    ac.acolite.acolite_cli(sys.argv)
  File "/home/thibaut/thibaut/acolite/acolite/acolite/acolite/acolite_cli.py", line 71, in acolite_cli
    acolite_run(settings=acolite_settings)
  File "/home/thibaut/thibaut/acolite/acolite/acolite/acolite/acolite_run.py", line 337, in acolite_run
    for f in ret: nc_to_geotiff(f, skip_geo=(not setu['export_geotiff_coordinates']))
  File "/home/thibaut/thibaut/acolite/acolite/acolite/output/nc_to_geotiff.py", line 17, in nc_to_geotiff
    import osgeo.osr, gdal
ModuleNotFoundError: No module named 'gdal'

It seems to be caused by the gdal import in nc_to_geotiff, and this fixes the issue.

Please let me know if that makes sense !