pyrocko / kite

InSAR unwrapped surface displacement processing for earthquake modelling.
https://pyrocko.org/kite/
GNU General Public License v3.0
79 stars 34 forks source link

LiCSAR import broken #50

Open braunfuss opened 4 years ago

braunfuss commented 4 years ago

Using the example from docs to download LiCSAR data fails:

python3 -m kite.clients http://gws-access.ceda.ac.uk/public/nceo_geohazards/LiCSAR_products/6/006D_05509_131313/products/20171107_20171201/20171107_20171201.geo.unw.tif .

spool --load=./20171107_20171201.geo.unw.tif
QApplication: invalid style override passed, ignoring it.
Traceback (most recent call last):
  File "/usr/local/bin/spool", line 11, in <module>
    load_entry_point('kite==1.3.0', 'console_scripts', 'spool')()
  File "/usr/local/lib/python3.6/dist-packages/kite-1.3.0-py3.6-linux-x86_64.egg/kite/spool/__main__.py", line 87, in main
    spool(import_file=ns.load)
  File "/usr/local/lib/python3.6/dist-packages/kite-1.3.0-py3.6-linux-x86_64.egg/kite/spool/spool.py", line 304, in spool
    spool_app = Spool(*args, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/kite-1.3.0-py3.6-linux-x86_64.egg/kite/spool/spool.py", line 42, in __init__
    self.importScene(import_file)
  File "/usr/local/lib/python3.6/dist-packages/kite-1.3.0-py3.6-linux-x86_64.egg/kite/spool/spool.py", line 58, in importScene
    self.spool_win.model.importFile(filename)
  File "/usr/local/lib/python3.6/dist-packages/kite-1.3.0-py3.6-linux-x86_64.egg/kite/spool/scene_model.py", line 134, in importFile
    self.setScene(Scene.import_data(filename))
  File "/usr/local/lib/python3.6/dist-packages/kite-1.3.0-py3.6-linux-x86_64.egg/kite/scene.py", line 431, in dynclassmethod
    return func(Scene(), *args, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/kite-1.3.0-py3.6-linux-x86_64.egg/kite/scene.py", line 907, in _import_data
    raise ImportError('Could not recognize format for %s' % path)
ImportError: Could not recognize format for ./20171107_20171201.geo.unw.tif
miili commented 4 years ago

Strange, cannot reproduce. Does work here, on dev branch.

hvasbath commented 4 years ago

works also here ... however:

In which pyrocko branch is this supposed to be? I checked master, sparrow7 and dev

spool --load=./20171107_20171201.geo.unw.tif
Traceback (most recent call last):
  File "/usr/local/bin/spool", line 11, in <module>
    load_entry_point('kite==1.3.0', 'console_scripts', 'spool')()
  File "/home/vasyurhm/.local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 489, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/home/vasyurhm/.local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2852, in load_entry_point
    return ep.load()
  File "/home/vasyurhm/.local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2443, in load
    return self.resolve()
  File "/home/vasyurhm/.local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2449, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/usr/local/lib/python3.6/dist-packages/kite-1.3.0-py3.6-linux-x86_64.egg/kite/spool/__init__.py", line 2, in <module>
    from .spool import Spool, spool
  File "/usr/local/lib/python3.6/dist-packages/kite-1.3.0-py3.6-linux-x86_64.egg/kite/spool/spool.py", line 13, in <module>
    from .scene_model import SceneModel
  File "/usr/local/lib/python3.6/dist-packages/kite-1.3.0-py3.6-linux-x86_64.egg/kite/spool/scene_model.py", line 6, in <module>
    from pyrocko.dataset.util import set_download_callback as\
ModuleNotFoundError: No module named 'pyrocko.dataset.util'
braunfuss commented 4 years ago

Yes - on dev branch and sparrow branches of pyrocko i also have the same error as @hvasbath. Also kite master should work on the pyrocko master branch and not depend on dev branches for easy access for people...

braunfuss commented 4 years ago

To clarify: my original error occurs on master kite and master pyrocko. I am happy if its just my problem of course ;-)

hsudha commented 4 years ago

I checked with both pyrocko and kite masters and it worked.

hvasbath commented 4 years ago

How is that possible @hsudha ? Here: there is no dataset.util module in the master: https://github.com/pyrocko/pyrocko/tree/master/src/dataset

You have to be on a different branch ...

But anyways Marius added it in the new to be released branch here: https://git.pyrocko.org/pyrocko/pyrocko/commit/69c9a04b08d940cf91493c089b4581381eee7f6e

So once this is merged it should work...

braunfuss commented 4 years ago

The ImportError: Could not recognize format seems to be a local issue on this particular machines environment but turns up for non-native imports like aria, licsar, gmtsar. Any idea what dependency could be the culprit? Else we can close this issue and maybe open a new one for the ModuleNotFoundError: No module named 'pyrocko.dataset.util'

miili commented 4 years ago

The import uses osgeo.gdal which is a pain to install :(

Yet the system packages on Debian based distros work:

apt-get install python3-gdal
braunfuss commented 4 years ago

Indeed on the system in questions gdal python3 bindings were not installed and the issue was solved. Maybe a dedicated error message would be helpful for other users.

janesion commented 2 years ago

Using the example from docs to download LiCSAR data fails:

python3 -m kite.clients http://gws-access.ceda.ac.uk/public/nceo_geohazards/LiCSAR_products/6/006D_05509_131313/products/20171107_20171201/20171107_20171201.geo.unw.tif .

spool --load=./20171107_20171201.geo.unw.tif
QApplication: invalid style override passed, ignoring it.
Traceback (most recent call last):
  File "/usr/local/bin/spool", line 11, in <module>
    load_entry_point('kite==1.3.0', 'console_scripts', 'spool')()
  File "/usr/local/lib/python3.6/dist-packages/kite-1.3.0-py3.6-linux-x86_64.egg/kite/spool/__main__.py", line 87, in main
    spool(import_file=ns.load)
  File "/usr/local/lib/python3.6/dist-packages/kite-1.3.0-py3.6-linux-x86_64.egg/kite/spool/spool.py", line 304, in spool
    spool_app = Spool(*args, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/kite-1.3.0-py3.6-linux-x86_64.egg/kite/spool/spool.py", line 42, in __init__
    self.importScene(import_file)
  File "/usr/local/lib/python3.6/dist-packages/kite-1.3.0-py3.6-linux-x86_64.egg/kite/spool/spool.py", line 58, in importScene
    self.spool_win.model.importFile(filename)
  File "/usr/local/lib/python3.6/dist-packages/kite-1.3.0-py3.6-linux-x86_64.egg/kite/spool/scene_model.py", line 134, in importFile
    self.setScene(Scene.import_data(filename))
  File "/usr/local/lib/python3.6/dist-packages/kite-1.3.0-py3.6-linux-x86_64.egg/kite/scene.py", line 431, in dynclassmethod
    return func(Scene(), *args, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/kite-1.3.0-py3.6-linux-x86_64.egg/kite/scene.py", line 907, in _import_data
    raise ImportError('Could not recognize format for %s' % path)
ImportError: Could not recognize format for ./20171107_20171201.geo.unw.tif

I'd like to know how you solved this problem, because I also encountered it. When loading the unw.tif, the unrecognized path is displayed. Very confused. Looking forward your reply! Thanks!

hvasbath commented 2 years ago

See the last comment from @miili . You need to check if gdal is correctly installed and working.

janesion commented 2 years ago

I already know. Thank you !

mmustacb commented 7 months ago

Hi, I am getting the same error even though gdal is successfully installed (with the conda-forge channel) and working.

Python 3.11.7 gdal 3.8.3 py311h39b4e0e_0 conda-forge kite 1.5.8.dev3+g1402f3c pypi_0 pypi pyrocko 2024.01.10 py311h03063b4_0 pyrocko