diff --git a/.readthedocs.yaml b/.readthedocs.yaml new file mode 100644 index 0000000..2014b39 --- /dev/null +++ b/.readthedocs.yaml @@ -0,0 +1,10 @@ +version: 2 +build: + os: "ubuntu-20.04" + tools: + python: "mambaforge-4.10" +conda: + environment: docs/environment.yml +sphinx: + configuration: docs/conf.py + fail_on_warning: true diff --git a/.travis.yml b/.travis.yml index f1db4b9..bab463a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,4 +37,4 @@ script: fi after_success: - - coveralls + - coveralls \ No newline at end of file diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..39c8566 --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,27 @@ +Copyright (c) 2018-2020, GLIMS, RGI, OGGM contributors, rgitools contributors +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/README.rst b/README.rst index 5e9763d..3401666 100644 --- a/README.rst +++ b/README.rst @@ -1,7 +1,7 @@ rgitools: processing files from the Randolph Glacier Inventory -------------------------------------------------------------- -`rgitools `_ provides several tools to +`rgitools `_ provides several tools to (pre-)process and analyse the glacier outlines provided by the `Randolph Glacier Inventory `_ (RGI). @@ -16,27 +16,24 @@ Get in touch - View the source code `on GitHub`_. - Report bugs or share your ideas on the `issue tracker`_. - Improve the model by submitting a `pull request`_. -- Follow us on `Twitter`_. -- Or you can always send us an `e-mail`_ the good old way. -.. _e-mail: info@oggm.org -.. _on GitHub: https://github.com/OGGM/rgitools -.. _issue tracker: https://github.com/OGGM/rgitools/issues -.. _pull request: https://github.com/OGGM/rgitools/pulls -.. _Twitter: https://twitter.com/OGGM_org +.. _on GitHub: https://github.com/GLIMS-RGI/rgitools +.. _issue tracker: https://github.com/GLIMS-RGI/rgitools/issues +.. _pull request: https://github.com/GLIMS-RGI/rgitools/pulls About ~~~~~ :Tests: - - .. image:: https://travis-ci.org/OGGM/rgitools.svg?branch=master - :target: https://travis-ci.org/OGGM/rgitools + .. image:: https://travis-ci.org/GLIMS-RGI/rgitools.svg?branch=master + :target: https://travis-ci.org/GLIMS-RGI/rgitools :alt: Linux build status :Documentation: - .. image:: https://readthedocs.org/projects/rgitools/badge/?version=latest :target: http://rgitools.readthedocs.org/en/latest/?badge=latest :alt: Documentation status + +:License: + `BSD-3-Clause License `_ diff --git a/ci/requirements-defaults.yml b/ci/requirements-defaults.yml index 93b75f5..8c3c92f 100644 --- a/ci/requirements-defaults.yml +++ b/ci/requirements-defaults.yml @@ -1,13 +1,36 @@ name: test_env channels: - - oggm - conda-forge - - conda-forge/label/dev dependencies: - - python=3.6 - - oggm-deps - - rasterio>=1.* + - python=3.8 + - numpy=1.19.1 + - scipy=1.5.2 + - pandas=1.1.3 + - shapely=1.7.1 + - matplotlib=3.3.2 + - Pillow + - netcdf4=1.5.4 + - scikit-image + - scikit-learn + - configobj + - xarray=0.16.1 + - pytables=3.6.1 + - pytest + - dask=2.30.0 + - bottleneck + - pyproj=2.6.1.post1 + - cartopy=0.18.0 + - geopandas=0.8.1 + - rasterio=1.1.7 + - descartes + - seaborn + - pip - pip: + - joblib + - progressbar2 + - motionless + - git+https://github.com/fmaussion/salem.git - git+https://github.com/OGGM/oggm.git + - git+https://github.com/OGGM/pytest-mpl - coveralls - pytest-cov diff --git a/ci/requirements-flake8.yml b/ci/requirements-flake8.yml index 52e480a..1fbc2a6 100644 --- a/ci/requirements-flake8.yml +++ b/ci/requirements-flake8.yml @@ -2,7 +2,7 @@ name: test_env channels: - conda-forge dependencies: - - python=3.6 + - python=3.8 - flake8 - pip: - coveralls diff --git a/docs/_static/dems_examples/alexander/dem_diffs.png b/docs/_static/dems_examples/alexander/dem_diffs.png new file mode 100644 index 0000000..f2c9b5f Binary files /dev/null and b/docs/_static/dems_examples/alexander/dem_diffs.png differ diff --git a/docs/_static/dems_examples/alexander/dem_scatter.png b/docs/_static/dems_examples/alexander/dem_scatter.png new file mode 100644 index 0000000..5330ef7 Binary files /dev/null and b/docs/_static/dems_examples/alexander/dem_scatter.png differ diff --git a/docs/_static/dems_examples/alexander/dem_slope.png b/docs/_static/dems_examples/alexander/dem_slope.png new file mode 100644 index 0000000..8a2f3ec Binary files /dev/null and b/docs/_static/dems_examples/alexander/dem_slope.png differ diff --git a/docs/_static/dems_examples/alexander/dem_topo_color.png b/docs/_static/dems_examples/alexander/dem_topo_color.png new file mode 100644 index 0000000..c9b8cf9 Binary files /dev/null and b/docs/_static/dems_examples/alexander/dem_topo_color.png differ diff --git a/docs/_static/dems_examples/alexander/dem_topo_shade.png b/docs/_static/dems_examples/alexander/dem_topo_shade.png new file mode 100644 index 0000000..a03fa8c Binary files /dev/null and b/docs/_static/dems_examples/alexander/dem_topo_shade.png differ diff --git a/docs/_static/dems_examples/balleny_islands/dem_diffs.png b/docs/_static/dems_examples/balleny_islands/dem_diffs.png new file mode 100644 index 0000000..2af5ecf Binary files /dev/null and b/docs/_static/dems_examples/balleny_islands/dem_diffs.png differ diff --git a/docs/_static/dems_examples/balleny_islands/dem_scatter.png b/docs/_static/dems_examples/balleny_islands/dem_scatter.png new file mode 100644 index 0000000..68a9c61 Binary files /dev/null and b/docs/_static/dems_examples/balleny_islands/dem_scatter.png differ diff --git a/docs/_static/dems_examples/balleny_islands/dem_slope.png b/docs/_static/dems_examples/balleny_islands/dem_slope.png new file mode 100644 index 0000000..3072db4 Binary files /dev/null and b/docs/_static/dems_examples/balleny_islands/dem_slope.png differ diff --git a/docs/_static/dems_examples/balleny_islands/dem_topo_color.png b/docs/_static/dems_examples/balleny_islands/dem_topo_color.png new file mode 100644 index 0000000..7a92b7c Binary files /dev/null and b/docs/_static/dems_examples/balleny_islands/dem_topo_color.png differ diff --git a/docs/_static/dems_examples/balleny_islands/dem_topo_shade.png b/docs/_static/dems_examples/balleny_islands/dem_topo_shade.png new file mode 100644 index 0000000..0ac9ebc Binary files /dev/null and b/docs/_static/dems_examples/balleny_islands/dem_topo_shade.png differ diff --git a/docs/_static/dems_examples/columbia/dem_diffs.png b/docs/_static/dems_examples/columbia/dem_diffs.png index 6699a29..179f56c 100644 Binary files a/docs/_static/dems_examples/columbia/dem_diffs.png and b/docs/_static/dems_examples/columbia/dem_diffs.png differ diff --git a/docs/_static/dems_examples/columbia/dem_scatter.png b/docs/_static/dems_examples/columbia/dem_scatter.png index 1862a59..5629125 100644 Binary files a/docs/_static/dems_examples/columbia/dem_scatter.png and b/docs/_static/dems_examples/columbia/dem_scatter.png differ diff --git a/docs/_static/dems_examples/columbia/dem_slope.png b/docs/_static/dems_examples/columbia/dem_slope.png new file mode 100644 index 0000000..ac818b7 Binary files /dev/null and b/docs/_static/dems_examples/columbia/dem_slope.png differ diff --git a/docs/_static/dems_examples/columbia/dem_topo_color.png b/docs/_static/dems_examples/columbia/dem_topo_color.png index 0a00055..7004267 100644 Binary files a/docs/_static/dems_examples/columbia/dem_topo_color.png and b/docs/_static/dems_examples/columbia/dem_topo_color.png differ diff --git a/docs/_static/dems_examples/columbia/dem_topo_shade.png b/docs/_static/dems_examples/columbia/dem_topo_shade.png index 2204632..b77ae4a 100644 Binary files a/docs/_static/dems_examples/columbia/dem_topo_shade.png and b/docs/_static/dems_examples/columbia/dem_topo_shade.png differ diff --git a/docs/_static/dems_examples/devon/dem_diffs.png b/docs/_static/dems_examples/devon/dem_diffs.png index 0b549fe..a3be787 100644 Binary files a/docs/_static/dems_examples/devon/dem_diffs.png and b/docs/_static/dems_examples/devon/dem_diffs.png differ diff --git a/docs/_static/dems_examples/devon/dem_scatter.png b/docs/_static/dems_examples/devon/dem_scatter.png index 322b1f1..41f8a49 100644 Binary files a/docs/_static/dems_examples/devon/dem_scatter.png and b/docs/_static/dems_examples/devon/dem_scatter.png differ diff --git a/docs/_static/dems_examples/devon/dem_slope.png b/docs/_static/dems_examples/devon/dem_slope.png new file mode 100644 index 0000000..a246272 Binary files /dev/null and b/docs/_static/dems_examples/devon/dem_slope.png differ diff --git a/docs/_static/dems_examples/devon/dem_topo_color.png b/docs/_static/dems_examples/devon/dem_topo_color.png index e3cb4f8..816b6d6 100644 Binary files a/docs/_static/dems_examples/devon/dem_topo_color.png and b/docs/_static/dems_examples/devon/dem_topo_color.png differ diff --git a/docs/_static/dems_examples/devon/dem_topo_shade.png b/docs/_static/dems_examples/devon/dem_topo_shade.png index 62444b0..ea6affe 100644 Binary files a/docs/_static/dems_examples/devon/dem_topo_shade.png and b/docs/_static/dems_examples/devon/dem_topo_shade.png differ diff --git a/docs/_static/dems_examples/dobbin/dem_diffs.png b/docs/_static/dems_examples/dobbin/dem_diffs.png new file mode 100644 index 0000000..0e76c31 Binary files /dev/null and b/docs/_static/dems_examples/dobbin/dem_diffs.png differ diff --git a/docs/_static/dems_examples/dobbin/dem_scatter.png b/docs/_static/dems_examples/dobbin/dem_scatter.png new file mode 100644 index 0000000..55e258f Binary files /dev/null and b/docs/_static/dems_examples/dobbin/dem_scatter.png differ diff --git a/docs/_static/dems_examples/dobbin/dem_slope.png b/docs/_static/dems_examples/dobbin/dem_slope.png new file mode 100644 index 0000000..44b6819 Binary files /dev/null and b/docs/_static/dems_examples/dobbin/dem_slope.png differ diff --git a/docs/_static/dems_examples/dobbin/dem_topo_color.png b/docs/_static/dems_examples/dobbin/dem_topo_color.png new file mode 100644 index 0000000..e50c0c2 Binary files /dev/null and b/docs/_static/dems_examples/dobbin/dem_topo_color.png differ diff --git a/docs/_static/dems_examples/dobbin/dem_topo_shade.png b/docs/_static/dems_examples/dobbin/dem_topo_shade.png new file mode 100644 index 0000000..c30dc79 Binary files /dev/null and b/docs/_static/dems_examples/dobbin/dem_topo_shade.png differ diff --git a/docs/_static/dems_examples/gillock/dem_diffs.png b/docs/_static/dems_examples/gillock/dem_diffs.png new file mode 100644 index 0000000..971a019 Binary files /dev/null and b/docs/_static/dems_examples/gillock/dem_diffs.png differ diff --git a/docs/_static/dems_examples/gillock/dem_scatter.png b/docs/_static/dems_examples/gillock/dem_scatter.png new file mode 100644 index 0000000..d7e1051 Binary files /dev/null and b/docs/_static/dems_examples/gillock/dem_scatter.png differ diff --git a/docs/_static/dems_examples/gillock/dem_slope.png b/docs/_static/dems_examples/gillock/dem_slope.png new file mode 100644 index 0000000..d5bf5cb Binary files /dev/null and b/docs/_static/dems_examples/gillock/dem_slope.png differ diff --git a/docs/_static/dems_examples/gillock/dem_topo_color.png b/docs/_static/dems_examples/gillock/dem_topo_color.png new file mode 100644 index 0000000..91b2feb Binary files /dev/null and b/docs/_static/dems_examples/gillock/dem_topo_color.png differ diff --git a/docs/_static/dems_examples/gillock/dem_topo_shade.png b/docs/_static/dems_examples/gillock/dem_topo_shade.png new file mode 100644 index 0000000..6a0aa2a Binary files /dev/null and b/docs/_static/dems_examples/gillock/dem_topo_shade.png differ diff --git a/docs/_static/dems_examples/greenland/dem_diffs.png b/docs/_static/dems_examples/greenland/dem_diffs.png index cf8a051..5a5946e 100644 Binary files a/docs/_static/dems_examples/greenland/dem_diffs.png and b/docs/_static/dems_examples/greenland/dem_diffs.png differ diff --git a/docs/_static/dems_examples/greenland/dem_scatter.png b/docs/_static/dems_examples/greenland/dem_scatter.png index 6467358..c3daf64 100644 Binary files a/docs/_static/dems_examples/greenland/dem_scatter.png and b/docs/_static/dems_examples/greenland/dem_scatter.png differ diff --git a/docs/_static/dems_examples/greenland/dem_slope.png b/docs/_static/dems_examples/greenland/dem_slope.png new file mode 100644 index 0000000..08561a5 Binary files /dev/null and b/docs/_static/dems_examples/greenland/dem_slope.png differ diff --git a/docs/_static/dems_examples/greenland/dem_topo_color.png b/docs/_static/dems_examples/greenland/dem_topo_color.png index 71d9872..cdd7aaa 100644 Binary files a/docs/_static/dems_examples/greenland/dem_topo_color.png and b/docs/_static/dems_examples/greenland/dem_topo_color.png differ diff --git a/docs/_static/dems_examples/greenland/dem_topo_shade.png b/docs/_static/dems_examples/greenland/dem_topo_shade.png index 05f33d0..1922c40 100644 Binary files a/docs/_static/dems_examples/greenland/dem_topo_shade.png and b/docs/_static/dems_examples/greenland/dem_topo_shade.png differ diff --git a/docs/_static/dems_examples/hef/dem_diffs.png b/docs/_static/dems_examples/hef/dem_diffs.png index 7548733..35e568a 100644 Binary files a/docs/_static/dems_examples/hef/dem_diffs.png and b/docs/_static/dems_examples/hef/dem_diffs.png differ diff --git a/docs/_static/dems_examples/hef/dem_scatter.png b/docs/_static/dems_examples/hef/dem_scatter.png index 47421e0..b298a15 100644 Binary files a/docs/_static/dems_examples/hef/dem_scatter.png and b/docs/_static/dems_examples/hef/dem_scatter.png differ diff --git a/docs/_static/dems_examples/hef/dem_slope.png b/docs/_static/dems_examples/hef/dem_slope.png new file mode 100644 index 0000000..585d052 Binary files /dev/null and b/docs/_static/dems_examples/hef/dem_slope.png differ diff --git a/docs/_static/dems_examples/hef/dem_topo_color.png b/docs/_static/dems_examples/hef/dem_topo_color.png index 475632b..caa0123 100644 Binary files a/docs/_static/dems_examples/hef/dem_topo_color.png and b/docs/_static/dems_examples/hef/dem_topo_color.png differ diff --git a/docs/_static/dems_examples/hef/dem_topo_shade.png b/docs/_static/dems_examples/hef/dem_topo_shade.png index 394a650..001bf3e 100644 Binary files a/docs/_static/dems_examples/hef/dem_topo_shade.png and b/docs/_static/dems_examples/hef/dem_topo_shade.png differ diff --git a/docs/_static/dems_examples/iceland/dem_diffs.png b/docs/_static/dems_examples/iceland/dem_diffs.png index 0dd68ad..484366c 100644 Binary files a/docs/_static/dems_examples/iceland/dem_diffs.png and b/docs/_static/dems_examples/iceland/dem_diffs.png differ diff --git a/docs/_static/dems_examples/iceland/dem_scatter.png b/docs/_static/dems_examples/iceland/dem_scatter.png index 2f03011..3c5452a 100644 Binary files a/docs/_static/dems_examples/iceland/dem_scatter.png and b/docs/_static/dems_examples/iceland/dem_scatter.png differ diff --git a/docs/_static/dems_examples/iceland/dem_slope.png b/docs/_static/dems_examples/iceland/dem_slope.png new file mode 100644 index 0000000..5688f30 Binary files /dev/null and b/docs/_static/dems_examples/iceland/dem_slope.png differ diff --git a/docs/_static/dems_examples/iceland/dem_topo_color.png b/docs/_static/dems_examples/iceland/dem_topo_color.png index 98b9a8c..0a526d8 100644 Binary files a/docs/_static/dems_examples/iceland/dem_topo_color.png and b/docs/_static/dems_examples/iceland/dem_topo_color.png differ diff --git a/docs/_static/dems_examples/iceland/dem_topo_shade.png b/docs/_static/dems_examples/iceland/dem_topo_shade.png index 5d6b863..c707fc5 100644 Binary files a/docs/_static/dems_examples/iceland/dem_topo_shade.png and b/docs/_static/dems_examples/iceland/dem_topo_shade.png differ diff --git a/docs/_static/dems_examples/lenin/dem_diffs.png b/docs/_static/dems_examples/lenin/dem_diffs.png new file mode 100644 index 0000000..de353b3 Binary files /dev/null and b/docs/_static/dems_examples/lenin/dem_diffs.png differ diff --git a/docs/_static/dems_examples/lenin/dem_scatter.png b/docs/_static/dems_examples/lenin/dem_scatter.png new file mode 100644 index 0000000..7bb97c7 Binary files /dev/null and b/docs/_static/dems_examples/lenin/dem_scatter.png differ diff --git a/docs/_static/dems_examples/lenin/dem_slope.png b/docs/_static/dems_examples/lenin/dem_slope.png new file mode 100644 index 0000000..12bce8d Binary files /dev/null and b/docs/_static/dems_examples/lenin/dem_slope.png differ diff --git a/docs/_static/dems_examples/lenin/dem_topo_color.png b/docs/_static/dems_examples/lenin/dem_topo_color.png new file mode 100644 index 0000000..61fee38 Binary files /dev/null and b/docs/_static/dems_examples/lenin/dem_topo_color.png differ diff --git a/docs/_static/dems_examples/lenin/dem_topo_shade.png b/docs/_static/dems_examples/lenin/dem_topo_shade.png new file mode 100644 index 0000000..262180c Binary files /dev/null and b/docs/_static/dems_examples/lenin/dem_topo_shade.png differ diff --git a/docs/_static/dems_examples/nigards/dem_diffs.png b/docs/_static/dems_examples/nigards/dem_diffs.png new file mode 100644 index 0000000..59a78ce Binary files /dev/null and b/docs/_static/dems_examples/nigards/dem_diffs.png differ diff --git a/docs/_static/dems_examples/nigards/dem_scatter.png b/docs/_static/dems_examples/nigards/dem_scatter.png new file mode 100644 index 0000000..d1c7629 Binary files /dev/null and b/docs/_static/dems_examples/nigards/dem_scatter.png differ diff --git a/docs/_static/dems_examples/nigards/dem_slope.png b/docs/_static/dems_examples/nigards/dem_slope.png new file mode 100644 index 0000000..5a213c6 Binary files /dev/null and b/docs/_static/dems_examples/nigards/dem_slope.png differ diff --git a/docs/_static/dems_examples/nigards/dem_topo_color.png b/docs/_static/dems_examples/nigards/dem_topo_color.png new file mode 100644 index 0000000..1a7376d Binary files /dev/null and b/docs/_static/dems_examples/nigards/dem_topo_color.png differ diff --git a/docs/_static/dems_examples/nigards/dem_topo_shade.png b/docs/_static/dems_examples/nigards/dem_topo_shade.png new file mode 100644 index 0000000..b369d38 Binary files /dev/null and b/docs/_static/dems_examples/nigards/dem_topo_shade.png differ diff --git a/docs/_static/dems_examples/nordenskjoeld/dem_diffs.png b/docs/_static/dems_examples/nordenskjoeld/dem_diffs.png new file mode 100644 index 0000000..0491e96 Binary files /dev/null and b/docs/_static/dems_examples/nordenskjoeld/dem_diffs.png differ diff --git a/docs/_static/dems_examples/nordenskjoeld/dem_scatter.png b/docs/_static/dems_examples/nordenskjoeld/dem_scatter.png new file mode 100644 index 0000000..5e0fa85 Binary files /dev/null and b/docs/_static/dems_examples/nordenskjoeld/dem_scatter.png differ diff --git a/docs/_static/dems_examples/nordenskjoeld/dem_slope.png b/docs/_static/dems_examples/nordenskjoeld/dem_slope.png new file mode 100644 index 0000000..8365a07 Binary files /dev/null and b/docs/_static/dems_examples/nordenskjoeld/dem_slope.png differ diff --git a/docs/_static/dems_examples/nordenskjoeld/dem_topo_color.png b/docs/_static/dems_examples/nordenskjoeld/dem_topo_color.png new file mode 100644 index 0000000..2134623 Binary files /dev/null and b/docs/_static/dems_examples/nordenskjoeld/dem_topo_color.png differ diff --git a/docs/_static/dems_examples/nordenskjoeld/dem_topo_shade.png b/docs/_static/dems_examples/nordenskjoeld/dem_topo_shade.png new file mode 100644 index 0000000..f0e6da9 Binary files /dev/null and b/docs/_static/dems_examples/nordenskjoeld/dem_topo_shade.png differ diff --git a/docs/_static/dems_examples/oberaletsch/dem_diffs.png b/docs/_static/dems_examples/oberaletsch/dem_diffs.png index 4d7d573..1d32759 100644 Binary files a/docs/_static/dems_examples/oberaletsch/dem_diffs.png and b/docs/_static/dems_examples/oberaletsch/dem_diffs.png differ diff --git a/docs/_static/dems_examples/oberaletsch/dem_scatter.png b/docs/_static/dems_examples/oberaletsch/dem_scatter.png index eae4f32..7f3e0cb 100644 Binary files a/docs/_static/dems_examples/oberaletsch/dem_scatter.png and b/docs/_static/dems_examples/oberaletsch/dem_scatter.png differ diff --git a/docs/_static/dems_examples/oberaletsch/dem_slope.png b/docs/_static/dems_examples/oberaletsch/dem_slope.png new file mode 100644 index 0000000..b5b9f1d Binary files /dev/null and b/docs/_static/dems_examples/oberaletsch/dem_slope.png differ diff --git a/docs/_static/dems_examples/oberaletsch/dem_topo_color.png b/docs/_static/dems_examples/oberaletsch/dem_topo_color.png index da922fe..ba040f9 100644 Binary files a/docs/_static/dems_examples/oberaletsch/dem_topo_color.png and b/docs/_static/dems_examples/oberaletsch/dem_topo_color.png differ diff --git a/docs/_static/dems_examples/oberaletsch/dem_topo_shade.png b/docs/_static/dems_examples/oberaletsch/dem_topo_shade.png index 4e4a3d6..2ba417a 100644 Binary files a/docs/_static/dems_examples/oberaletsch/dem_topo_shade.png and b/docs/_static/dems_examples/oberaletsch/dem_topo_shade.png differ diff --git a/docs/_static/dems_examples/olivine/dem_diffs.png b/docs/_static/dems_examples/olivine/dem_diffs.png new file mode 100644 index 0000000..8a15f21 Binary files /dev/null and b/docs/_static/dems_examples/olivine/dem_diffs.png differ diff --git a/docs/_static/dems_examples/olivine/dem_scatter.png b/docs/_static/dems_examples/olivine/dem_scatter.png new file mode 100644 index 0000000..c1940e5 Binary files /dev/null and b/docs/_static/dems_examples/olivine/dem_scatter.png differ diff --git a/docs/_static/dems_examples/olivine/dem_slope.png b/docs/_static/dems_examples/olivine/dem_slope.png new file mode 100644 index 0000000..5c17e50 Binary files /dev/null and b/docs/_static/dems_examples/olivine/dem_slope.png differ diff --git a/docs/_static/dems_examples/olivine/dem_topo_color.png b/docs/_static/dems_examples/olivine/dem_topo_color.png new file mode 100644 index 0000000..557cb99 Binary files /dev/null and b/docs/_static/dems_examples/olivine/dem_topo_color.png differ diff --git a/docs/_static/dems_examples/olivine/dem_topo_shade.png b/docs/_static/dems_examples/olivine/dem_topo_shade.png new file mode 100644 index 0000000..bc853e8 Binary files /dev/null and b/docs/_static/dems_examples/olivine/dem_topo_shade.png differ diff --git a/docs/_static/dems_examples/pine_island_bay/dem_diffs.png b/docs/_static/dems_examples/pine_island_bay/dem_diffs.png new file mode 100644 index 0000000..db8cca1 Binary files /dev/null and b/docs/_static/dems_examples/pine_island_bay/dem_diffs.png differ diff --git a/docs/_static/dems_examples/pine_island_bay/dem_scatter.png b/docs/_static/dems_examples/pine_island_bay/dem_scatter.png new file mode 100644 index 0000000..3e44123 Binary files /dev/null and b/docs/_static/dems_examples/pine_island_bay/dem_scatter.png differ diff --git a/docs/_static/dems_examples/pine_island_bay/dem_slope.png b/docs/_static/dems_examples/pine_island_bay/dem_slope.png new file mode 100644 index 0000000..85bc82a Binary files /dev/null and b/docs/_static/dems_examples/pine_island_bay/dem_slope.png differ diff --git a/docs/_static/dems_examples/pine_island_bay/dem_topo_color.png b/docs/_static/dems_examples/pine_island_bay/dem_topo_color.png new file mode 100644 index 0000000..0f14741 Binary files /dev/null and b/docs/_static/dems_examples/pine_island_bay/dem_topo_color.png differ diff --git a/docs/_static/dems_examples/pine_island_bay/dem_topo_shade.png b/docs/_static/dems_examples/pine_island_bay/dem_topo_shade.png new file mode 100644 index 0000000..0813904 Binary files /dev/null and b/docs/_static/dems_examples/pine_island_bay/dem_topo_shade.png differ diff --git a/docs/_static/dems_examples/queen_maud_land/dem_diffs.png b/docs/_static/dems_examples/queen_maud_land/dem_diffs.png new file mode 100644 index 0000000..16f011c Binary files /dev/null and b/docs/_static/dems_examples/queen_maud_land/dem_diffs.png differ diff --git a/docs/_static/dems_examples/queen_maud_land/dem_scatter.png b/docs/_static/dems_examples/queen_maud_land/dem_scatter.png new file mode 100644 index 0000000..fc32ac9 Binary files /dev/null and b/docs/_static/dems_examples/queen_maud_land/dem_scatter.png differ diff --git a/docs/_static/dems_examples/queen_maud_land/dem_slope.png b/docs/_static/dems_examples/queen_maud_land/dem_slope.png new file mode 100644 index 0000000..b12e9a2 Binary files /dev/null and b/docs/_static/dems_examples/queen_maud_land/dem_slope.png differ diff --git a/docs/_static/dems_examples/queen_maud_land/dem_topo_color.png b/docs/_static/dems_examples/queen_maud_land/dem_topo_color.png new file mode 100644 index 0000000..d312a3f Binary files /dev/null and b/docs/_static/dems_examples/queen_maud_land/dem_topo_color.png differ diff --git a/docs/_static/dems_examples/queen_maud_land/dem_topo_shade.png b/docs/_static/dems_examples/queen_maud_land/dem_topo_shade.png new file mode 100644 index 0000000..1c5f3de Binary files /dev/null and b/docs/_static/dems_examples/queen_maud_land/dem_topo_shade.png differ diff --git a/docs/_static/dems_examples/rgitopo_ex.jpg b/docs/_static/dems_examples/rgitopo_ex.jpg new file mode 100644 index 0000000..775ad0c Binary files /dev/null and b/docs/_static/dems_examples/rgitopo_ex.jpg differ diff --git a/docs/_static/dems_examples/shallap/dem_diffs.png b/docs/_static/dems_examples/shallap/dem_diffs.png index 83ebabc..c3cac35 100644 Binary files a/docs/_static/dems_examples/shallap/dem_diffs.png and b/docs/_static/dems_examples/shallap/dem_diffs.png differ diff --git a/docs/_static/dems_examples/shallap/dem_scatter.png b/docs/_static/dems_examples/shallap/dem_scatter.png index e5c12af..c4475cf 100644 Binary files a/docs/_static/dems_examples/shallap/dem_scatter.png and b/docs/_static/dems_examples/shallap/dem_scatter.png differ diff --git a/docs/_static/dems_examples/shallap/dem_slope.png b/docs/_static/dems_examples/shallap/dem_slope.png new file mode 100644 index 0000000..0d707db Binary files /dev/null and b/docs/_static/dems_examples/shallap/dem_slope.png differ diff --git a/docs/_static/dems_examples/shallap/dem_topo_color.png b/docs/_static/dems_examples/shallap/dem_topo_color.png index 3b9f384..00b29a9 100644 Binary files a/docs/_static/dems_examples/shallap/dem_topo_color.png and b/docs/_static/dems_examples/shallap/dem_topo_color.png differ diff --git a/docs/_static/dems_examples/shallap/dem_topo_shade.png b/docs/_static/dems_examples/shallap/dem_topo_shade.png index 2eaa5ba..dbd6b22 100644 Binary files a/docs/_static/dems_examples/shallap/dem_topo_shade.png and b/docs/_static/dems_examples/shallap/dem_topo_shade.png differ diff --git a/docs/_static/dems_examples/tellbreen/dem_diffs.png b/docs/_static/dems_examples/tellbreen/dem_diffs.png new file mode 100644 index 0000000..a7cd019 Binary files /dev/null and b/docs/_static/dems_examples/tellbreen/dem_diffs.png differ diff --git a/docs/_static/dems_examples/tellbreen/dem_scatter.png b/docs/_static/dems_examples/tellbreen/dem_scatter.png new file mode 100644 index 0000000..fad91be Binary files /dev/null and b/docs/_static/dems_examples/tellbreen/dem_scatter.png differ diff --git a/docs/_static/dems_examples/tellbreen/dem_slope.png b/docs/_static/dems_examples/tellbreen/dem_slope.png new file mode 100644 index 0000000..12d33da Binary files /dev/null and b/docs/_static/dems_examples/tellbreen/dem_slope.png differ diff --git a/docs/_static/dems_examples/tellbreen/dem_topo_color.png b/docs/_static/dems_examples/tellbreen/dem_topo_color.png new file mode 100644 index 0000000..2de60ae Binary files /dev/null and b/docs/_static/dems_examples/tellbreen/dem_topo_color.png differ diff --git a/docs/_static/dems_examples/tellbreen/dem_topo_shade.png b/docs/_static/dems_examples/tellbreen/dem_topo_shade.png new file mode 100644 index 0000000..e217468 Binary files /dev/null and b/docs/_static/dems_examples/tellbreen/dem_topo_shade.png differ diff --git a/docs/_static/dems_examples/thana/dem_diffs.png b/docs/_static/dems_examples/thana/dem_diffs.png new file mode 100644 index 0000000..59be2cf Binary files /dev/null and b/docs/_static/dems_examples/thana/dem_diffs.png differ diff --git a/docs/_static/dems_examples/thana/dem_scatter.png b/docs/_static/dems_examples/thana/dem_scatter.png new file mode 100644 index 0000000..b5fa1f8 Binary files /dev/null and b/docs/_static/dems_examples/thana/dem_scatter.png differ diff --git a/docs/_static/dems_examples/thana/dem_slope.png b/docs/_static/dems_examples/thana/dem_slope.png new file mode 100644 index 0000000..7049ddd Binary files /dev/null and b/docs/_static/dems_examples/thana/dem_slope.png differ diff --git a/docs/_static/dems_examples/thana/dem_topo_color.png b/docs/_static/dems_examples/thana/dem_topo_color.png new file mode 100644 index 0000000..535b6da Binary files /dev/null and b/docs/_static/dems_examples/thana/dem_topo_color.png differ diff --git a/docs/_static/dems_examples/thana/dem_topo_shade.png b/docs/_static/dems_examples/thana/dem_topo_shade.png new file mode 100644 index 0000000..26719ad Binary files /dev/null and b/docs/_static/dems_examples/thana/dem_topo_shade.png differ diff --git a/docs/_static/images/barplot_allregions_v2.png b/docs/_static/images/barplot_allregions_v2.png new file mode 100644 index 0000000..b5eb5d4 Binary files /dev/null and b/docs/_static/images/barplot_allregions_v2.png differ diff --git a/docs/_static/images/barplot_rgi01_v2.png b/docs/_static/images/barplot_rgi01_v2.png new file mode 100644 index 0000000..cad0dac Binary files /dev/null and b/docs/_static/images/barplot_rgi01_v2.png differ diff --git a/docs/_static/images/barplot_rgi02_v2.png b/docs/_static/images/barplot_rgi02_v2.png new file mode 100644 index 0000000..b9c912f Binary files /dev/null and b/docs/_static/images/barplot_rgi02_v2.png differ diff --git a/docs/_static/images/barplot_rgi03_v2.png b/docs/_static/images/barplot_rgi03_v2.png new file mode 100644 index 0000000..611dd49 Binary files /dev/null and b/docs/_static/images/barplot_rgi03_v2.png differ diff --git a/docs/_static/images/barplot_rgi04_v2.png b/docs/_static/images/barplot_rgi04_v2.png new file mode 100644 index 0000000..be29a31 Binary files /dev/null and b/docs/_static/images/barplot_rgi04_v2.png differ diff --git a/docs/_static/images/barplot_rgi05_v2.png b/docs/_static/images/barplot_rgi05_v2.png new file mode 100644 index 0000000..91e8f2b Binary files /dev/null and b/docs/_static/images/barplot_rgi05_v2.png differ diff --git a/docs/_static/images/barplot_rgi06_v2.png b/docs/_static/images/barplot_rgi06_v2.png new file mode 100644 index 0000000..4bc304c Binary files /dev/null and b/docs/_static/images/barplot_rgi06_v2.png differ diff --git a/docs/_static/images/barplot_rgi07_v2.png b/docs/_static/images/barplot_rgi07_v2.png new file mode 100644 index 0000000..84a1f29 Binary files /dev/null and b/docs/_static/images/barplot_rgi07_v2.png differ diff --git a/docs/_static/images/barplot_rgi08_v2.png b/docs/_static/images/barplot_rgi08_v2.png new file mode 100644 index 0000000..a35811a Binary files /dev/null and b/docs/_static/images/barplot_rgi08_v2.png differ diff --git a/docs/_static/images/barplot_rgi09_v2.png b/docs/_static/images/barplot_rgi09_v2.png new file mode 100644 index 0000000..d31b977 Binary files /dev/null and b/docs/_static/images/barplot_rgi09_v2.png differ diff --git a/docs/_static/images/barplot_rgi10_v2.png b/docs/_static/images/barplot_rgi10_v2.png new file mode 100644 index 0000000..cf7a05b Binary files /dev/null and b/docs/_static/images/barplot_rgi10_v2.png differ diff --git a/docs/_static/images/barplot_rgi11_v2.png b/docs/_static/images/barplot_rgi11_v2.png new file mode 100644 index 0000000..df77f66 Binary files /dev/null and b/docs/_static/images/barplot_rgi11_v2.png differ diff --git a/docs/_static/images/barplot_rgi12_v2.png b/docs/_static/images/barplot_rgi12_v2.png new file mode 100644 index 0000000..2bd6470 Binary files /dev/null and b/docs/_static/images/barplot_rgi12_v2.png differ diff --git a/docs/_static/images/barplot_rgi13_v2.png b/docs/_static/images/barplot_rgi13_v2.png new file mode 100644 index 0000000..64e426d Binary files /dev/null and b/docs/_static/images/barplot_rgi13_v2.png differ diff --git a/docs/_static/images/barplot_rgi14_v2.png b/docs/_static/images/barplot_rgi14_v2.png new file mode 100644 index 0000000..e58acf5 Binary files /dev/null and b/docs/_static/images/barplot_rgi14_v2.png differ diff --git a/docs/_static/images/barplot_rgi15_v2.png b/docs/_static/images/barplot_rgi15_v2.png new file mode 100644 index 0000000..88a6f9c Binary files /dev/null and b/docs/_static/images/barplot_rgi15_v2.png differ diff --git a/docs/_static/images/barplot_rgi16_v2.png b/docs/_static/images/barplot_rgi16_v2.png new file mode 100644 index 0000000..7b9f073 Binary files /dev/null and b/docs/_static/images/barplot_rgi16_v2.png differ diff --git a/docs/_static/images/barplot_rgi17_v2.png b/docs/_static/images/barplot_rgi17_v2.png new file mode 100644 index 0000000..6b2226f Binary files /dev/null and b/docs/_static/images/barplot_rgi17_v2.png differ diff --git a/docs/_static/images/barplot_rgi18_v2.png b/docs/_static/images/barplot_rgi18_v2.png new file mode 100644 index 0000000..aa54446 Binary files /dev/null and b/docs/_static/images/barplot_rgi18_v2.png differ diff --git a/docs/_static/images/barplot_rgi19_v2.png b/docs/_static/images/barplot_rgi19_v2.png new file mode 100644 index 0000000..b649981 Binary files /dev/null and b/docs/_static/images/barplot_rgi19_v2.png differ diff --git a/docs/_static/tables/dem_allrgi_v2.csv b/docs/_static/tables/dem_allrgi_v2.csv new file mode 100644 index 0000000..11a754f --- /dev/null +++ b/docs/_static/tables/dem_allrgi_v2.csv @@ -0,0 +1,21 @@ +RGI region,# total,ALASKA,ARCTICDEM,ASTER,AW3D30,COPDEM30,COPDEM90,DEM3,GIMP,MAPZEN,NASADEM,RAMP,REMA,SRTM,TANDEM +:ref:`01: Alaska`,27108,100%,75%,100%,76%,100%,100%,100%,--,100%,47%,--,--,47%,99% +:ref:`02: Western Canada and USA`,18855,17%,4%,100%,94%,100%,100%,100%,--,100%,93%,--,--,93%,98% +":ref:`03: Arctic Canada, North`",4556,--,99%,98%,63%,99%,99%,99%,15%,100%,--,--,--,--,100% +":ref:`04: Arctic Canada, South`",7415,--,97%,100%,44%,100%,100%,98%,--,100%,1%,--,--,1%,100% +:ref:`05: Greenland Periphery`,19306,--,95%,98%,71%,99%,99%,99%,100%,99%,--,--,--,--,99% +:ref:`06: Iceland`,568,--,97%,100%,27%,100%,100%,100%,--,100%,--,--,--,--,100% +:ref:`07: Svalbard and Jan Mayen`,1615,--,99%,100%,32%,100%,100%,100%,--,100%,--,--,--,--,99% +:ref:`08: Scandinavia`,3417,--,92%,100%,24%,100%,100%,100%,--,100%,8%,--,--,2%,100% +:ref:`09: Russian Arctic`,1069,--,98%,99%,7%,99%,99%,99%,--,100%,--,--,--,--,100% +":ref:`10: Asia, North`",5151,--,48%,99%,85%,99%,99%,99%,--,99%,69%,--,--,67%,100% +:ref:`11: Central Europe`,3927,--,--,100%,100%,99%,100%,100%,--,100%,100%,--,--,100%,93% +:ref:`12: Caucasus and Middle East`,1888,--,--,100%,100%,95%,100%,100%,--,100%,100%,--,--,100%,98% +":ref:`13: Asia, Central`",54429,--,--,100%,100%,100%,100%,100%,--,100%,100%,--,--,100%,98% +":ref:`14: Asia, South West`",27988,--,--,100%,100%,100%,100%,100%,--,100%,100%,--,--,100%,95% +":ref:`15: Asia, South East`",13119,--,--,100%,100%,100%,100%,100%,--,100%,100%,--,--,100%,94% +:ref:`16: Low Latitudes`,2939,--,--,100%,100%,100%,100%,100%,--,100%,100%,--,--,100%,99% +:ref:`17: Southern Andes`,15908,--,--,99%,99%,99%,99%,99%,--,100%,99%,--,--,99%,98% +:ref:`18: New Zealand`,3537,--,--,100%,100%,100%,100%,100%,--,100%,100%,--,--,100%,85% +:ref:`19: Antarctic and Subantarctic`,2752,--,--,78%,41%,89%,90%,78%,--,99%,25%,49%,20%,24%,87% +All RGI regions,215547,14%,28%,99%,87%,99%,99%,99%,9%,99%,73%,--,--,73%,97% diff --git a/docs/_static/tables/dem_rgi01_v2.csv b/docs/_static/tables/dem_rgi01_v2.csv new file mode 100644 index 0000000..00cb5f9 --- /dev/null +++ b/docs/_static/tables/dem_rgi01_v2.csv @@ -0,0 +1,7 @@ +RGI region,# total,ALASKA,ARCTICDEM,ASTER,AW3D30,COPDEM30,COPDEM90,DEM3,GIMP,MAPZEN,NASADEM,RAMP,REMA,SRTM,TANDEM +01-01: N Alaska,616,100%,94%,100%,81%,100%,100%,100%,--,100%,--,--,--,--,100% +01-02: Alaska Ra (Wrangell/Kilbuck),5773,100%,81%,100%,67%,100%,100%,100%,--,100%,2%,--,--,2%,99% +01-03: Alaska Pena (Aleutians),872,100%,87%,100%,100%,100%,100%,100%,--,100%,100%,--,--,100%,100% +01-04: W Chugach Mtns (Talkeetna),4258,100%,90%,100%,54%,100%,100%,100%,--,100%,10%,--,--,10%,100% +01-05: St Elias Mtns,5037,100%,86%,100%,54%,100%,100%,100%,--,100%,19%,--,--,19%,100% +01-06: N Coast Ranges,10552,100%,59%,100%,99%,100%,100%,100%,--,100%,98%,--,--,98%,98% diff --git a/docs/_static/tables/dem_rgi02_v2.csv b/docs/_static/tables/dem_rgi02_v2.csv new file mode 100644 index 0000000..cd2a4e9 --- /dev/null +++ b/docs/_static/tables/dem_rgi02_v2.csv @@ -0,0 +1,6 @@ +RGI region,# total,ALASKA,ARCTICDEM,ASTER,AW3D30,COPDEM30,COPDEM90,DEM3,GIMP,MAPZEN,NASADEM,RAMP,REMA,SRTM,TANDEM +02-01: Mackenzie and Selwyn Mtns,1235,--,68%,100%,10%,100%,100%,100%,--,100%,--,--,--,--,100% +02-02: S Coast Ranges,7389,35%,--,100%,100%,100%,100%,100%,--,100%,100%,--,--,100%,96% +02-03: N Rocky Mtns,5067,13%,--,100%,100%,100%,100%,100%,--,100%,100%,--,--,100%,98% +02-04: Cascade Ra and Sa Nevada,3202,--,--,100%,100%,100%,100%,100%,--,100%,100%,--,--,100%,99% +02-05: S Rocky Mtns,1962,--,--,100%,100%,100%,100%,100%,--,100%,100%,--,--,100%,100% diff --git a/docs/_static/tables/dem_rgi03_v2.csv b/docs/_static/tables/dem_rgi03_v2.csv new file mode 100644 index 0000000..6d20797 --- /dev/null +++ b/docs/_static/tables/dem_rgi03_v2.csv @@ -0,0 +1,8 @@ +RGI region,# total,ALASKA,ARCTICDEM,ASTER,AW3D30,COPDEM30,COPDEM90,DEM3,GIMP,MAPZEN,NASADEM,RAMP,REMA,SRTM,TANDEM +03-01: N Ellesmere Island,2049,--,99%,96%,44%,99%,99%,98%,15%,100%,--,--,--,--,100% +03-02: Axel Heiberg and Meighen Is,627,--,100%,100%,63%,100%,100%,100%,--,100%,--,--,--,--,100% +03-03: NC Ellesmere Island,880,--,100%,100%,96%,100%,100%,99%,41%,100%,--,--,--,--,100% +03-04: SC Ellesmere Island,241,--,100%,100%,72%,100%,100%,100%,8%,100%,--,--,--,--,100% +03-05: S Ellesmere Island (NW Devon),536,--,100%,100%,74%,100%,100%,100%,--,100%,--,--,--,--,100% +03-06: Devon Island,216,--,100%,100%,62%,100%,100%,100%,--,100%,--,--,--,--,100% +03-07: Melville Island,7,--,100%,100%,57%,100%,100%,100%,--,100%,--,--,--,--,100% diff --git a/docs/_static/tables/dem_rgi04_v2.csv b/docs/_static/tables/dem_rgi04_v2.csv new file mode 100644 index 0000000..3ef8bd1 --- /dev/null +++ b/docs/_static/tables/dem_rgi04_v2.csv @@ -0,0 +1,10 @@ +RGI region,# total,ALASKA,ARCTICDEM,ASTER,AW3D30,COPDEM30,COPDEM90,DEM3,GIMP,MAPZEN,NASADEM,RAMP,REMA,SRTM,TANDEM +04-01: Bylot Island,455,--,99%,100%,68%,100%,100%,100%,--,100%,--,--,--,--,100% +04-02: W Baffin Island,71,--,100%,100%,63%,100%,100%,100%,--,100%,--,--,--,--,100% +04-03: N Baffin Island,277,--,99%,100%,73%,100%,100%,100%,--,100%,--,--,--,--,100% +04-04: NE Baffin Island,1442,--,98%,100%,47%,100%,100%,100%,--,100%,--,--,--,--,100% +04-05: EC Baffin Island,1645,--,97%,100%,35%,100%,100%,100%,--,100%,--,--,--,--,100% +04-06: SE Baffin Island,2249,--,98%,100%,42%,100%,100%,95%,--,100%,--,--,--,--,100% +04-07: Cumberland Sound,1108,--,99%,100%,36%,100%,100%,100%,--,100%,--,--,--,--,100% +04-08: Frobisher Bay,65,--,100%,100%,66%,100%,100%,100%,--,100%,--,--,--,--,100% +04-09: Labrador,103,--,--,100%,100%,100%,100%,100%,--,100%,100%,--,--,100%,100% diff --git a/docs/_static/tables/dem_rgi05_v2.csv b/docs/_static/tables/dem_rgi05_v2.csv new file mode 100644 index 0000000..74faa4e --- /dev/null +++ b/docs/_static/tables/dem_rgi05_v2.csv @@ -0,0 +1,2 @@ +RGI region,# total,ALASKA,ARCTICDEM,ASTER,AW3D30,COPDEM30,COPDEM90,DEM3,GIMP,MAPZEN,NASADEM,RAMP,REMA,SRTM,TANDEM +05-01: Greenland Periphery,19306,--,95%,98%,71%,99%,99%,99%,100%,99%,--,--,--,--,99% diff --git a/docs/_static/tables/dem_rgi06_v2.csv b/docs/_static/tables/dem_rgi06_v2.csv new file mode 100644 index 0000000..366f4f8 --- /dev/null +++ b/docs/_static/tables/dem_rgi06_v2.csv @@ -0,0 +1,2 @@ +RGI region,# total,ALASKA,ARCTICDEM,ASTER,AW3D30,COPDEM30,COPDEM90,DEM3,GIMP,MAPZEN,NASADEM,RAMP,REMA,SRTM,TANDEM +06-01: Iceland,568,--,97%,100%,27%,100%,100%,100%,--,100%,--,--,--,--,100% diff --git a/docs/_static/tables/dem_rgi07_v2.csv b/docs/_static/tables/dem_rgi07_v2.csv new file mode 100644 index 0000000..0ff35f6 --- /dev/null +++ b/docs/_static/tables/dem_rgi07_v2.csv @@ -0,0 +1,3 @@ +RGI region,# total,ALASKA,ARCTICDEM,ASTER,AW3D30,COPDEM30,COPDEM90,DEM3,GIMP,MAPZEN,NASADEM,RAMP,REMA,SRTM,TANDEM +07-01: Svalbard,1567,--,99%,100%,33%,100%,100%,100%,--,100%,--,--,--,--,99% +07-02: Jan Mayen,48,--,100%,100%,--,100%,100%,100%,--,100%,--,--,--,--,100% diff --git a/docs/_static/tables/dem_rgi08_v2.csv b/docs/_static/tables/dem_rgi08_v2.csv new file mode 100644 index 0000000..dcd8de8 --- /dev/null +++ b/docs/_static/tables/dem_rgi08_v2.csv @@ -0,0 +1,4 @@ +RGI region,# total,ALASKA,ARCTICDEM,ASTER,AW3D30,COPDEM30,COPDEM90,DEM3,GIMP,MAPZEN,NASADEM,RAMP,REMA,SRTM,TANDEM +08-01: N Scandinavia,1837,--,95%,100%,31%,100%,100%,100%,--,100%,--,--,--,--,100% +08-02: SW Scandinavia,1215,--,88%,100%,14%,100%,100%,100%,--,100%,18%,--,--,3%,100% +08-03: SE Scandinavia,365,--,84%,100%,19%,100%,100%,100%,--,100%,23%,--,--,8%,100% diff --git a/docs/_static/tables/dem_rgi09_v2.csv b/docs/_static/tables/dem_rgi09_v2.csv new file mode 100644 index 0000000..cda2de3 --- /dev/null +++ b/docs/_static/tables/dem_rgi09_v2.csv @@ -0,0 +1,4 @@ +RGI region,# total,ALASKA,ARCTICDEM,ASTER,AW3D30,COPDEM30,COPDEM90,DEM3,GIMP,MAPZEN,NASADEM,RAMP,REMA,SRTM,TANDEM +09-01: Franz Josef Land,412,--,100%,99%,--,99%,99%,100%,--,100%,--,--,--,--,100% +09-02: Novaya Zemlya,480,--,97%,100%,14%,100%,100%,100%,--,100%,--,--,--,--,100% +09-03: Severnaya Zemlya,177,--,99%,100%,3%,100%,100%,99%,--,100%,--,--,--,--,100% diff --git a/docs/_static/tables/dem_rgi10_v2.csv b/docs/_static/tables/dem_rgi10_v2.csv new file mode 100644 index 0000000..904f13d --- /dev/null +++ b/docs/_static/tables/dem_rgi10_v2.csv @@ -0,0 +1,7 @@ +RGI region,# total,ALASKA,ARCTICDEM,ASTER,AW3D30,COPDEM30,COPDEM90,DEM3,GIMP,MAPZEN,NASADEM,RAMP,REMA,SRTM,TANDEM +10-01: Ural Mountains,161,--,88%,100%,53%,100%,100%,100%,--,100%,--,--,--,--,100% +10-02: Central Siberia,394,--,80%,100%,61%,100%,100%,100%,--,100%,19%,--,--,19%,100% +10-03: Cherskiy/Suntar Khayata Ranges,426,--,91%,99%,61%,99%,99%,99%,--,100%,--,--,--,--,100% +10-04: Altay and Sayan,2437,--,--,100%,100%,100%,100%,100%,--,100%,100%,--,--,100%,100% +10-05: NE Russia,1660,--,96%,99%,79%,99%,99%,99%,--,99%,65%,--,--,59%,100% +10-06: E Chukotka,73,--,97%,100%,60%,100%,100%,100%,--,100%,--,--,--,--,100% diff --git a/docs/_static/tables/dem_rgi11_v2.csv b/docs/_static/tables/dem_rgi11_v2.csv new file mode 100644 index 0000000..9392e01 --- /dev/null +++ b/docs/_static/tables/dem_rgi11_v2.csv @@ -0,0 +1,3 @@ +RGI region,# total,ALASKA,ARCTICDEM,ASTER,AW3D30,COPDEM30,COPDEM90,DEM3,GIMP,MAPZEN,NASADEM,RAMP,REMA,SRTM,TANDEM +11-01: Alps,3892,--,--,100%,100%,99%,100%,100%,--,100%,100%,--,--,100%,93% +11-02: Southern and Eastern Europe,35,--,--,100%,100%,100%,100%,100%,--,100%,100%,--,--,100%,100% diff --git a/docs/_static/tables/dem_rgi12_v2.csv b/docs/_static/tables/dem_rgi12_v2.csv new file mode 100644 index 0000000..82280c4 --- /dev/null +++ b/docs/_static/tables/dem_rgi12_v2.csv @@ -0,0 +1,3 @@ +RGI region,# total,ALASKA,ARCTICDEM,ASTER,AW3D30,COPDEM30,COPDEM90,DEM3,GIMP,MAPZEN,NASADEM,RAMP,REMA,SRTM,TANDEM +12-01: Caucasus and Middle East,1637,--,--,100%,100%,95%,100%,100%,--,100%,100%,--,--,100%,98% +12-02: Middle East,251,--,--,100%,100%,97%,100%,100%,--,100%,100%,--,--,100%,96% diff --git a/docs/_static/tables/dem_rgi13_v2.csv b/docs/_static/tables/dem_rgi13_v2.csv new file mode 100644 index 0000000..479963b --- /dev/null +++ b/docs/_static/tables/dem_rgi13_v2.csv @@ -0,0 +1,10 @@ +RGI region,# total,ALASKA,ARCTICDEM,ASTER,AW3D30,COPDEM30,COPDEM90,DEM3,GIMP,MAPZEN,NASADEM,RAMP,REMA,SRTM,TANDEM +13-01: Hissar Alay,3151,--,--,100%,100%,100%,100%,100%,--,100%,100%,--,--,100%,98% +13-02: Pamir (Safed Khirs/W Tarim),10233,--,--,100%,100%,100%,100%,100%,--,100%,100%,--,--,100%,98% +13-03: W Tien Shan,9739,--,--,100%,100%,100%,100%,100%,--,100%,100%,--,--,100%,97% +13-04: E Tien Shan (Dzhungaria),5227,--,--,100%,100%,100%,100%,100%,--,100%,100%,--,--,100%,99% +13-05: W Kun Lun,5397,--,--,100%,100%,100%,100%,100%,--,100%,100%,--,--,100%,99% +13-06: E Kun Lun (Altyn Tagh),3519,--,--,100%,100%,100%,100%,100%,--,100%,100%,--,--,100%,100% +13-07: Qilian Shan,2730,--,--,100%,100%,100%,100%,100%,--,100%,100%,--,--,100%,100% +13-08: Inner Tibet,9368,--,--,100%,100%,100%,100%,100%,--,100%,100%,--,--,100%,100% +13-09: S and E Tibet,5065,--,--,100%,100%,100%,100%,100%,--,100%,100%,--,--,100%,96% diff --git a/docs/_static/tables/dem_rgi14_v2.csv b/docs/_static/tables/dem_rgi14_v2.csv new file mode 100644 index 0000000..6702b24 --- /dev/null +++ b/docs/_static/tables/dem_rgi14_v2.csv @@ -0,0 +1,4 @@ +RGI region,# total,ALASKA,ARCTICDEM,ASTER,AW3D30,COPDEM30,COPDEM90,DEM3,GIMP,MAPZEN,NASADEM,RAMP,REMA,SRTM,TANDEM +14-01: Hindu Kush,4401,--,--,100%,100%,100%,100%,100%,--,100%,100%,--,--,100%,95% +14-02: Karakoram,13757,--,--,100%,100%,100%,100%,100%,--,100%,100%,--,--,100%,94% +14-03: W Himalaya,9830,--,--,100%,100%,100%,100%,100%,--,100%,100%,--,--,100%,97% diff --git a/docs/_static/tables/dem_rgi15_v2.csv b/docs/_static/tables/dem_rgi15_v2.csv new file mode 100644 index 0000000..7bb62fe --- /dev/null +++ b/docs/_static/tables/dem_rgi15_v2.csv @@ -0,0 +1,4 @@ +RGI region,# total,ALASKA,ARCTICDEM,ASTER,AW3D30,COPDEM30,COPDEM90,DEM3,GIMP,MAPZEN,NASADEM,RAMP,REMA,SRTM,TANDEM +15-01: C Himalaya,4528,--,--,100%,100%,100%,100%,100%,--,100%,100%,--,--,100%,91% +15-02: E Himalaya,4238,--,--,100%,100%,100%,100%,100%,--,100%,100%,--,--,100%,97% +15-03: Hengduan Shan,4353,--,--,100%,100%,100%,100%,100%,--,100%,100%,--,--,100%,94% diff --git a/docs/_static/tables/dem_rgi16_v2.csv b/docs/_static/tables/dem_rgi16_v2.csv new file mode 100644 index 0000000..4c555f1 --- /dev/null +++ b/docs/_static/tables/dem_rgi16_v2.csv @@ -0,0 +1,5 @@ +RGI region,# total,ALASKA,ARCTICDEM,ASTER,AW3D30,COPDEM30,COPDEM90,DEM3,GIMP,MAPZEN,NASADEM,RAMP,REMA,SRTM,TANDEM +16-01: Low-latitude Andes,2891,--,--,100%,100%,100%,100%,100%,--,100%,100%,--,--,100%,99% +16-02: Mexico,7,--,--,100%,100%,100%,100%,100%,--,100%,100%,--,--,100%,100% +16-03: E Africa,36,--,--,100%,100%,100%,100%,100%,--,100%,100%,--,--,100%,100% +16-04: New Guinea,5,--,--,100%,100%,100%,100%,100%,--,100%,100%,--,--,100%,100% diff --git a/docs/_static/tables/dem_rgi17_v2.csv b/docs/_static/tables/dem_rgi17_v2.csv new file mode 100644 index 0000000..c78008b --- /dev/null +++ b/docs/_static/tables/dem_rgi17_v2.csv @@ -0,0 +1,3 @@ +RGI region,# total,ALASKA,ARCTICDEM,ASTER,AW3D30,COPDEM30,COPDEM90,DEM3,GIMP,MAPZEN,NASADEM,RAMP,REMA,SRTM,TANDEM +17-01: Patagonia,9434,--,--,99%,99%,99%,99%,99%,--,100%,99%,--,--,99%,99% +17-02: C Andes,6474,--,--,100%,100%,100%,100%,100%,--,100%,100%,--,--,100%,98% diff --git a/docs/_static/tables/dem_rgi18_v2.csv b/docs/_static/tables/dem_rgi18_v2.csv new file mode 100644 index 0000000..4e85804 --- /dev/null +++ b/docs/_static/tables/dem_rgi18_v2.csv @@ -0,0 +1,2 @@ +RGI region,# total,ALASKA,ARCTICDEM,ASTER,AW3D30,COPDEM30,COPDEM90,DEM3,GIMP,MAPZEN,NASADEM,RAMP,REMA,SRTM,TANDEM +18-01: New Zealand,3537,--,--,100%,100%,100%,100%,100%,--,100%,100%,--,--,100%,85% diff --git a/docs/_static/tables/dem_rgi19_v2.csv b/docs/_static/tables/dem_rgi19_v2.csv new file mode 100644 index 0000000..f38a5db --- /dev/null +++ b/docs/_static/tables/dem_rgi19_v2.csv @@ -0,0 +1,19 @@ +RGI region,# total,ALASKA,ARCTICDEM,ASTER,AW3D30,COPDEM30,COPDEM90,DEM3,GIMP,MAPZEN,NASADEM,RAMP,REMA,SRTM,TANDEM +19-01: Subantarctic (Pacific),27,--,--,96%,--,92%,92%,96%,--,100%,--,37%,--,--,100% +19-02: South Shetlands and South Orkney,412,--,--,91%,11%,97%,97%,98%,--,100%,--,72%,18%,--,51% +19-03: Subantarctic (Atlantic),553,--,--,97%,91%,96%,96%,97%,--,100%,94%,--,--,92%,92% +19-04: Subantarctic (Indian),177,--,--,100%,99%,100%,100%,100%,--,100%,100%,--,--,98%,98% +19-05: Balleny Islands,15,--,--,--,--,60%,66%,40%,--,93%,--,13%,--,--,93% +19-11: E Queen Maud Land 7A,162,--,--,30%,26%,69%,72%,11%,--,100%,--,15%,6%,--,100% +19-12: Amery Ice Shelf 7B,1,--,--,100%,--,100%,100%,100%,--,100%,--,100%,100%,--,100% +19-13: Wilkes Land 7C,73,--,--,27%,34%,94%,94%,63%,--,100%,--,65%,21%,--,100% +19-14: Victoria Land 7D,70,--,--,22%,31%,87%,85%,41%,--,100%,--,42%,15%,--,100% +19-15: Ross Ice Shelf 7E,121,--,--,96%,93%,100%,100%,96%,--,100%,--,96%,75%,--,100% +19-16: Marie Byrd Land 7F,34,--,--,73%,29%,88%,88%,94%,--,97%,--,94%,52%,--,100% +19-17: Pine Island Bay 7G,109,--,--,11%,5%,23%,26%,6%,--,100%,--,18%,1%,--,100% +19-18: Bellingshausen Sea 7H1,20,--,--,90%,30%,90%,90%,85%,--,100%,--,95%,55%,--,100% +19-19: Alexander Island 7H2,123,--,--,76%,20%,91%,91%,88%,--,100%,--,91%,48%,--,100% +19-20: W Antarctic Pena 7I1,667,--,--,78%,15%,88%,89%,66%,--,100%,--,68%,23%,--,83% +19-21: NE Antarctic Pena 7I2,169,--,--,94%,37%,99%,99%,94%,--,100%,--,94%,68%,--,98% +19-22: SE Antarctic Pena 7I3,5,--,--,80%,--,100%,100%,100%,--,100%,--,100%,--,--,100% +19-24: W Queen Maud Land 7K,14,--,--,28%,7%,100%,100%,100%,--,100%,--,100%,50%,--,100% diff --git a/docs/conf.py b/docs/conf.py index 8468202..fd1ed93 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -37,11 +37,6 @@ print("scipy: %s, %s" % (scipy.__version__, scipy.__file__)) except ImportError: print("no scipy") -try: - import PIL - print("PIL (Pillow): %s, %s" % (PIL.PILLOW_VERSION, PIL.__file__)) -except ImportError: - print("no PIL (Pillow)") try: import pandas print("pandas: %s, %s" % (pandas.__version__, pandas.__file__)) @@ -122,9 +117,10 @@ 'IPython.sphinxext.ipython_console_highlighting', ] -extlinks = {'issue': ('https://github.com/OGGM/rgitools/issues/%s', 'GH'), - 'pull': ('https://github.com/OGGM/rgitools/pull/%s', 'PR'), - } +extlinks = { + 'issue': ('https://github.com/OGGM/rgitools/issues/%s', 'GH %s'), + 'pull': ('https://github.com/OGGM/rgitools/pull/%s', 'PR %s'), +} autosummary_generate = True @@ -166,7 +162,7 @@ # # 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 +language = 'en' # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: @@ -303,7 +299,7 @@ # Sphinx supports the following languages: # 'da', 'de', 'en', 'es', 'fi', 'fr', 'h', 'it', 'ja' # 'nl', 'no', 'pt', 'ro', 'r', 'sv', 'tr' -#html_search_language = 'en' +# html_search_language = 'en' # A dictionary with options for the search language support, empty by default. # Now only 'ja' uses this config value @@ -399,7 +395,4 @@ # Example configuration for intersphinx: refer to the Python standard library. intersphinx_mapping = { - 'python': ('https://docs.python.org/3.6/', None), - 'pandas': ('http://pandas.pydata.org/pandas-docs/stable/', None), - 'numpy': ('http://docs.scipy.org/doc/numpy/', None), } diff --git a/docs/dem_examples/alexander.rst b/docs/dem_examples/alexander.rst new file mode 100644 index 0000000..2d88055 --- /dev/null +++ b/docs/dem_examples/alexander.rst @@ -0,0 +1,44 @@ +Alexander Island (Antarctica) +============================= + +Located at the Antarctic Peninsula (`72°30'59.8"S 71°18'00.1"W `_), +RGI60-19.00124. + +The sources available are: ASTER, AW3D30, COPDEM30, COPDEM90, DEM3, RAMP, MAPZEN and TanDEM-X. + +Summary +------- + +- ASTER has a lot of noise +- DEM3 is obviously taken from RAMP +- One of the rare cases where there is no proper MAPZEN data +- AW3D30 has poor data coverage + +Maps +---- + +.. image:: /_static/dems_examples/alexander/dem_topo_color.png + :width: 100% + +Shaded relief +------------- + +.. image:: /_static/dems_examples/alexander/dem_topo_shade.png + :width: 100% + + +Differences +----------- + +.. image:: /_static/dems_examples/alexander/dem_diffs.png + :width: 100% + + + +Scatter plots +------------- + +These scatter plots are for the glacier area only. + +.. image:: /_static/dems_examples/alexander/dem_scatter.png + :width: 100% diff --git a/docs/dem_examples/balleny_islands.rst b/docs/dem_examples/balleny_islands.rst new file mode 100644 index 0000000..f62f9fa --- /dev/null +++ b/docs/dem_examples/balleny_islands.rst @@ -0,0 +1,44 @@ +Balleny Islands (Antarctica) +============================= + +Located at the Antarctic Peninsula (`67°26'33.0"S 164°45'21.6"E `_), +RGI60-19.00783. + +The sources available are: RAMP, MAPZEN, TANDEM-X, COPDEM30, COPDEM90 and DEM3. + +Summary +------- + +- RAMP shows ocean +- MAPZEN shows no data or ocean +- TANDEM, COPDEM30 and COPDEM90 don't match the outline and have artifacts +- DEM3 matches the outlines the best + +Maps +---- + +.. image:: /_static/dems_examples/balleny_islands/dem_topo_color.png + :width: 100% + +Shaded relief +------------- + +.. image:: /_static/dems_examples/balleny_islands/dem_topo_shade.png + :width: 100% + + +Differences +----------- + +.. image:: /_static/dems_examples/balleny_islands/dem_diffs.png + :width: 100% + + + +Scatter plots +------------- + +These scatter plots are for the glacier area only. + +.. image:: /_static/dems_examples/balleny_islands/dem_scatter.png + :width: 100% diff --git a/docs/dem_examples/columbia.rst b/docs/dem_examples/columbia.rst index e39c73c..53b2e88 100644 --- a/docs/dem_examples/columbia.rst +++ b/docs/dem_examples/columbia.rst @@ -1,10 +1,10 @@ Columbia (Alaska) ================= -Located in Alaska (`61°12'02"N 146°54'17"W `_). +Located in Alaska (`61°12'02"N 146°54'17"W `_), +RGI60-01.10689. -The sources available are: DEM3, ASTER, TanDEM-X, ArcticDEM. **The current -default is DEM3**. +The sources available are: ASTER, Alaska DEM, COPDEM30, COPDEM90, AW3D30, DEM3, ArcticDEM, TanDEM-X and MAPZEN. Summary ------- @@ -15,6 +15,9 @@ Summary - clear differences between ASTER and the newer products (TanDEM-X, ArcticDEM) might be due to mass-loss, although it seems exaggerated - it is one of the cases where ArctiDEM has too many data gaps +- AW3D30 also hast way to many gaps +- Both Alaska and Copernicus DEM are without visual problems and compareable + besides some differences in the tongue area. Maps diff --git a/docs/dem_examples/devon.rst b/docs/dem_examples/devon.rst index a01e3a6..bbd0c23 100644 --- a/docs/dem_examples/devon.rst +++ b/docs/dem_examples/devon.rst @@ -1,10 +1,10 @@ Devon ice-cap (Arctic Canada) ============================= -Located in Canada (`75°04'08"N 83°25'03"W `_). +Located in Canada (`75°04'08"N 83°25'03"W `_), +RGI60-03.02489. -The sources available are: DEM3, ASTER, ArcticDEM, TanDEM-X. **The current -default is DEM3**. +The sources available are: ASTER, COPDEM30, COPDEM90, AW3D30, DEM3, ArcticDEM, TanDEM-X and MAPZEN. Summary ------- @@ -12,6 +12,8 @@ Summary - DEM3 has small artifacts at the boundary between two tiles, fortunately not too dramatic - ArcticDEM, TanDEM-X are performing well +- ASTER has a lot of artifacts and noise +- AW3D30 misses huge junks Maps ---- diff --git a/docs/dem_examples/dobbin.rst b/docs/dem_examples/dobbin.rst new file mode 100644 index 0000000..1e41fda --- /dev/null +++ b/docs/dem_examples/dobbin.rst @@ -0,0 +1,43 @@ +Dobbin Bay (Arctic Canada) +========================== + +Located on Ellesmere Island (`80°05'21.1"N 74°43'43.3"W `_), +RGI60-03.00251. + +The sources available are: ASTER, COPDEM30, COPDEM90, AW3D30, ArcticDEM, DEM3, GIMP, MAPZEN and TanDEM-X. + +Summary +------- + +- The Greenland DEM GIMP is available but all values outside of Greenland are set to 0. +- AW3D30 has many missing patches +- ArcticDEM has a few missing points, but overall looks good and agrees with the other DEMs + +Maps +---- + +.. image:: /_static/dems_examples/dobbin/dem_topo_color.png + :width: 100% + +Shaded relief +------------- + +.. image:: /_static/dems_examples/dobbin/dem_topo_shade.png + :width: 100% + + +Differences +----------- + +.. image:: /_static/dems_examples/dobbin/dem_diffs.png + :width: 100% + + + +Scatter plots +------------- + +These scatter plots are for the glacier area only. + +.. image:: /_static/dems_examples/dobbin/dem_scatter.png + :width: 100% diff --git a/docs/dem_examples/gillock.rst b/docs/dem_examples/gillock.rst new file mode 100644 index 0000000..20c3570 --- /dev/null +++ b/docs/dem_examples/gillock.rst @@ -0,0 +1,47 @@ +Gillock Island (Antarctica) +=========================== + +Located at the East Antarctica (`70°26'06.0"S 71°48'25.3"E `_), +RGI60-19.01251. + +The sources available are: ASTER, AW3D30, COPDEM30, COPDEM90, DEM3, RAMP, REMA, MAPZEN and TanDEM-X. + +Summary +------- + +- ASTER shows ocean +- DEM3 is obviously taken from RAMP +- REMA and TanDEM-X agree quite well +- REMA has small missing featuers +- One of the rare cases where there is no MAPZEN data +- AW3D30 has poor data coverage + +Maps +---- + +.. image:: /_static/dems_examples/gillock/dem_topo_color.png + :width: 100% + +Shaded relief +------------- + +.. image:: /_static/dems_examples/gillock/dem_topo_shade.png + :width: 100% + + +Differences +----------- + +.. image:: /_static/dems_examples/gillock/dem_diffs.png + :width: 100% + + + +Scatter plots +------------- + +These scatter plots are for the glacier area only. +The plots do not work in that case, as MAPZEN DEM only contains NaN values. + +.. image:: /_static/dems_examples/gillock/dem_scatter.png + :width: 100% diff --git a/docs/dem_examples/greenland.rst b/docs/dem_examples/greenland.rst index 71d7acb..3df48e0 100644 --- a/docs/dem_examples/greenland.rst +++ b/docs/dem_examples/greenland.rst @@ -1,10 +1,10 @@ Random ice-cap (Greenland) ========================== -Located in Greenland (`81°21'55"N 25°40'49"W `_). +Located in Greenland (`81°21'55"N 25°40'49"W `_), +RGI60-05.10137. -The sources available are: GIMP, ASTER, ArcticDEM. **The current -default is GIMP**. +The sources available are: ASTER, COPDEM30, COPDEM90, AW3D30, ArcticDEM, DEM3, GIMP, MAPZEN and TanDEM-X. Summary ------- diff --git a/docs/dem_examples/hef.rst b/docs/dem_examples/hef.rst index 7f5a739..1824247 100644 --- a/docs/dem_examples/hef.rst +++ b/docs/dem_examples/hef.rst @@ -1,10 +1,10 @@ Hintereisferner (Alps) ====================== -Located in the Austrian Alps (`46°47'43"N 10°46'01"E `_). +Located in the Austrian Alps (`46°47'43"N 10°46'01"E `_), +RGI60-11.00897. -The sources available are: SRTM, ASTER, TanDEM-X, DEM3. **The current -default is SRTM**. +The sources available are: ASTER, COPDEM30, COPDEM90, AW3D30, DEM3, MAPZEN, NASADEM, SRTM and TanDEM-X. Summary ------- @@ -14,6 +14,9 @@ Summary - worrying generalised bias between SRTM and TanDEM-X, the latter being higher of 40m in average - ASTER and SRTM agree the most +- NASADEM shows noticeable differences to SRTM in steeper (often unglaciated + areas) which are also present in e.g. AW3D30. But the flatter parts of the + glacier are very similar. Maps ---- diff --git a/docs/dem_examples/iceland.rst b/docs/dem_examples/iceland.rst index 447069f..0ddf694 100644 --- a/docs/dem_examples/iceland.rst +++ b/docs/dem_examples/iceland.rst @@ -1,10 +1,10 @@ Dyngjujoekull (Iceland) ======================= -Located in Iceland (`64°43'03"N 17°03'28"W `_). +Located in Iceland (`64°43'03"N 17°03'28"W `_), +RGI60-06.00477. -The sources available are: DEM3, ASTER, TanDEM-X, ArcticDEM. **The current -default is DEM3**. +The sources available are: ASTER, COPDEM30, COPDEM90, AW3D30, ArcticDEM, DEM3, MAPZEN and TanDEM-X. Summary ------- @@ -14,6 +14,7 @@ Summary - TanDEM-X and ArcticDEM agree well - DEM3 was generated before these new products, so I guess that a little bit of magic was needed to generate the map +- AW3D30 misses huge junks Maps ---- diff --git a/docs/dem_examples/lenin.rst b/docs/dem_examples/lenin.rst new file mode 100644 index 0000000..9369e16 --- /dev/null +++ b/docs/dem_examples/lenin.rst @@ -0,0 +1,44 @@ +Leningradskiy Ice Cap +===================== + +Located on Bolshevik Island in the Russian Arctic (`78°29'30.4"N 103°05'01.0"E `_), +RGI60-09.00552. + +The sources available are: ASTER, COPDEM30, COPDEM90, AW3D30, ArcticDEM, DEM3, MAPZEN and TanDEM-X. + +Summary +------- + +- Aster has some extreme artefacts +- AW3D30 is missing +- MAPZEN hase some smaller artefacts +- TanDEM-X and ArcticDEM agree quite well + +Maps +---- + +.. image:: /_static/dems_examples/lenin/dem_topo_color.png + :width: 100% + +Shaded relief +------------- + +.. image:: /_static/dems_examples/lenin/dem_topo_shade.png + :width: 100% + + +Differences +----------- + +.. image:: /_static/dems_examples/lenin/dem_diffs.png + :width: 100% + + + +Scatter plots +------------- + +These scatter plots are for the glacier area only. + +.. image:: /_static/dems_examples/lenin/dem_scatter.png + :width: 100% diff --git a/docs/dem_examples/nigards.rst b/docs/dem_examples/nigards.rst new file mode 100644 index 0000000..f18a757 --- /dev/null +++ b/docs/dem_examples/nigards.rst @@ -0,0 +1,45 @@ +Nigardsbreen (Norway) +===================== + +Located in southern Norway (`61°41'32.9"N 7°10'07.7"E `_), +RGI60-08.01126. + +The sources available are: ASTER, COPDEM30, COPDEM90, AW3D30, ArcticDEM, DEM3, MAPZEN and TanDEM-X. + +Summary +------- + +- Aster is noisy +- AW3D30 is missing most of the glacier +- For some of the available AW3D30 parts it deviates significantly from the other DEMs +- ArcticDEM is also missing bigger junks +- TanDEM-X has some gaps outside the glacier + +Maps +---- + +.. image:: /_static/dems_examples/nigards/dem_topo_color.png + :width: 100% + +Shaded relief +------------- + +.. image:: /_static/dems_examples/nigards/dem_topo_shade.png + :width: 100% + + +Differences +----------- + +.. image:: /_static/dems_examples/nigards/dem_diffs.png + :width: 100% + + + +Scatter plots +------------- + +These scatter plots are for the glacier area only. + +.. image:: /_static/dems_examples/nigards/dem_scatter.png + :width: 100% diff --git a/docs/dem_examples/nordenskjoeld.rst b/docs/dem_examples/nordenskjoeld.rst new file mode 100644 index 0000000..9abe4e6 --- /dev/null +++ b/docs/dem_examples/nordenskjoeld.rst @@ -0,0 +1,43 @@ +Nordenskjöld Glacier (S. Georgia) +================================= + +Located in South Georgia (`54°24'27.5"S 36°22'47.2"W `_), +RGI60-19.02274. + +The sources available are: ASTER, COPDEM30, COPDEM90, AW3D30, DEM3, SRTM, NASADEM, MAPZEN and TanDEM-X. + +Summary +------- + +- one of the (many) cases where TanDEM-X has data gaps and artefacts. Especially note the artefacts in the upper (southern) part of the glacier. +- NASADEM shows noticeable differences to SRTM in steeper/upper parts which are + also present in e.g. AW3D30. + +Maps +---- + +.. image:: /_static/dems_examples/nordenskjoeld/dem_topo_color.png + :width: 100% + +Shaded relief +------------- + +.. image:: /_static/dems_examples/nordenskjoeld/dem_topo_shade.png + :width: 100% + + +Differences +----------- + +.. image:: /_static/dems_examples/nordenskjoeld/dem_diffs.png + :width: 100% + + + +Scatter plots +------------- + +These scatter plots are for the glacier area only. + +.. image:: /_static/dems_examples/nordenskjoeld/dem_scatter.png + :width: 100% diff --git a/docs/dem_examples/oberaletsch.rst b/docs/dem_examples/oberaletsch.rst index 3c300d6..3db1b7b 100644 --- a/docs/dem_examples/oberaletsch.rst +++ b/docs/dem_examples/oberaletsch.rst @@ -1,15 +1,18 @@ -Oberaletschgletscher -==================== +Oberaletschgletscher (Alps) +=========================== -Located in the Swiss Alps (`46°25'21"N 7°57'55"E `_). +Located in the Swiss Alps (`46°25'21"N 7°57'55"E `_), +RGI60-11.01827. -The sources available are: SRTM, ASTER, TanDEM-X, DEM3. **The current -default is SRTM**. +The sources available are: ASTER, COPDEM30, COPDEM90, AW3D30, DEM3, SRTM, NASADEM, MAPZEN and TanDEM-X. Summary ------- - one of the (many) cases where TanDEM-X has data gaps and artefacts +- NASADEM shows noticeable differences to SRTM in steeper (often unglaciated + areas) which are also present in e.g. ASTER. But the flatter parts of the + glacier are very similar. Maps ---- diff --git a/docs/dem_examples/olivine.rst b/docs/dem_examples/olivine.rst new file mode 100644 index 0000000..90038ef --- /dev/null +++ b/docs/dem_examples/olivine.rst @@ -0,0 +1,45 @@ +Olivine Ice Plateau (NZ) +======================== + +Located in New Zealand (`44°26'02.2"S 168°22'27.2"E `_), +RGI60-18.00854. + +The sources available are: ASTER, COPDEM30, COPDEM90, AW3D30, DEM3, SRTM, NASADEM, MAPZEN and TanDEM-X. + +Summary +------- + +- TanDEM-X is missing huge parts of the topography +- SRTM is available for entire New Zealand +- NASADEM shows noticeable differences to SRTM at the head and the tongue of + the ice plateau and also the surroundings. This is very similar to ASTER and + AW3D30. + +Maps +---- + +.. image:: /_static/dems_examples/olivine/dem_topo_color.png + :width: 100% + +Shaded relief +------------- + +.. image:: /_static/dems_examples/olivine/dem_topo_shade.png + :width: 100% + + +Differences +----------- + +.. image:: /_static/dems_examples/olivine/dem_diffs.png + :width: 100% + + + +Scatter plots +------------- + +These scatter plots are for the glacier area only. + +.. image:: /_static/dems_examples/olivine/dem_scatter.png + :width: 100% diff --git a/docs/dem_examples/pine_island_bay.rst b/docs/dem_examples/pine_island_bay.rst new file mode 100644 index 0000000..af7efaa --- /dev/null +++ b/docs/dem_examples/pine_island_bay.rst @@ -0,0 +1,44 @@ +Pine Island Bay (Antarctica) +============================= + +Located at the Antarctic Peninsula (`73°08'40.6"S 105°05'34.8"W `_), +RGI60-19.01405. + +The sources available are: RAMP, MAPZEN, TANDEM-X, COPDEM30, COPDEM90 and DEM3. + +Summary +------- + +- TANDEM, COPDEM30 and COPDEM90 DEMs are clearly shifted to the north-east +- AW3D30 has no data +- MAPZEN and ASTER are noisy and a bit shifted to the east +- DEM3 is taken from RAMP + +Maps +---- + +.. image:: /_static/dems_examples/pine_island_bay/dem_topo_color.png + :width: 100% + +Shaded relief +------------- + +.. image:: /_static/dems_examples/pine_island_bay/dem_topo_shade.png + :width: 100% + + +Differences +----------- + +.. image:: /_static/dems_examples/pine_island_bay/dem_diffs.png + :width: 100% + + + +Scatter plots +------------- + +These scatter plots are for the glacier area only. + +.. image:: /_static/dems_examples/pine_island_bay/dem_scatter.png + :width: 100% diff --git a/docs/dem_examples/queen_maud_land.rst b/docs/dem_examples/queen_maud_land.rst new file mode 100644 index 0000000..b0bb3c5 --- /dev/null +++ b/docs/dem_examples/queen_maud_land.rst @@ -0,0 +1,44 @@ +Queen Maud Land (Antarctica) +============================= + +Located at the Antarctic Peninsula (`70°02'24.4"S 10°48'19.8"E `_), +RGI60-19.00792. + +The sources available are: ASTER, REMA, RAMP, MAPZEN, TANDEM-X, COPDEM30, COPDEM90 and DEM3. + +Summary +------- + +- ASTER shows ocean +- MAPZEN has no data +- TANDEM, COPDEM30 and COPDEM90 are shifted towards the south +- DEM3 and RAMP are similiar but show no glacier + +Maps +---- + +.. image:: /_static/dems_examples/queen_maud_land/dem_topo_color.png + :width: 100% + +Shaded relief +------------- + +.. image:: /_static/dems_examples/queen_maud_land/dem_topo_shade.png + :width: 100% + + +Differences +----------- + +.. image:: /_static/dems_examples/queen_maud_land/dem_diffs.png + :width: 100% + + + +Scatter plots +------------- + +These scatter plots are for the glacier area only. + +.. image:: /_static/dems_examples/queen_maud_land/dem_scatter.png + :width: 100% diff --git a/docs/dem_examples/shallap.rst b/docs/dem_examples/shallap.rst index 7359099..e9af349 100644 --- a/docs/dem_examples/shallap.rst +++ b/docs/dem_examples/shallap.rst @@ -1,10 +1,10 @@ Shallap (Peru) ============== -Located in Peru (`9°29'08"S 77°20'02"W `_). +Located in Peru (`9°29'08"S 77°20'02"W `_), +RGI60-16.02207. -The sources available are: SRTM, ASTER, TanDEM-X, DEM3. **The current -default is SRTM**. +The sources available are: ASTER, COPDEM30, COPDEM90, AW3D30, DEM3, SRTM, NASADEM, MAPZEN and TanDEM-X. Summary ------- @@ -12,6 +12,12 @@ Summary - another location where TanDEM-X has artifacts - the other DEMS also agree quite poorly - obvious smoothing artefact in SRTM +- the smoothing artefacts are gone in NASADEM and probably replaced with ASTER + data +- NASADEM and SRTM are quite different here +- NASADEM still has a wired feature in the northwest corner which is also + present in SRTM + Maps ---- diff --git a/docs/dem_examples/tellbreen.rst b/docs/dem_examples/tellbreen.rst new file mode 100644 index 0000000..dc9eee5 --- /dev/null +++ b/docs/dem_examples/tellbreen.rst @@ -0,0 +1,42 @@ +Tellbreen (Svalbard) +==================== + +Located on Svalbard (`78°15'11.7"N 16°13'08.2"E `_), +RGI60-07.01114. + +The sources available are: ASTER, COPDEM30, COPDEM90, AW3D30, ArcticDEM, DEM3, MAPZEN and TanDEM-X. + +Summary +------- + +- Aster has some noisy patches +- MAPZEN shows a prominent artifact which is not flagged as false data + +Maps +---- + +.. image:: /_static/dems_examples/tellbreen/dem_topo_color.png + :width: 100% + +Shaded relief +------------- + +.. image:: /_static/dems_examples/tellbreen/dem_topo_shade.png + :width: 100% + + +Differences +----------- + +.. image:: /_static/dems_examples/tellbreen/dem_diffs.png + :width: 100% + + + +Scatter plots +------------- + +These scatter plots are for the glacier area only. + +.. image:: /_static/dems_examples/tellbreen/dem_scatter.png + :width: 100% diff --git a/docs/dem_examples/thana.rst b/docs/dem_examples/thana.rst new file mode 100644 index 0000000..7cb7d1b --- /dev/null +++ b/docs/dem_examples/thana.rst @@ -0,0 +1,45 @@ +Thana (Bhutan) +============== + +Located in the eastern Himalayas (`28°01'16.1"N 90°36'36.6"E `_), +RGI60-15.02578. + +The sources available are: ASTER, COPDEM30, COPDEM90, AW3D30, DEM3, SRTM, NASADEM, MAPZEN and TanDEM-X. + +Summary +------- + +- Aster has a noisy glacier surface +- SRTM is available for the entire High Mountain Asia +- NASADEM shows noticeable differences to SRTM in steeper (often unglaciated + areas) which are also present in e.g. ASTER. But the flatter/lower parts of + the glacier look similar. + +Maps +---- + +.. image:: /_static/dems_examples/thana/dem_topo_color.png + :width: 100% + +Shaded relief +------------- + +.. image:: /_static/dems_examples/thana/dem_topo_shade.png + :width: 100% + + +Differences +----------- + +.. image:: /_static/dems_examples/thana/dem_diffs.png + :width: 100% + + + +Scatter plots +------------- + +These scatter plots are for the glacier area only. + +.. image:: /_static/dems_examples/shallap/dem_scatter.png + :width: 100% diff --git a/docs/dems.rst b/docs/dems.rst index 2c69dd9..b598953 100644 --- a/docs/dems.rst +++ b/docs/dems.rst @@ -1,55 +1,135 @@ .. _dems: -The DEM problem -=============== +The RGI-TOPO dataset (beta release) +=================================== -One of the main goals of rgitools is to provide not only aggregated -statistics (hypsometry), but also a local topography map -for each single glacier in the RGI. +RGI-TOPO provides a local topography map for each single glacier in the RGI. -Unfortunately, **there is no gap-free and freely available global DEM to -date**. For most regions we can rely on a number of sources, which all have -their own issues. Here is the list currently supported by OGGM/rgitools: +.. image:: /_static/dems_examples/rgitopo_ex.jpg + :width: 100% + +We gathered and processed topography data for each glacier in the RGI V6 and +for each :ref:`dem-data-sources` we are aware of. +These data are released in a **beta version and are provided here +for feedback and testing purposes only**, i.e. they are not (yet) an +official RGI product. In particular, the various topography data +are provided "as is", i.e. without recommendation on which data source to use. +Note also that RGI-TOPO cannot be used for glacier change assessment: its aim is +to provide a baseline for glacier modelling and other data analysis efforts. + +Please help us to finalize this product! :ref:`dem-how-to-help` will tell you +how. + +.. note:: + + We will include the final topography and hypsometry data in the next + official RGI release (V7) scheduled for release by end of 2020. + + +Data download +------------- + +We processed the data at two different resolutions. +The default version is available at `https://cluster.klima.uni-bremen.de/data/gdirs/dems_v1/default/RGI62/b_010/L1/ `_. +And a version with higher spatial resolution is available at `https://cluster.klima.uni-bremen.de/data/gdirs/dems_v1/highres/RGI62/b_020/L1/ `_ + +**New in June 2022**: a new version for RGI6 (**dems_v2**) is available at `https://cluster.klima.uni-bremen.de/data/gdirs/dems_v2/default/RGI62/b_010/L1/ `_. This preprocessed data includes the recently released `Copernicus DEM GLO-30`_. + +See :ref:`dem-data-format` for details on file content, processing and resolution. +And carefully read :ref:`dem-how-to-cite` to find information on the original +data sources and how to acknowledge them. + +.. _dem-data-sources: + +Data sources +------------ + +For most regions several data sources are available, each with various +acquisition dates and data quality issues. +Until recently there was no **gap-free, global DEM** available. +This might have changed with the release of `Copernicus DEM GLO-90`_ which so +far shows no artifacts and a very good global coverage: +All but 284 RGI v6 glaciers are covered by Copernicus DEM. +Unfortunately 264 of these are located in the +:ref:`RGI region 19: Antarctic and Subantarctic` which accounts for 10% +of this region's total glaciers. These are mostly situated on small islands +which are either not covered by the DEM or the RGI outlines are slightly +misaligned and placed in the ocean. But this needs further investigation. +Another downside is that the acquisition date of Copernicus DEM (2010-2015) +differs from the target year 2000 of the current and the upcoming RGI outlines. + +As of today (Mar 27 2020), the data sources supported by OGGM/rgitools are: - the `Shuttle Radar Topography Mission`_ (SRTM) 90m Digital Elevation Database v4.1 - freely available for all locations in the [60°S; 60°N] range + freely available for all locations in the [60°S; 60°N] range. + **Date of acquisition: February 2000** - the `Greenland Mapping Project`_ (GIMP) Digital Elevation Model - covering Greenland (for RGI region 05) + covering Greenland (for RGI region 05). + **Date of acquisition: February 2003 - October 2009** - the `Radarsat Antarctic Mapping Project`_ (RAMP) Digital Elevation Model, Version 2 covering the Antarctic continent - (for RGI region 19 with the exception of the peripheral islands) -- the `Advanced Spaceborne Thermal Emission and Reflection Radiometer`_ (ASTER GDEM) - Global Digital Elevation Model Version 2 covering the entire globe. - (password protected for license issues) + (for RGI region 19 with the exception of the peripheral islands). + **Date of acquisition: 1940-1999 (mostly 1980s and 1990s)** +- the `Advanced Spaceborne Thermal Emission and Reflection Radiometer`_ (ASTER) + ASTER Global Digital Elevation Model (GDEM) Version 3 (ASTGTM) covering the entire globe but + with consequent artefacts (not tagged as invalid data). + **Date of acquisition: 2000 - 2013** - the `Viewfinder Panoramas DEM3`_ products, a global DEM based on various of the - above listed sources, manually merged and corrected. + above listed sources, manually merged and corrected, sometimes from cartographical data. + **Date of acquisition: variable, depending on original source.** - the `TanDEM-X 90m`_ DEM, newly released and covering the entire globe. + **Date of acquisition: December 2010 - January 2015** - the `Arctic DEM`_ newly released in version 7 and covering the northern latitudes at various resolutions (we picked 100m for a start). + **Date of acquisition: 2007-2018** - the `REMA Antarctic DEM`_ newly released and covering the Antarctic continent at various resolutions (we picked 100m for a start). + **Date of acquisition: 2009 - 2017 (mostly 2015-2016)** - the `ALOS World 3D - 30mx`_ (AW3D30) global digital surface model from the Japanese space agency JAXA. + **Date of acquisition: 2006-2011** - the `AWS terrain tiles`_ data hosted on Amazon Web Services and maintained by `Mapzen `_. This is a bundle of `various data-sources`_ but very flexible in use. + **Date of acquisition: variable, depending on original source** +- the `Copernicus DEM GLO-90`_ is a new global DEM based on WorldDEM and void + filled using ASTER, SRTM, GMTED2010, TerraSAR-X and ALOS World 3D-30m. + It is a European Space Agency Copernicus product and freely available at a + 3 arc second resolution. + **Date of acquisition: 2010-2015** +- the `Copernicus DEM GLO-30`_ - is similar to Copernicus DEM GLO-90 but at approximately + 30m resolution (1 arc second). + **Date of acquisition: 2010-2015** +- the `Alaska V3 DEM`_ is a merged DEM product from SRTM, IFSAR DEM, SPOT + observations of the SPIRIT program and ASTER with a final resolution of 30m. + The DEM was created for and is provided by `Kienholz et al., 2014`_. + **Date of acquisition: 2000-2011** +- the `NASADEM`_ is a merged DEM product with 1 arc second resolution and + available between 60N and 56S. NASADEM is dereived from the original SRTM + but postprocessed with updated algorithms and newer auxiliary data which were + not around for the original SRTM processing. + **Date of acquisition: February 2000** .. _Shuttle Radar Topography Mission: http://srtm.csi.cgiar.org/ .. _Greenland Mapping Project: https://bpcrc.osu.edu/gdg/data/gimpdem .. _Radarsat Antarctic Mapping Project: http://nsidc.org/data/nsidc-0082 .. _Viewfinder Panoramas DEM3: http://viewfinderpanoramas.org/dem3.html -.. _Advanced Spaceborne Thermal Emission and Reflection Radiometer: https://asterweb.jpl.nasa.gov/gdem.asp +.. _Advanced Spaceborne Thermal Emission and Reflection Radiometer: https://doi.org/10.5067/ASTER/ASTGTM.003 .. _TanDEM-X 90m: https://geoservice.dlr.de/web/dataguide/tdm90/ .. _Arctic DEM: https://www.pgc.umn.edu/data/arcticdem/ .. _ALOS World 3D - 30mx: https://www.eorc.jaxa.jp/ALOS/en/aw3d30/ .. _AWS terrain tiles: https://registry.opendata.aws/terrain-tiles/ .. _various data-sources: https://github.com/tilezen/joerd/blob/master/docs/data-sources.md .. _REMA Antarctic DEM: https://www.pgc.umn.edu/data/rema/ +.. _Copernicus DEM GLO-90: https://bit.ly/2T98qqs +.. _Copernicus DEM GLO-30: https://spacedata.copernicus.eu/web/cscda/dataset-details?articleId=394198 +.. _`Alaska V3 DEM`: https://www.the-cryosphere.net/8/503/2014/ +.. _`Kienholz et al., 2014`: https://www.the-cryosphere.net/8/503/2014/ +.. _`NASADEM`: https://lpdaac.usgs.gov/products/nasadem_hgtv001/ -In theory, this should be enough data. In practice, none of the solutions above -is 100% satisfying. We didn't do a thorough assesment yet, but you can have a -look at the following examples: +Examples +-------- .. toctree:: :maxdepth: 1 @@ -61,23 +141,215 @@ look at the following examples: dem_examples/greenland.rst dem_examples/devon.rst dem_examples/shallap.rst + dem_examples/nordenskjoeld.rst + dem_examples/alexander.rst + dem_examples/gillock.rst + dem_examples/balleny_islands.rst + dem_examples/pine_island_bay.rst + dem_examples/queen_maud_land.rst + dem_examples/dobbin.rst + dem_examples/thana.rst + dem_examples/tellbreen.rst + dem_examples/nigards.rst + dem_examples/olivine.rst + dem_examples/lenin.rst + + +These graphics and statistics were generated with a freely available +`Jupyter notebook `_. +You can run this notebook online (without any installation) by following +`this link `_ +(the online server may take a couple of minutes to start). + +.. _dem-data-format: + +Data format +----------- + +The data is sorted into regional folders (one per RGI region). Each tar file +stores 1000 glaciers (`RGI60-01.00.tar` contains glacier IDs from +`RGI60-01.00001` to `RGI60-01.00999`, `RGI60-01.01.tar` contains glacier IDs +from `RGI60-01.01000` to `RGI60-01.01999`, etc.). + +Each glacier data comes in a single folder named after its RGI ID. A glacier +folder contains the following data files: + +- `glacier_mask.tif`: a raster mask of the RGI glacier at the same + resolution than the associated DEMs (geotiff format). +- `outlines.tar.gz`: the RGI vector outlines for this glacier +- `intersects.tar.gz`: the vector lines of the boundaries between this glacier + and possible neighbors +- `glacier_grid.json`: information about the grid and map projection +- `diagnostics.json`, `log.txt`: files used by OGGM/rgitools (not relevant here) +- **one folder per available DEM source**, containing a `dem.tif` file + (geotiff format) **and the data source and citation information** in + `dem_source.txt` (text file). + +The topography data is bilinearily interpolated from the DEM source to a +local **tranverse mercator map projection** (similar to the well known UTM, +but with projection parameters centered on the glacier). Most modern GIS packages +are able to read the projection information out of the geotiff files. + +The spatial resolution of the target local grid depends on the size of the +glacier. We use a square relation to the glacier size +(:math:`dx=aS^{\frac{1}{2}}`, with S the area of the glacier +in :math:`\text{km}^{2}`). The parameter a is set to 14 in the default +and 7 in the higher resolution data set. +The resulting dx is clipped to minimum of 10m in both versions. +The maximum of dx is clipped to 200m in the +default and 100m in the higher resolution version. + +The map size is chosen so that it is larger than the glacier of about 10 grid +points (20 in the higher resolution version to give approximately the same +extents). A future release of the data will also ship with larger map extents. + +.. _dem-how-to-cite: + +How to cite these data +---------------------- + +.. warning:: + + **IMPORTANT**: RGI-TOPO does NOT generate any new topography data. + We use freely available data and interpolate it to a local glacier map. + If you make use of these data for a publication, presentation or website, + **it is mandatory to refer to the original data provider as given in the + dem_source.txt file found in each DEM folder.** + + We are very thankful to the institutions providing these data, and we + ask our users to acknowledge the original contributions according to their + respective license (sometimes unclear, unfortunately). + +RGI-TOPO itself (i.e., the compilation of data) is licensed under a +`CC BY 4.0 `_ license, i.e. +you can use, share and adapt it under the conditions stated by the license and +by acknowledging the rgitools contributors as well as the original data +sources (as explained above). The name of the rgitools contributors cannot be +used to endorse any product or result derived from RGI-TOPO without +prior approval. + +.. note:: + + If you wish to acknowledge the data processing work that was necessary to + generate these data in a scientific publication, we suggest the + following citation: "The glacier dem data was processed with the rgitools and + OGGM software packages (Maussion et al., 2019 + `doi: 10.5194/gmd-12-909-2019 `_)." + +.. _dem-how-to-help: -Summary +How to provide feedback +----------------------- + +Before the official release with the next RGI version, we aim to: + +- make sure that we didn't miss any important data source +- ensure that there is no bug in our processing chain, i.e. that the data is + properly parsed, reprojected, and documented +- decide on the data format which is most suitable for the majority of users +- publish a detailed report about the quality and data availability of each + data source +- decide on a "standard" data source for each glacier, which will provide + the reference hypsometry for future RGI versions + +Your help on any of these objectives is very welcome! :ref:`dem-contact` us if +you want to provide feedback. + +Regarding the choice of the default data source for the RGI, we currently +formulate the following criteria: + +1. robust and gap-free datasets are preferred over more accurate or recent but + incomplete DEMS. Indeed, we have to keep in mind that any kind of glacier + bed inversion or glacier simulation based on ice-dynamics cannot deal with + topographical artefacts. +2. the acquisition date of the DEM must be as close as possible to the + acquisition date of the glacier outline (which is targeted to be around 2000 + in RGI V7). +3. preferably, the DEM source should be the same for neighboring glaciers. This + implies that ideally, a single DEM source should be chosen at the region or + sub-region level. + +Currently, we are most confident in SRTM for all latitudes between 60° N and S. +Almost gap free, the SRTM data aquisition date is also very concordant with the +target date of the RGI outlines. + +For all other regions, more investigation is needed and your feedback is welcome. + + +Global data availability +------------------------ + +The following section shows a more detailed analysis of all the above +mentioned DEMs with respect to the different RGI regions. + +Table 1 gives a summary for the RGI regions with respect to the different DEMs. +For this and all further analysis a DEM is only attributed as available to a +individual glacier if the glacier centered cutout has less than 10% missing +data points in this DEM. This threshold obviously only covers actual voids in +the DEM source but does not state anything about the quality or accuracy of the +none-void data points. + + +.. csv-table:: Table 1: Summary of all RGI regions. First column shows total + number of glaciers per RGI region. The consecutive columns specify the + availability of particular DEMs for a RGI region in percent of the total + glaciers per region. Values are not rounded but truncated so 99% could be + just one missing glacier. Only DEMs with less than 10% missing values are + considered. + :file: _static/tables/dem_allrgi_v2.csv + + +The following barplot shows again the availability of particular DEMs for RGI +region. + +.. image:: /_static/images/barplot_allregions_v2.png + :width: 100% + +In the section :ref:`subregions` you can find similar statistics but broken +down into the RGI Subregions. + + +.. toctree:: + :hidden: + :maxdepth: 1 + + dems_subregions.rst + + +Code availability +----------------- + +These data where generated with `OGGM version 1.2 `_. +This `tutorial `_ +(`interactive version `_) +documents how to create local +topography maps yourselves. + +.. _dem-contact: + +Contact ------- -We have to keep in mind that any kind of glacier bed estimate inversion or -glacier simulation based on ice-dynamics cannot deal with artefacts. -Therefore, robust and gap-free datasets are much preferred over more -accurate but incomplete DEMS. Furthermore, the concurrent -timing of the glacier outline with the DEM is another important criterion, -as shown by the Columbia example. - -Altogether, we are confident in: -- SRTM for all latitudes below 60° N and S -- GIMP for Greenland -- RAMP for Antarctica (but the peripheral Islands are an issue) - -For everything else, more investigation is needed. DEM3 offers the stability -and timeliness that TanDEM-X and ArcticDEM cannot offer (yet), and is the -current default in OGGM. +RGI-TOPO authors: +`Matthias Dusch `_ Alexander Fisher and +`Fabien Maussion `_. + +For feedback, please use the `github issue tracker `_ +(requires a github account) or send us an email. + +Acknowledgements +---------------- + +.. raw:: html + + + Image missing + + + Image missing + + +We acknowledge financial support from the +`International Association of Cryospheric Sciences `_ +(Matthias Dusch) and from the University of Innsbruck (Fabien Maussion). diff --git a/docs/dems_subregions.rst b/docs/dems_subregions.rst new file mode 100644 index 0000000..50a62d1 --- /dev/null +++ b/docs/dems_subregions.rst @@ -0,0 +1,326 @@ +.. _subregions: + +Details for RGI subregions +========================== + +.. _rgi01: + +01 - Alaska +----------- + +.. image:: /_static/images/barplot_rgi01_v2.png + :width: 100% + +.. csv-table:: Summary of all the RGI subregions. First column shows total + number of glaciers per RGI subregion. The consecutive columns specify the + availability of particular DEMs for a RGI subregion in percent of the total + glaciers per subregion. Values are not rounded but truncated so 99% could + be just one missing glacier. Only DEMs with less than 10% missing values + are considered. + :file: _static/tables/dem_rgi01_v2.csv + + +.. _rgi02: + +02 - Western Canada and USA +--------------------------- + +.. image:: /_static/images/barplot_rgi02_v2.png + :width: 100% + +.. csv-table:: Summary of all the RGI subregions. First column shows total + number of glaciers per RGI subregion. The consecutive columns specify the + availability of particular DEMs for a RGI subregion in percent of the total + glaciers per subregion. Values are not rounded but truncated so 99% could + be just one missing glacier. Only DEMs with less than 10% missing values + are considered. + :file: _static/tables/dem_rgi02_v2.csv + + +.. _rgi03: + +03 - Arctic Canada, North +------------------------- + +.. image:: /_static/images/barplot_rgi03_v2.png + :width: 100% + +.. csv-table:: Summary of all the RGI subregions. First column shows total + number of glaciers per RGI subregion. The consecutive columns specify the + availability of particular DEMs for a RGI subregion in percent of the total + glaciers per subregion. Values are not rounded but truncated so 99% could + be just one missing glacier. Only DEMs with less than 10% missing values + are considered. + :file: _static/tables/dem_rgi03_v2.csv + + +.. _rgi04: + +04 - Arctic Canada, South +------------------------- + +.. image:: /_static/images/barplot_rgi04_v2.png + :width: 100% + +.. csv-table:: Summary of all the RGI subregions. First column shows total + number of glaciers per RGI subregion. The consecutive columns specify the + availability of particular DEMs for a RGI subregion in percent of the total + glaciers per subregion. Values are not rounded but truncated so 99% could + be just one missing glacier. Only DEMs with less than 10% missing values + are considered. + :file: _static/tables/dem_rgi04_v2.csv + + +.. _rgi05: + +05 - Greenland Periphery +------------------------ + +.. image:: /_static/images/barplot_rgi05_v2.png + :width: 100% + +.. csv-table:: Summary of all the RGI subregions. First column shows total + number of glaciers per RGI subregion. The consecutive columns specify the + availability of particular DEMs for a RGI subregion in percent of the total + glaciers per subregion. Values are not rounded but truncated so 99% could + be just one missing glacier. Only DEMs with less than 10% missing values + are considered. + :file: _static/tables/dem_rgi05_v2.csv + + +.. _rgi06: + +06 - Iceland +------------ + +.. image:: /_static/images/barplot_rgi06_v2.png + :width: 100% + +.. csv-table:: Summary of all the RGI subregions. First column shows total + number of glaciers per RGI subregion. The consecutive columns specify the + availability of particular DEMs for a RGI subregion in percent of the total + glaciers per subregion. Values are not rounded but truncated so 99% could + be just one missing glacier. Only DEMs with less than 10% missing values + are considered. + :file: _static/tables/dem_rgi06_v2.csv + + +.. _rgi07: + +07 - Svalbard and Jan Mayen +--------------------------- + +.. image:: /_static/images/barplot_rgi07_v2.png + :width: 100% + +.. csv-table:: Summary of all the RGI subregions. First column shows total + number of glaciers per RGI subregion. The consecutive columns specify the + availability of particular DEMs for a RGI subregion in percent of the total + glaciers per subregion. Values are not rounded but truncated so 99% could + be just one missing glacier. Only DEMs with less than 10% missing values + are considered. + :file: _static/tables/dem_rgi07_v2.csv + + +.. _rgi08: + +08 - Scandinavia +---------------- + +.. image:: /_static/images/barplot_rgi08_v2.png + :width: 100% + +.. csv-table:: Summary of all the RGI subregions. First column shows total + number of glaciers per RGI subregion. The consecutive columns specify the + availability of particular DEMs for a RGI subregion in percent of the total + glaciers per subregion. Values are not rounded but truncated so 99% could + be just one missing glacier. Only DEMs with less than 10% missing values + are considered. + :file: _static/tables/dem_rgi08_v2.csv + + +.. _rgi09: + +09 - Russian Arctic +------------------- + +.. image:: /_static/images/barplot_rgi09_v2.png + :width: 100% + +.. csv-table:: Summary of all the RGI subregions. First column shows total + number of glaciers per RGI subregion. The consecutive columns specify the + availability of particular DEMs for a RGI subregion in percent of the total + glaciers per subregion. Values are not rounded but truncated so 99% could + be just one missing glacier. Only DEMs with less than 10% missing values + are considered. + :file: _static/tables/dem_rgi09_v2.csv + + +.. _rgi10: + +10 - Asia, North +---------------- + +.. image:: /_static/images/barplot_rgi10_v2.png + :width: 100% + +.. csv-table:: Summary of all the RGI subregions. First column shows total + number of glaciers per RGI subregion. The consecutive columns specify the + availability of particular DEMs for a RGI subregion in percent of the total + glaciers per subregion. Values are not rounded but truncated so 99% could + be just one missing glacier. Only DEMs with less than 10% missing values + are considered. + :file: _static/tables/dem_rgi10_v2.csv + + +.. _rgi11: + +11 - Central Europe +------------------- + +.. image:: /_static/images/barplot_rgi11_v2.png + :width: 100% + +.. csv-table:: Summary of all the RGI subregions. First column shows total + number of glaciers per RGI subregion. The consecutive columns specify the + availability of particular DEMs for a RGI subregion in percent of the total + glaciers per subregion. Values are not rounded but truncated so 99% could + be just one missing glacier. Only DEMs with less than 10% missing values + are considered. + :file: _static/tables/dem_rgi11_v2.csv + + +.. _rgi12: + +12 - Caucasus and Middle East +----------------------------- + +.. image:: /_static/images/barplot_rgi12_v2.png + :width: 100% + +.. csv-table:: Summary of all the RGI subregions. First column shows total + number of glaciers per RGI subregion. The consecutive columns specify the + availability of particular DEMs for a RGI subregion in percent of the total + glaciers per subregion. Values are not rounded but truncated so 99% could + be just one missing glacier. Only DEMs with less than 10% missing values + are considered. + :file: _static/tables/dem_rgi12_v2.csv + + +.. _rgi13: + +13 - Asia, Central +------------------ + +.. image:: /_static/images/barplot_rgi13_v2.png + :width: 100% + +.. csv-table:: Summary of all the RGI subregions. First column shows total + number of glaciers per RGI subregion. The consecutive columns specify the + availability of particular DEMs for a RGI subregion in percent of the total + glaciers per subregion. Values are not rounded but truncated so 99% could + be just one missing glacier. Only DEMs with less than 10% missing values + are considered. + :file: _static/tables/dem_rgi13_v2.csv + + +.. _rgi14: + +14 - Asia, South West +--------------------- + +.. image:: /_static/images/barplot_rgi14_v2.png + :width: 100% + +.. csv-table:: Summary of all the RGI subregions. First column shows total + number of glaciers per RGI subregion. The consecutive columns specify the + availability of particular DEMs for a RGI subregion in percent of the total + glaciers per subregion. Values are not rounded but truncated so 99% could + be just one missing glacier. Only DEMs with less than 10% missing values + are considered. + :file: _static/tables/dem_rgi14_v2.csv + + +.. _rgi15: + +15 - Asia, South East +--------------------- + +.. image:: /_static/images/barplot_rgi15_v2.png + :width: 100% + +.. csv-table:: Summary of all the RGI subregions. First column shows total + number of glaciers per RGI subregion. The consecutive columns specify the + availability of particular DEMs for a RGI subregion in percent of the total + glaciers per subregion. Values are not rounded but truncated so 99% could + be just one missing glacier. Only DEMs with less than 10% missing values + are considered. + :file: _static/tables/dem_rgi15_v2.csv + + +.. _rgi16: + +16 - Low Latitudes +------------------ + +.. image:: /_static/images/barplot_rgi16_v2.png + :width: 100% + +.. csv-table:: Summary of all the RGI subregions. First column shows total + number of glaciers per RGI subregion. The consecutive columns specify the + availability of particular DEMs for a RGI subregion in percent of the total + glaciers per subregion. Values are not rounded but truncated so 99% could + be just one missing glacier. Only DEMs with less than 10% missing values + are considered. + :file: _static/tables/dem_rgi16_v2.csv + + +.. _rgi17: + +17 - Southern Andes +------------------- + +.. image:: /_static/images/barplot_rgi17_v2.png + :width: 100% + +.. csv-table:: Summary of all the RGI subregions. First column shows total + number of glaciers per RGI subregion. The consecutive columns specify the + availability of particular DEMs for a RGI subregion in percent of the total + glaciers per subregion. Values are not rounded but truncated so 99% could + be just one missing glacier. Only DEMs with less than 10% missing values + are considered. + :file: _static/tables/dem_rgi17_v2.csv + + +.. _rgi18: + +18 - New Zealand +---------------- + +.. image:: /_static/images/barplot_rgi18_v2.png + :width: 100% + +.. csv-table:: Summary of all the RGI subregions. First column shows total + number of glaciers per RGI subregion. The consecutive columns specify the + availability of particular DEMs for a RGI subregion in percent of the total + glaciers per subregion. Values are not rounded but truncated so 99% could + be just one missing glacier. Only DEMs with less than 10% missing values + are considered. + :file: _static/tables/dem_rgi18_v2.csv + + +.. _rgi19: + +19 - Antarctic and Subantarctic +------------------------------- + +.. image:: /_static/images/barplot_rgi19_v2.png + :width: 100% + +.. csv-table:: Summary of all the RGI subregions. First column shows total + number of glaciers per RGI subregion. The consecutive columns specify the + availability of particular DEMs for a RGI subregion in percent of the total + glaciers per subregion. Values are not rounded but truncated so 99% could + be just one missing glacier. Only DEMs with less than 10% missing values + are considered. + :file: _static/tables/dem_rgi19_v2.csv \ No newline at end of file diff --git a/docs/environment.yml b/docs/environment.yml new file mode 100644 index 0000000..cd2ca10 --- /dev/null +++ b/docs/environment.yml @@ -0,0 +1,40 @@ +name: rgitools_docs +channels: + - conda-forge +dependencies: + - jupyter + - jupyterlab + - numpy + - scipy + - pandas + - shapely + - matplotlib + - Pillow + - netcdf4 + - scikit-image + - scikit-learn + - configobj + - xarray + - pytest + - dask + - bottleneck + - pyproj + - cartopy + - geopandas + - rasterio<1.2.10 + - rioxarray + - seaborn + - pytables + - salem + - motionless + - sphinx + - ipython + - numpydoc + - seaborn + - sphinx_rtd_theme + - pip: + - joblib + - progressbar2 + - oggm + # relative to this file. Needs to be editable to be accepted. + - -e .. diff --git a/docs/index.rst b/docs/index.rst index 4495966..42f0116 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -2,18 +2,19 @@ rgitools: processing files from the Randolph Glacier Inventory -------------------------------------------------------------- -`rgitools `_ provides several tools to +`rgitools `_ provides several tools to (pre-)process and analyse the glacier outlines provided by the `Randolph Glacier Inventory `_ (RGI). It is currently in development, but our goal is to provide the following -sevices to the RGI community: +services to the RGI community: - **automated data quality check**: see :ref:`tools.qc`. - **Geometry of the ice divides and listing or glacier clusters**: see :ref:`tools.intersects`. - **Merging of glacier clusters**: see :ref:`tools.merge`. -- **Glacier hypsometry**: see :ref:`tools.hypso`. +- **Glacier hypsometry from DEM**: see :ref:`tools.hypso`. +- **Gridded topography data for each glacier**: see :ref:`dems`. - **ID link list between RGI versions** (not available yet) @@ -23,12 +24,12 @@ Documentation .. toctree:: :maxdepth: 1 - whats-new installing tools known-issues dems api + whats-new Get in touch @@ -37,27 +38,24 @@ Get in touch - View the source code `on GitHub`_. - Report bugs or share your ideas on the `issue tracker`_. - Improve the model by submitting a `pull request`_. -- Follow us on `Twitter`_. -- Or you can always send us an `e-mail`_ the good old way. -.. _e-mail: info@oggm.org -.. _on GitHub: https://github.com/OGGM/rgitools -.. _issue tracker: https://github.com/OGGM/rgitools/issues -.. _pull request: https://github.com/OGGM/rgitools/pulls -.. _Twitter: https://twitter.com/OGGM_org +.. _on GitHub: https://github.com/GLIMS-RGI/rgitools +.. _issue tracker: https://github.com/GLIMS-RGI/rgitools/issues +.. _pull request: https://github.com/GLIMS-RGI/rgitools/pulls About ----- :Tests: - - .. image:: https://travis-ci.org/OGGM/rgitools.svg?branch=master - :target: https://travis-ci.org/OGGM/rgitools + .. image:: https://travis-ci.org/GLIMS-RGI/rgitools.svg?branch=master + :target: https://travis-ci.org/GLIMS-RGI/rgitools :alt: Linux build status :Documentation: - .. image:: https://readthedocs.org/projects/rgitools/badge/?version=latest :target: http://rgitools.readthedocs.org/en/latest/?badge=latest :alt: Documentation status + +:License: + `BSD-3-Clause License `_ diff --git a/docs/known-issues.rst b/docs/known-issues.rst index 6ccf2d3..c010c7e 100644 --- a/docs/known-issues.rst +++ b/docs/known-issues.rst @@ -1,20 +1,16 @@ Known issues in RGI V6 ====================== -This page lists the issues that have been discovered in RGIV6. +This page has moved! To read current issues (and add your own), visit: +https://github.com/GLIMS-RGI/rgi_issue_tracker - -Data files ----------- +Data files (RGI6) +----------------- - The file ``01_rgi60_Alaska_hypso.csv`` contains RGI IDs which are still labelled as RGI50. - The column ``Zmed`` in the file '19_rgi60_AntarcticSubantarctic.shp' contains only missing data -- the file ``08_rgi60_Scandinavia.shp`` is located in a folder wrongly entitled - ``07_rgi60_Scandinavia``. -- the file ``04_rgi60_ArcticCanadaSouth.shp`` is located in a folder - wrongly entitled ``04_rgi60_ArcticCanadaNorth``. - in the `summary file `_, the RGI subregions of Region 08 (Scandinavia) are wrongly named and the subregion 08-03 as defined in the technical report is missing. diff --git a/docs/requirements.txt b/docs/requirements.txt deleted file mode 100644 index d2b7a9f..0000000 --- a/docs/requirements.txt +++ /dev/null @@ -1,25 +0,0 @@ -numpy==1.16.4 -scipy -pandas -shapely -matplotlib -pyproj -rasterio -Pillow -geopandas -netcdf4==1.3.1 -scikit-image -configobj -joblib -xarray -progressbar2 -pytest -motionless -dask -bottleneck -descartes -toolz -ipython -numpydoc -git+https://github.com/fmaussion/salem.git -git+https://github.com/OGGM/oggm.git diff --git a/docs/whats-new.rst b/docs/whats-new.rst index ce1f2a9..3ad8d76 100644 --- a/docs/whats-new.rst +++ b/docs/whats-new.rst @@ -3,7 +3,9 @@ Version history =============== -v0.X (unreleased) ------------------ +- May 2018: the project was created. +- January 2020: the project was transferred from the OGGM to the GLIMS-RGI + organisation -May 2018: the project was created. +See the `github log `_ for +a full history. diff --git a/notebooks/dem_statistics/README.rst b/notebooks/dem_statistics/README.rst new file mode 100644 index 0000000..b888260 --- /dev/null +++ b/notebooks/dem_statistics/README.rst @@ -0,0 +1,24 @@ +The scripts and notebooks in this directory are used for the creation of the the plots and tables that can be found on these pages: + +- https://rgitools.readthedocs.io/en/latest/dems.html#global-data-availability +- https://rgitools.readthedocs.io/en/latest/dems_subregions.html + +In the following the steps necessary to create a new version of these statistics are described: + +1. create a new RGI topo dataset with the **oggm/cli/prepro_levels.py** script within the oggm repository + +2. adapt all variables within the **statistics_paths.py** script to valid local paths. The *prepro_path* variable has to point towards the RGI topo dataset + +3. run the **post_all_dems.py** script to create statistics about the coverage of each DEM product that RGI is currently supporting. These statistics are saved as *.h5*-files. + +4. run the **dem_post_quality_per_region.py** script to create the barplots and csv files visualizing the previously created *.h5*-files. + +5. if you plan to **update the docs pages**: run the **create_dems_subregions_rst.ipynb** to move the new barplots and csv files to the correct directory within the repository and regenerate the **dems_subregions.rst**. The barplots and csv files also contain files for all RGI regions combined. These are used in the **dems.rst** file, **and have to be updated manually**. + +To also create new plots for the single glacier/ice sheet examples given at https://rgitools.readthedocs.io/en/latest/dems.html#examples execute the following steps: + +1. adapt the path named **"gdir_url"** in the section **Download the data using OGGM utility functions** in the **dem_comparison_for_rgitopo_docs.ipynb** notebook. It has to point to the current dataset. + +2. run the **create_dem_example_images.py** from the "rgitools/notebooks/dem_statistics" directory. This creates the example plots for the glaciers and directly saves/overwrites them into the correct directories. + +3. check for changes in DEM sources manually and adapt the "dem_examples" rst files accordingly. \ No newline at end of file diff --git a/notebooks/dem_statistics/create_dem_example_images.py b/notebooks/dem_statistics/create_dem_example_images.py new file mode 100644 index 0000000..478c3cb --- /dev/null +++ b/notebooks/dem_statistics/create_dem_example_images.py @@ -0,0 +1,35 @@ +import papermill as pm +import os +import os.path as path +# these names and RGIids are taken from the "Examples" on this page: https://rgitools.readthedocs.io/en/latest/dems.html +name_mapping = { + 'RGI60-11.00897': 'hef', + 'RGI60-11.01827': 'oberaletsch', + 'RGI60-01.10689': 'columbia', + 'RGI60-06.00477': 'iceland', + 'RGI60-05.10137': 'greenland', + 'RGI60-03.02489': 'devon', + 'RGI60-16.02207': 'shallap', + 'RGI60-19.02274': 'nordenskjoeld', + 'RGI60-19.00124': 'alexander', + 'RGI60-19.01251': 'gillock', + 'RGI60-03.00251': 'dobbin', + 'RGI60-15.02578': 'thana', + 'RGI60-07.01114': 'tellbreen', + 'RGI60-08.01126': 'nigards', + 'RGI60-18.00854': 'olivine', + 'RGI60-09.00552': 'lenin', + 'RGI60-19.00783': 'balleny_islands', + 'RGI60-19.00792': 'queen_maud_land', + 'RGI60-19.01405': 'pine_island_bay' +} + +# create the comparison plots for each example glacier in the dictionary above +# and save them in their corresponding directory +for (rgiid, name) in name_mapping.items(): + output_path = path.abspath(path.join(os.getcwd(), '../../docs/_static/dems_examples/', name)) + pm.execute_notebook( + 'dem_comparison_for_rgitopo_docs.ipynb', + '/dev/null', + parameters=dict(rgi_id=rgiid, plot_dir=output_path) + ) \ No newline at end of file diff --git a/notebooks/dem_statistics/create_dems_subregions_rst.ipynb b/notebooks/dem_statistics/create_dems_subregions_rst.ipynb new file mode 100644 index 0000000..2237b65 --- /dev/null +++ b/notebooks/dem_statistics/create_dems_subregions_rst.ipynb @@ -0,0 +1,248 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "98d58eb5", + "metadata": {}, + "source": [ + "# this notebook creates the `rgitools/docs/dems_subregions.rst` file for rgitools docs and copies the new barplot and csv files to their corresponding directories" + ] + }, + { + "cell_type": "markdown", + "id": "14960c59", + "metadata": {}, + "source": [ + "**NOTE:** \n", + "- **there is a `README.rst` in this notebook's directory which gives instructions on the preceding steps necessary to execute this notebook**\n", + "- **this notebook has to be executed in the directory `rgitools/notebooks/dem_statistics` in order to handle repository intern paths correctly and to import the `statistics_paths.py` script which is located in the same directory.**\n", + "- **the paths `statistics_paths.py` have to be adapted to your local system's paths and have to remain unchanged during the execution of the `post_all_dems.py` and the `dem_post_quality_per_region.py`**\n", + "\n", + "- **The (old) barplot and csv files in the directories `rgitools/docs/_static/images/` and `rgitools/docs/_static/images/` that might be outdated and unsued after the run of this script have to be deleted manually.**\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "2821159e", + "metadata": {}, + "outputs": [], + "source": [ + "import os\n", + "import os.path as path\n", + "import shutil\n", + "import geopandas as gpd\n", + "import numpy as np\n", + "from oggm import cfg\n", + "\n", + "\n", + "import statistics_paths\n", + "cfg.initialize()" + ] + }, + { + "cell_type": "markdown", + "id": "4c29ccbc", + "metadata": {}, + "source": [ + "This notebook can be run as a script with parameters using [papermill](https://github.com/nteract/papermill), but it is not necessary nor intended, as the parameters are taken from the `statistics_paths.py` script. The following cell contains the parameters you can choose from:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "40c0d86e", + "metadata": { + "tags": [ + "parameters" + ] + }, + "outputs": [], + "source": [ + "# path to the postprocessing output directory which contains the barplots and csv-tables within its subdirectories\n", + "post = None\n", + "# suffix of the filenames\n", + "sfx = None" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "c30f3c4f", + "metadata": {}, + "outputs": [], + "source": [ + "if not post:\n", + " post = statistics_paths.post\n", + "if not sfx:\n", + " sfx = statistics_paths.sfx" + ] + }, + { + "cell_type": "markdown", + "id": "fd369b59", + "metadata": {}, + "source": [ + "## copy barplot images and csv files" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "95eed8f9", + "metadata": {}, + "outputs": [], + "source": [ + "barplot_source_dir = path.join(post, 'out/images')\n", + "csv_source_dir = path.join(post, 'out/tables')\n", + "\n", + "barplot_target_dir = path.abspath(path.join(os.getcwd(), '../../docs/_static/images'))\n", + "csv_target_dir = path.abspath(path.join(os.getcwd(), '../../docs/_static/tables'))\n", + "\n", + "# you can simply delete the folder 'images' and 'tables' before copying the file, so you don't have to worry about outdated files\n", + "os.makedirs(barplot_target_dir, exist_ok=True)\n", + "os.makedirs(csv_target_dir, exist_ok=True)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "4eea869b", + "metadata": {}, + "outputs": [], + "source": [ + "for filename in os.listdir(barplot_source_dir):\n", + " shutil.copy(path.join(barplot_source_dir, filename), barplot_target_dir)\n", + "print('copied all barplots from {} to {}'.format(barplot_source_dir, barplot_target_dir))\n", + "for filename in os.listdir(csv_source_dir):\n", + " shutil.copy(path.join(csv_source_dir, filename), csv_target_dir)\n", + "print('copied all csv files from {} to {}'.format(csv_source_dir, csv_target_dir))" + ] + }, + { + "cell_type": "markdown", + "id": "925a42b6", + "metadata": {}, + "source": [ + "## create `dems_subregions.rst` rst file" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "8afc3a62", + "metadata": {}, + "outputs": [], + "source": [ + "# path to the file whose content is created in this script and will be overwritten in the end\n", + "subregion_rts_filepath = path.abspath(path.join(os.getcwd(), '../../docs/dems_subregions.rst'))\n", + "\n", + "# rgi region & subregion file - depending on the RGI version (6.0, 6.x ..) chosen for the RGI Topo Dataset creation\n", + "# this folder- and filenames might be adapted\n", + "regions = gpd.read_file(os.path.join(cfg.PATHS['rgi_dir'], 'RGIV62',\n", + " '00_rgi62_regions',\n", + " '00_rgi62_O1Regions.shp'))\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "4a388fa0", + "metadata": {}, + "outputs": [], + "source": [ + "# static strings\n", + "page_header = '.. _subregions:\\n\\nDetails for RGI subregions\\n==========================\\n\\n'\n", + "table_info = ('Summary of all the RGI subregions. First column shows total\\n '\n", + " 'number of glaciers per RGI subregion. The consecutive columns specify the\\n '\n", + " 'availability of particular DEMs for a RGI subregion in percent of the total\\n '\n", + " 'glaciers per subregion. Values are not rounded but truncated so 99% could\\n '\n", + " 'be just one missing glacier. Only DEMs with less than 10% missing values\\n '\n", + " 'are considered.')\n", + "# path strings\n", + "img_dir = '/_static/images/'\n", + "csv_dir = '_static/tables/' " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "220aaa2b", + "metadata": {}, + "outputs": [], + "source": [ + "string_list = [page_header]\n", + " \n", + "for reg in np.arange(1,20):\n", + " # region string\n", + " rs = []\n", + " \n", + " regstr = '{:02.0f}'.format(reg)\n", + " regname = regions.loc[regions['RGI_CODE'].astype('int') == reg, 'FULL_NAME'].iloc[0]\n", + " barplot_name = 'barplot_rgi{}.png'.format(regstr + sfx)\n", + " csv_name = 'dem_rgi{}.csv'.format(regstr + sfx)\n", + " \n", + " # region header\n", + " rs.append('.. _rgi{}:\\n\\n{} - {}\\n'.format(regstr, regstr, regname))\n", + " \n", + " # header_underscore with the same length as region number and name\n", + " rs.append(('-' * len('{} - {}'.format(regstr, regname))) + '\\n\\n')\n", + " \n", + " # barplot\n", + " rs.append('.. image:: {}\\n :width: 100%\\n\\n'.format(path.join(img_dir, barplot_name)))\n", + " \n", + " # table\n", + " rs.append('.. csv-table:: {}\\n :file: {}\\n\\n\\n'.format(table_info, path.join(csv_dir, csv_name)))\n", + " \n", + " string_list.append(''.join(rs))\n", + " \n", + "# remove empty lines at file ending\n", + "string_list[-1] = string_list[-1][:-3]" + ] + }, + { + "cell_type": "markdown", + "id": "cc297d56", + "metadata": {}, + "source": [ + "## The following cell will *overwrite(!)* the `dems_subregions.rst` file" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "5956aa09", + "metadata": {}, + "outputs": [], + "source": [ + "# write the .rst file\n", + "subreg_rst_file = open(subregion_rts_filepath, 'w')\n", + "subreg_rst_file.write(''.join(string_list))\n", + "subreg_rst_file.close()\n", + "print('wrote new \\'rgitools/docs/dems_subregions.rst\\' file\\ncheck the new file for correctness')" + ] + } + ], + "metadata": { + "celltoolbar": "Tags", + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.9.10" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/notebooks/dem_statistics/dem_comparison_for_rgitopo_docs.ipynb b/notebooks/dem_statistics/dem_comparison_for_rgitopo_docs.ipynb new file mode 100644 index 0000000..a86639e --- /dev/null +++ b/notebooks/dem_statistics/dem_comparison_for_rgitopo_docs.ipynb @@ -0,0 +1,788 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Compare different DEMs for individual glaciers" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## this notebook is almost identical to the [dem_comparison](https://github.com/OGGM/tutorials/blob/master/notebooks/dem_comparison.ipynb) notebook from the oggm \"tutorials\" repository, but contains minor changes." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "For most glaciers in the world there are several digital elevation models (DEM) which cover the respective glacier. In OGGM we have currently implemented 10 different open access DEMs to choose from. Some are regional and only available in certain areas (e.g. Greenland or Antarctica) and some cover almost the entire globe. For more information, visit the [rgitools documentation about DEMs](https://rgitools.readthedocs.io/en/latest/dems.html).\n", + "\n", + "This notebook allows to see which of the DEMs are available for a selected glacier and how they compare to each other. That way it is easy to spot systematic differences and also invalid points in the DEMs." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Input parameters " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "This notebook can be run as a script with parameters using [papermill](https://github.com/nteract/papermill), but it is not necessary. The following cell contains the parameters you can choose from:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "papermill": { + "duration": 0.017019, + "end_time": "2019-05-02T12:29:41.613572", + "exception": false, + "start_time": "2019-05-02T12:29:41.596553", + "status": "completed" + }, + "tags": [ + "parameters" + ] + }, + "outputs": [], + "source": [ + "# The RGI Id of the glaciers you want to look for\n", + "# Use the original shapefiles or the GLIMS viewer to check for the ID: https://www.glims.org/maps/glims\n", + "rgi_id = 'RGI60-11.00897'\n", + "\n", + "# The default is to test for all sources available for this glacier\n", + "# Set to a list of source names to override this\n", + "sources = None\n", + "# Where to write the plots. Default is in the current working directory\n", + "plot_dir = f'outputs/{rgi_id}'\n", + "# The RGI version to use\n", + "# V62 is an unofficial modification of V6 with only minor, backwards compatible modifications\n", + "prepro_rgi_version = 62\n", + "# Size of the map around the glacier. Currently only 10 and 40 are available\n", + "prepro_border = 10\n", + "# Degree of processing level. Currently only 1 is available.\n", + "from_prepro_level = 1" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Check input and set up" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "papermill": { + "duration": 0.015677, + "end_time": "2019-05-02T12:29:41.666761", + "exception": false, + "start_time": "2019-05-02T12:29:41.651084", + "status": "completed" + }, + "tags": [] + }, + "outputs": [], + "source": [ + "# The sources can be given as parameters\n", + "if sources is not None and isinstance(sources, str):\n", + " sources = sources.split(',')" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "papermill": { + "duration": 0.015098, + "end_time": "2019-05-02T12:29:41.691832", + "exception": false, + "start_time": "2019-05-02T12:29:41.676734", + "status": "completed" + }, + "tags": [] + }, + "outputs": [], + "source": [ + "# Plotting directory as well\n", + "if not plot_dir:\n", + " plot_dir = './' + rgi_id\n", + "import os\n", + "plot_dir = os.path.abspath(plot_dir)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "papermill": { + "duration": 1.830809, + "end_time": "2019-05-02T12:29:43.532252", + "exception": false, + "start_time": "2019-05-02T12:29:41.701443", + "status": "completed" + }, + "tags": [] + }, + "outputs": [], + "source": [ + "import pandas as pd\n", + "import numpy as np\n", + "from oggm import cfg, utils, workflow, tasks, graphics, GlacierDirectory\n", + "import xarray as xr\n", + "import rioxarray as rioxr\n", + "import geopandas as gpd\n", + "import salem\n", + "import matplotlib.pyplot as plt\n", + "from mpl_toolkits.axes_grid1 import AxesGrid\n", + "import itertools\n", + "\n", + "from oggm.utils import DEM_SOURCES\n", + "from oggm.workflow import init_glacier_directories" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "papermill": { + "duration": 0.093459, + "end_time": "2019-05-02T12:29:43.661588", + "exception": false, + "start_time": "2019-05-02T12:29:43.568129", + "status": "completed" + }, + "tags": [] + }, + "outputs": [], + "source": [ + "# Make sure the plot directory exists\n", + "utils.mkdir(plot_dir);\n", + "# Use OGGM to download the data\n", + "cfg.initialize()\n", + "cfg.PATHS['working_dir'] = utils.gettempdir(dirname='OGGM-DEMS', reset=True)\n", + "cfg.PARAMS['use_intersects'] = False" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Download the data using OGGM utility functions " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The `gdir_url` is pointing to the `dems_v2` dataset, also containing the COPDEM30 product" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# URL of the preprocessed GDirs\n", + "gdir_url = 'https://cluster.klima.uni-bremen.de/data/gdirs/dems_v2/default/'\n", + "# We use OGGM to download the data\n", + "gdir = init_glacier_directories([rgi_id], from_prepro_level=1, prepro_border=10, \n", + " prepro_rgi_version='62', prepro_base_url=gdir_url)[0]" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Read the DEMs and store them all in a dataset " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "papermill": { + "duration": 0.028343, + "end_time": "2019-05-02T12:29:44.137034", + "exception": false, + "start_time": "2019-05-02T12:29:44.108691", + "status": "completed" + }, + "tags": [] + }, + "outputs": [], + "source": [ + "if sources is None:\n", + " sources = [src for src in os.listdir(gdir.dir) if src in utils.DEM_SOURCES]\n", + " \n", + "# keep COPDEM30 and COPDEM90 next to each other for a clearer overview when looking at the generated plots\n", + "cop_30_idx = None\n", + "cop_90_idx = None\n", + "print(sources)\n", + "for i, src in enumerate(sources):\n", + " if src=='COPDEM30':\n", + " cop_30_idx = i\n", + " if src=='COPDEM90':\n", + " cop_90_idx = i\n", + "if (cop_30_idx != None) and (cop_90_idx != None) and abs(cop_30_idx-cop_90_idx)>1:\n", + " if cop_30_idx > cop_90_idx:\n", + " exchange_dem = sources[cop_90_idx+1]\n", + " sources[cop_30_idx] = exchange_dem\n", + " sources[cop_90_idx+1] = 'COPDEM30'\n", + " else:\n", + " exchange_dem = sources[cop_30_idx+1]\n", + " sources[cop_90_idx] = exchange_dem\n", + " sources[cop_30_idx+1] = 'COPDEM90'" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "papermill": { + "duration": 0.019044, + "end_time": "2019-05-02T12:29:44.166408", + "exception": false, + "start_time": "2019-05-02T12:29:44.147364", + "status": "completed" + }, + "tags": [] + }, + "outputs": [], + "source": [ + "print('RGI ID:', rgi_id)\n", + "print('Available DEM sources:', sources)\n", + "print('Plotting directory:', plot_dir)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "papermill": { + "duration": 0.081067, + "end_time": "2019-05-02T12:30:18.702292", + "exception": false, + "start_time": "2019-05-02T12:30:18.621225", + "status": "completed" + }, + "tags": [] + }, + "outputs": [], + "source": [ + "# We use xarray to store the data\n", + "ods = xr.Dataset()\n", + "for src in sources:\n", + " demfile = os.path.join(gdir.dir, src) + '/dem.tif'\n", + " with rioxr.open_rasterio(demfile) as ds:\n", + " data = ds.sel(band=1).load() * 1.\n", + " ods[src] = data.where(data > -100, np.NaN)\n", + " \n", + " sy, sx = np.gradient(ods[src], gdir.grid.dx, gdir.grid.dx)\n", + " ods[src + '_slope'] = ('y', 'x'), np.arctan(np.sqrt(sy**2 + sx**2))\n", + "\n", + "with rioxr.open_rasterio(gdir.get_filepath('glacier_mask')) as ds:\n", + " ods['mask'] = ds.sel(band=1).load()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "papermill": { + "duration": 0.0212, + "end_time": "2019-05-02T12:30:18.877473", + "exception": false, + "start_time": "2019-05-02T12:30:18.856273", + "status": "completed" + }, + "tags": [] + }, + "outputs": [], + "source": [ + "# Decide on the number of plots and figure size\n", + "ns = len(sources)\n", + "x_size = 12\n", + "n_cols = 2\n", + "n_rows = -(-ns // n_cols)\n", + "y_size = x_size / n_cols * n_rows" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Raw topography data " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "papermill": { + "duration": 3.510211, + "end_time": "2019-05-02T12:30:22.402979", + "exception": false, + "start_time": "2019-05-02T12:30:18.892768", + "status": "completed" + }, + "scrolled": true, + "tags": [] + }, + "outputs": [], + "source": [ + "smap = salem.graphics.Map(gdir.grid, countries=False)\n", + "smap.set_shapefile(gdir.read_shapefile('outlines'))\n", + "smap.set_plot_params(cmap='topo')\n", + "smap.set_lonlat_contours(add_tick_labels=False)\n", + "smap.set_plot_params(vmin=np.nanquantile([ods[s].min() for s in sources], 0.25),\n", + " vmax=np.nanquantile([ods[s].max() for s in sources], 0.75))\n", + "\n", + "fig = plt.figure(figsize=(x_size, y_size))\n", + "grid = AxesGrid(fig, 111,\n", + " nrows_ncols=(n_rows, n_cols),\n", + " axes_pad=0.7,\n", + " cbar_mode='each',\n", + " cbar_location='right',\n", + " cbar_pad=0.1\n", + " )\n", + "\n", + "for i, s in enumerate(sources):\n", + " data = ods[s]\n", + " smap.set_data(data)\n", + " ax = grid[i]\n", + " smap.visualize(ax=ax, addcbar=False, title=s)\n", + " if np.isnan(data).all():\n", + " grid[i].cax.remove()\n", + " continue\n", + " cax = grid.cbar_axes[i]\n", + " smap.colorbarbase(cax)\n", + " \n", + "# take care of uneven grids\n", + "if ax != grid[-1]:\n", + " grid[-1].remove()\n", + " grid[-1].cax.remove()\n", + "\n", + "plt.savefig(os.path.join(plot_dir, 'dem_topo_color.png'), dpi=150, bbox_inches='tight')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Shaded relief " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "papermill": { + "duration": 3.282248, + "end_time": "2019-05-02T12:30:25.712385", + "exception": false, + "start_time": "2019-05-02T12:30:22.430137", + "status": "completed" + }, + "tags": [] + }, + "outputs": [], + "source": [ + "fig = plt.figure(figsize=(x_size, y_size))\n", + "grid = AxesGrid(fig, 111,\n", + " nrows_ncols=(n_rows, n_cols),\n", + " axes_pad=0.7,\n", + " cbar_mode='none',\n", + " cbar_location='right',\n", + " cbar_pad=0.1\n", + " )\n", + "smap.set_plot_params(cmap='Blues')\n", + "smap.set_shapefile()\n", + "for i, s in enumerate(sources):\n", + " data = ods[s].copy().where(np.isfinite(ods[s]), 0)\n", + " smap.set_data(data * 0)\n", + " ax = grid[i]\n", + " smap.set_topography(data)\n", + " smap.visualize(ax=ax, addcbar=False, title=s)\n", + " \n", + "# take care of uneven grids\n", + "if ax != grid[-1]:\n", + " grid[-1].remove()\n", + " grid[-1].cax.remove()\n", + "\n", + "plt.savefig(os.path.join(plot_dir, 'dem_topo_shade.png'), dpi=150, bbox_inches='tight')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Slope " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "fig = plt.figure(figsize=(x_size, y_size))\n", + "grid = AxesGrid(fig, 111,\n", + " nrows_ncols=(n_rows, n_cols),\n", + " axes_pad=0.7,\n", + " cbar_mode='each',\n", + " cbar_location='right',\n", + " cbar_pad=0.1\n", + " )\n", + "\n", + "smap.set_topography();\n", + "smap.set_plot_params(vmin=0, vmax=0.7, cmap='Blues')\n", + "\n", + "for i, s in enumerate(sources):\n", + " data = ods[s + '_slope']\n", + " smap.set_data(data)\n", + " ax = grid[i]\n", + " smap.visualize(ax=ax, addcbar=False, title=s + ' (slope)')\n", + " cax = grid.cbar_axes[i]\n", + " smap.colorbarbase(cax)\n", + " \n", + "# take care of uneven grids\n", + "if ax != grid[-1]:\n", + " grid[-1].remove()\n", + " grid[-1].cax.remove()\n", + "\n", + "plt.savefig(os.path.join(plot_dir, 'dem_slope.png'), dpi=150, bbox_inches='tight')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Some simple statistics about the DEMs " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "df = pd.DataFrame()\n", + "for s in sources:\n", + " df[s] = ods[s].data.flatten()[ods.mask.data.flatten() == 1]\n", + "\n", + "dfs = pd.DataFrame()\n", + "for s in sources:\n", + " dfs[s] = ods[s + '_slope'].data.flatten()[ods.mask.data.flatten() == 1]" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "df.describe()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Comparison matrix plot " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Table of differences between DEMS\n", + "df_diff = pd.DataFrame()\n", + "done = []\n", + "for s1, s2 in itertools.product(sources, sources):\n", + " if s1 == s2:\n", + " continue\n", + " if (s2, s1) in done:\n", + " continue\n", + " df_diff[s1 + '-' + s2] = df[s1] - df[s2]\n", + " done.append((s1, s2))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Decide on plot levels\n", + "max_diff = df_diff.quantile(0.99).max()\n", + "base_levels = np.array([-8, -5, -3, -1.5, -1, -0.5, -0.2, -0.1, 0, 0.1, 0.2, 0.5, 1, 1.5, 3, 5, 8])\n", + "if max_diff < 10:\n", + " levels = base_levels\n", + "elif max_diff < 100:\n", + " levels = base_levels * 10\n", + "elif max_diff < 1000:\n", + " levels = base_levels * 100\n", + "else:\n", + " levels = base_levels * 1000\n", + "levels = [l for l in levels if abs(l) < max_diff]\n", + "if max_diff > 10:\n", + " levels = [int(l) for l in levels]\n", + "levels" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "papermill": { + "duration": 3.367876, + "end_time": "2019-05-02T12:30:29.111637", + "exception": false, + "start_time": "2019-05-02T12:30:25.743761", + "status": "completed" + }, + "scrolled": true, + "tags": [] + }, + "outputs": [], + "source": [ + "smap.set_plot_params(levels=levels, cmap='PuOr', extend='both')\n", + "smap.set_shapefile(gdir.read_shapefile('outlines'))\n", + "\n", + "fig = plt.figure(figsize=(14, 14))\n", + "grid = AxesGrid(fig, 111,\n", + " nrows_ncols=(ns - 1, ns - 1),\n", + " axes_pad=0.3,\n", + " cbar_mode='single',\n", + " cbar_location='right',\n", + " cbar_pad=0.1\n", + " )\n", + "done = []\n", + "for ax in grid:\n", + " ax.set_axis_off()\n", + "for s1, s2 in itertools.product(sources, sources):\n", + " if s1 == s2:\n", + " continue\n", + " if (s2, s1) in done:\n", + " continue\n", + " data = ods[s1] - ods[s2]\n", + " ax = grid[sources.index(s1) * (ns - 1) + sources[1:].index(s2)]\n", + " ax.set_axis_on()\n", + " smap.set_data(data)\n", + " smap.visualize(ax=ax, addcbar=False)\n", + " done.append((s1, s2))\n", + " ax.set_title(s1 + '-' + s2, fontsize=8)\n", + " \n", + "cax = grid.cbar_axes[0]\n", + "smap.colorbarbase(cax);\n", + "\n", + "plt.savefig(os.path.join(plot_dir, 'dem_diffs.png'), dpi=150, bbox_inches='tight')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Comparison scatter plot " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "papermill": { + "duration": 28.675102, + "end_time": "2019-05-02T12:30:57.924205", + "exception": false, + "start_time": "2019-05-02T12:30:29.249103", + "status": "completed" + }, + "tags": [] + }, + "outputs": [], + "source": [ + "import seaborn as sns\n", + "sns.set(style=\"ticks\")\n", + "\n", + "l1, l2 = (utils.nicenumber(df.min().min(), binsize=50, lower=True), \n", + " utils.nicenumber(df.max().max(), binsize=50, lower=False))\n", + "\n", + "def plot_unity(xdata, ydata, **kwargs):\n", + " points = np.linspace(l1, l2, 100)\n", + " plt.gca().plot(points, points, color='k', marker=None,\n", + " linestyle=':', linewidth=3.0)\n", + "\n", + "g = sns.pairplot(df.dropna(how='all', axis=1).dropna(), plot_kws=dict(s=50, edgecolor=\"C0\", linewidth=1));\n", + "g.map_offdiag(plot_unity)\n", + "for asx in g.axes:\n", + " for ax in asx:\n", + " ax.set_xlim((l1, l2))\n", + " ax.set_ylim((l1, l2))\n", + "\n", + "plt.savefig(os.path.join(plot_dir, 'dem_scatter.png'), dpi=150, bbox_inches='tight')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Table statistics " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "papermill": { + "duration": 0.074215, + "end_time": "2019-05-02T12:30:58.035917", + "exception": false, + "start_time": "2019-05-02T12:30:57.961702", + "status": "completed" + }, + "tags": [] + }, + "outputs": [], + "source": [ + "df.describe()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "papermill": { + "duration": 0.065549, + "end_time": "2019-05-02T12:30:58.159184", + "exception": false, + "start_time": "2019-05-02T12:30:58.093635", + "status": "completed" + }, + "tags": [] + }, + "outputs": [], + "source": [ + "df.corr()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "df_diff.describe()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "df_diff.abs().describe()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## What's next?\n", + "\n", + "- return to the [OGGM documentation](https://docs.oggm.org)\n", + "- back to the [table of contents](welcome.ipynb)" + ] + } + ], + "metadata": { + "celltoolbar": "Tags", + "hide_input": false, + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.9.10" + }, + "latex_envs": { + "LaTeX_envs_menu_present": true, + "autoclose": false, + "autocomplete": true, + "bibliofile": "biblio.bib", + "cite_by": "apalike", + "current_citInitial": 1, + "eqLabelWithNumbers": true, + "eqNumInitial": 1, + "hotkeys": { + "equation": "Ctrl-E", + "itemize": "Ctrl-I" + }, + "labels_anchors": false, + "latex_user_defs": false, + "report_style_numbering": false, + "user_envs_cfg": false + }, + "nbTranslate": { + "displayLangs": [ + "*" + ], + "hotkey": "alt-t", + "langInMainMenu": true, + "sourceLang": "en", + "targetLang": "fr", + "useGoogleTranslate": true + }, + "papermill": { + "duration": 78.878142, + "end_time": "2019-05-02T12:30:59.784271", + "environment_variables": {}, + "exception": null, + "input_path": "dem_comparison.ipynb", + "output_path": "out-param.ipynb", + "parameters": { + "rgi_id": "RGI60-03.02489" + }, + "start_time": "2019-05-02T12:29:40.906129", + "version": "1.0.0" + }, + "toc": { + "base_numbering": 1, + "nav_menu": {}, + "number_sections": false, + "sideBar": true, + "skip_h1_title": true, + "title_cell": "Table of Contents", + "title_sidebar": "Contents", + "toc_cell": false, + "toc_position": {}, + "toc_section_display": true, + "toc_window_display": false + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} \ No newline at end of file diff --git a/notebooks/dem_statistics/dem_post_quality_per_region.py b/notebooks/dem_statistics/dem_post_quality_per_region.py new file mode 100644 index 0000000..7e221fe --- /dev/null +++ b/notebooks/dem_statistics/dem_post_quality_per_region.py @@ -0,0 +1,142 @@ +# This script has originally been created by Matthias Dusch(https://github.com/matthiasdusch) and got modified +# for the creation of dems_v2 statistics + +import os +import pandas as pd +import geopandas as gpd +import numpy as np +import matplotlib.pyplot as plt + +from oggm import utils, cfg + +from my_dem_funcs import dem_barplot +import statistics_paths + +wd = statistics_paths.wd +post = statistics_paths.post +sfx = statistics_paths.sfx + +os.makedirs(os.path.join(post, 'out/images'), exist_ok=True) +os.makedirs(os.path.join(post, 'out/tables'), exist_ok=True) + +cfg.initialize() +cfg.PATHS['working_dir'] = wd + +# dataframe for all areas +dfall = pd.DataFrame() + +# dataframe for statistic +cols = utils.DEM_SOURCES.copy() +cols.sort() +cols = ['RGI region', '# total'] + cols +dfstat = pd.DataFrame([], columns=cols) + +# statistic on subregions +dfsub = dfstat.copy() + +# rgi region & subregion file - depending on the RGI version (6.0, 6.x ..) chosen for the RGI Topo Dataset creation +# this folder- and filenames have to be adapted +regions = gpd.read_file(os.path.join(cfg.PATHS['rgi_dir'], 'RGIV62', + '00_rgi62_regions', + '00_rgi62_O1Regions.shp')) +subregs = gpd.read_file(os.path.join(cfg.PATHS['rgi_dir'], 'RGIV62', + '00_rgi62_regions', + '00_rgi62_O2Regions.shp')) +fig0, ax0 = plt.subplots(1, 1, figsize=[10, 10]) + +for reg in np.arange(1, 20): + fig, ax = plt.subplots(1, 1, figsize=[10, 10]) + regstr = '{:02.0f}'.format(reg) + + quality = pd.read_hdf(os.path.join(post, 'rgi_{}.h5'.format(regstr + sfx)), + 'quality') + regname = regions.loc[regions['RGI_CODE'].astype('int') == reg, 'FULL_NAME'].iloc[0] + + dem_barplot(quality, ax, + title='RGI region {}: {} ({:.0f} glaciers)'. + format(regstr, regname, len(quality))) + fig.tight_layout() + fig.savefig(os.path.join(post, 'out/images/', + 'barplot_rgi{}.png'.format(regstr + sfx))) + + # dfall = dfall.append(quality) + dfall = pd.concat([dfall, quality]) + # FULL REGION + total = len(quality) + good = (quality > 0.9).sum() + + # out = good / total + out = (good / total * 100).dropna().astype(int) + outstr = out.astype(str) + outstr.loc[out != 0] += '%' + outstr.loc[out == 0] = '--' + outstr['# total'] = total + + dfstat.loc[':ref:`{0}: {1}`'.format(regstr, regname)] = outstr + + # take care of subregions + regdf = gpd.read_file(utils.get_rgi_region_file(regstr)) + sregs = np.unique(regdf.O2Region) + + # For greenland we omit connectivity level 2. As this has also been done when generating the data with the + # prepo_levels cli, it also has to be done here. + if regstr == '05': + regdf = regdf.loc[regdf['Connect'] != 2] + + for sreg in sregs: + ids = regdf.loc[regdf.O2Region == sreg, 'RGIId'].values + subq = quality.loc[ids] + + # SUBREGIONS + total = len(subq) + good = (subq > 0.9).sum() + out = (good / total * 100).dropna().astype(int) + outstr = out.astype(str) + outstr.loc[out != 0] += '%' + outstr.loc[out == 0] = '--' + outstr['# total'] = total + + subregstr = '-{:02.0f}'.format(int(sreg)) + subregname = subregs.loc[subregs.RGI_CODE == regstr + subregstr].\ + FULL_NAME.iloc[0] + + dfsub.loc['{}: {}'.format(regstr + subregstr, subregname)] = outstr + +# FULL RGI +total = len(dfall) +good = (dfall > 0.9).sum() +out = (good / total * 100).dropna().astype(int) +outstr = out.astype(str) +outstr.loc[out != 0] += '%' +outstr.loc[out == 0] = '--' +outstr['# total'] = total + +dfstat.loc['All RGI regions'] = outstr + +dfsub.sort_index(inplace=True) + +# integer for number of glaciers +dfstat['# total'] = dfstat['# total'].astype(int) +dfstat['RGI region'] = dfstat.index +dfsub['# total'] = dfsub['# total'].astype(int) +dfsub['RGI region'] = dfsub.index + + +# write csv files for RST readthedocs +dfstat.to_csv(os.path.join(post, 'out/tables/', 'dem_allrgi{}.csv'.format(sfx)), + index=False) + +# write subregion tables: +for reg in np.arange(1, 20): + regstr = '{:02.0f}'.format(reg) + sub = dfsub.loc[dfsub.index.str.contains('{}-'.format(regstr))] + sub.to_csv(os.path.join(post, 'out/tables/', 'dem_rgi{}.csv'.format(regstr + sfx)), + index=False) + +# make and save plots +dem_barplot(dfall, ax0, + title='All RGI regions ({:.0f} glaciers)'.format(len(dfall))) + +fig0.tight_layout() +fig0.savefig(os.path.join(post, 'out/images/', + 'barplot_allregions{}.png'.format(sfx))) diff --git a/notebooks/dem_statistics/my_dem_funcs.py b/notebooks/dem_statistics/my_dem_funcs.py new file mode 100644 index 0000000..2ecd071 --- /dev/null +++ b/notebooks/dem_statistics/my_dem_funcs.py @@ -0,0 +1,198 @@ +# This script has been created by Matthias Dusch(https://github.com/matthiasdusch) +import os +import tarfile +import logging + +import numpy as np +import pandas as pd +import rasterio + +from oggm import utils, GlacierDirectory, entity_task + +# Module logger +log = logging.getLogger(__name__) + + +def dem_quality(gdir, demfile): + """Quality check based on oggm.simple_glacier_masks. + Parameters + ---------- + gdir : :py:class:`oggm.GlacierDirectory` + the glacier in question + demfile : str + path to a specific DEM tif-file + Returns + ------- + nanpercent : float + how many grid points are NaN as a fraction of all grid points + nanpercent_glc : float + how many grid points are NaN as a fraction of all glaciated grid points + meanhgt : float + mean elevation of grid points + meanhgt_glc : float + mean elevation of glaciated grid points + roughness : float + standard deviation of 2d slope of all grid points + roughness_glc : float + standard deviation of 2d slope of all glaciated grid points + """ + + # open tif-file: + with rasterio.open(demfile, 'r', driver='GTiff') as ds: + dem = ds.read(1).astype(rasterio.float32) + nx = ds.width + ny = ds.height + dx = ds.transform[0] + # assert some basics + assert nx == gdir.grid.nx + assert ny == gdir.grid.ny + assert dx == gdir.grid.dx + + # open glacier mask + with rasterio.open(gdir.get_filepath('glacier_mask'), + 'r', driver='GTiff') as ds: + mask = ds.read(1).astype(rasterio.int16) + + # set nodata values to NaN + min_z = -999. + dem[dem <= min_z] = np.NaN + isfinite = np.isfinite(dem) + isfinite_glc = np.isfinite(dem[np.where(mask)]) + + # calculate fraction of NaNs in all and glaciated area + nanpercent = np.sum(isfinite) / (nx * ny) + nanpercent_glc = np.sum(isfinite_glc) / mask.sum() + + # calculate mean elevation of all and glaciated area + meanhgt = np.nanmean(dem) + meanhgt_glc = np.nanmean(dem[np.where(mask)]) + + # calculate roughness of all area + sy, sx = np.gradient(dem, dx) + slope = np.arctan(np.sqrt(sy**2 + sx**2)) + roughness = np.nanstd(slope) + + # calculate roughness of glaciated area + dem_glc = np.where(mask, dem, np.nan) + sy, sx = np.gradient(dem_glc, dx) + slope = np.arctan(np.sqrt(sy**2 + sx**2)) + roughness_glc = np.nanstd(slope) + + return (nanpercent, nanpercent_glc, meanhgt, meanhgt_glc, roughness, + roughness_glc) + + +@entity_task(log) +def get_dem_area(gdir): + """Read the glacier_mask.tif and calculated glacier area based on this + Parameters + ---------- + gdir : GlacierDirectory + the glacier in question + Returns + ------- + float + glacier area in km2 + """ + + # read dem mask + with rasterio.open(gdir.get_filepath('glacier_mask'), + 'r', driver='GTiff') as ds: + profile = ds.profile + data = ds.read(1).astype(profile['dtype']) + + # calculate dem_mask size and test against RGI area + mask_area_km2 = data.sum() * gdir.grid.dx**2 * 1e-6 + + return mask_area_km2 + + +def gdirs_from_tar_files(path, rgi_region=None): + + gdirs = [] + for regdir in os.listdir(path): + + # only do required rgi_region + if (rgi_region is not None) and (regdir[-2:] != rgi_region): + continue + + rdpath = os.path.join(path, regdir) + + for file in os.listdir(rdpath): + + with tarfile.open(os.path.join(rdpath, file), 'r') as tfile: + for member in tfile: + if member.isdir(): + continue + tar_base = os.path.join(rdpath, member.path) + gdirs.append(GlacierDirectory(member.name[-21:-7], + from_tar=tar_base)) + + return gdirs + + +@entity_task(log) +def check_all_dems_per_gdir(gdir): + """Will go through all available DEMs and create some metrics + + DEMs musst be in GDir subfolders + + :param gdir: + :return: + """ + # dataframe for results + df = pd.DataFrame([], index=[gdir.rgi_id]*6, # np.arange(3), + columns=['metric'] + utils.DEM_SOURCES) + df.iloc[0]['metric'] = 'quality' + df.iloc[1]['metric'] = 'quality_glc' + df.iloc[2]['metric'] = 'meanhgt' + df.iloc[3]['metric'] = 'meanhgt_glc' + df.iloc[4]['metric'] = 'roughness' + df.iloc[5]['metric'] = 'roughness_glc' + + logfile = (os.path.join(gdir.dir, 'log.txt')) + + # read logfile, specify names cause log entries have different size + lfdf = pd.read_csv(logfile, delimiter=';', header=None, + skipinitialspace=True, names=[0, 1, 2, 3]) + + # loop over dems and save existing ones to test + dem2test = [] + for _, line in lfdf.iterrows(): + if ('DEM SOURCE' in line[1]) and ('SUCCESS' in line[2]): + rgi = line[1].split(',')[0] + dem = line[1].split(',')[2] + dem2test.append(dem) + + # loop over DEMs + for dem in dem2test: + demfile = os.path.join(gdir.dir, dem) + '/dem.tif' + qual, qualglc, hgt, hgt_glc, rgh, rgh_glc = dem_quality(gdir, demfile) + df.loc[df.metric == 'quality', dem] = qual + df.loc[df.metric == 'quality_glc', dem] = qualglc + df.loc[df.metric == 'meanhgt', dem] = hgt + df.loc[df.metric == 'meanhgt_glc', dem] = hgt_glc + df.loc[df.metric == 'roughness', dem] = rgh + df.loc[df.metric == 'roughness_glc', dem] = rgh_glc + + return df + + +def dem_barplot(df, ax, title=''): + + # dfexist = (df > 0).sum().sort_index() + dfgood = (df > 0.9).sum().sort_index() + + # ax.bar(dfexist.index, dfexist.values, width=-0.4, align='edge', + # label='DEM exists') + # ax.bar(dfgood.index, dfgood.values, width=0.4, align='edge', color='C2', + # label='DEM with >= 90% valid pixels') + ax.bar(dfgood.index, dfgood.values, width=0.8, align='center', color='C0', + label='DEM with >= 90% valid pixels') + + ax.set_ylabel('# number of glaciers') + # ax.set_ylim([0, np.ceil(len(df)/50)*50]) + ax.set_ylim([0, len(df)]) + ax.set_xticklabels(dfgood.index, rotation=75) + ax.set_title(title) + # ax.legend(loc=3) diff --git a/notebooks/dem_statistics/post_all_dems.py b/notebooks/dem_statistics/post_all_dems.py new file mode 100644 index 0000000..e9dcc00 --- /dev/null +++ b/notebooks/dem_statistics/post_all_dems.py @@ -0,0 +1,178 @@ +# This script has originally been created by Matthias Dusch(https://github.com/matthiasdusch) and got modified +# for the creation of dems_v2 statistics +import os +import pandas as pd +import geopandas as gpd +import numpy as np +import matplotlib.pyplot as plt + +from oggm.cli.prepro_levels import run_prepro_levels +from oggm import utils, cfg, GlacierDirectory +from oggm.workflow import execute_entity_task + +from my_dem_funcs import (check_all_dems_per_gdir, gdirs_from_tar_files, + get_dem_area) +import statistics_paths + + +def parse_logfile(path, df=None): + + # df passed or new one? + if df is None: + df = pd.DataFrame([], columns=utils.DEM_SOURCES) + + for lf in os.listdir(path): + # get rgi id from file name + if '.ERROR' in lf: + rgi = lf.split('.ERROR')[0] + else: + raise RuntimeError + + # read logfile + lfdf = pd.read_csv(os.path.join(path, lf), delimiter=';', header=None, + skipinitialspace=True) + + # set all DEMs to True + df.loc[rgi, :] = True + + # loop over dems and set erroneous ones to False + for _, dem in lfdf.iterrows(): + print(dem[3]) + if dem[2] == 'InvalidDEMError': + df.loc[rgi, dem[3].split()[1]] = False + if 'HTTPSConnect' in dem[3]: + print(rgi) + + return df + + +def parse_logfiles(path): + + df = pd.DataFrame([], columns=utils.DEM_SOURCES) + + for root, dirs, files in os.walk(path): + if 'log.txt' in files: + logfile = (os.path.join(root, 'log.txt')) + + # read logfile + lfdf = pd.read_csv(logfile, delimiter=';', header=None, + skipinitialspace=True) + + # loop over dems and set erroneous ones to False + for _, line in lfdf.iterrows(): + if 'DEM SOURCE' in line[1]: + rgi = line[1].split(',')[0] + dem = line[1].split(',')[2] + df.loc[rgi, dem] = True + #elif 'InvalidDEMError' in line[2]: + # rgi = line[2].split()[-1] + # assert rgi[:3] == 'RGI' + # dem = line[2].split()[2] + # assert dem in df.columns + # df.loc[rgi, dem] = 0 + + return df + + +def hgt_barplot(df1, df2, title='', savepath=None): + + fig, ax = plt.subplots(figsize=[10, 7]) + + ax.bar(df1.index, df1.values, width=-0.4, align='edge', + label='glaciated area (all DEMs >0.9 quality)', color='C0') + ax.bar(df2.index, df2.values, width=0.4, align='edge', color='C1', + label='full area (all DEMs >0.9 quality') + + ax.set_ylabel('elevation [m]') + # ax.set_ylim([0, np.ceil(len(df)/5)*5]) + + ax.set_title(title) + ax.legend(loc=3) + + fig.tight_layout() + if savepath is not None: + fig.savefig(savepath) + + +wd = statistics_paths.wd +post = statistics_paths.post +sfx = statistics_paths.sfx +prepro_path = statistics_paths.prepro_path + +os.makedirs(post, exist_ok=True) + +cfg.initialize() +cfg.PATHS['working_dir'] = wd + + +dfarea = pd.DataFrame([], index=np.arange(1, 20), columns=['demarea']) + +for reg in np.arange(1, 20): + regstr = '{:02.0f}'.format(reg) + + try: + rgidf = gpd.read_file(utils.get_rgi_region_file(regstr, version='6')) + gdirs = [GlacierDirectory(rgiid) for rgiid in rgidf.RGIId] + print('from gdir') + except: + gdirs = gdirs_from_tar_files(prepro_path, rgi_region=regstr) + print('from tar') + + dfreg = execute_entity_task(check_all_dems_per_gdir, gdirs) + dfreg = pd.concat(dfreg) + + quality = dfreg.loc[dfreg['metric'] == 'quality', + dfreg.columns != 'metric'] + + hgt = dfreg.loc[dfreg['metric'] == 'meanhgt', + dfreg.columns != 'metric'] + + qualityglc = dfreg.loc[dfreg['metric'] == 'quality_glc', + dfreg.columns != 'metric'] + hgtglc = dfreg.loc[dfreg['metric'] == 'meanhgt_glc', + dfreg.columns != 'metric'] + + rgh = dfreg.loc[dfreg['metric'] == 'roughness', + dfreg.columns != 'metric'] + rghglc = dfreg.loc[dfreg['metric'] == 'roughness_glc', + dfreg.columns != 'metric'] + + hgt_good = (hgt[(quality > 0.9)].dropna(axis=1, how='all'). + dropna(axis=0, how='any')) + + hgtglc_good = (hgtglc[(qualityglc > 0.9)].dropna(axis=1, how='all'). + dropna(axis=0, how='any')) + + hgt_barplot(hgt_good.mean(), hgtglc_good.mean(), + title=('Mean height of RGI region {} (#{:.0f} full area, ' + + '#{:.0f} glaciated area)').format(regstr, + len(hgt_good), + len(hgtglc_good)), + savepath=os.path.join(post, 'rgi_hgt_%s.png' % (regstr + sfx))) + + rgi_area = np.sum([gd.rgi_area_km2 for gd in gdirs]) + + dem_area = np.sum(execute_entity_task(get_dem_area, gdirs)) + + dfarea.loc[reg, 'demarea'] = dem_area + + quality.to_hdf(os.path.join(post, 'rgi_%s.h5' % (regstr + sfx)), + mode='a', key='quality') + + qualityglc.to_hdf(os.path.join(post, 'rgi_%s.h5' % (regstr + sfx)), + mode='a', key='quality_glc') + + hgt.to_hdf(os.path.join(post, 'rgi_%s.h5' % (regstr + sfx)), + mode='a', key='mhgt') + + hgtglc.to_hdf(os.path.join(post, 'rgi_%s.h5' % (regstr + sfx)), + mode='a', key='mhgt_glc') + + rgh.to_hdf(os.path.join(post, 'rgi_%s.h5' % (regstr + sfx)), + mode='a', key='roughness') + + rghglc.to_hdf(os.path.join(post, 'rgi_%s.h5' % (regstr + sfx)), + mode='a', key='roughness_glc') + + +dfarea.to_hdf(os.path.join(post, 'dem_area{}.h5'.format(sfx)), key='demarea') diff --git a/notebooks/dem_statistics/statistics_paths.py b/notebooks/dem_statistics/statistics_paths.py new file mode 100644 index 0000000..2a89da1 --- /dev/null +++ b/notebooks/dem_statistics/statistics_paths.py @@ -0,0 +1,14 @@ +# these paths have to be set according to your local system in order to run the creation of the DEM statistics +# and shouldn't be changed inbetween the execution of the separate scripts + +# path to your preprocessed RGI data +prepro_path = '/PATH/TO/PREPROCESSED/DATA/RGI62/b_010/L1' + +# path to directory that should be used as workdir by OGGM +wd = 'PATH/TO/YOUR/OGGM_WORKDIR' + +# directory where the generated h5-files, barplots and CSV-files will be saved +post = 'PATH/TO/THE/POSTPROCESSING/FOLDER' + +# suffix that is added to the output filenames of this run +sfx = '_v2' \ No newline at end of file diff --git a/notebooks/gamdam_links/Link_GAMDAM_RGI.ipynb b/notebooks/gamdam_links/Link_GAMDAM_RGI.ipynb new file mode 100644 index 0000000..c47e975 --- /dev/null +++ b/notebooks/gamdam_links/Link_GAMDAM_RGI.ipynb @@ -0,0 +1,579 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# A semi-automated matching of the GAMDAM and RGI6 glacier inventories" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "This notebook downloads and reads the GAMDAM glacier inventory, \"RGIifies\" it, and links it with RGI.\n", + "\n", + "We first try an automated matching in the direction RGI -> GAMDAM, since RGI seems to have less entries in general.\n", + "We then write PDFs with plots around unmatched RGI polygons with neighboring GAMDAM glaciers. These have to be manually assessed (good luck!) and then eneterd into a list (CSV or so). Finally, there should be three lists left: \n", + "\n", + "1) a list with all matches from RGI to GAMDAM, \n", + "\n", + "2) a list with RGI polygons that don't have a GAMDAM partner, and \n", + "\n", + "3) a list with all GAMDAM polygons that don't have an RGI partner" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Make imports" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import geopandas as gpd\n", + "import pandas as pd\n", + "import numpy as np\n", + "import salem\n", + "import shapely\n", + "import oggm\n", + "from oggm import cfg\n", + "import zipfile\n", + "\n", + "from glob import glob\n", + "import os\n", + "import matplotlib.pyplot as plt\n", + "%matplotlib notebook" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Do the OGGM initialization to make use of the download options (we might want to externalize this later)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "oggm.cfg.initialize()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Set paths" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# paths\n", + "base_path = os.path.expanduser('~')\n", + "regions = ['CentralAsia', 'NorthAsia', 'SouthAsiaEast', 'SouthAsiaWest']\n", + "region = 'CentralAsia'" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Automated download of all GAMDAM shape files (make use of OGGM funcs)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "def download_gamdam_file(base_path, region):\n", + " with oggm.utils.get_lock():\n", + " return _download_gamdam_file_unlocked(base_path, region)\n", + "\n", + "\n", + "def _download_gamdam_file_unlocked(base_path, region):\n", + " fname = 'gamdam20180404_001_{}.zip'.format(region)\n", + " dest_file = os.path.join(base_path, fname)\n", + " oggm.utils._downloads._requests_urlretrieve('http://store.pangaea.de/Publications/Sakai_2018/{}'.format(\n", + " fname), dest_file, None, auth=None, timeout=None)\n", + "\n", + " with zipfile.ZipFile(dest_file) as zf:\n", + " zf.extractall(os.path.dirname(dest_file))\n", + "\n", + "# do the job\n", + "for r in regions:\n", + " download_gamdam_file(base_path, r)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Say what we want to process" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# GAMDAM file\n", + "gfile = os.path.join(base_path, 'gamdam20180404_001_{}.shp'.format(region))\n", + "\n", + "\n", + "# RGI file (glob to save region number)\n", + "# spoiler: the RGI folders should be in base_path already\n", + "rfile = glob(os.path.join(base_path, '**/*_rgi60_{}.shp'.format(region)))[0]" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Here is the function that creates and fills RGI attributes, if they are straightforward" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "def rgiify_gamdam(gamdam_gdf: gpd.GeoDataFrame, area_epsg: int = 5837) -> gpd.GeoDataFrame:\n", + " \"\"\"\n", + " Make an RGI imitation of the GAMDAM glacier inventory [1]_.\n", + " \n", + " Most of the attributes are just dummies, since it's not yet clear which DEM we want to use etc.\n", + "\n", + " Parameters\n", + " ----------\n", + " gamdam_gdf : geopandas.GeoDataFrame\n", + "\n", + " Returns\n", + " -------\n", + " gamdam_gdf: geopandas.GeoDataFrame\n", + " Same geometries as in the GAMDAM inventory, but with RGI attributes.\n", + " area_epsg: int\n", + " EPSG code for a projection to use to claculate the polygon area in metric units. Default: 3857 \n", + " (WGS 84 / Pseudo-Mercator), may not be the optimum though.\n", + "\n", + " References\n", + " ----------\n", + " .. [1] Sakai, A. (2019). Brief communication: Updated GAMDAM glacier\n", + " inventory over high-mountain Asia. The Cryosphere, 13(7), 2043-2049.\n", + " \"\"\"\n", + "\n", + " gamdam_gdf['RGIId'] = ''\n", + " gamdam_gdf['GLIMSId'] = ''\n", + " gamdam_gdf['BgnDate'] = pd.to_datetime([f'{y}-{m}-{d}' for y, m, d in\n", + " zip(gamdam_gdf.yyyy,\n", + " gamdam_gdf.mm,\n", + " gamdam_gdf.dd)])\n", + " del gamdam_gdf['yyyy']\n", + " del gamdam_gdf['mm']\n", + " del gamdam_gdf['dd']\n", + " gamdam_gdf['EndDate'] = gamdam_gdf['BgnDate'].copy(deep=True)\n", + " centroids = gamdam_gdf.geometry.centroid\n", + " gamdam_gdf['CenLon'] = [p.x for p in centroids]\n", + " gamdam_gdf['CenLat'] = [p.y for p in centroids]\n", + " gamdam_gdf['O1Region'] = ''\n", + " gamdam_gdf['O2Region'] = ''\n", + " gamdam_reproj = gamdam_gdf.to_crs(epsg=area_epsg)\n", + " gamdam_gdf['Area'] = gamdam_reproj.geometry.area / 10**6\n", + " gamdam_gdf['Zmin'] = np.nan\n", + " gamdam_gdf['Zmax'] = np.nan\n", + " gamdam_gdf['Zmed'] = np.nan\n", + " gamdam_gdf['Slope'] = np.nan\n", + " gamdam_gdf['Aspect'] = np.nan\n", + " gamdam_gdf['Lmax'] = np.nan\n", + " gamdam_gdf['Status'] = np.nan\n", + " gamdam_gdf['Connect'] = np.nan\n", + " gamdam_gdf['Form'] = np.nan\n", + " gamdam_gdf['TermType'] = np.nan\n", + " gamdam_gdf['Surging'] = np.nan\n", + " gamdam_gdf['Linkages'] = np.nan\n", + " gamdam_gdf['Name'] = ''\n", + "\n", + " return gamdam_gdf" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Read the data" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# read\n", + "gamdam = salem.read_shapefile(gfile)\n", + "rgi6 = salem.read_shapefile(rfile)\n", + "\n", + "# set CRS (missing)\n", + "gamdam.crs = {'init' :'epsg:4326'}\n", + "rgi6.crs = {'init' :'epsg:4326'}" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Look at the headers" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "gamdam.head(2)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "rgi6.head(2)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Do the \"RGIifying\"" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "rgam = rgiify_gamdam(gamdam)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Set some search parameters" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# How many potential GAMDAM neighbors in the vicinity of an RGI polygon to consider\n", + "consider_closest = 20\n", + "# This thrshold determines how high a threshold has to be to make it a match\n", + "overlap_ratio = 0.8" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Automated matching approach" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "On vierzack06 (ETH server), the processing corrently takes ~5min for 1000 glaciers" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "nomatch = []\n", + "for i, rgirow in rgi6[:100].iterrows():\n", + " pct_overlap = []\n", + " rgiframe = gpd.GeoDataFrame([rgirow], geometry='geometry')\n", + " rgi_area = rgiframe.geometry.area.values\n", + " \n", + " hdist = oggm.utils.haversine(rgirow.CenLon, rgirow.CenLat, rgam.CenLon, rgam.CenLat)\n", + " rgam['hdist'] = hdist\n", + " rgam.sort_values(by='hdist', inplace=True)\n", + " rgam_sel = rgam.head(consider_closest)\n", + " for j, gamdamrow in rgam_sel.iterrows():\n", + " gamframe = gpd.GeoDataFrame([gamdamrow], geometry='geometry')\n", + " gamdam_area = gamframe.geometry.area.values\n", + " intsct_area = gpd.overlay(gamframe, rgiframe, how='intersection').geometry.area.values\n", + " \n", + " # no intersection\n", + " if (intsct_area).size == 0:\n", + " continue \n", + " \n", + " # check: either RGI can be in GAMDAM or the other way around\n", + " intsct_ratio_one = intsct_area / gamdam_area\n", + " intsct_ratio_two = intsct_area / rgi_area\n", + " intsct_ratio = np.max([intsct_ratio_one, intsct_ratio_two])\n", + " pct_overlap.append(intsct_ratio)\n", + " \n", + " if (i % 100) == 0:\n", + " print(i)\n", + " \n", + " if ~(np.array(pct_overlap) > overlap_ratio).any():\n", + " print('No Match: ', rgirow.RGIId)\n", + " nomatch.append(rgirow.RGIId)\n", + " continue\n", + " best_match = np.argmax(np.array(pct_overlap))\n", + " \n", + " rgam.loc[rgam.FID_1 == rgam_sel.iloc[best_match].FID_1, 'RGIId'] = rgirow.RGIId" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Shapefile doesn't like date objects" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "rgam['BgnDate'] = rgam['BgnDate'].apply(lambda x: x.strftime('%Y-%m-%d'))\n", + "rgam['EndDate'] = rgam['EndDate'].apply(lambda x: x.strftime('%Y-%m-%d'))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "rgam.to_file(os.path.join(base_path, 'RGI_GAMDAM_links_automated_{}.shp'.format(region)))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Write all unmatched glaciers (RGI -> GAMDAM) to PDF plots" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "'{} Glaciers are unmatched in the automated approach.'.format(len(nomatch))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We pack plots into batches of 50 plots per PDF, otherwise the PDF file size becomes very large." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "scrolled": true + }, + "outputs": [], + "source": [ + "from matplotlib.backends.backend_pdf import PdfPages\n", + "\n", + "region = 'CentralAsia'\n", + "plot_closest = 10\n", + "curr = 1 # current plot\n", + "unmatched_ids = nomatch.copy()\n", + "total = len(unmatched_ids) # total number of plots ()\n", + "batch_size = 50\n", + "\n", + "pdf_batches = np.arange(0, total + batch_size, batch_size)\n", + "\n", + "for k, (start, end) in enumerate(zip(pdf_batches[:-1], pdf_batches[1:])):\n", + " with PdfPages(os.path.join(base_path, 'RGI_GAMDAM_manual_checks_{}_{}.pdf'.format(region, k))) as pdf:\n", + " for gid in unmatched_ids[start:end]:\n", + " glacier = rgi6[rgi6.RGIId == gid].iloc[0]\n", + " lon, lat = glacier.CenLon, glacier.CenLat\n", + " hdist = curr_dist = oggm.utils.haversine(glacier.CenLon, glacier.CenLat, rgam.CenLon, rgam.CenLat)\n", + " rgam['hdist'] = hdist\n", + " rgam.sort_values(by='hdist', inplace=True)\n", + " \n", + " rgam_sel = rgam.head(plot_closest)\n", + "\n", + " # For GoogleMap we need a lon lat range to generate the map\n", + " mmlon = [lon, lon]\n", + " mmlat = [lat, lat]\n", + " \n", + " bminx, bminy, bmaxx, bmaxy = rgam_sel.total_bounds\n", + " mmlon = [np.min(np.append(mmlon, bminx)), np.max(np.append(mmlon, bmaxx))]\n", + " mmlat = [np.min(np.append(mmlat, bminy)), np.max(np.append(mmlat, bmaxy))]\n", + "\n", + " # Make a local map where to plot the polygons\n", + " local = salem.GoogleVisibleMap(x=mmlon, y=mmlat) # also possible: maptype='terrain'\n", + " local_map = salem.Map(local.grid, countries=False, nx=640)\n", + " local_map.set_lonlat_contours()\n", + "\n", + "\n", + " # Prepare the figure\n", + " fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(14, 5))\n", + " ax1.set_title('{}: '.format(gid) + glacier.O1Region + '-' + str(glacier.Name) + \n", + " ' {:.2f}km2'.format(glacier.Area))\n", + "\n", + " # Plot glaciers\n", + " colors = ['red', 'orange', 'green', 'blue', 'purple', 'magenta', 'chartreuse', 'brown', 'black',\n", + " 'yellow']\n", + " for i in np.arange(0, plot_closest):\n", + " gamg = rgam_sel.iloc[i]\n", + " # In case the glacier is a MultiPolygon we (again) account for this here:\n", + " if gamg.geometry.type == 'Polygon':\n", + " x, y = gamg.geometry.exterior.xy\n", + " elif gamg.geometry.type == 'MultiPolygon':\n", + " # buffer is necessary as some multi-polygons are self-intersecting\n", + " allparts = [p.buffer(0) for p in gamg.geometry] \n", + " gamg.geometry = shapely.ops.cascaded_union(allparts)\n", + " x, y = gamg.geometry.exterior.xy\n", + "\n", + " # print centroid of matching glacier\n", + " if i == 0:\n", + " local_map.set_geometry(shapely.geometry.Point(gamg.CenLon, gamg.CenLat), edgecolor='k',\n", + " marker='x', color='g', linewidth=4, markersize=100, zorder=50, text='GAMDAM', text_delta=(0.02, 0.02))\n", + "\n", + " # RGI polygon label\n", + " if gamg.Name == '':\n", + " plabel = 'ID: ' + str(gamg.FID_1)+'\\n'+str(round(gamg.Area, 2))+'km2' + ', HDIST: ' + str(int(gamg.hdist))+'m'\n", + " else:\n", + " plabel = 'ID: ' + str(gamg.FID_1)+'\\n'+str(round(gamg.Area, 2))+'km2\\n'+str(gamg.Name) + ', HDIST: ' + str(int(gamg.hdist))+'m'\n", + "\n", + " local_map.set_geometry(gamg.geometry.exterior, color=colors[i], linewidth=3, label=plabel)\n", + "\n", + " local_map.set_geometry(shapely.geometry.Point(gamg.CenLon, gamg.CenLat), c='k', marker='x', markersize=30, zorder=51) #again adjusted fpr RGI 5.0\n", + "\n", + " local_map.set_geometry(shapely.geometry.Point(lon, lat), color='g', marker='x', linewidth=4, markersize=100, zorder=50, text='RGI', text_delta=(0.02, 0.02))\n", + " local_map.set_geometry(glacier.geometry.exterior, color='darkblue', linewidth=3, label=glacier.RGIId)\n", + " \n", + " local_map.set_rgb(local.get_vardata())\n", + " local_map.visualize(ax=ax1, addcbar=False)\n", + "\n", + " local = salem.GoogleVisibleMap(x=mmlon, y=mmlat, maptype='terrain')\n", + " local_map.set_rgb(local.get_vardata())\n", + " local_map.visualize(ax=ax2, addcbar=False)\n", + " plt.subplots_adjust(left=0.04, right=0.80, top=0.94, bottom=0.07)\n", + " plt.legend(bbox_to_anchor=(1.02, 1.), fontsize=12, loc=2, borderaxespad=0, frameon=False, numpoints=1,scatterpoints=1)\n", + " pdf.savefig(fig)\n", + " plt.close()\n", + "\n", + " if curr % 5 == 0:\n", + " print('{} / {} plots done.'.format(curr, total))\n", + " curr += 1" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Unmatched RGI polygons by area" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "rgi_sub = rgi6.loc[rgi6.RGIId.isin(nomatch)]\n", + "plt.figure()\n", + "rgi_sub.Area.hist(bins=500)\n", + "plt.xlabel('Area (km2)')\n", + "plt.ylabel('No. of unmatched')\n", + "plt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Make a CSV where all unmatched RGI polygons can get a partner" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "csv_outpath = os.path.join(base_path, 'unmatched_rgi_gamdam_{}.csv'.format(region))\n", + "\n", + "unmatched_df = pd.DataFrame(data=np.array([nomatch, np.full_like(nomatch, np.nan)]).T, \n", + " columns=['RGIId', 'GAMDAM_ID'])\n", + "unmatched_df.to_csv(csv_outpath) " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Conclude by listing the GAMDAM glaciers which are unmatched" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "This list will contain all GAMDAM glaciers that haven't been successfully matched \n", + "1) During the automated RGI -> GAMDAM search\n", + "2) During the manual RGI -> GAMDAM search\n", + "This means the list will contain all row of `rgam`, which to do have an try in the RGI column after the autmated search, MINUS all sucessful matches during the manual matching." + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "rgitools", + "language": "python", + "name": "rgitools" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.7.8" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/readthedocs.yml b/readthedocs.yml deleted file mode 100644 index 5a16256..0000000 --- a/readthedocs.yml +++ /dev/null @@ -1,6 +0,0 @@ -python: - version: 3.5 - install: - - requirements: docs/requirements.txt - system_packages: true - setup_py_install: true diff --git a/rgitools/funcs.py b/rgitools/funcs.py index 05df53b..e1b374d 100644 --- a/rgitools/funcs.py +++ b/rgitools/funcs.py @@ -248,28 +248,31 @@ def compute_intersects(rgi_df, to_file='', job_id=''): if isinstance(mult_intersect, shpg.Point): continue if isinstance(mult_intersect, shpg.linestring.LineString): - mult_intersect = [mult_intersect] - if len(mult_intersect) == 0: + mult_intersect = shpg.MultiLineString([mult_intersect]) + if len(mult_intersect.geoms) == 0: continue - mult_intersect = [m for m in mult_intersect if + mult_intersect = [m for m in mult_intersect.geoms if not isinstance(m, shpg.Point)] if len(mult_intersect) == 0: continue # Simplify the geometries if possible - mult_intersect = linemerge(mult_intersect) + try: + mult_intersect = linemerge(mult_intersect) + except IndexError: + pass # Add each line to the output file if isinstance(mult_intersect, shpg.linestring.LineString): - mult_intersect = [mult_intersect] - for line in mult_intersect: + mult_intersect = shpg.MultiLineString([mult_intersect]) + for line in mult_intersect.geoms: assert isinstance(line, shpg.linestring.LineString) # Filter the very small ones if line.length < 1e-3: continue line = gpd.GeoDataFrame([[major.RGIId, neighbor.RGIId, line]], columns=out_cols) - out = out.append(line) + out = pd.concat([out, line]) # Index and merge out.reset_index(inplace=True, drop=True) @@ -354,7 +357,7 @@ def merge_clusters(rgi_df, intersects_df, keep_all=True, to_file='', d2 = rgi_df.dissolve(by='OrigIds') # Process attributes - gb = rgi_df.groupby('OrigIds') + gb = rgi_df[['OrigIds', 'Area', 'Zmax', 'Zmin']].groupby('OrigIds') d2['Area'] = gb.sum()['Area'] d2['Zmax'] = gb.max()['Zmax'] d2['Zmin'] = gb.min()['Zmin'] @@ -436,8 +439,10 @@ def hypsometries(rgi_df, to_file='', job_id='', oggm_working_dir='', cfg.PARAMS['use_intersects'] = False cfg.PARAMS['continue_on_error'] = True cfg.PARAMS['use_multiprocessing'] = False - gdirs = workflow.init_glacier_regions(rgi_df) - workflow.execute_entity_task(tasks.simple_glacier_masks, gdirs) + gdirs = workflow.init_glacier_directories(rgi_df) + workflow.execute_entity_task(tasks.define_glacier_region, gdirs) + workflow.execute_entity_task(tasks.simple_glacier_masks, gdirs, + write_hypsometry=True) compile_glacier_statistics(gdirs, filesuffix='_{}'.format(gdirs[0].rgi_region)) @@ -476,7 +481,7 @@ def hypsometries(rgi_df, to_file='', job_id='', oggm_working_dir='', out_gdf = out_gdf.reset_index() df = df.reset_index(drop=True) - bdf = df[df.columns[3:]].fillna(0).astype(np.int) + bdf = df[df.columns[3:]].fillna(0).astype(int) ok = bdf.sum(axis=1) bdf.loc[ok < 1000, :] = -9 df[df.columns[3:]] = bdf diff --git a/rgitools/tests/conftest.py b/rgitools/tests/conftest.py new file mode 100644 index 0000000..4476bd3 --- /dev/null +++ b/rgitools/tests/conftest.py @@ -0,0 +1,8 @@ +import pytest +from oggm.utils import _downloads +from oggm.tests.conftest import secure_url_retrieve + + +@pytest.fixture(autouse=True) +def patch_url_retrieve(monkeypatch): + monkeypatch.setattr(_downloads, 'oggm_urlretrieve', secure_url_retrieve) diff --git a/rgitools/tests/test_rgitools.py b/rgitools/tests/test_rgitools.py index 91d7ccf..00727de 100644 --- a/rgitools/tests/test_rgitools.py +++ b/rgitools/tests/test_rgitools.py @@ -11,23 +11,12 @@ import geopandas as gpd import numpy as np from numpy.testing import assert_equal, assert_allclose -import oggm.utils -from oggm.tests.funcs import patch_url_retrieve_github import rgitools from rgitools import funcs from rgitools.funcs import get_demo_file, mkdir -def setup_module(module): - module._url_retrieve = oggm.utils.oggm_urlretrieve - oggm.utils._downloads.oggm_urlretrieve = patch_url_retrieve_github - - -def teardown_module(module): - oggm.utils._downloads.oggm_urlretrieve = module._url_retrieve - - def get_iceland_df(reduced=False): df = gpd.read_file(get_demo_file('RGI6_icecap.shp')) @@ -319,7 +308,7 @@ def set_oggm_params(cfg): assert rmsd(gdf['Zmed'], rgi_df['Zmed']) < 25 assert rmsd(gdf['Zmin'], rgi_df['Zmin']) < 25 assert rmsd(gdf['Zmax'], rgi_df['Zmax']) < 25 - assert rmsd(gdf['Slope'], rgi_df['Slope']) < 1 + assert rmsd(gdf['Slope'], rgi_df['Slope']) < 2 # For aspect test for cos / sin because of 0 360 thing us = np.cos(np.deg2rad(gdf.Aspect)) @@ -344,7 +333,7 @@ def set_oggm_params(cfg): assert rmsd(gdf['Zmed'], rgi_df['Zmed']) < 25 assert rmsd(gdf['Zmin'], rgi_df['Zmin']) < 25 assert rmsd(gdf['Zmax'], rgi_df['Zmax']) < 25 - assert rmsd(gdf['Slope'], rgi_df['Slope']) < 1 + assert rmsd(gdf['Slope'], rgi_df['Slope']) < 2 # For aspect test for cos / sin because of 0 360 thing us = np.cos(np.deg2rad(gdf.Aspect)) diff --git a/setup.py b/setup.py index 8627915..950a757 100644 --- a/setup.py +++ b/setup.py @@ -10,14 +10,14 @@ MAJOR = 0 MINOR = 0 -MICRO = 1 -ISRELEASED = True +MICRO = 2 +ISRELEASED = False VERSION = '%d.%d.%d' % (MAJOR, MINOR, MICRO) QUALIFIER = '' DISTNAME = 'rgitools' -LICENSE = 'LGPLv3+' -AUTHOR = 'rgitools developers' +LICENSE = 'BSD-3-Clause' +AUTHOR = 'rgitools contributors' AUTHOR_EMAIL = 'fabien.maussion@uibk.ac.at' URL = '' CLASSIFIERS = [ @@ -26,8 +26,7 @@ 'Development Status :: 4 - Alpha', # Indicate who your project is intended for 'Intended Audience :: Science/Research', - 'License :: OSI Approved :: GNU Lesser General Public License ' + - 'v3 or later (LGPLv3+)', + 'License :: OSI Approved :: BSD License', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6'