kite
Advanced tools
| repo_token: xq6lSVM3FiUPL4lajDwQg3UXjulNym3Zm |
| name: Build Wheels | ||
| on: | ||
| pull_request: | ||
| push: | ||
| tags: | ||
| - v* | ||
| jobs: | ||
| build_wheels: | ||
| name: Build wheels on ${{ matrix.os }} | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| matrix: | ||
| os: [ubuntu-20.04, macOS-11] | ||
| # Exclude windows-2019 | ||
| steps: | ||
| - uses: actions/checkout@v3 | ||
| - name: Build wheels | ||
| uses: pypa/cibuildwheel@v2.8.1 | ||
| # to supply options, put them in 'env', like: | ||
| env: | ||
| CIBW_ARCHS_MACOS: x86_64 universal2 | ||
| CIBW_SKIP: "{pp*,*musllinux*}" | ||
| - uses: actions/upload-artifact@v3 | ||
| with: | ||
| path: ./wheelhouse/*.whl | ||
| build_sdist: | ||
| name: Build source distribution | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v3 | ||
| - name: Build sdist | ||
| run: pipx run build --sdist | ||
| - uses: actions/upload-artifact@v3 | ||
| with: | ||
| path: dist/*.tar.gz | ||
| upload_pypi: | ||
| needs: [build_wheels, build_sdist] | ||
| name: Upload PyPI | ||
| runs-on: ubuntu-latest | ||
| # upload to PyPI on every tag starting with 'v' | ||
| if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | ||
| # alternatively, to publish when a GitHub Release is created, use the following rule: | ||
| # if: github.event_name == 'release' && github.event.action == 'published' | ||
| steps: | ||
| - uses: actions/download-artifact@v3 | ||
| with: | ||
| # unpacks default artifact into dist/ | ||
| # if `name: artifact` is omitted, the action will create extra parent dir | ||
| name: artifact | ||
| path: dist | ||
| - uses: pypa/gh-action-pypi-publish@v1.5.0 | ||
| with: | ||
| user: __token__ | ||
| password: ${{ secrets.PYPI_API_TOKEN }} | ||
| # To test: repository_url: https://test.pypi.org/legacy/ |
| name: Lint | ||
| on: | ||
| pull_request: | ||
| push: | ||
| branches: [master] | ||
| tags: | ||
| - v* | ||
| jobs: | ||
| pre-commit: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v3 | ||
| - uses: actions/setup-python@v3 | ||
| - uses: pre-commit/action@v3.0.0 |
+133
| # Byte-compiled / optimized / DLL files | ||
| __pycache__/ | ||
| *.py[cod] | ||
| *$py.class | ||
| # C extensions | ||
| *.so | ||
| # Distribution / packaging | ||
| .Python | ||
| build/ | ||
| develop-eggs/ | ||
| dist/ | ||
| downloads/ | ||
| eggs/ | ||
| .eggs/ | ||
| lib/ | ||
| lib64/ | ||
| parts/ | ||
| sdist/ | ||
| var/ | ||
| wheels/ | ||
| pip-wheel-metadata/ | ||
| share/python-wheels/ | ||
| *.egg-info/ | ||
| .installed.cfg | ||
| *.egg | ||
| MANIFEST | ||
| # PyInstaller | ||
| # Usually these files are written by a python script from a template | ||
| # before PyInstaller builds the exe, so as to inject date/other infos into it. | ||
| *.manifest | ||
| *.spec | ||
| # Installer logs | ||
| pip-log.txt | ||
| pip-delete-this-directory.txt | ||
| # Unit test / coverage reports | ||
| htmlcov/ | ||
| .tox/ | ||
| .nox/ | ||
| .coverage | ||
| .coverage.* | ||
| .cache | ||
| nosetests.xml | ||
| coverage.xml | ||
| *.cover | ||
| .hypothesis/ | ||
| .pytest_cache/ | ||
| # Translations | ||
| *.mo | ||
| *.pot | ||
| # Django stuff: | ||
| *.log | ||
| local_settings.py | ||
| db.sqlite3 | ||
| db.sqlite3-journal | ||
| # Flask stuff: | ||
| instance/ | ||
| .webassets-cache | ||
| # Scrapy stuff: | ||
| .scrapy | ||
| # Sphinx documentation | ||
| docs/_build/ | ||
| # PyBuilder | ||
| target/ | ||
| # Jupyter Notebook | ||
| .ipynb_checkpoints | ||
| # IPython | ||
| profile_default/ | ||
| ipython_config.py | ||
| # pyenv | ||
| .python-version | ||
| # pipenv | ||
| # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. | ||
| # However, in case of collaboration, if having platform-specific dependencies or dependencies | ||
| # having no cross-platform support, pipenv may install dependencies that don't work, or not | ||
| # install all needed dependencies. | ||
| #Pipfile.lock | ||
| # celery beat schedule file | ||
| celerybeat-schedule | ||
| # SageMath parsed files | ||
| *.sage.py | ||
| # Environments | ||
| .env | ||
| .venv | ||
| env/ | ||
| venv/ | ||
| ENV/ | ||
| env.bak/ | ||
| venv.bak/ | ||
| # Spyder project settings | ||
| .spyderproject | ||
| .spyproject | ||
| # Rope project settings | ||
| .ropeproject | ||
| # mkdocs documentation | ||
| /site | ||
| # mypy | ||
| .mypy_cache/ | ||
| .dmypy.json | ||
| dmypy.json | ||
| # Pyre type checker | ||
| .pyre/ | ||
| # Custom | ||
| *.sublime-* | ||
| gh-pages | ||
| *swp | ||
| test/data/ | ||
| kite.git/ | ||
| .idea | ||
| .vscode |
| repos: | ||
| - repo: https://github.com/pre-commit/pre-commit-hooks | ||
| rev: v2.3.0 | ||
| hooks: | ||
| - id: check-added-large-files | ||
| - id: check-yaml | ||
| - id: end-of-file-fixer | ||
| - id: trailing-whitespace | ||
| - repo: https://github.com/codespell-project/codespell | ||
| rev: v2.1.0 | ||
| hooks: | ||
| - id: codespell | ||
| args: [--write-changes, "-L ure,nd,ue,parms,Ue"] | ||
| - repo: https://github.com/pycqa/isort | ||
| rev: 5.10.1 | ||
| hooks: | ||
| - id: isort | ||
| name: isort (python) | ||
| args: [--profile, black] | ||
| - repo: https://github.com/psf/black | ||
| rev: 22.6.0 | ||
| hooks: | ||
| - id: black |
+48
| language: python | ||
| env: | ||
| global: | ||
| - OMP_NUM_THREADS=4 | ||
| cache: | ||
| pip: true | ||
| directories: $TRAVIS_BUILD_DIR/kite/test/data | ||
| matrix: | ||
| include: | ||
| - os: linux | ||
| sudo: required | ||
| python: 2.7 | ||
| virtualenv: | ||
| system_site_packages: true | ||
| dist: precise | ||
| addons: | ||
| apt: | ||
| packages: [ python-dev, python-pyside, | ||
| gfortran, libatlas-dev, libopenblas-dev, libyaml-dev, | ||
| python-tk, xvfb, git] | ||
| before_install: | ||
| - pip install --upgrade pip setuptools wheel | ||
| - pip install --only-binary=numpy,scipy,matplotlib scipy numpy matplotlib | ||
| - pip install flake8 pyyaml coveralls future coverage nose | ||
| - pip install git+https://github.com/pyrocko/pyrocko.git | ||
| before_script: | ||
| - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then flake8 src/ apps/ test/ ; fi | ||
| - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then export DISPLAY=:99.0 ; fi | ||
| - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sh -e /etc/init.d/xvfb start ; fi | ||
| - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sleep 3 ; fi | ||
| install: | ||
| - pip install . | ||
| script: | ||
| - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then nosetests test/; fi | ||
| after_success: | ||
| - coveralls | ||
| notifications: | ||
| email: false |
+136
| # Changelog | ||
| All notable changes to Kite will be documented in this file. | ||
| The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). | ||
| ## [1.4.0] 27. April 2020 | ||
| ### Added | ||
| - Import of SNAP products | ||
| - Scene: Added method `get_elevation` | ||
| - Scene: Added polygon masking of unwanted areas | ||
| - Scene: Added empirical APS removal | ||
| - Scene: Added GACOS APS import and removal | ||
| - Scene: Added Deramping as module | ||
| - SceneStack: handles stacks of time series | ||
| - Spool: Added Plugin handlers | ||
| ### Changed | ||
| - QuadTree: Exporting unit vectors [ENU] | ||
| ### Fixed | ||
| - Spool: improved UI | ||
| - Covariance: fixing sparse spool noise window selection | ||
| - Covariance: fixed spectral 1D estmiation // performance improvements | ||
| ## [1.3.0] 3. December 2019 | ||
| ### Added | ||
| - Spool: Added outline to Quadtree Nodes | ||
| - Spool: Added scene de-ramp action | ||
| - `bbd2kite`: import of BGR BodenBewegungsDienst data (https://bodenbewegungsdienst.bgr.de) | ||
| ### Changed | ||
| - Spool: | ||
| - changed leaf center color | ||
| - changed satellite arrow label | ||
| - Quadtree sliders now behave exponential for better fine-tuning | ||
| - Performance upgrade | ||
| - `stamps2kite` parses pixel size in meters instead of grid size | ||
| - Quadtree smallest node size is calculated adaptively | ||
| ### Fixed | ||
| - Spool: | ||
| - Fixed displayed coordinates | ||
| - Improvement slider responsiveness | ||
| - Gamma: Fixed ncols/nrows import | ||
| - Quadtree: focal point calculation to accommodate small quadtree nodes. | ||
| - Quadtree: Export UTM GeoJSON | ||
| ## [1.2.4] 29. October 2019 | ||
| ### Added | ||
| - Added ARIA import | ||
| - `quadtree` added GeoJSON export | ||
| - Spool: covariance progress bar | ||
| ### Fixed | ||
| - Spool: added absolute degree to cursor position | ||
| - bugfixes LiCSAR import | ||
| ## [1.2.3] 17. July 2019 | ||
| ### Added | ||
| - `Scene` added `__i/add__`, `__i/sub__` and `__neg__` standard operators. | ||
| - Talpa dialog to change LOS vectors (phi and theta) of forward modelled scene. | ||
| ### Fixed | ||
| - MacOS gcc install with OpenMP. | ||
| - `stamps2kite` Backward compat MATLAB import. | ||
| - `covariance`/`quadtree` more defensive against sparsely correlated scenes. | ||
| - LiCSAR import more defensive data handling. | ||
| ## [1.2.2] 26. June 2019 | ||
| ### Added | ||
| - scene displacement pixel variance attribute`displacement_px_var`. | ||
| - quadtree and covariance propagation of `displacement_px_var` towards diagonal. | ||
| - spool to display `displacement_px_var`. | ||
| - More meta information for `stamps2kite`. | ||
| ### Fixed | ||
| - `stamps2kite`: look angle import | ||
| ## [1.2.1] 17. June 2019 | ||
| ### Fixed | ||
| - `stamps2kite` import of look angle is now from interpolation. | ||
| ## [1.2.0] 14. June 2019 | ||
| ### Added | ||
| - `stamps2kite` conversion tool. | ||
| ### Fixed | ||
| - ISCE import: XML tag cases. | ||
| - Version numbering in `setup.py` | ||
| ## [1.1.1] 6. June 2019 | ||
| ### Added | ||
| - Deramping of displacement maps `Scene.displacement_deramp()` | ||
| ### Fixed | ||
| - Spool more digits for degree scenes | ||
| - Fixed log handling and handler injection | ||
| ## [1.1.0] 6. May 2019 | ||
| ### Added | ||
| - Added LiCSAR import | ||
| - Added SARSCAPE import | ||
| - Added LiCSAR downloader (`client.py`) | ||
| - Added CLVDVolume to talpa | ||
| - Added SpinBox for sliders | ||
| ### Fixed | ||
| - talpa various improvements and bugfixes | ||
| - updated documentation | ||
| - fixed import for ROIPAC and ISCE | ||
| - matplotlib plotting functions | ||
| ### Changed | ||
| - Spool: Changes 'LOS' to 'Towards Satellite' | ||
| ## [1.0.1] 21. January 2019 | ||
| ### Added | ||
| - Adapting semating versioning | ||
| - Spool: added log control | ||
| ### Fixed | ||
| - Improved log control | ||
| - Documentation fixes and internal references. | ||
| - Fixed Gamma import from Lat/Lon | ||
| - docs: Removed Anaconda pre-build installation |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
+225
| # Makefile for Sphinx documentation | ||
| # | ||
| # You can set these variables from the command line. | ||
| SPHINXOPTS = | ||
| SPHINXBUILD = sphinx-build | ||
| PAPER = | ||
| BUILDDIR = build | ||
| # Internal variables. | ||
| PAPEROPT_a4 = -D latex_paper_size=a4 | ||
| PAPEROPT_letter = -D latex_paper_size=letter | ||
| ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source | ||
| # the i18n builder cannot share the environment and doctrees with the others | ||
| I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source | ||
| .PHONY: help | ||
| help: | ||
| @echo "Please use \`make <target>' where <target> is one of" | ||
| @echo " html to make standalone HTML files" | ||
| @echo " dirhtml to make HTML files named index.html in directories" | ||
| @echo " singlehtml to make a single large HTML file" | ||
| @echo " pickle to make pickle files" | ||
| @echo " json to make JSON files" | ||
| @echo " htmlhelp to make HTML files and a HTML help project" | ||
| @echo " qthelp to make HTML files and a qthelp project" | ||
| @echo " applehelp to make an Apple Help Book" | ||
| @echo " devhelp to make HTML files and a Devhelp project" | ||
| @echo " epub to make an epub" | ||
| @echo " epub3 to make an epub3" | ||
| @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" | ||
| @echo " latexpdf to make LaTeX files and run them through pdflatex" | ||
| @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx" | ||
| @echo " text to make text files" | ||
| @echo " man to make manual pages" | ||
| @echo " texinfo to make Texinfo files" | ||
| @echo " info to make Texinfo files and run them through makeinfo" | ||
| @echo " gettext to make PO message catalogs" | ||
| @echo " changes to make an overview of all changed/added/deprecated items" | ||
| @echo " xml to make Docutils-native XML files" | ||
| @echo " pseudoxml to make pseudoxml-XML files for display purposes" | ||
| @echo " linkcheck to check all external links for integrity" | ||
| @echo " doctest to run all doctests embedded in the documentation (if enabled)" | ||
| @echo " coverage to run coverage check of the documentation (if enabled)" | ||
| @echo " dummy to check syntax errors of document sources" | ||
| .PHONY: clean | ||
| clean: | ||
| rm -rf $(BUILDDIR)/* | ||
| .PHONY: html | ||
| html: | ||
| $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html | ||
| @echo | ||
| @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." | ||
| .PHONY: dirhtml | ||
| dirhtml: | ||
| $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml | ||
| @echo | ||
| @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." | ||
| .PHONY: singlehtml | ||
| singlehtml: | ||
| $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml | ||
| @echo | ||
| @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." | ||
| .PHONY: pickle | ||
| pickle: | ||
| $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle | ||
| @echo | ||
| @echo "Build finished; now you can process the pickle files." | ||
| .PHONY: json | ||
| json: | ||
| $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json | ||
| @echo | ||
| @echo "Build finished; now you can process the JSON files." | ||
| .PHONY: htmlhelp | ||
| htmlhelp: | ||
| $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp | ||
| @echo | ||
| @echo "Build finished; now you can run HTML Help Workshop with the" \ | ||
| ".hhp project file in $(BUILDDIR)/htmlhelp." | ||
| .PHONY: qthelp | ||
| qthelp: | ||
| $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp | ||
| @echo | ||
| @echo "Build finished; now you can run "qcollectiongenerator" with the" \ | ||
| ".qhcp project file in $(BUILDDIR)/qthelp, like this:" | ||
| @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/Kite.qhcp" | ||
| @echo "To view the help file:" | ||
| @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/Kite.qhc" | ||
| .PHONY: applehelp | ||
| applehelp: | ||
| $(SPHINXBUILD) -b applehelp $(ALLSPHINXOPTS) $(BUILDDIR)/applehelp | ||
| @echo | ||
| @echo "Build finished. The help book is in $(BUILDDIR)/applehelp." | ||
| @echo "N.B. You won't be able to view it unless you put it in" \ | ||
| "~/Library/Documentation/Help or install it in your application" \ | ||
| "bundle." | ||
| .PHONY: devhelp | ||
| devhelp: | ||
| $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp | ||
| @echo | ||
| @echo "Build finished." | ||
| @echo "To view the help file:" | ||
| @echo "# mkdir -p $$HOME/.local/share/devhelp/Kite" | ||
| @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/Kite" | ||
| @echo "# devhelp" | ||
| .PHONY: epub | ||
| epub: | ||
| $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub | ||
| @echo | ||
| @echo "Build finished. The epub file is in $(BUILDDIR)/epub." | ||
| .PHONY: epub3 | ||
| epub3: | ||
| $(SPHINXBUILD) -b epub3 $(ALLSPHINXOPTS) $(BUILDDIR)/epub3 | ||
| @echo | ||
| @echo "Build finished. The epub3 file is in $(BUILDDIR)/epub3." | ||
| .PHONY: latex | ||
| latex: | ||
| $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex | ||
| @echo | ||
| @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." | ||
| @echo "Run \`make' in that directory to run these through (pdf)latex" \ | ||
| "(use \`make latexpdf' here to do that automatically)." | ||
| .PHONY: latexpdf | ||
| latexpdf: | ||
| $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex | ||
| @echo "Running LaTeX files through pdflatex..." | ||
| $(MAKE) -C $(BUILDDIR)/latex all-pdf | ||
| @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." | ||
| .PHONY: latexpdfja | ||
| latexpdfja: | ||
| $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex | ||
| @echo "Running LaTeX files through platex and dvipdfmx..." | ||
| $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja | ||
| @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." | ||
| .PHONY: text | ||
| text: | ||
| $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text | ||
| @echo | ||
| @echo "Build finished. The text files are in $(BUILDDIR)/text." | ||
| .PHONY: man | ||
| man: | ||
| $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man | ||
| @echo | ||
| @echo "Build finished. The manual pages are in $(BUILDDIR)/man." | ||
| .PHONY: texinfo | ||
| texinfo: | ||
| $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo | ||
| @echo | ||
| @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." | ||
| @echo "Run \`make' in that directory to run these through makeinfo" \ | ||
| "(use \`make info' here to do that automatically)." | ||
| .PHONY: info | ||
| info: | ||
| $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo | ||
| @echo "Running Texinfo files through makeinfo..." | ||
| make -C $(BUILDDIR)/texinfo info | ||
| @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." | ||
| .PHONY: gettext | ||
| gettext: | ||
| $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale | ||
| @echo | ||
| @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." | ||
| .PHONY: changes | ||
| changes: | ||
| $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes | ||
| @echo | ||
| @echo "The overview file is in $(BUILDDIR)/changes." | ||
| .PHONY: linkcheck | ||
| linkcheck: | ||
| $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck | ||
| @echo | ||
| @echo "Link check complete; look for any errors in the above output " \ | ||
| "or in $(BUILDDIR)/linkcheck/output.txt." | ||
| .PHONY: doctest | ||
| doctest: | ||
| $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest | ||
| @echo "Testing of doctests in the sources finished, look at the " \ | ||
| "results in $(BUILDDIR)/doctest/output.txt." | ||
| .PHONY: coverage | ||
| coverage: | ||
| $(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage | ||
| @echo "Testing of coverage in the sources finished, look at the " \ | ||
| "results in $(BUILDDIR)/coverage/python.txt." | ||
| .PHONY: xml | ||
| xml: | ||
| $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml | ||
| @echo | ||
| @echo "Build finished. The XML files are in $(BUILDDIR)/xml." | ||
| .PHONY: pseudoxml | ||
| pseudoxml: | ||
| $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml | ||
| @echo | ||
| @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml." | ||
| .PHONY: dummy | ||
| dummy: | ||
| $(SPHINXBUILD) -b dummy $(ALLSPHINXOPTS) $(BUILDDIR)/dummy | ||
| @echo | ||
| @echo "Build finished. Dummy builder generates no files." |
| # -*- coding: utf-8 -*- | ||
| # | ||
| # Kite documentation build configuration file, created by | ||
| # sphinx-quickstart on Thu Oct 6 17:05:40 2016. | ||
| # | ||
| # This file is execfile()d with the current directory set to its | ||
| # containing dir. | ||
| # | ||
| # Note that not all possible configuration values are present in this | ||
| # autogenerated file. | ||
| # | ||
| # All configuration values have a default; values that are commented out | ||
| # serve to show the default. | ||
| # If extensions (or modules to document with autodoc) are in another directory, | ||
| # add these directories to sys.path here. If the directory is relative to the | ||
| # documentation root, use os.path.abspath to make it absolute, like shown here. | ||
| # | ||
| import sphinx_sleekcat_theme | ||
| import kite | ||
| # sys.path.insert(0, os.path.abspath(os.path.join(__file__, '../../'))) | ||
| # -- General configuration ------------------------------------------------ | ||
| # If your documentation needs a minimal Sphinx version, state it here. | ||
| # | ||
| # needs_sphinx = '1.0' | ||
| # Add any Sphinx extension module names here, as strings. They can be | ||
| # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom | ||
| # ones. | ||
| extensions = [ | ||
| "sphinx.ext.autodoc", | ||
| "sphinx.ext.todo", | ||
| "sphinx.ext.mathjax", | ||
| "sphinx.ext.githubpages", | ||
| "sphinx.ext.coverage", | ||
| "sphinx.ext.viewcode", | ||
| "sphinx.ext.intersphinx", | ||
| ] | ||
| intersphinx_mapping = { | ||
| "numpy": ("https://docs.scipy.org/doc/numpy/", None), | ||
| "scipy": ("https://docs.scipy.org/doc/scipy/reference/", None), | ||
| "pyrocko": ("https://pyrocko.org/docs/current/", None), | ||
| } | ||
| # Add any paths that contain templates here, relative to this directory. | ||
| templates_path = ["_templates"] | ||
| # The suffix(es) of source filenames. | ||
| # You can specify multiple suffix as a list of string: | ||
| # | ||
| # source_suffix = ['.rst', '.md'] | ||
| source_suffix = ".rst" | ||
| imgmath_image_format = "svg" | ||
| # The encoding of source files. | ||
| # | ||
| # source_encoding = 'utf-8-sig' | ||
| # The master toctree document. | ||
| master_doc = "index" | ||
| # General information about the project. | ||
| project = "Kite" | ||
| copyright = "2018 The kite developers" | ||
| author = "Marius Isken" | ||
| # The version info for the project you're documenting, acts as replacement for | ||
| # |version| and |release|, also used in various other places throughout the | ||
| # built documents. | ||
| # | ||
| # The short X.Y version. | ||
| version = kite.__version__ | ||
| # The full version, including alpha/beta/rc tags. | ||
| release = kite.__version__ | ||
| # The language for content autogenerated by Sphinx. Refer to documentation | ||
| # for a list of supported languages. | ||
| # | ||
| # This is also used if you do content translation via gettext catalogs. | ||
| # Usually you set "language" from the command line for these cases. | ||
| language = None | ||
| # There are two options for replacing |today|: either, you set today to some | ||
| # non-false value, then it is used: | ||
| # | ||
| # today = '' | ||
| # | ||
| # Else, today_fmt is used as the format for a strftime call. | ||
| # | ||
| # today_fmt = '%B %d, %Y' | ||
| # List of patterns, relative to source directory, that match files and | ||
| # directories to ignore when looking for source files. | ||
| # This patterns also effect to html_static_path and html_extra_path | ||
| exclude_patterns = [] | ||
| # The reST default role (used for this markup: `text`) to use for all | ||
| # documents. | ||
| # | ||
| # default_role = None | ||
| # If true, '()' will be appended to :func: etc. cross-reference text. | ||
| # | ||
| # add_function_parentheses = True | ||
| # If true, the current module name will be prepended to all description | ||
| # unit titles (such as .. function::). | ||
| # | ||
| # add_module_names = True | ||
| # If true, sectionauthor and moduleauthor directives will be shown in the | ||
| # output. They are ignored by default. | ||
| # | ||
| # show_authors = False | ||
| # The name of the Pygments (syntax highlighting) style to use. | ||
| pygments_style = "sphinx" | ||
| # A list of ignored prefixes for module index sorting. | ||
| modindex_common_prefix = ["kite.", "src."] | ||
| # If true, keep warnings as "system message" paragraphs in the built documents. | ||
| # keep_warnings = False | ||
| # If true, `todo` and `todoList` produce output, else they produce nothing. | ||
| todo_include_todos = True | ||
| # -- Options for HTML output ---------------------------------------------- | ||
| html_theme_options = { | ||
| # 'githuburl': 'https://github.com/ionelmc/sphinx-py3doc-enhanced-theme/', | ||
| "bodyfont": '"Roboto Slab",Arial,sans-serif', | ||
| "headfont": '"Lucida Grande",Arial,sans-serif', | ||
| "codefont": "monospace,sans-serif", | ||
| "linkcolor": "#204a87", | ||
| "visitedlinkcolor": "#204a87", | ||
| "nosidebar": True, | ||
| # 'sidebarcollapse': False, | ||
| # 'googlewebfonturl': 'https://fonts.googleapis.com/css?family=Roboto+Slab', | ||
| } | ||
| pygments_style = "friendly" | ||
| # The theme to use for HTML and HTML Help pages. See the documentation for | ||
| # a list of builtin themes. | ||
| # | ||
| html_theme = "sphinx_sleekcat_theme" | ||
| # Theme options are theme-specific and customize the look and feel of a theme | ||
| # further. For a list of options available for each theme, see the | ||
| # documentation. | ||
| # | ||
| # html_theme_options = {} | ||
| # Add any paths that contain custom themes here, relative to this directory. | ||
| html_theme_path = [sphinx_sleekcat_theme.get_html_theme_path()] | ||
| # The name for this set of Sphinx documents. | ||
| # "<project> v<release> documentation" by default. | ||
| # | ||
| html_title = "%s v%s Manual" % (project, release) | ||
| # A shorter title for the navigation bar. Default is the same as html_title. | ||
| # | ||
| # html_short_title = None | ||
| # The name of an image file (relative to this directory) to place at the top | ||
| # of the sidebar. | ||
| # | ||
| # html_logo = None | ||
| # The name of an image file (relative to this directory) to use as a favicon of | ||
| # the docs. This file should be a Windows icon file (.ico) being 16x16 or | ||
| # 32x32 pixels large. | ||
| # | ||
| # html_favicon = None | ||
| # Add any paths that contain custom static files (such as style sheets) here, | ||
| # relative to this directory. They are copied after the builtin static files, | ||
| # so a file named "default.css" will overwrite the builtin "default.css". | ||
| html_static_path = ["_static"] | ||
| # Add any extra paths that contain custom files (such as robots.txt or | ||
| # .htaccess) here, relative to this directory. These files are copied | ||
| # directly to the root of the documentation. | ||
| # | ||
| # html_extra_path = [] | ||
| # If not None, a 'Last updated on:' timestamp is inserted at every page | ||
| # bottom, using the given strftime format. | ||
| # The empty string is equivalent to '%b %d, %Y'. | ||
| # | ||
| # html_last_updated_fmt = None | ||
| # If true, SmartyPants will be used to convert quotes and dashes to | ||
| # typographically correct entities. | ||
| # | ||
| # html_use_smartypants = True | ||
| # Custom sidebar templates, maps document names to template names. | ||
| # | ||
| # html_sidebars = {} | ||
| # Additional templates that should be rendered to pages, maps page names to | ||
| # template names. | ||
| # | ||
| # html_additional_pages = {} | ||
| # If false, no module index is generated. | ||
| # | ||
| # html_domain_indices = True | ||
| # If false, no index is generated. | ||
| # | ||
| # html_use_index = True | ||
| # If true, the index is split into individual pages for each letter. | ||
| # | ||
| # html_split_index = False | ||
| # If true, links to the reST sources are added to the pages. | ||
| # | ||
| # html_show_sourcelink = True | ||
| # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. | ||
| # | ||
| html_show_sphinx = False | ||
| # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. | ||
| # | ||
| # html_show_copyright = True | ||
| # If true, an OpenSearch description file will be output, and all pages will | ||
| # contain a <link> tag referring to it. The value of this option must be the | ||
| # base URL from which the finished HTML is served. | ||
| # | ||
| # html_use_opensearch = '' | ||
| # This is the file name suffix for HTML files (e.g. ".xhtml"). | ||
| # html_file_suffix = None | ||
| # Language to be used for generating the HTML full-text search index. | ||
| # Sphinx supports the following languages: | ||
| # 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja' | ||
| # 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr', 'zh' | ||
| # | ||
| # html_search_language = 'en' | ||
| # A dictionary with options for the search language support, empty by default. | ||
| # 'ja' uses this config value. | ||
| # 'zh' user can custom change `jieba` dictionary path. | ||
| # | ||
| # html_search_options = {'type': 'default'} | ||
| # The name of a javascript file (relative to the configuration directory) that | ||
| # implements a search results scorer. If empty, the default will be used. | ||
| # | ||
| # html_search_scorer = 'scorer.js' | ||
| # Output file base name for HTML help builder. | ||
| htmlhelp_basename = "Kite-doc" | ||
| # -- Options for LaTeX output --------------------------------------------- | ||
| latex_elements = { | ||
| # The paper size ('letterpaper' or 'a4paper'). | ||
| # | ||
| # 'papersize': 'letterpaper', | ||
| # The font size ('10pt', '11pt' or '12pt'). | ||
| # | ||
| # 'pointsize': '10pt', | ||
| # Additional stuff for the LaTeX preamble. | ||
| # | ||
| # 'preamble': '', | ||
| # Latex figure (float) alignment | ||
| # | ||
| # 'figure_align': 'htbp', | ||
| } | ||
| # Grouping the document tree into LaTeX files. List of tuples | ||
| # (source start file, target name, title, | ||
| # author, documentclass [howto, manual, or own class]). | ||
| latex_documents = [ | ||
| ( | ||
| master_doc, | ||
| "Kite.tex", | ||
| "Kite Documentation", | ||
| "The Pyrocko Development Team.", | ||
| "manual", | ||
| ), | ||
| ] | ||
| # The name of an image file (relative to this directory) to place at the top of | ||
| # the title page. | ||
| # | ||
| # latex_logo = None | ||
| # For "manual" documents, if this is true, then toplevel headings are parts, | ||
| # not chapters. | ||
| # | ||
| # latex_use_parts = False | ||
| # If true, show page references after internal links. | ||
| # | ||
| # latex_show_pagerefs = False | ||
| # If true, show URL addresses after external links. | ||
| # | ||
| # latex_show_urls = False | ||
| # Documents to append as an appendix to all manuals. | ||
| # | ||
| # latex_appendices = [] | ||
| # It false, will not define \strong, \code, itleref, \crossref ... but only | ||
| # \sphinxstrong, ..., \sphinxtitleref, ... To help avoid clash with user added | ||
| # packages. | ||
| # | ||
| # latex_keep_old_macro_names = True | ||
| # If false, no module index is generated. | ||
| # | ||
| # latex_domain_indices = True | ||
| # -- Options for manual page output --------------------------------------- | ||
| # One entry per manual page. List of tuples | ||
| # (source start file, name, description, authors, manual section). | ||
| man_pages = [(master_doc, "kite", "Kite Documentation", [author], 1)] | ||
| # If true, show URL addresses after external links. | ||
| # | ||
| # man_show_urls = False | ||
| # -- Options for Texinfo output ------------------------------------------- | ||
| # Grouping the document tree into Texinfo files. List of tuples | ||
| # (source start file, target name, title, author, | ||
| # dir menu entry, description, category) | ||
| texinfo_documents = [ | ||
| ( | ||
| master_doc, | ||
| "Kite", | ||
| "Kite Documentation", | ||
| author, | ||
| "Kite", | ||
| "InSAR displacement processing towards " "earthquake parametrization.", | ||
| "Science,Geology,Earthquake", | ||
| ), | ||
| ] | ||
| # Documents to append as an appendix to all manuals. | ||
| # | ||
| # texinfo_appendices = [] | ||
| # If false, no module index is generated. | ||
| # | ||
| # texinfo_domain_indices = True | ||
| # How to display URL addresses: 'footnote', 'no', or 'inline'. | ||
| # | ||
| # texinfo_show_urls = 'footnote' | ||
| # If true, do not generate a @detailmenu in the "Top" node's menu. | ||
| # | ||
| # texinfo_no_detailmenu = False | ||
| def process_signature(app, what, name, obj, options, signature, return_annotation): | ||
| from pyrocko import guts | ||
| if what == "attribute" and isinstance(obj, guts.TBase): | ||
| return "", str(obj) | ||
| if what == "class" and issubclass(obj, guts.Object): | ||
| if obj.dummy_for is not None: | ||
| return ("(dummy)", "%s" % obj.dummy_for.__name__) | ||
| return |
| Contributing | ||
| ============ | ||
| See the GitHub Project page and follow pyrocko's style guide. |
| Covariance calculation | ||
| ====================== | ||
| This is a brief document describing where we learn how to access how we can calculate and use the covariance and weight properties of the quadtree. More, detailed information how ``kite`` calculates the covariance matrix can be found at the module docmentation :mod:`kite.Covariance`. | ||
| Accessing the covariance | ||
| ------------------------ | ||
| In this example we will access the covariance attributes of a pre-configured scene. | ||
| .. literalinclude :: /examples/scripts/covariance-calculation.py | ||
| :language: python | ||
| Inspection and configuration of the covariance | ||
| ---------------------------------------------- | ||
| The covariance can be manipulated through ``spool``. More information here :ref:`spool-covariance`. | ||
| Manual covariance configuration | ||
| ------------------------------- | ||
| The covariance can be manipulated by editing the ``.yml`` file. Or by changing the covariance parameters during runtime: | ||
| .. code-block:: python | ||
| scene.covariance.a = 1.412e-4 | ||
| scene.covariance.b = 1.2521 | ||
| # Will show the updated covariance | ||
| plt.imshow(scene.covariance.covariance_focal) | ||
| # calculate the covariance matrix and save the scene | ||
| scene.covariance | ||
| scene.save('filename.yml') |
| Examples and Tutorials | ||
| ====================== | ||
| Here we go into details how to inspect unwrapped InSAR scenes, configure the spatial quadtree subsampling and compute the data covariance matrix. | ||
| Instructions for importing and loading displacement data, can be found in the :doc:`../quickstart`. | ||
| .. toctree:: | ||
| quadtree | ||
| covariance | ||
| sandbox |
| Quadtree | ||
| ======== | ||
| The :class:`~kite.Quadtree` reduces the amount of displacement data by sub-sampling the InSAR displacement map. For efficient forward modelling it is important to have reasonably sized dataset. | ||
| .. figure :: ../../_images/quadtree-myanmar-quadtree.gif | ||
| :width: 100% | ||
| Figure 1: Quadtree data reduction of an InSAR displacement scene. (Left) the origin full resolution ALSO displacement map, (right) the adaptive quadtree reduction. | ||
| The quadtree is made from hierarchically organized :class:`~kite.quadtree.QuadNode`, a slice through of the tree's nodes is then called :attr:`~kite.Quadtree.leaves`. | ||
| Parameters defining the quadtree are: | ||
| * :attr:`~kite.Quadtree.epsilon` threshold controlling the leaves' split, this is the displacement variance within a leave. | ||
| * :attr:`~kite.Quadtree.nan_allowed` is the fraction of allowed NaN values before a leaf is dismissed. | ||
| * :attr:`~kite.Quadtree.tile_size_max` and :attr:`~kite.Quadtree.tile_size_min` define the maximum and minimum dimension of the tile in meter or degree | ||
| Kite realises the quadtree concept from Jónsson et al. (2002) [#f1]_. | ||
| .. note :: All nodes of the :class:`~kite.Quadtree` are built upon initialisation an instance. | ||
| Interactive quadtree parametrisation | ||
| ------------------------------------ | ||
| The graphical user interface (GUI) ``spool`` offers an interactive parametrisation of the quadtree. Start the program, click on tab :guilabel:`&Quadtree`. Detailed instruction can be found in :doc:`spool's tutorial </tools/spool>`. | ||
| .. code-block :: sh | ||
| :caption: Start spool and open a QuadTree container. | ||
| spool insar_displacement_scene.npz | ||
| Scripted quadtree parametrisation | ||
| --------------------------------- | ||
| The quadtree can also be parametrised by a python script. This example modifies the quadtree and saves the scene. | ||
| .. tip :: | ||
| It is recommended to use the spool GUI for parametrisation of the quadtree and covariance. | ||
| .. code-block :: python | ||
| :caption: Scripted parametrisation of the quadtree. | ||
| import logging | ||
| from kite import Scene | ||
| logging.basicConfig(level=logging.DEBUG) | ||
| sc = Scene.import_data('test/data/20110214_20110401_ml4_sm.unw.geo_ig_dsc_ionnocorr.mat') | ||
| # For convenience we set an abbreviation to the quadtree | ||
| qt = sc.quadtree | ||
| # Parametrisation of the quadtree | ||
| qt.epsilon = 0.024 # Variance threshold | ||
| qt.nan_allowed = 0.9 # Percentage of NaN values allowed per tile/leave | ||
| # Be careful here, if you scene is referenced in degree use decimal values! | ||
| qt.tile_size_max = 12000 # Maximum leave edge length in [m] or [deg] | ||
| qt.tile_size_min = 250 # Minimum leave edge length in [m] or [deg] | ||
| print(qt.reduction_rms) # In units of [m] or [deg] | ||
| # >>> 0.234123152 | ||
| for l in qt.leaves: | ||
| print l | ||
| # We save the scene in kite's format | ||
| sc.save('kite_scene') | ||
| # Or export the quadtree to CSV file | ||
| qt.export('/tmp/tree.csv') | ||
| Plotting the quadtree with matplotlib | ||
| ------------------------------------- | ||
| We can also use Matplotlib to plot the Quadtree's current leaves. | ||
| .. code-block :: python | ||
| :caption: Plotting the quadtree with Matplotlib. | ||
| import numpy as num | ||
| import matplotlib.pyplot as plt | ||
| from matplotlib import cm, colors | ||
| from kite import Scene | ||
| sc = Scene.load('my_scene.yml') | ||
| qt = sc.quadtree | ||
| fig = plt.figure() | ||
| ax = fig.gca() | ||
| limit = num.abs(qt.leaf_medians).max() | ||
| color_map = cm.ScalarMappable( | ||
| norm=colors.Normalize(vmin=-limit, vmax=limit), | ||
| cmap=cm.get_cmap('RdBu')) | ||
| for rect, leaf in zip(qt.getMPLRectangles(), qt.leaves): | ||
| color = color_map.to_rgba(leaf.median) | ||
| rect.set_facecolor(color) | ||
| ax.add_artist(rect) | ||
| ax.set_xlim(qt.leaf_eastings.min(), qt.leaf_eastings.max()) | ||
| ax.set_ylim(qt.leaf_northings.min(), qt.leaf_northings.max()) | ||
| plt.show() | ||
| .. rubric:: Footnotes | ||
| .. [#f1] Jónsson, Sigurjón, Howard Zebker, Paul Segall, and Falk Amelung. 2002. “Fault Slip Distribution of the 1999 Mw 7.1 Hector Mine, California, Earthquake, Estimated from Satellite Radar and GPS Measurements.” Bulletin of the Seismological Society of America 92 (4): 1377–89. doi:10.1785/0120000922. |
| Modelling static displacement | ||
| ============================== | ||
| Kite comes with a :class:`~kite.SandboxScene`, which is a playground for static displacement sources of different kinds and modelling engines. It support analytical backends such as Okada ``disloc``-code [#f1]_ and Compound dislocation model ([#f2]_; http://www.volcanoedeformation.com/). Numerical forward modelling is enabled through :mod:`pyrocko.gf`, this allows us to put geometrically more complex sources into the modelling sandbox. | ||
| Currently implemented static displacement sources: | ||
| * :class:`~kite.sources.OkadaSource` | ||
| Several Pyrocko Sources: | ||
| * :class:`~kite.sources.PyrockoRectangularSource` | ||
| * :class:`~kite.sources.PyrockoMomentTensor` | ||
| * :class:`~kite.sources.PyrockoDoubleCouple` | ||
| * :class:`~kite.sources.PyrockoRingfaultSource` | ||
| Analytical dilatational point through CDM ([#f2]_) sources: | ||
| * :class:`~kite.sources.EllipsoidSource` | ||
| * :class:`~kite.sources.PointCompoundSource` | ||
| More information about the sources and their implementation can be found at the modules reference: :mod:`kite.sources`. | ||
| .. [#f1] Okada, Y., 1992, Internal deformation due to shear and tensile faults in a half-space, Bull. Seism. Soc. Am., 82, 1018-1040. | ||
| .. [#f2] Nikkhoo, M., Walter, T. R., Lundgren, P. R., Prats-Iraola, P. (2017): Compound dislocation models (CDMs) for volcano deformation analyses. - Geophysical Journal International, 208, 2, p. 877-894. | ||
| Add Displacement Sources into :class:`SandboxScene` | ||
| --------------------------------------------------- | ||
| In this example we will add a simple :class:`~kite.sources.OkadaSource` into a :class:`~kite.SandboxScene`. | ||
| .. literalinclude :: /examples/scripts/sandboxscene-add_source.py | ||
| :language: python | ||
| A full list of available sources and their parameters can be found at the modules' reference page :mod:`kite.sources`. | ||
| Save and Load :class:`pyrocko.SandboxScene` | ||
| -------------------------------------------- | ||
| In this small example we will add a basic :class:`~kite.sources.EllipsoidSource` to the sandbox. Subsequently we will save it and load it again. | ||
| .. literalinclude :: /examples/scripts/sandboxscene-save_load.py | ||
| :language: python | ||
| Graphical Manipulation of Displacement Sources | ||
| ----------------------------------------------- | ||
| The graphical user interface :ref:`talpa` offers tools to handle and interact with the different kinds of displacement sources. |
| import matplotlib.pyplot as plt | ||
| from kite import Scene | ||
| # Assume we have a existing kite.Scene with defined quadtree parametrized | ||
| scene = Scene.load("acquila_2016.yml") | ||
| ax = plt.gca() | ||
| # Inspect the noise data which is used to calculate the covariance | ||
| ax.imshow(scene.covariance.noise_data) | ||
| plt.show() | ||
| # Inspect the focal-point (quick mode) covariance matrix | ||
| ax.imshow(scene.covariance.covariance_matrix_focal) | ||
| # Inspect the full covariance matrix | ||
| ax.imshow(scene.covariance.covariance_matrix) | ||
| # Get the full weight matrix | ||
| ax.imshow(scene.covariance.weight_matrix) | ||
| # Get the covariance and weight between two leafes | ||
| leaf_1 = scene.quadtree.leaves[0] | ||
| leaf_2 = scene.quadtree.leaves[0] | ||
| scene.covariance.getLeafCovariance(leaf_1, leaf_2) | ||
| scene.covariance.getLeafWeight(leaf_1, leaf_2) |
| sc.covariance.config.a | ||
| sc.covariance.config.b | ||
| sc.covariance.weight_matrix_focal | ||
| sc.covariance.save |
| import matplotlib.animation as animation | ||
| import matplotlib.pyplot as plt | ||
| import numpy as num | ||
| from kite import SandboxScene | ||
| from kite.sources import OkadaSource | ||
| km = 1e3 | ||
| sandbox = SandboxScene() | ||
| nframes = 20 | ||
| depths = num.linspace(4 * km, 4 * km, nframes) | ||
| strikes = num.linspace(0, 180, nframes) | ||
| okada = OkadaSource( | ||
| northing=40 * km, | ||
| easting=40 * km, | ||
| depth=4 * km, | ||
| length=8 * km, | ||
| width=4 * km, | ||
| strike=63.0, | ||
| rake=0, | ||
| dip=0.0, | ||
| slip=3.0, | ||
| opening=0, | ||
| ) | ||
| sandbox.addSource(okada) | ||
| sandbox.processSources() | ||
| fig, axis = plt.subplots(nrows=2, ncols=2) | ||
| # Plot the resulting surface displacements | ||
| def imargs(data): | ||
| max_value = max(num.abs(data.max()), num.abs(data.min())) | ||
| return { | ||
| "X": data, | ||
| "cmap": "bwr", | ||
| "vmin": -max_value, | ||
| "vmax": max_value, | ||
| "animated": True, | ||
| } | ||
| components = [sandbox.north, sandbox.east, sandbox.down, sandbox.displacement] | ||
| titles = ["North", "East", "Down", "LOS"] | ||
| images = [] | ||
| for ax, comp, title in zip(fig.axes, components, titles): | ||
| im = ax.imshow(**imargs(comp)) | ||
| images.append(im) | ||
| ax.set_title(title) | ||
| def update_figure(iframe, *args): | ||
| print("Updating figure! (frame %03d)" % iframe) | ||
| okada.depth = depths[iframe] | ||
| okada.strike = strikes[iframe] | ||
| sandbox.processSources() | ||
| for im, comp in zip(images, components): | ||
| args = imargs(comp) | ||
| im.set_data(comp) | ||
| return images | ||
| ani = animation.FuncAnimation( | ||
| fig, update_figure, interval=50, frames=nframes, blit=True | ||
| ) | ||
| fig.show() |
| import matplotlib.pyplot as plt | ||
| import numpy as num | ||
| from kite import SandboxScene | ||
| from kite.sources import OkadaSource, PyrockoRectangularSource | ||
| km = 1e3 | ||
| sandbox = SandboxScene() | ||
| # Set the LOS incident angles, remember :class:`kite.Scene` | ||
| sandbox.phi.fill(num.rad2deg(100.0)) | ||
| sandbox.theta.fill(num.rad2deg(23.0)) | ||
| okada = OkadaSource( | ||
| northing=40 * km, | ||
| easting=40 * km, | ||
| depth=4 * km, | ||
| length=8 * km, | ||
| width=4 * km, | ||
| strike=63.0, | ||
| dip=33.0, | ||
| slip=3.0, | ||
| opening=1, | ||
| ) | ||
| pyrocko_rectangular = PyrockoRectangularSource( | ||
| northing=40 * km, | ||
| easting=40 * km, | ||
| depth=4 * km, | ||
| length=8 * km, | ||
| width=4 * km, | ||
| strike=63.0, | ||
| dip=33.0, | ||
| slip=3.0, | ||
| store_dir="gfstore_halfspace", | ||
| ) | ||
| sandbox.addSource(okada) | ||
| sandbox.processSources() | ||
| # Plot the resulting surface displacements | ||
| fig, axis = plt.subplots(nrows=2, ncols=2) | ||
| axis[0][0].imshow(sandbox.north) | ||
| axis[0][1].imshow(sandbox.east) | ||
| axis[1][0].imshow(sandbox.down) | ||
| axis[1][1].imshow(sandbox.displacement) # Displacement in LOS | ||
| fig.show() |
| from kite import SandboxScene | ||
| from kite.sources import EllipsoidSource | ||
| km = 1e3 | ||
| sandbox = SandboxScene() | ||
| ellipsoid_source = EllipsoidSource( | ||
| northing=40 * km, | ||
| easting=40 * km, | ||
| depth=4 * km, | ||
| length_x=100, | ||
| length_y=200, | ||
| length_z=350, | ||
| roation_x=42.0, | ||
| ) | ||
| sandbox.addSource(ellipsoid_source) | ||
| sandbox.save("/tmp/sandbox_scene.yml") | ||
| playground = SandboxScene.load("/tmp/sandbox_scene.yml") |
| Kite Manual | ||
| =========== | ||
| Kite is an open source toolbox for processing and analysing InSAR surface displacement maps. | ||
| Features | ||
| -------- | ||
| .. raw:: html | ||
| <div class="keywords"> | ||
| <span>InSAR displacement analysis</span> | ||
| <span>displacement processing</span> | ||
| <span>quadtree calculation and parametrisation</span> | ||
| <span>InSAR noise analysis</span> | ||
| <span>covariance calculation</span> | ||
| <span>error estimation</span> | ||
| </div> | ||
| Overview | ||
| -------- | ||
| .. toctree:: | ||
| :maxdepth: 2 | ||
| installation | ||
| quickstart | ||
| examples/index | ||
| tools/index | ||
| reference/index | ||
| contributing | ||
| Indices and tables | ||
| ------------------ | ||
| * :ref:`genindex` | ||
| * :ref:`modindex` | ||
| * :ref:`search` |
| Installation | ||
| ============ | ||
| Kite is written for `Python 3 <https://python.org>`_, the installation has been tested on Debian based distributions (e.g. Ubuntu and Mint), MacOSX, and `Anaconda <https://anaconda.org/pyrocko/kite>`_. | ||
| Debian / Ubuntu | ||
| --------------- | ||
| As a mandatory prerequisite you have to install Pyrocko, visit `Pyrocko installation instructions <https://pyrocko.org/docs/current/install/index.html>`_ for details. | ||
| .. code-block :: sh | ||
| :caption: Installation from source and ``apt-get`` | ||
| sudo apt-get install python3-dev python3-pyqt5 python3-pyqt5 python3-pyqt5.qtopengl python3-scipy python3-numpy python3-pyqtgraph | ||
| git clone https://github.com/Turbo87/utm | ||
| cd utm | ||
| sudo python3 setup.py install | ||
| git clone https://github.com/pyrocko/kite | ||
| cd kite | ||
| sudo python3 setup.py install | ||
| PIP | ||
| --- | ||
| An installation through ``pip`` requires the same prerequisites as above: | ||
| .. code-block :: sh | ||
| :caption: Installation through pip | ||
| sudo pip3 install utm | ||
| sudo pip3 install git+https://github.com/pyrocko/kite | ||
| MacOS (Sierra, MacPorts) | ||
| ------------------------ | ||
| Installing Pyrocko is a prerequisite, visit `Pyrocko Mac installation instructions <http://pyrocko.org/docs/current/install_mac.html>`_ for details. | ||
| Kite installation instructions with `MacPorts <https://www.macports.org/>`_, alternatively check out the Anaconda3 instructions: | ||
| .. code-block :: sh | ||
| :caption: Installation from source through MacPorts | ||
| sudo port install git | ||
| sudo port install python35 | ||
| sudo port select python python35 | ||
| sudo port install py35-numpy | ||
| sudo port install py35-scipy | ||
| sudo port install py35-matplotlib | ||
| sudo port install py35-yaml | ||
| sudo port install py35-pyqt5 | ||
| sudo port install py35-setuptools | ||
| sudo pip3 install git+https://github.com/Turbo87/utm | ||
| sudo pip3 install git+https://github.com/pyqtgraph/pyqtgraph | ||
| git clone https://github.com/pyrocko/kite | ||
| cd kite | ||
| python3 setup.py install --user --install-scripts=/usr/local/bin | ||
| Anaconda3 using ``pip`` | ||
| -------------------------- | ||
| Use ``pip`` on Anaconda to install the software: | ||
| .. code-block:: sh | ||
| :caption: Install the prerequisites through ``conda`` | ||
| pip install git+https://github.com/Turbo87/utm | ||
| pip install git+https://github.com/pyrocko/kite |
| Quickstart | ||
| ========== | ||
| Kite supports importing unwrapped displacement scenes from different InSAR processors: | ||
| * `GMT5SAR <https://gmt.soest.hawaii.edu/projects/gmt5sar>`_ | ||
| * `GAMMA Software <http://www.gamma-rs.ch/no_cache/software.html>`_ | ||
| * `ROI_PAC <http://www.geo.cornell.edu/eas/PeoplePlaces/Faculty/matt/roi_pac.html/>`_ | ||
| * `ISCE <https://winsar.unavco.org/software/isce>`_ | ||
| * `SARscape <http://www.sarmap.ch/page.php?page=sarscape>`_ | ||
| * `LiCSAR <https://comet.nerc.ac.uk/COMET-LiCS-portal/>`_ | ||
| * `ARIA <https://aria.jpl.nasa.gov/products>`_ | ||
| * `SNAP <https://step.esa.int/main/toolboxes/snap/>`_ | ||
| Each processor delivers different file formats and metadata. In order to import the data into Kite, data has to be prepared. Details for each format are described in :mod:`kite.scene_io`. | ||
| Importing data to ``spool`` | ||
| --------------------------- | ||
| When you have processed your InSAR data and aligned with the expected import conversions (:mod:`kite.scene_io`), you can use spool to import the data: | ||
| .. code-block :: sh | ||
| :caption: Importing and visualising unwrapped InSAR data with ``spool``. | ||
| spool --load data/my_scene-asc.grd | ||
| Inspecting a scene with ``spool`` | ||
| --------------------------------- | ||
| You can use start :doc:`../tools/spool` to inspect the scene and manipulate it's properties. | ||
| .. code-block :: python | ||
| :caption: Kite's GUI ``spool`` is based on `Qt5 <https://www.qt.io/>`_. Here we will import data, straight from a GMT5SAR scene. | ||
| from kite import Scene | ||
| sc = Scene.import_file('unwrap_ll.grd') | ||
| # Start the GUI | ||
| sc.spool() | ||
| .. code-block :: sh | ||
| :caption: Alternatively ``spool`` can be started from command line. | ||
| # Start spool and import a displacement scene data | ||
| spool --load unwrap_ll.grd | ||
| # Or load from Kite format | ||
| spool my_scene.yml | ||
| .. figure :: ../_images/spool-scene.png | ||
| :width: 90% | ||
| :align: center | ||
| **Figure 1**: Manipulating unwrapped InSAR surface displacement data in Spool, Kite's GUI. | ||
| Scripted data import | ||
| -------------------- | ||
| We will start with importing a scene from GMT5SAR using a Python script: | ||
| .. code-block :: python | ||
| :caption: GMT5SAR is an open-source processor based on GMT. We will import a binary ``.grd`` file. | ||
| from kite import Scene | ||
| # We import a unwrapped interferogram scene. | ||
| # The format shall be detected automatically | ||
| # in this case processed a GMTSAR5 | ||
| sc = Scene.import_data('unwrap_ll.grd') | ||
| # Open spool | ||
| sc.spool() | ||
| Scripted scene setup | ||
| -------------------- | ||
| Initialisation of a custom scene through a Python script. Here we will import arbitrary data and define the geographical reference frame manually. | ||
| .. code-block :: python | ||
| :caption: Setting up scene from 2D displacement data. | ||
| from kite import Scene | ||
| sc = Scene() | ||
| sc.displacement = num.empty((2048, 2048)) | ||
| # Dummy line-of-sight vectors in radians | ||
| # Theta is the elevation angle towards satellite from horizon in radians. | ||
| sc.theta = num.full((2048, 2048), fill=num.pi/2) | ||
| # Phi, the horizontal angle towards satellite in radians, counter-clockwise from East. | ||
| sc.phi = num.full((2048, 2048), fill=num.pi/4) | ||
| # Reference the scene's frame lower left corner, always in geographical coordinates | ||
| sc.frame.llLat = 38.2095 | ||
| sc.frame.llLon = 19.1256 | ||
| # The pixel spacing can be either 'meter' or 'degree' | ||
| sc.frame.spacing = 'degree' | ||
| sc.frame.dN = .00005 # Latitudal pixel spacing | ||
| sc.frame.dE = .00012 # Longitudal pixel spacing | ||
| # Saving the scene | ||
| sc.save('my_scene') | ||
| Saving the scene and quadtree/covariance | ||
| ---------------------------------------- | ||
| The native file structure of ``Kite`` is based on NumPy binary files together with `YAML <https://en.wikipedia.org/wiki/YAML>`_ configuration files, holding all meta information and configurable parameters, such as: | ||
| * :class:`~kite.Quadtree`, | ||
| * :class:`~kite.Covariance`, | ||
| * and :class:`~kite.scene.Meta`. | ||
| This structure also holds the :attr:`kite.Covariance.covariance_matrix`, which requires a computational intensive task! | ||
| This code snippet shows how to import data from a foreign file format and saving it to kite's native format. | ||
| .. code-block :: python | ||
| :caption: Importing data and saving it in Kite format. | ||
| from kite import Scene | ||
| # The .grd is interpreted as an GMT5SAR scene | ||
| sc = Scene.import_data('unwrap_ll.grd') | ||
| # Writes out the scene in kite's native format | ||
| sc.save('kite_scene') | ||
| .. code-block :: sh | ||
| :caption: Kite's file structure consists of only two files: | ||
| kite_scene.npz | ||
| kite_scene.yml | ||
| Download and import data from ARIA (NASA) | ||
| ----------------------------------------- | ||
| The `ARIA <https://aria.jpl.nasa.gov/>`_ web service provides unwrapped Sentinel-1 data covering selected regions. The data can be explore on the `website <https://aria-products.jpl.nasa.gov/>`_. For this example we use ``wget`` to download the ascending and descending ARIA GUNW data products from ARIA from the `2019 Ridgecrest Earthquakes <https://en.wikipedia.org/wiki/2019_Ridgecrest_earthquakes>`_. | ||
| .. code-block :: sh | ||
| # Ascending | ||
| wget https://aria-products.jpl.nasa.gov/search/dataset/grq_v2.0.2_s1-gunw-released/S1-GUNW-A-R-064-tops-20190710_20180703-015013-36885N_35006N-PP-9955-v2_0_2/S1-GUNW-A-R-064-tops-20190710_20180703-015013-36885N_35006N-PP-9955-v2_0_2.nc | ||
| # Descending | ||
| wget https://aria-products.jpl.nasa.gov/search/dataset/grq_v2.0.2_s1-gunw-released/S1-GUNW-D-R-071-tops-20190728_20190622-135213-36450N_34472N-PP-b4b2-v2_0_2/S1-GUNW-D-R-071-tops-20190728_20190622-135213-36450N_34472N-PP-b4b2-v2_0_2.nc | ||
| Now use the Python package `ARIA-tools <https://github.com/aria-tools/ARIA-tools>`_ to extract three channels (``unwrappedPhase, incidenceAngle, azimuthAngle``) from the ARIA data product: | ||
| .. code-block :: sh | ||
| :caption: We use two workdirs: ``ascending`` and ``descending``. | ||
| # Extract into ascending/ | ||
| ariaExtract.py -w ascending -f S1-GUNW-A-R-064-tops-20190710_20180703-015013-36885N_35006N-PP-9955-v2_0_2.nc -d download -l unwrappedPhase,incidenceAngle,azimuthAngle | ||
| # Extract into descending/ | ||
| ariaExtract.py -w descending -f S1-GUNW-D-R-071-tops-20190728_20190622-135213-36450N_34472N-PP-b4b2-v2_0_2.nc -d download -l unwrappedPhase,incidenceAngle,azimuthAngle | ||
| For more information see ``ariaExtract.py --help`` and the `ARIA-tools documentation <https://github.com/aria-tools/ARIA-tools>`_. | ||
| Import ARIA GUNW data into Kite | ||
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
| To import the data into spool use a regular ``load``: | ||
| .. code-block :: sh | ||
| spool --load ascending | ||
| .. note :: | ||
| ARIA scenes are provided at a high resolution and calculation of the covariance matrix can take a long time! | ||
| Download and import data from COMET LiCSAR | ||
| ------------------------------------------ | ||
| A slim client for downloading `COMET LiCSAR <https://comet.nerc.ac.uk/COMET-LiCS-portal/>`_ products is included in :mod:`kite.clients`. The script will download the passed unwrapped LiCSAR data and necessary LOS GeoTIFFs into the current directory. | ||
| This example will download data from the 2017 Iran–Iraq earthquake (M 7.3) from the `COMET LiCSAR Portal <https://comet.nerc.ac.uk/COMET-LiCS-portal/>`_: | ||
| .. code-block :: sh | ||
| :caption: Download data from COMET LiCSAR Portal. | ||
| 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 . | ||
| Now just load the scene into Kite or spool. | ||
| .. code-block :: sh | ||
| :caption: Importing the scene in spool. | ||
| spool --load 20171107_20171201.geo.unw.tif | ||
| Converting StaMPS velocities to a Kite scene | ||
| -------------------------------------------- | ||
| The CLI tool :file:`stamps2kite` loads PS velocities from a `StaMPS <https://homepages.see.leeds.ac.uk/~earahoo/stamps/>`_ project (i.e. processed mean velocity data through ``ps_plot(..., -1);``), and grids the data into mean velocity bins. The LOS velocities will be converted into a Kite scene. | ||
| StaMPS' data has to be fully processed through and may stem from the master | ||
| project or from one of the processed small baseline pairs. The required files are: | ||
| - :file:`ps2.mat` Meta information and geographical coordinates. | ||
| - :file:`parms.mat` Meta information about the scene (heading, etc.). | ||
| - :file:`ps_plot*.mat` Processed and corrected LOS velocities. | ||
| - :file:`mv2.mat` Mean velocity's standard deviation. | ||
| - :file:`look_angle.1.in` Look angles for the scene. | ||
| - :file:`width.txt` Width dimensions of the interferogram and | ||
| - :file:`len.txt` length. | ||
| .. code-block :: sh | ||
| :caption: Importing StaMPS mean velocities into a gridded Kite scene. | ||
| stamps2kite stamps_project/ --resolution 800 800 --save my_kite_scene | ||
| For more information on the util, see the ``--help``. |
| Module reference | ||
| ================ | ||
| The framework's API documentation can be found here. | ||
| .. toctree:: | ||
| :maxdepth: 2 | ||
| kite.scene | ||
| kite.quadtree | ||
| kite.covariance | ||
| kite.spool | ||
| kite.sandboxscene | ||
| kite.sources |
| ``Covariance`` Module | ||
| ===================== | ||
| .. autoclass:: kite.Covariance | ||
| :members: | ||
| CovarianceConfig | ||
| -------------------- | ||
| .. autoclass:: kite.covariance.CovarianceConfig | ||
| :members: | ||
| Model assumptions | ||
| ----------------- | ||
| .. autofunction:: kite.covariance.modelCovarianceExponential | ||
| .. autofunction:: kite.covariance.modelCovarianceExponentialCosine | ||
| .. autofunction:: kite.covariance.modelPowerspec |
| ``Quadtree`` Module | ||
| =================== | ||
| The quadtree reduces the amount of displacement information contained in a full resolution displacement scene by adaptively subsampling in areas of complex signal (a visual example can be found here :doc:`../tools/spool`. The complexity of the signal is defined through the standard deviation within a tile (or :class:`~kite.quadtree.QuadNode`) of the data. The quadtree parameters define thresholds when a :class:`~kite.quadtree.QuadNode` is split. The four essential threshold controlling the tree are: | ||
| * epsilon/std threshold (:attr:`~kite.Quadtree.epsilon`) | ||
| * Fraction of NaN values within (:attr:`~kite.Quadtree.nan_allowed`) | ||
| * Maximum and minimum dimension of the tile | ||
| (:attr:`~kite.Quadtree.tile_size_max` and :attr:`~kite.Quadtree.tile_size_min`) | ||
| Programming example of the quadtree can be found here :doc:`../examples/quadtree` and here :doc:`../tools/spool`. | ||
| .. autoclass:: | ||
| kite.Quadtree | ||
| :members: | ||
| QuadtreeConfig | ||
| ------------------ | ||
| The ``QuadtreeConfig`` holds the necessary configuration to reconstruct and save an instance. | ||
| .. autoclass:: kite.quadtree.QuadtreeConfig | ||
| QuadNode Object | ||
| ------------------ | ||
| .. autoclass:: kite.quadtree.QuadNode | ||
| :members: |
| ``SandboxScene`` Module | ||
| ======================= | ||
| .. autoclass:: kite.sandbox_scene.SandboxSceneConfig | ||
| :members: | ||
| .. autoclass:: kite.SandboxScene | ||
| :show-inheritance: | ||
| :members: |
| ``Scene`` Module | ||
| ================ | ||
| .. autoclass:: kite.Scene | ||
| :show-inheritance: | ||
| :members: | ||
| .. autoclass:: kite.scene.BaseScene | ||
| :members: | ||
| Scene I/O Modules | ||
| --------------------- | ||
| .. automodule:: kite.scene_io | ||
| :members: | ||
| ``SceneConfig`` | ||
| ---------------------- | ||
| .. autoclass:: kite.scene.SceneConfig | ||
| Meta Information Container | ||
| ------------------------------ | ||
| A ``Scene`` holds several configuration objects: | ||
| .. autoclass:: kite.scene.Meta | ||
| ``Frame`` | ||
| --------- | ||
| .. autoclass:: kite.scene.Frame | ||
| :members: | ||
| ``FrameConfig`` | ||
| +++++++++++++++ | ||
| .. autoclass:: kite.scene.FrameConfig | ||
| ``LOSUnitVectors`` | ||
| ------------------ | ||
| .. autoclass:: kite.scene.LOSUnitVectors | ||
| :members: |
| List of Sandbox Sources | ||
| ======================== | ||
| .. note :: | ||
| * Easting and Northing is in meter. | ||
| * Strike is degree from North. | ||
| * Dip is degree from horizontal. | ||
| * Rake is clockwise from left-lateral strike-slip, | ||
| hence 180 degree is right-lateral strike-slip. | ||
| The Okada Model | ||
| --------------------------- | ||
| Surface displacement from Okada [#f1]_ sources are calculated using a wrapped and parallelized (OpenMP) ``disloc`` code. | ||
| .. [#f1] Okada, Y., 1992, Internal deformation due to shear and tensile faults in a half-space, Bull. Seism. Soc. Am., 82, 1018-1040. | ||
| .. autoclass:: | ||
| kite.sources.OkadaSource | ||
| :members: | ||
| :inherited-members: | ||
| :show-inheritance: | ||
| Pyrocko Source Models | ||
| --------------------- | ||
| Pyrocko source models are calculated from pre-calculated Green's function databases using :mod:`pyrocko.gf`. For more information see https://pyrocko.org/docs/current/apps/fomosto/. | ||
| .. autoclass:: | ||
| kite.sources.PyrockoSource | ||
| :members: | ||
| :inherited-members: | ||
| :show-inheritance: | ||
| .. autoclass:: | ||
| kite.sources.PyrockoRectangularSource | ||
| :members: | ||
| :inherited-members: | ||
| :show-inheritance: | ||
| .. autoclass:: | ||
| kite.sources.PyrockoMomentTensor | ||
| :members: | ||
| :inherited-members: | ||
| :show-inheritance: | ||
| .. autoclass:: | ||
| kite.sources.PyrockoDoubleCouple | ||
| :members: | ||
| :inherited-members: | ||
| :show-inheritance: | ||
| .. autoclass:: | ||
| kite.sources.PyrockoRingfaultSource | ||
| :members: | ||
| :inherited-members: | ||
| :show-inheritance: | ||
| Compound Dislocation Models | ||
| ---------------------------- | ||
| Compound dislocation models developed by Mehdi Nikkhoo [#f2]_. Are implemented in Python. | ||
| More information on the routines and sources at http://www.volcanodeformation.com. | ||
| .. [#f2] Nikkhoo, M., Walter, T. R., Lundgren, P. R., Prats-Iraola, P. (2017): Compound dislocation models (CDMs) for volcano deformation analyses. - Geophysical Journal International, 208, 2, p. 877-894. | ||
| .. autoclass:: | ||
| kite.sources.EllipsoidSource | ||
| :members: | ||
| :inherited-members: | ||
| :show-inheritance: | ||
| .. autoclass:: | ||
| kite.sources.PointCompoundSource | ||
| :members: | ||
| :inherited-members: | ||
| :show-inheritance: | ||
| Objects Bases | ||
| ------------- | ||
| .. autoclass:: | ||
| kite.sources.base.SandboxSource | ||
| :members: | ||
| :inherited-members: | ||
| .. autoclass:: | ||
| kite.sources.base.SandboxSourceRectangular | ||
| :members: | ||
| :inherited-members: | ||
| :show-inheritance: |
| ``Spool`` Module | ||
| ================= | ||
| The ``spool`` user interface is written in ``Qt4`` (using ``pyside``), the plots are generated through ``pyqtgraph`` (http://www.pyqtgraph.org). | ||
| .. automodule:: kite.spool | ||
| :members: | ||
| :undoc-members: |
| GUI Tools | ||
| ========= | ||
| Kite comes with two graphical user interfaces: | ||
| 1. ``spool`` to handle InSAR displacement scenes :mod:`kite.scene.Scene` and | ||
| 2. ``talpa`` for interactive modelling of various displacement sources. | ||
| .. toctree:: | ||
| spool | ||
| talpa |
| InSAR Scene Inspection with ``Spool`` | ||
| ===================================== | ||
| InSAR displacement scenes are complex visual datasets, the ``Spool`` user interface offers interactive and intuitive analysis and **parametrization** of all aspects of the container | ||
| * :doc:`../reference/kite.scene`, | ||
| * :doc:`../reference/kite.quadtree` | ||
| * and :doc:`../reference/kite.covariance` | ||
| .. note :: Naming conventions in the GUI represent the :class:`kite.Scene` syntax! | ||
| A usage scenario for the scenario could look like this - start the GUI: | ||
| .. code-block :: sh | ||
| spool --load test/data/20110214_20110401_ml4_sm.unw.geo_ig_dsc_ionnocorr.mat | ||
| .. note :: | ||
| The dataset is part of the `GitHub repository <https://github.com/pyrocko/kite>`_. | ||
| Parametrization of the :class:`~kite.Quadtree` and :class:`~kite.Covariance` through the interface is shown in the latter paragraphs of this page. | ||
| From :command:`spool` we can save the scene and it's quadtree and covariance parametrization through :menuselection:`File --> &Save Scene`. Let's save the scene as :file:`/tmp/myanmar_2011.[npz,yml]`. | ||
| Now we can utilize ``kite``\'s python framework to work with the subsampled quadtree and errors/weights. | ||
| .. code-block :: python | ||
| from kite import Scene | ||
| sc = Scene.load('/tmp/myanmar_2011.yml') | ||
| # Get the total leaf weight | ||
| leaf_weights = [] | ||
| for l in sc.quadtree.leafs: | ||
| leaf_weights.append((l.id, l.weight)) | ||
| # sc.covariance.getWeight(l) == l.weight | ||
| # True | ||
| # Get the covariance | ||
| cross_weights = [] | ||
| for l1 in sc.quadtree.leafs: | ||
| for l2 in sc.quadtree.leafs: | ||
| w = sc.covariance.getLeafCovariance(l1, l2) | ||
| cross_weights.append((l1.id, l2.id, w)) | ||
| LOS Displacement inspection | ||
| ---------------------------- | ||
| The first tab offers simple data inspection of plain parameters. From the side menu we can choose displacement, :abbr:`Line of Sight (LOS)` incident angles and unit their georeferenced unit vectors. :guilabel:`display` offers the components ``displacement, phi, theta, thetaDeg, degPhi, unitE, unitN, unitU``. | ||
| .. figure:: ../../_images/spool-scene.png | ||
| :alt: InSAR unwrapped displacement scene from Myanmar 2011 earthquake event | ||
| An unwrapped InSAR displacement scene from a 2011 Myanmar strike-slip event (Sudhaus and Gomba, 2016 [#f1]_). Red color shows displacement away from the satellite, blue displacement towards LOS. | ||
| .. _spool-quadtree: | ||
| Quadtree manipulation | ||
| ---------------------- | ||
| The :class:`~kite.Quadtree` subsamples the InSAR displacement in order to have a reduced and thus more manageable dataset for modelling. | ||
| The four parameters characterizing the quadtree can be controlled through the gui (see also :doc:`../examples/quadtree`) | ||
| * epsilon/std threshold (:attr:`~kite.Quadtree.epsilon`) | ||
| * Fraction of NaN values within (:attr:`~kite.Quadtree.nan_allowed`) | ||
| * Maximum and minimum dimension of the tile | ||
| (:attr:`~kite.Quadtree.tile_size_max` and :attr:`~kite.Quadtree.tile_size_min`) | ||
| .. figure:: ../../_images/spool-quadtree_mean.png | ||
| :alt: Quadtree parametrization and properties | ||
| Interactive quadtree parametrization through the :command:`spool` GUI. Shown here is the mean displacement of the leafs (:attr:`kite.quadtree.QuadNode.mean`). | ||
| To get a feel for the covariance and error estimation we can have a look at the absolute weights of the leafs (see :attr:`kite.quadtree.QuadNode.weight` or :func:`kite.Covariance.getLeafWeight`). | ||
| .. figure:: ../../_images/spool-quadtree_weight.png | ||
| :alt: Quadtree nodes with associated errors/weights derived from kite.Covariance | ||
| Absolute weight of each :class:`~kite.quadtree.QuadNode` derived from :class:`~kite.Covariance`. Yellow is low weight, blue are higher weighted leafs. | ||
| .. _spool-covariance: | ||
| Covariance parametrisation | ||
| ---------------------------- | ||
| The covariance of the InSAR scene is a measure for the noise which affects our deformation signal. In order to generate a reasonable geodynamic model we need to quantify the contribution of noise to our signal. A common model for the noise contributionin satellite interferometry is: | ||
| .. math :: | ||
| d_{total} = d_{signal} + [d_{atmosphere} + d_{topography} + d_{err_baseline} + d_{other}] | ||
| .. figure:: ../../_images/spool-covariance.png | ||
| :alt: Covariance parametrization through spool GUI | ||
| Covariance parametrization through the GUI. The center panels shows the noise selector (green), the 2D plots illustrate (from top) :attr:`~kite.Covariance.covariance_func`, :attr:`~kite.Covariance.structure_func` and the :func:`~kite.Covariance.noiseSpectrum`. | ||
| .. figure:: ../../_images/spool-covariance_noise.png | ||
| :width: 50% | ||
| :align: center | ||
| :alt: Noise patch used for covariance/error analysis | ||
| **Right click** on the noise spectrum or :menuselection:`Tools --> Covariance &Noise Data` brings up the noise inspection window showing :attr:`~kite.Covariance.noise_data`. Before the Fouriere transformation the data is deramped in 2D as well as demeaned. | ||
| .. rubric:: References | ||
| .. [#f1] Sudhaus, Henriette and Gomba, Giorgio (2016) Influences of ionospheric disturbances in L-band InSAR data on earthquake source modelling. Living Planet Symposium 2016, 9-13 May 2016, Prague, Czech Republic. |
| .. _talpa: | ||
| Static Displacement Modelling with ``Talpa`` | ||
| ============================================ | ||
| The tool ``talpa`` (`Talpidae; the mole`) enables interactive modelling of static displacement sources. | ||
| It acts as a front end for :mod:`kite.SandboxScene`, a modelling sandbox for InSAR scenes. | ||
| Examples for a programmatic interaction with the sandbox can be found :doc:`/examples/sandbox`. | ||
| Available Static Displacement Sources | ||
| ------------------------------------- | ||
| The :mod:`~kite.SandboxScene` can hosts different types of displacement source by levering different processing engines, analytical and numerical. The different types of dispalcement source can be mixed within a single sandbox | ||
| 1. Okada Source | ||
| ~~~~~~~~~~~~~~~~ | ||
| A basic analytical displacement source is :class:`~kite.sources.OkadaSource`. We will use an Okada source in examples below, however the other's sources handling is similar. | ||
| 2. Pyrocko Sources | ||
| ~~~~~~~~~~~~~~~~~~ | ||
| We leverage different sources from Pyrocko. These sources need a pre-build Green's function store, which enable layered half-space models. (see https://pyrocko.org/current/apps/fomosto/index.html) | ||
| Implemented source types - Point sources and extended. | ||
| * :class:`~kite.sources.PyrockoRectangularSource` | ||
| * :class:`~kite.sources.PyrockoMomentTensor` | ||
| * :class:`~kite.sources.PyrockoDoubleCouple` | ||
| * :class:`~kite.sources.PyrockoRingfaultSource` | ||
| 3. Compound Dislocation Sources | ||
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
| Analytical dilatation point sources extending Mogi sources are implemented in ``kite``: | ||
| * :class:`~kite.sources.EllipsoidSource` | ||
| * :class:`~kite.sources.PointCompoundSource` | ||
| for more information see http://www.volcanodeformation.com and [#f1]_. | ||
| .. [#f1] Nikkhoo, M., Walter, T. R., Lundgren, P. R., Prats-Iraola, P. (2017): Compound dislocation models (CDMs) for volcano deformation analyses. - Geophysical Journal International, 208, 2, p. 877-894. | ||
| Adding Sources | ||
| --------------------------- | ||
| A selection of different displacement sources can be added to the modelling sandbox by right clicking on the source list. | ||
| .. figure:: ../../_images/talpa-src_add.png | ||
| :class: gif | ||
| :width: 80% | ||
| :align: center | ||
| Adding a source to the :class:`kite.SandboxScene` using the GUI. | ||
| Manipulating Sources | ||
| ---------------------------------- | ||
| The spatial parameters of the the sandbox's source can be interacted with by click-and-drag. Advanced parameters, in this case dip, rake and slip are accesses through the editing dialog. | ||
| .. figure:: ../../_images/talpa-src_mod.gif | ||
| :width: 80% | ||
| :align: center | ||
| Interactive manipulation of a :class:`~kite.sources.OkadaSource` within the sandbox. | ||
| Parametrisation through the source's editing dialog (:menuselection:`<right-click> --> Edit`). | ||
| .. figure:: ../../_images/talpa-src_dialog.png | ||
| :align: center | ||
| Source parameter dialog for an :class:`~kite.sources.OkadaSource`. | ||
| Saving and Loading a Sandbox | ||
| ---------------------------- | ||
| The scene can be saved and loaded through the :menuselection:`File` menu. |
| #!/bin/bash | ||
| set -e | ||
| VERSION=v`python3 -c "import kite; print(kite.__version__);"` | ||
| if [ ! -f maintenance/deploy-docs.sh ] ; then | ||
| echo "must be run from pyrocko's toplevel directory" | ||
| exit 1 | ||
| fi | ||
| cd docs | ||
| rm -rf build/$VERSION | ||
| make clean; make html $1 | ||
| cp -r build/html build/$VERSION | ||
| read -r -p "Are your sure to update live docs at http://pyrocko.org/kite/docs/$VERSION [y/N]?" resp | ||
| case $resp in | ||
| [yY][eE][sS]|[yY] ) | ||
| rsync -av build/$VERSION pyrocko@hive:/var/www/pyrocko.org/kite/docs/; | ||
| ;; | ||
| * ) ;; | ||
| esac | ||
| read -r -p "Do you want to link 'current' to the just uploaded version $VERSION [y/N]?" resp | ||
| case $resp in | ||
| [yY][eE][sS]|[yY] ) | ||
| echo "Linking /kite/docs/$VERSION to /kite/docs/current"; | ||
| ssh pyrocko@hive "rm -rf /var/www/pyrocko.org/kite/docs/current; ln -s /var/www/pyrocko.org/kite/docs/$VERSION /var/www/pyrocko.org/kite/docs/current"; | ||
| ;; | ||
| * ) ;; | ||
| esac | ||
| cd .. |
| from . import common # noqa |
+122
| import logging | ||
| import os | ||
| import re | ||
| import time | ||
| import requests | ||
| from requests.compat import urljoin | ||
| op = os.path | ||
| data_uri = "http://data.pyrocko.org/testing/kite/" | ||
| data_dir = op.join(op.dirname(op.abspath(__file__)), "data/") | ||
| logger = logging.getLogger("kite.testing") | ||
| class DownloadError(Exception): | ||
| pass | ||
| def _makedir(path): | ||
| try: | ||
| os.makedirs(path) | ||
| except OSError: | ||
| pass | ||
| def get_test_data(fn): | ||
| def _dir_content(url): | ||
| r = requests.get(url) | ||
| r.raise_for_status() | ||
| entries = re.findall(r'href="([a-zA-Z0-9_.-]+/?)"', r.text) | ||
| files = sorted(set(fn for fn in entries if not fn.endswith("/"))) | ||
| return files | ||
| def _file_size(url): | ||
| r = requests.head(url, headers={"Accept-Encoding": "identity"}) | ||
| r.raise_for_status() | ||
| return int(r.headers["content-length"]) | ||
| def _download_file(url, fn_local): | ||
| if op.exists(fn_local): | ||
| if os.stat(fn_local).st_size == _file_size(url): | ||
| logger.info("Using cached file %s" % fn_local) | ||
| return fn_local | ||
| logger.info("Downloading %s..." % url) | ||
| fsize = _file_size(url) | ||
| r = requests.get(url, stream=True) | ||
| r.raise_for_status() | ||
| dl_bytes = 0 | ||
| with open(fn_local, "wb") as f: | ||
| for d in r.iter_content(chunk_size=1024): | ||
| dl_bytes += len(d) | ||
| f.write(d) | ||
| if dl_bytes != fsize: | ||
| raise DownloadError("Download incomplete!") | ||
| logger.info("Download completed.") | ||
| return fn_local | ||
| url = urljoin(data_uri, fn) | ||
| dl_dir = data_dir | ||
| _makedir(dl_dir) | ||
| if fn.endswith("/"): | ||
| dl_dir = op.join(data_dir, fn) | ||
| _makedir(dl_dir) | ||
| dl_files = _dir_content(url) | ||
| dl_files = zip( | ||
| [urljoin(url, u) for u in dl_files], [op.join(dl_dir, f) for f in dl_files] | ||
| ) | ||
| else: | ||
| dl_files = (url, op.join(data_dir, fn)) | ||
| return _download_file(*dl_files) | ||
| return [_download_file(*f) for f in dl_files] | ||
| class Benchmark(object): | ||
| def __init__(self, prefix=None): | ||
| self.prefix = prefix or "" | ||
| self.results = [] | ||
| def __call__(self, func): | ||
| def stopwatch(*args): | ||
| t0 = time.time() | ||
| name = self.prefix + func.__name__ | ||
| result = func(*args) | ||
| elapsed = time.time() - t0 | ||
| self.results.append((name, elapsed)) | ||
| return result | ||
| return stopwatch | ||
| def __str__(self): | ||
| rstr = ["Benchmark results"] | ||
| if self.prefix != "": | ||
| rstr[-1] += " - %s" % self.prefix | ||
| if len(self.results) > 0: | ||
| indent = max([len(name) for name, _ in self.results]) | ||
| else: | ||
| indent = 0 | ||
| rstr.append("=" * (indent + 17)) | ||
| rstr.insert(0, rstr[-1]) | ||
| for res in self.results: | ||
| rstr.append("{0:<{indent}}{1:.8f} s".format(*res, indent=indent + 5)) | ||
| if len(self.results) == 0: | ||
| rstr.append("None ran!") | ||
| return "\n".join(rstr) | ||
| def setLogLevel(level): | ||
| level = getattr(logging, level, "DEBUG") | ||
| logging.basicConfig(level=level) |
Sorry, the diff of this file is too big to display
| Metadata-Version: 2.1 | ||
| Name: kite | ||
| Version: 1.5.2 | ||
| Version: 1.5.3 | ||
| Summary: InSAR unwrapped surface displacement processing for earthquake modelling. | ||
@@ -24,3 +24,3 @@ Author-email: Marius Paul Isken <mi@gfz-potsdam.de>, Henriette Sudhaus <hsudhaus@ifg.uni-kiel.de> | ||
| Description-Content-Type: text/markdown | ||
| Provides-Extra: formating | ||
| Provides-Extra: formatting | ||
| Provides-Extra: gdal | ||
@@ -27,0 +27,0 @@ License-File: LICENSE.md |
| numpy>=1.22.0 | ||
| scipy>=1.8.0 | ||
| PyQt5>=5.15.7 | ||
| pyqtgraph>=0.12.4 | ||
| pyqtgraph==0.12.4 | ||
| pyrocko>=2022.06.10 | ||
@@ -9,3 +9,3 @@ utm>=0.7.0 | ||
| [formating] | ||
| [formatting] | ||
| flake8 | ||
@@ -12,0 +12,0 @@ black |
@@ -0,1 +1,6 @@ | ||
| .coveralls.yml | ||
| .gitignore | ||
| .pre-commit-config.yaml | ||
| .travis.yml | ||
| CHANGELOG.md | ||
| LICENSE.md | ||
@@ -5,2 +10,39 @@ README.md | ||
| setup.py | ||
| .github/workflows/build-wheels.yaml | ||
| .github/workflows/lint.yaml | ||
| docs/Makefile | ||
| docs/_images/quadtree-myanmar-quadtree.gif | ||
| docs/_images/spool-covariance.png | ||
| docs/_images/spool-covariance_noise.png | ||
| docs/_images/spool-quadtree_mean.png | ||
| docs/_images/spool-quadtree_weight.png | ||
| docs/_images/spool-scene.png | ||
| docs/_images/talpa-src_add.gif | ||
| docs/_images/talpa-src_add.png | ||
| docs/_images/talpa-src_dialog.png | ||
| docs/_images/talpa-src_mod.gif | ||
| docs/source/conf.py | ||
| docs/source/contributing.rst | ||
| docs/source/index.rst | ||
| docs/source/installation.rst | ||
| docs/source/quickstart.rst | ||
| docs/source/examples/covariance.rst | ||
| docs/source/examples/index.rst | ||
| docs/source/examples/quadtree.rst | ||
| docs/source/examples/sandbox.rst | ||
| docs/source/examples/scripts/covariance-calculation.py | ||
| docs/source/examples/scripts/covariance-manual.py | ||
| docs/source/examples/scripts/sandbox-animation.py | ||
| docs/source/examples/scripts/sandboxscene-add_source.py | ||
| docs/source/examples/scripts/sandboxscene-save_load.py | ||
| docs/source/reference/index.rst | ||
| docs/source/reference/kite.covariance.rst | ||
| docs/source/reference/kite.quadtree.rst | ||
| docs/source/reference/kite.sandboxscene.rst | ||
| docs/source/reference/kite.scene.rst | ||
| docs/source/reference/kite.sources.rst | ||
| docs/source/reference/kite.spool.rst | ||
| docs/source/tools/index.rst | ||
| docs/source/tools/spool.rst | ||
| docs/source/tools/talpa.rst | ||
| kite/__init__.py | ||
@@ -89,2 +131,6 @@ kite/aps.py | ||
| kite/util/stamps2kite.py | ||
| maintenance/deploy-docs.sh | ||
| test/__init__.py | ||
| test/common.py | ||
| test/covariance_ref.npy | ||
| test/test_covariance.py | ||
@@ -91,0 +137,0 @@ test/test_deramp.py |
+2
-2
| #!/usr/bin/env python3 | ||
| import pkg_resources | ||
| from .scene import Scene, TestScene, read # noqa | ||
| from .covariance import Covariance # noqa | ||
| from .quadtree import Quadtree # noqa | ||
| from .covariance import Covariance # noqa | ||
| from .sandbox_scene import SandboxScene, TestSandboxScene # noqa | ||
| from .scene import Scene, TestScene, read # noqa | ||
| __version__ = pkg_resources.get_distribution("kite").version |
+2
-3
| import numpy as num | ||
| from pyrocko.guts import Tuple | ||
| from scipy import stats | ||
| from pyrocko.guts import Tuple | ||
| from .plugin import Plugin, PluginConfig | ||
| from .plugin import PluginConfig, Plugin | ||
| class APSConfig(PluginConfig): | ||
@@ -10,0 +9,0 @@ patch_coords = Tuple.T(optional=True) |
+1
-0
| import logging | ||
| import os | ||
| import re | ||
| import requests | ||
@@ -5,0 +6,0 @@ |
+12
-14
| #!/usr/bin/python | ||
| # -*- coding: utf-8 -*- | ||
| from hashlib import sha1 | ||
| import numpy as num | ||
| import scipy as sp | ||
| from hashlib import sha1 | ||
@@ -11,15 +12,12 @@ try: | ||
| from scipy import fft | ||
| import time | ||
| from kite import covariance_ext | ||
| from pyrocko import guts | ||
| from pyrocko.guts_array import Array | ||
| from kite.util import ( | ||
| Subject, | ||
| property_cached, # noqa | ||
| trimMatrix, | ||
| derampMatrix, | ||
| squareMatrix, | ||
| ) | ||
| from kite import covariance_ext | ||
| from kite.util import property_cached # noqa | ||
| from kite.util import Subject, derampMatrix, squareMatrix, trimMatrix | ||
| __all__ = ["Covariance", "CovarianceConfig"] | ||
@@ -594,3 +592,3 @@ | ||
| if not pos_def: | ||
| self._log.warning("Covariance matrix is not positiv definite!") | ||
| self._log.warning("Covariance matrix is not positive definite!") | ||
| return pos_def | ||
@@ -657,3 +655,3 @@ | ||
| (:attr:`noise_data`) (:func:`powerspecNoise`) to create synthetic | ||
| noise, e.g. to use it for data pertubation in optinmizations. | ||
| noise, e.g. to use it for data perturbation in optinmizations. | ||
| The default sampling distances are taken from | ||
@@ -716,8 +714,8 @@ :attr:`kite.scene.Frame.dE` and :attr:`kite.scene.Frame.dN`. They can | ||
| kN = num.fft.fftshift(kN) | ||
| mkE = num.logical_and(kE >= skE.min(), kE <= skE.max()) | ||
| make = num.logical_and(kE >= skE.min(), kE <= skE.max()) | ||
| mkN = num.logical_and(kN >= skN.min(), kN <= skN.max()) | ||
| mkRad = num.where( # noqa | ||
| k_rad < num.sqrt(kN[mkN].max() ** 2 + kE[mkE].max() ** 2) | ||
| k_rad < num.sqrt(kN[mkN].max() ** 2 + kE[make].max() ** 2) | ||
| ) | ||
| res = interp_pspec(kN[mkN, num.newaxis], kE[num.newaxis, mkE], grid=True) | ||
| res = interp_pspec(kN[mkN, num.newaxis], kE[num.newaxis, make], grid=True) | ||
| amp = res | ||
@@ -724,0 +722,0 @@ amp = num.fft.fftshift(amp) |
+2
-2
| import numpy as num | ||
| from pyrocko.guts import Bool | ||
| from .plugin import PluginConfig, Plugin | ||
| from .plugin import Plugin, PluginConfig | ||
@@ -46,3 +46,3 @@ | ||
| def apply(self, displacement): | ||
| """Fit a plane onto the displacement data and substract it | ||
| """Fit a plane onto the displacement data and subtract it | ||
@@ -49,0 +49,0 @@ :param demean: Demean the displacement |
+4
-3
| import logging | ||
| import os.path as op | ||
| import re | ||
| import os.path as op | ||
| import shutil | ||
| import numpy as num | ||
| from datetime import datetime, timedelta | ||
| import numpy as num | ||
| from pyrocko.guts import Bool, List | ||
| from .plugin import PluginConfig, Plugin | ||
| from .plugin import Plugin, PluginConfig | ||
| def load_params(filename): | ||
@@ -13,0 +14,0 @@ rc = re.compile(r"([\w]*)\s*([\w.+-]*)") |
+1
-1
@@ -1,2 +0,1 @@ | ||
| import numpy as num | ||
| import logging | ||
@@ -6,2 +5,3 @@ import time | ||
| import matplotlib.pyplot as plt | ||
| import numpy as num | ||
| from matplotlib.image import AxesImage | ||
@@ -8,0 +8,0 @@ |
+2
-1
| from hashlib import sha1 | ||
| from pyrocko.guts import Object, Bool | ||
| from pyrocko.guts import Bool, Object | ||
| class PluginConfig(Object): | ||
@@ -6,0 +7,0 @@ |
+3
-4
@@ -0,10 +1,9 @@ | ||
| import logging | ||
| import os | ||
| import logging | ||
| from os import path as op | ||
| from PyQt5 import QtGui, QtCore, uic, QtWidgets | ||
| import pyqtgraph.parametertree.parameterTypes as pTypes | ||
| from PyQt5 import QtCore, QtGui, QtWidgets, uic | ||
| from pyqtgraph.parametertree.parameterTypes import WidgetParameterItem | ||
| import pyqtgraph.parametertree.parameterTypes as pTypes | ||
| SCRIPT_DIRECTORY = op.dirname(op.abspath(__file__)) | ||
@@ -11,0 +10,0 @@ |
+9
-8
@@ -1,8 +0,9 @@ | ||
| import numpy as num | ||
| import time | ||
| from hashlib import sha1 | ||
| import numpy as num | ||
| from pyrocko import guts | ||
| from pyrocko import orthodrome as od | ||
| from .util import Subject, property_cached, derampMatrix | ||
| from .util import Subject, derampMatrix, property_cached | ||
@@ -306,3 +307,3 @@ | ||
| :yields: Leafs fullfilling the tree's parameters. | ||
| :yields: Leafs fulfilling the tree's parameters. | ||
| :type: :class:`~kite.quadtree.QuadNode` | ||
@@ -395,3 +396,3 @@ """ | ||
| efficiently reduces data point density in regions with small displacement | ||
| variations. The product is a managable dataset size with good | ||
| variations. The product is a manageable dataset size with good | ||
| representation of the original data. | ||
@@ -402,4 +403,4 @@ | ||
| * ``mean``: Mean is substracted | ||
| * ``median``: Median is substracted | ||
| * ``mean``: Mean is subtracted | ||
| * ``median``: Median is subtracted | ||
| * ``bilinear``: A 2D detrend is applied to the node | ||
@@ -501,4 +502,4 @@ * ``std``: Pure standard deviation without correction | ||
| * ``mean``: Mean is substracted | ||
| * ``median``: Median is substracted | ||
| * ``mean``: Mean is subtracted | ||
| * ``median``: Median is subtracted | ||
| * ``bilinear``: A 2D detrend is applied to the node | ||
@@ -505,0 +506,0 @@ * ``std``: Pure standard deviation without correction |
@@ -1,15 +0,14 @@ | ||
| import numpy as num | ||
| import time | ||
| from os import path as op | ||
| from pyrocko.guts import Object, List, Int, String | ||
| import numpy as num | ||
| from pyrocko import guts | ||
| from pyrocko.guts import Int, List, Object, String | ||
| from kite.util import Subject, property_cached | ||
| from kite.scene import BaseScene, FrameConfig | ||
| # Import the modeling backends | ||
| from kite.sources import DislocProcessor, PyrockoProcessor, CompoundModelProcessor | ||
| from kite.sources import CompoundModelProcessor, DislocProcessor, PyrockoProcessor | ||
| from kite.util import Subject, property_cached | ||
| __processors__ = [DislocProcessor, PyrockoProcessor, CompoundModelProcessor] | ||
@@ -16,0 +15,0 @@ km = 1e3 |
+5
-5
@@ -1,10 +0,10 @@ | ||
| import re | ||
| import glob | ||
| import os | ||
| import re | ||
| import time | ||
| from datetime import datetime | ||
| import numpy as num | ||
| import scipy.io | ||
| import utm | ||
| import scipy.io | ||
| import numpy as num | ||
@@ -677,3 +677,3 @@ from kite import util | ||
| """ | ||
| Reading geocoded, unwraped displacement maps | ||
| Reading geocoded, unwrapped displacement maps | ||
| processed with ISCE software (https://winsar.unavco.org/isce.html). | ||
@@ -988,3 +988,3 @@ | ||
| if not op.exists(alos_file): | ||
| self._log.warning("Could not find ALOS file! (%s)" % alos_file) | ||
| self._log.warning("Could not find ALSO file! (%s)" % alos_file) | ||
| alos_file = False | ||
@@ -991,0 +991,0 @@ return ilos_file, alos_file |
| import matplotlib.pyplot as plt | ||
| import numpy as num | ||
| from matplotlib.path import Path | ||
| import numpy as num | ||
| from pyrocko.guts import Bool, Dict | ||
| from pyrocko.guts import Dict, Bool | ||
| from .plugin import Plugin, PluginConfig | ||
| from .plugin import PluginConfig, Plugin | ||
| class PolygonMaskConfig(PluginConfig): | ||
@@ -11,0 +10,0 @@ polygons = Dict.T(optional=True, default={}) |
| #!/bin/python | ||
| import numpy as num | ||
| from pyrocko.guts import Float, Int, Object | ||
| from scipy import ndimage | ||
| from pyrocko.guts import Object, Float, Int | ||
| from kite.meta import ADict, Subject | ||
| from kite.meta import Subject, ADict | ||
| class SceneProcess(Object): | ||
@@ -11,0 +10,0 @@ def __init__(self, scene, *args, **kwargs): |
| from datetime import datetime | ||
| from .scene import BaseScene, Scene | ||
| import numpy as num | ||
| from .scene import BaseScene, Scene | ||
| def dtime(timestamp): | ||
@@ -7,0 +9,0 @@ return datetime.fromtimestamp(timestamp) |
+11
-14
| #!/usr/bin/env python3 | ||
| import copy | ||
| import hashlib | ||
| import logging | ||
| import numpy as num | ||
| import utm | ||
| import os.path as op | ||
| import copy | ||
| import hashlib | ||
| import time | ||
| from datetime import datetime as dt | ||
| from scipy import interpolate | ||
| from pyrocko.guts import Object, Float, StringChoice, String, Timestamp, Dict, load | ||
| import numpy as num | ||
| import utm | ||
| from pyrocko.dataset.topo import srtmgl3 | ||
| from pyrocko.guts import Dict, Float, Object, String, StringChoice, Timestamp, load | ||
| from pyrocko.orthodrome import latlon_to_ne, latlon_to_ne_numpy, ne_to_latlon # noqa | ||
| from scipy import interpolate | ||
| from kite.quadtree import QuadtreeConfig | ||
| from kite import scene_io | ||
| from kite.aps import APS, APSConfig | ||
| from kite.covariance import CovarianceConfig | ||
| from kite.aps import APSConfig, APS | ||
| from kite.deramp import Deramp, DerampConfig | ||
| from kite.gacos import GACOSConfig, GACOSCorrection | ||
| from kite.deramp import Deramp, DerampConfig | ||
| from kite.quadtree import QuadtreeConfig | ||
| from kite.scene_mask import PolygonMask, PolygonMaskConfig | ||
| from kite.util import Subject, property_cached | ||
| from kite import scene_io | ||
| from kite.scene_mask import PolygonMask, PolygonMaskConfig | ||
| def read(filename): | ||
@@ -30,0 +27,0 @@ try: |
@@ -0,4 +1,4 @@ | ||
| from .compound_sources import * # noqa | ||
| from .okada import * # noqa | ||
| from .pyrocko_gf import * # noqa | ||
| from .compound_sources import * # noqa | ||
@@ -5,0 +5,0 @@ __sources__ = [ |
| import numpy as num | ||
| from pyrocko import orthodrome as od | ||
| from pyrocko.guts import Float, Object | ||
| from kite.util import Subject | ||
| from pyrocko import orthodrome as od | ||
| from pyrocko.guts import Object, Float | ||
@@ -7,0 +7,0 @@ d2r = num.pi / 180.0 |
@@ -1,5 +0,6 @@ | ||
| import numpy as num | ||
| import logging | ||
| import time | ||
| import numpy as num | ||
| """Ellispoidal Cavity Model (ECM), triaxial elipsoidal deformation source. | ||
@@ -66,3 +67,3 @@ | ||
| def pointCDM(coords, x0, y0, z0, rotx, roty, rotz, dVx, dVy, dVz, nu): | ||
| """Point Compund Dislocation Model for surface displacements | ||
| """Point Compound Dislocation Model for surface displacements | ||
@@ -449,3 +450,3 @@ :param coords: Coordinates upon displacement is calculated | ||
| """calculates surface displacements associated with a tensile | ||
| point dislocation (PTD) in an elastic half-space (Okada, 1985). | ||
| point dislocation (PDF) in an elastic half-space (Okada, 1985). | ||
| """ | ||
@@ -473,3 +474,3 @@ ncoords = coords_shifted.shape[0] | ||
| # Note: For a PTD M0 = dV*mu! | ||
| # Note: For a PDF M0 = dV*mu! | ||
| u = num.empty((ncoords, 3)) | ||
@@ -476,0 +477,0 @@ |
| import numpy as num | ||
| import pyrocko.orthodrome as od | ||
| from pyrocko.guts import Float | ||
| import pyrocko.orthodrome as od | ||
@@ -9,3 +8,2 @@ from . import compound_engine as ce | ||
| d2r = num.pi / 180.0 | ||
@@ -12,0 +10,0 @@ r2d = 180.0 / num.pi |
| /* disloc.c -- Computes surface displacements for dislocations in an elastic half-space. | ||
| Based on code by Y. Okada. | ||
| Version 1.2, 10/28/2000 | ||
@@ -302,3 +302,3 @@ | ||
| npy_float64 *output, *coords, *models, nu; | ||
| struct module_state *st = GETSTATE(m); | ||
@@ -369,3 +369,3 @@ | ||
| import_array(); | ||
| struct module_state *st = GETSTATE(module); | ||
@@ -372,0 +372,0 @@ st->error = PyErr_NewException("disloc_ext.error", NULL, NULL); |
| import numpy as num | ||
| from pyrocko import orthodrome as od | ||
| from pyrocko.guts import List, Bool, Float | ||
| from pyrocko.guts import Bool, Float, List | ||
| from kite.sources import disloc_ext | ||
| from .base import SandboxSourceRectangular, SandboxSource, SourceProcessor | ||
| from .base import SandboxSource, SandboxSourceRectangular, SourceProcessor | ||
| d2r = num.pi / 180.0 | ||
@@ -17,3 +18,3 @@ r2d = 180.0 / num.pi | ||
| class OkadaSource(SandboxSourceRectangular): | ||
| """Rectangular Okada source modell.""" | ||
| """Rectangular Okada source model.""" | ||
@@ -20,0 +21,0 @@ __implements__ = "disloc" |
| import numpy as num | ||
| from pyrocko.guts import String, Float, Int | ||
| from pyrocko import gf | ||
| from pyrocko.guts import Float, Int, String | ||
| from .base import SandboxSourceRectangular, SandboxSource, SourceProcessor | ||
| from .base import SandboxSource, SandboxSourceRectangular, SourceProcessor | ||
@@ -7,0 +7,0 @@ d2r = num.pi / 180.0 |
| #!/bin/python | ||
| import argparse as ap | ||
| import logging | ||
| import sys | ||
| import argparse as ap | ||
| from kite import Scene, TestScene | ||
| from kite.spool import spool | ||
| from kite import Scene, TestScene | ||
@@ -60,3 +60,3 @@ | ||
| For more informatio see the online documentation at https://pyrocko.org""", | ||
| For more information see the online documentation at https://pyrocko.org""", | ||
| ) | ||
@@ -81,3 +81,3 @@ parser.add_argument( | ||
| default=1, | ||
| help="Verbosity, add mutliple to increase verbosity.", | ||
| help="Verbosity, add multiple to increase verbosity.", | ||
| ) | ||
@@ -84,0 +84,0 @@ |
@@ -1,12 +0,11 @@ | ||
| import numpy as num | ||
| from os import path | ||
| from PyQt5 import QtCore | ||
| import numpy as num | ||
| import pyqtgraph as pg | ||
| import pyqtgraph.parametertree.parameterTypes as pTypes | ||
| from PyQt5 import QtCore | ||
| from pyqtgraph import dockarea | ||
| from kite.qt_utils import _viridis_data | ||
| from kite.util import calcPrecission, formatScalar | ||
| from kite.util import calcPrecision, formatScalar | ||
@@ -228,3 +227,3 @@ __all__ = ["KiteView", "KitePlot", "KiteToolColormap", "KiteParameterGroup"] | ||
| # if there are strong artifical edges in the data, shades get | ||
| # if there are strong artificial edges in the data, shades get | ||
| # dominated by them. Cutting off the largest and smallest 2% of | ||
@@ -311,3 +310,3 @@ # shades helps | ||
| self.hint["precision"], self.hint["vlength"] = calcPrecission(self.data) | ||
| self.hint["precision"], self.hint["vlength"] = calcPrecision(self.data) | ||
| self.mouseMoved() | ||
@@ -314,0 +313,0 @@ |
@@ -1,6 +0,7 @@ | ||
| from PyQt5 import QtCore | ||
| from pyqtgraph import SignalProxy | ||
| import logging | ||
| from datetime import datetime | ||
| from PyQt5 import QtCore | ||
| from pyqtgraph import SignalProxy | ||
| try: | ||
@@ -7,0 +8,0 @@ from pyrocko.dataset.util import set_download_callback as pyrocko_download_callback |
+12
-11
| #!/usr/bin/python | ||
| from PyQt5 import QtGui, QtCore, QtWidgets | ||
| import math | ||
| import os.path as op | ||
| import sys | ||
| import time # noqa | ||
| import math | ||
| import os.path as op | ||
| import pyqtgraph as pg | ||
| from datetime import datetime | ||
| from kite.qt_utils import loadUi, validateFilename, SceneLog, QRangeSlider | ||
| import pyqtgraph as pg | ||
| from PyQt5 import QtCore, QtGui, QtWidgets | ||
| from kite.qt_utils import QRangeSlider, SceneLog, loadUi, validateFilename | ||
| from kite.scene import Scene | ||
| from kite.scene_stack import SceneStack | ||
| from .base import get_resource | ||
| from .scene_model import SceneModel | ||
| from .tab_aps import KiteAPS # noqa | ||
| from .tab_covariance import KiteCovariance # noqa | ||
| from .tab_quadtree import KiteQuadtree # noqa | ||
| from .tab_scene import KiteScene | ||
| from .tab_quadtree import KiteQuadtree # noqa | ||
| from .tab_covariance import KiteCovariance # noqa | ||
| from .tab_aps import KiteAPS # noqa | ||
| from .base import get_resource | ||
@@ -243,3 +244,3 @@ | ||
| "Scene config saved", | ||
| "Scene config successfuly saved!" | ||
| "Scene config successfully saved!" | ||
| f'<p style="font-family: monospace;">{filename}' | ||
@@ -263,3 +264,3 @@ "</p>", | ||
| "Scene saved", | ||
| "Scene successfuly saved!" | ||
| "Scene successfully saved!" | ||
| '<p style="font-family: monospace;">%s' | ||
@@ -266,0 +267,0 @@ "</p>" % filename, |
| import numpy as num | ||
| import pyqtgraph as pg | ||
| import pyqtgraph.parametertree.parameterTypes as pTypes | ||
| from PyQt5 import QtCore, QtGui, QtWidgets | ||
| from pyqtgraph import dockarea | ||
| import pyqtgraph.parametertree.parameterTypes as pTypes | ||
| from kite.qt_utils import loadUi | ||
| from .base import KiteView, KitePlot, get_resource, KiteParameterGroup | ||
| from .base import KiteParameterGroup, KitePlot, KiteView, get_resource | ||
| from .tab_covariance import KiteSubplot | ||
| km = 1e3 | ||
@@ -14,0 +13,0 @@ pen_roi = pg.mkPen((78, 154, 6), width=2) |
@@ -0,14 +1,13 @@ | ||
| from collections import OrderedDict | ||
| import numpy as num | ||
| import pyqtgraph as pg | ||
| import pyqtgraph.parametertree.parameterTypes as pTypes | ||
| from collections import OrderedDict | ||
| from PyQt5 import QtGui, QtCore, QtWidgets | ||
| from PyQt5 import QtCore, QtGui, QtWidgets | ||
| from pyqtgraph import dockarea | ||
| from kite.covariance import CovarianceConfig | ||
| from kite.qt_utils import loadUi | ||
| from kite.covariance import CovarianceConfig | ||
| from .base import KiteView, KitePlot, KiteParameterGroup, KiteToolColormap, get_resource | ||
| from .base import KiteParameterGroup, KitePlot, KiteToolColormap, KiteView, get_resource | ||
@@ -110,3 +109,3 @@ pen_covariance_model = pg.mkPen((204, 0, 0), width=2, style=QtCore.Qt.DotLine) | ||
| "Covariance.covariance_matrix_focal</span>" | ||
| " is not positiv definit!</b>" | ||
| " is not positive definite!</b>" | ||
| ) | ||
@@ -370,4 +369,4 @@ self.setInformativeText( | ||
| covariance = self.model.covariance | ||
| struc, dist = covariance.getStructure() | ||
| self.structure.setData(dist[num.isfinite(struc)], struc[num.isfinite(struc)]) | ||
| struct, dist = covariance.getStructure() | ||
| self.structure.setData(dist[num.isfinite(struct)], struct[num.isfinite(struct)]) | ||
| self.variance.setValue(covariance.variance) | ||
@@ -741,7 +740,7 @@ | ||
| self.setIcon(QtWidgets.QMessageBox.Information) | ||
| self.setText("Finished, %s is positiv definit!" % self.text_tmpl) | ||
| self.setText("Finished, %s is positive definite!" % self.text_tmpl) | ||
| self.setInformativeText("") | ||
| else: | ||
| self.setIcon(QtWidgets.QMessageBox.Warning) | ||
| self.setText("<b>%s is not positiv definit!</b>" % self.text_tmpl) | ||
| self.setText("<b>%s is not positive definite!</b>" % self.text_tmpl) | ||
| self.setInformativeText( | ||
@@ -813,3 +812,3 @@ 'Change the <span style="font-family: monospace;">' | ||
| "step": 5, | ||
| "edditable": True, | ||
| "editable": True, | ||
| "tip": CovarianceConfig.spatial_bins.help, | ||
@@ -830,3 +829,3 @@ } | ||
| "step": 50000, | ||
| "edditable": True, | ||
| "editable": True, | ||
| "tip": CovarianceConfig.spatial_pairs.help, | ||
@@ -833,0 +832,0 @@ } |
@@ -0,8 +1,8 @@ | ||
| import math | ||
| import time | ||
| import math | ||
| from collections import OrderedDict | ||
| from PyQt5 import QtCore, QtGui, QtWidgets | ||
| import pyqtgraph as pg | ||
| import pyqtgraph.parametertree.parameterTypes as pTypes | ||
| from PyQt5 import QtCore, QtGui, QtWidgets | ||
@@ -12,3 +12,3 @@ from kite.qt_utils import SliderWidgetParameterItem | ||
| from .base import KiteView, KitePlot, KiteParameterGroup | ||
| from .base import KiteParameterGroup, KitePlot, KiteView | ||
@@ -15,0 +15,0 @@ |
| #!/usr/bin/python2 | ||
| import numpy as num | ||
| from collections import OrderedDict | ||
| from PyQt5 import QtWidgets, QtCore | ||
| import numpy as num | ||
| import pyqtgraph as pg | ||
| import pyqtgraph.parametertree.parameterTypes as pTypes | ||
| from PyQt5 import QtCore, QtWidgets | ||
| from kite.qt_utils import loadUi | ||
| from .base import KiteView, KitePlot, KiteParameterGroup, get_resource | ||
| from .base import KiteParameterGroup, KitePlot, KiteView, get_resource | ||
@@ -418,3 +417,3 @@ __all__ = ["KiteScene"] | ||
| "value": scene.deramp.config.demean, | ||
| "tip": "substract mean of displacement", | ||
| "tip": "subtract mean of displacement", | ||
| } | ||
@@ -421,0 +420,0 @@ self.demean = pTypes.SimpleParameter(**p) |
| #!/usr/bin/python2 | ||
| import argparse as ap | ||
| import logging | ||
| import sys | ||
| import logging | ||
| import argparse as ap | ||
| from kite.talpa import Talpa | ||
@@ -50,3 +51,3 @@ | ||
| default=1, | ||
| help="Verbosity, add mutliple to increase verbosity.", | ||
| help="Verbosity, add multiple to increase verbosity.", | ||
| ) | ||
@@ -53,0 +54,0 @@ |
@@ -0,11 +1,11 @@ | ||
| import logging | ||
| import os | ||
| import logging | ||
| from os import path | ||
| from PyQt5 import QtCore, QtWidgets, QtGui | ||
| from .util import get_resource | ||
| from PyQt5 import QtCore, QtGui, QtWidgets | ||
| from pyrocko.guts import Bool, Float, Int, List, Object, String, Tuple, load | ||
| from kite.qt_utils import loadUi | ||
| from pyrocko.guts import Object, Bool, String, Int, Float, Tuple, List, load | ||
| from os import path | ||
| from .util import get_resource | ||
@@ -12,0 +12,0 @@ config_file = path.expanduser("~/.config/kite/talpa_config.yml") |
@@ -1,4 +0,5 @@ | ||
| from PyQt5 import QtGui, QtCore, QtWidgets | ||
| import numpy as num | ||
| import pyqtgraph as pg | ||
| from PyQt5 import QtCore, QtGui, QtWidgets | ||
| from pyqtgraph import dockarea | ||
| import pyqtgraph as pg | ||
@@ -8,4 +9,2 @@ from .config import getConfig | ||
| import numpy as num | ||
| d2r = num.pi / 180.0 | ||
@@ -12,0 +11,0 @@ |
@@ -0,1 +1,3 @@ | ||
| import logging | ||
| from PyQt5 import QtCore | ||
@@ -5,8 +7,6 @@ | ||
| from kite.qt_utils import SceneLogModel | ||
| from . import sources | ||
| from .util import SourceROI, SourceEditorDialog | ||
| from .util import SourceEditorDialog, SourceROI | ||
| import logging | ||
| available_delegates = {} | ||
@@ -13,0 +13,0 @@ for module in sources.__sources__: |
@@ -1,2 +0,2 @@ | ||
| from PyQt5 import QtGui, QtCore, QtWidgets | ||
| from PyQt5 import QtCore, QtGui, QtWidgets | ||
@@ -3,0 +3,0 @@ from .sources import __sources__ |
@@ -0,12 +1,11 @@ | ||
| from .compound_models import EllipsoidSourceDelegate, PointCompoundSourceDelegate | ||
| from .okada import OkadaSourceDelegate | ||
| from .pyrocko import ( | ||
| PyrockoDoubleCoupleDelegate, | ||
| PyrockoMomentTensorDelegate, | ||
| PyrockoRectangularSourceDelegate, | ||
| PyrockoMomentTensorDelegate, | ||
| PyrockoDoubleCoupleDelegate, | ||
| PyrockoRingfaultDelegate, | ||
| PyrockoVLVDSourceDelegate, | ||
| ) | ||
| from .compound_models import EllipsoidSourceDelegate, PointCompoundSourceDelegate | ||
| __sources__ = [ | ||
@@ -13,0 +12,0 @@ OkadaSourceDelegate, |
@@ -0,8 +1,9 @@ | ||
| import numpy as num | ||
| import pyqtgraph as pg | ||
| from PyQt5 import QtCore, QtWidgets | ||
| import pyqtgraph as pg | ||
| import numpy as num | ||
| from ..util import get_resource | ||
| from kite.qt_utils import loadUi | ||
| from ..util import get_resource | ||
| d2r = num.pi / 180.0 | ||
@@ -9,0 +10,0 @@ r2d = 180.0 / num.pi |
| import numpy as num | ||
| from .base import PointSourceROI, SourceDelegate, SourceEditDialog | ||
| from kite.sources import EllipsoidSource, PointCompoundSource | ||
| from .base import PointSourceROI, SourceDelegate, SourceEditDialog | ||
| d2r = num.pi / 180.0 | ||
@@ -7,0 +8,0 @@ r2d = 180.0 / num.pi |
| import numpy as num | ||
| from .base import RectangularSourceROI, SourceDelegate, SourceEditDialog | ||
| from kite.sources import OkadaSource | ||
| from .base import RectangularSourceROI, SourceDelegate, SourceEditDialog | ||
| d2r = num.pi / 180.0 | ||
@@ -7,0 +8,0 @@ r2d = 180.0 / num.pi |
@@ -1,10 +0,10 @@ | ||
| from PyQt5 import QtCore, QtGui | ||
| import numpy as num | ||
| import os | ||
| from .base import RectangularSourceROI, PointSourceROI, SourceDelegate, SourceEditDialog | ||
| import numpy as num | ||
| from PyQt5 import QtCore, QtGui | ||
| from kite.sources import ( | ||
| PyrockoDoubleCouple, | ||
| PyrockoMomentTensor, | ||
| PyrockoRectangularSource, | ||
| PyrockoMomentTensor, | ||
| PyrockoDoubleCouple, | ||
| PyrockoRingfaultSource, | ||
@@ -15,2 +15,3 @@ PyrockoVLVDSource, | ||
| from ..config import getConfig | ||
| from .base import PointSourceROI, RectangularSourceROI, SourceDelegate, SourceEditDialog | ||
@@ -17,0 +18,0 @@ d2r = num.pi / 180.0 |
| import sys | ||
| from PyQt5 import QtCore, QtGui, QtWidgets | ||
| from .util import get_resource | ||
| from kite.qt_utils import SceneLog, loadUi, validateFilename | ||
| from kite.sandbox_scene import SandboxScene | ||
| from .multiplot import SandboxSceneDockarea, ModelReferenceDockarea | ||
| from .config import ConfigDialog | ||
| from .multiplot import ModelReferenceDockarea, SandboxSceneDockarea | ||
| from .sandbox_model import SandboxModel | ||
| from .sources_dock import SourcesListDock | ||
| from .tool_dialogs import ExtentDialog, LosDialog | ||
| from .config import ConfigDialog | ||
| from .sandbox_model import SandboxModel | ||
| from .util import get_resource | ||
| from kite.sandbox_scene import SandboxScene | ||
| from kite.qt_utils import loadUi, SceneLog, validateFilename | ||
| class Talpa(QtWidgets.QApplication): | ||
@@ -17,0 +17,0 @@ def __init__(self, filename=None): |
@@ -1,6 +0,7 @@ | ||
| from PyQt5 import QtWidgets, QtCore | ||
| import numpy as num | ||
| from PyQt5 import QtCore, QtWidgets | ||
| from kite.qt_utils import loadUi | ||
| from .util import get_resource | ||
| import numpy as num | ||
@@ -7,0 +8,0 @@ km = 1e3 |
@@ -147,3 +147,3 @@ #!/bin/python | ||
| def calcPrecission(data): | ||
| def calcPrecision(data): | ||
| # number of floating points: | ||
@@ -154,8 +154,8 @@ mn = num.nanmin(data) | ||
| return 3, 6 | ||
| precission = int(round(num.log10((100.0 / (mx - mn))))) | ||
| if precission < 0: | ||
| precission = 0 | ||
| precision = int(round(num.log10((100.0 / (mx - mn))))) | ||
| if precision < 0: | ||
| precision = 0 | ||
| # length of the number in the label: | ||
| length = max(len(str(int(mn))), len(str(int(mx)))) + precission | ||
| return precission, length | ||
| length = max(len(str(int(mn))), len(str(int(mx)))) + precision | ||
| return precision, length | ||
@@ -162,0 +162,0 @@ |
@@ -1,9 +0,9 @@ | ||
| import shapefile | ||
| import logging | ||
| import os.path as op | ||
| import re | ||
| import numpy as num | ||
| import pyrocko.orthodrome as od | ||
| import shapefile | ||
| import utm | ||
| import re | ||
| import os.path as op | ||
| import pyrocko.orthodrome as od | ||
| from scipy import stats | ||
@@ -13,3 +13,2 @@ | ||
| log = logging.getLogger("bbd2kite") | ||
@@ -256,3 +255,3 @@ | ||
| default=0, | ||
| help="verbosity, add mutliple to increase verbosity.", | ||
| help="verbosity, add multiple to increase verbosity.", | ||
| ) | ||
@@ -259,0 +258,0 @@ |
@@ -0,9 +1,9 @@ | ||
| import glob | ||
| import logging | ||
| import glob | ||
| from datetime import datetime, timedelta | ||
| from os import path as op | ||
| from datetime import datetime, timedelta | ||
| import pyrocko.orthodrome as od | ||
| import numpy as num | ||
| from scipy import stats, interpolate, io | ||
| import pyrocko.orthodrome as od | ||
| from scipy import interpolate, io, stats | ||
@@ -359,3 +359,3 @@ try: | ||
| default=0, | ||
| help="verbosity, add mutliple to increase verbosity.", | ||
| help="verbosity, add multiple to increase verbosity.", | ||
| ) | ||
@@ -362,0 +362,0 @@ |
+2
-2
| Metadata-Version: 2.1 | ||
| Name: kite | ||
| Version: 1.5.2 | ||
| Version: 1.5.3 | ||
| Summary: InSAR unwrapped surface displacement processing for earthquake modelling. | ||
@@ -24,3 +24,3 @@ Author-email: Marius Paul Isken <mi@gfz-potsdam.de>, Henriette Sudhaus <hsudhaus@ifg.uni-kiel.de> | ||
| Description-Content-Type: text/markdown | ||
| Provides-Extra: formating | ||
| Provides-Extra: formatting | ||
| Provides-Extra: gdal | ||
@@ -27,0 +27,0 @@ License-File: LICENSE.md |
+6
-4
| [build-system] | ||
| requires = ["setuptools >= 61.0.0", "oldest-supported-numpy"] | ||
| requires = ["setuptools >= 61.0.0", "oldest-supported-numpy", "setuptools_scm[toml]>=6.2"] | ||
| build-backend = "setuptools.build_meta" | ||
@@ -7,5 +7,5 @@ | ||
| name = "kite" | ||
| version = "1.5.2" | ||
| requires-python = ">=3.7" | ||
| license = {text = "GPLv3"} | ||
| dynamic = ["version"] | ||
| description = "InSAR unwrapped surface displacement processing for earthquake modelling." | ||
@@ -37,3 +37,3 @@ readme = "README.md" | ||
| "PyQt5>=5.15.7", | ||
| "pyqtgraph>=0.12.4", | ||
| "pyqtgraph==0.12.4", | ||
| "pyrocko>=2022.06.10", | ||
@@ -50,3 +50,3 @@ "utm>=0.7.0", | ||
| [project.optional-dependencies] | ||
| formating = ["flake8", "black"] | ||
| formatting = ["flake8", "black"] | ||
| gdal = ["gdal>=3.5.0"] | ||
@@ -77,1 +77,3 @@ | ||
| "kite.talpa.res" = ["*.ui", "*.jpg", "*.png"] | ||
| [tool.setuptools_scm] |
+3
-4
@@ -5,8 +5,7 @@ #!/usr/bin/env python3 | ||
| import tempfile | ||
| from distutils.sysconfig import get_python_inc | ||
| from setuptools import setup, Extension | ||
| from os.path import join as pjoin | ||
| from setuptools import Extension, setup | ||
| try: | ||
@@ -31,4 +30,4 @@ import numpy | ||
| import distutils.sysconfig | ||
| import shutil | ||
| import subprocess | ||
| import shutil | ||
@@ -35,0 +34,0 @@ tmpdir = tempfile.mkdtemp(prefix="kite") |
| #!/usr/bin/env python3 | ||
| import unittest | ||
| import matplotlib.pyplot as plt | ||
| import numpy as num | ||
| import matplotlib.pyplot as plt | ||
| from kite import Scene | ||
| from . import common | ||
@@ -8,0 +10,0 @@ |
| import matplotlib.pyplot as plt | ||
| from kite.gacos import GACOSCorrection | ||
@@ -3,0 +4,0 @@ |
+5
-4
| from __future__ import absolute_import | ||
| import shutil | ||
| import tempfile | ||
| import unittest | ||
| import tempfile | ||
| import shutil | ||
| import numpy as num | ||
| from os import path as op | ||
| from . import common | ||
| import numpy as num | ||
| from kite import Scene | ||
| from . import common | ||
@@ -13,0 +14,0 @@ # format (dl_dir, load_file) |
@@ -1,9 +0,9 @@ | ||
| import numpy as num | ||
| import logging | ||
| import time | ||
| import numpy as num | ||
| from kite.quadtree import QuadNode | ||
| from kite.scene import TestScene | ||
| from kite.scene_stack import TSScene, SceneStack | ||
| from kite.quadtree import QuadNode | ||
| from kite.scene_stack import SceneStack, TSScene | ||
| from kite.spool import spool | ||
@@ -10,0 +10,0 @@ |
| #!/bin/python | ||
| import logging | ||
| import unittest | ||
| import numpy as num | ||
| from kite import TestScene, Scene | ||
| from kite import Scene, TestScene | ||
| # from . import common | ||
@@ -8,0 +10,0 @@ |
| import unittest | ||
| import numpy as num | ||
| from kite.sources import ( | ||
| compound_engine as cm, | ||
| EllipsoidSource, | ||
| PointCompoundSource, | ||
| ) # noqa | ||
| from kite import SandboxScene | ||
| from kite.sources import EllipsoidSource, PointCompoundSource | ||
| from kite.sources import compound_engine as cm # noqa | ||
| from . import common | ||
@@ -65,5 +65,6 @@ | ||
| # Lost reference file | ||
| from scipy import io | ||
| from os import path as p | ||
| from scipy import io | ||
| X, Y = num.meshgrid(num.linspace(-7.0, 7.0, 701), num.linspace(-5.0, 5.0, 501)) | ||
@@ -134,5 +135,6 @@ x0 = 0.5 | ||
| def _test_pointCDM_against_Octave(self): | ||
| from scipy import io | ||
| from os import path as p | ||
| from scipy import io | ||
| X, Y = num.meshgrid(num.linspace(-7.0, 7.0, 701), num.linspace(-5.0, 5.0, 501)) | ||
@@ -139,0 +141,0 @@ x0 = 0.5 |
@@ -0,8 +1,9 @@ | ||
| import shutil | ||
| import tempfile | ||
| import unittest | ||
| import numpy as num | ||
| import tempfile | ||
| import shutil | ||
| from kite import SandboxScene, TestSandboxScene | ||
| from kite.sources import OkadaSource, OkadaPath | ||
| from kite.sources import OkadaPath, OkadaSource | ||
@@ -9,0 +10,0 @@ from . import common |
@@ -0,11 +1,12 @@ | ||
| import shutil | ||
| import tempfile | ||
| import unittest | ||
| import numpy as num | ||
| import tempfile | ||
| import shutil | ||
| from kite import SandboxScene, TestSandboxScene # noqa | ||
| from kite.sources import ( | ||
| PyrockoDoubleCouple, | ||
| PyrockoMomentTensor, | ||
| PyrockoRectangularSource, | ||
| PyrockoMomentTensor, | ||
| PyrockoDoubleCouple, | ||
| PyrockoRingfaultSource, | ||
@@ -12,0 +13,0 @@ ) |
| import numpy as num | ||
| from kite import util | ||
@@ -3,0 +4,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Alert delta unavailable
Currently unable to show alert delta for PyPI packages.
3341979
143.93%145
46.46%13775
3.97%