Skip to content

Commit 8f0b3b6

Browse files
authored
Merge pull request #16 from GLIMS-RGI/essd_review
final merge/update before releasing v1.0 on github/zenodo
2 parents c7f73fd + 509638e commit 8f0b3b6

41 files changed

Lines changed: 20480 additions & 19744 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# This workflow will install Python dependencies, run tests and lint with a single version of Python
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
3+
4+
name: dataset checks
5+
6+
on:
7+
push:
8+
branches: [ "main" ]
9+
pull_request:
10+
branches: [ "main" ]
11+
12+
permissions:
13+
contents: read
14+
15+
jobs:
16+
test:
17+
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- uses: actions/checkout@v5
22+
with:
23+
fetch-depth: 0
24+
- name: Set up Python 3.10
25+
uses: actions/setup-python@v3
26+
with:
27+
python-version: "3.10"
28+
- name: Install dependencies
29+
run: |
30+
python -m pip install --upgrade pip
31+
pip install pytest pandas geopandas delayed-assert gitpython tqdm
32+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
33+
- name: Run Dataset Checks
34+
run: |
35+
pytest

README.md

Lines changed: 65 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Global lake-terminating glacier classification: a community effort for the Randolph Glacier Inventory (RGI) and beyond
22

3+
[![DOI](https://zenodo.org/badge/764141248.svg)](https://zenodo.org/badge/latestdoi/764141248)
4+
35
Written by William Armstrong and Tobias Bolch with contributions from Robert McNabb, Rodrigo Aguayo, Fabien Maussion,
46
Jakob Steiner, and Will Kochtitzky
57

@@ -62,16 +64,72 @@ Each of the files in the dataset folders contains the following fields:
6264
- `contributor` - the ID of the contributor(s) who classified the glacier
6365
- `notes` - any additional notes from each contributor
6466

67+
Additionally, the `contributor_files/` may have an additional field, `auto_term`. When running
68+
`scripts/finalize_csv.py`, the column `term_type` (if included in the CSV) is renamed to `auto_term` to indicate that
69+
`scripts/assign_lake_flag.py` was run and there was an inventory lake within the buffer around the terminus
70+
(`auto_term == 2`)
71+
6572
The `.gpkg` files contained in the `lakeflags/` and `outlines/` directories are generated from the `.csv` files and the
6673
RGI outlines using `scripts/generate_geopackage.py`.
6774

75+
## Scripts
76+
77+
The repository has a number of scripts that can be used to update or work with the dataset. To be able to run any of the
78+
scripts, you will first need to create a [conda]() environment using the `environment.yml` file found in the repository.
79+
80+
The following scripts are found in the `scripts/` folder:
81+
82+
- `test_submission.py`: this script contains a number of tests that can be run with `pytest` to check that any new or
83+
updated files in `dataset/contributor_files` or `dataset/csv` match the formatting of the dataset.
84+
- `update_dataset.py`: this script can be used to update the dataset with any new or revised files found in
85+
`dataset/contributor_files`. The script first checks for any conflicts (glaciers with multiple `lake_cat` values). If
86+
there are conflicts, these need to be resolved by editing the `{region}_conflicts.csv` file(s) created and changing
87+
the conflicting `lake_cat` values to an agreed value, and the script then needs to be run again. Once all conflicts
88+
have been resolved, the script updates the geopackage files, and re-creates `dataset/summary_table.csv` with the
89+
updated number and area of lake-terminating glaciers. At this point, the updated files can be committed and merged
90+
using a [pull request](https://github.com/GLIMS-RGI/lake_terminating/pulls). For more information about how to use
91+
the script, run `python scripts/update_dataset.py -h` from within the `conda` environment.
92+
- `assign_lake_flag.py`: can be used with a lake inventory to identify glaciers that have a lake within some buffer
93+
around the terminus. For more information about how to use the script, run `python scripts/assign_lake_flag.py -h`
94+
from within the `conda` environment, or see the "Workflow using existing lake inventory" section below.
95+
- `assign_term_type.py`: this script can be used to update the RGI v7.0 `term_type` attribute, using the files found
96+
in `dataset/csv`. Glaciers with a `lake_cat` of 2 or 3 will be assigned a `term_type` of 2 (lake-terminating), while
97+
glaciers with a `lake_cat` of 0 or 1 will be assigned a `term_type` of 0 (land-terminating). The updated .csv files
98+
can then be joined to the RGI shapefiles.
99+
- `generate_geopackage.py`: re-generates the geopackage files for each region.
100+
- `summary_table.py`: re-creates `dataset/summary_table.csv` based on the files in `dataset/csv`.
101+
- `finalize_csv.py`: converts the attribute table from a shapefile used for mapping into a .csv file that is compatible
102+
with the dataset. For more information about how to use the script, run `python scripts/finalize_csv.py -h`
103+
from within the `conda` environment.
104+
105+
68106
## Contributing
69107

70108
The classifications provided here are the result of a community effort, which means that there may be disagreement
71-
between analysts. If you find any such issues, we invite you to submit your updates/corrections by first forking this
72-
repository and submitting a Pull Request (https://github.com/GLIMS-RGI/lake_terminating/pulls).
109+
between analysts. If you find any such issues, we invite you to submit your updates/corrections in one of the following
110+
ways, depending on your level of comfort with git/GitHub:
111+
112+
### through GitHub
113+
114+
1. Open an issue (https://github.com/GLIMS-RGI/lake_terminating/issues) for further discussion;
115+
2. Fork this repository, make your changes/updates, and open a Pull Request
116+
(https://github.com/GLIMS-RGI/lake_terminating/pulls). **Please Note**: if you choose this option, ensure
117+
that your updated files are placed in the relevant regional folder in `dataset/contributor_files`, rather than
118+
updating the files in `dataset/csv` directly.
119+
120+
As part of the PR process, any updated CSV files will be checked for formatting consistency. Once those checks have
121+
passed, the updates can be merged using the process outlined by `scripts/update_dataset.py`.
122+
123+
You are welcome to make these changes yourself; alternatively, one of the maintainers will be able to do the final
124+
merge/update.
125+
126+
### outside of GitHub
127+
128+
Outside of GitHub, you are welcome to contact one or more of the maintainers to discuss any issues or to send along
129+
your proposed updates/corrections.
73130

74-
Alternatively, you are welcome to open an issue for further discussion (https://github.com/GLIMS-RGI/lake_terminating/issues).
131+
Please ensure that your submitted CSV file uses the same format as is found in the `lake_term_data_template.csv`
132+
file found in this repository, as it will greatly simplify the integration process.
75133

76134
## 1. Definition and categories of lake-terminating glaciers
77135

@@ -136,12 +194,12 @@ that have not amalgamated to form one lake spanning the majority of the glacier
136194
Similarly, we did not consider glaciers with proglacial water bodies smaller than 0.01 km<sup>2</sup> to be
137195
lake-terminating.
138196

139-
![Fig4_Level_0_Examples.png](essd/figures/Fig4_Category_0_Examples.png)
197+
![](essd/figures/Fig4_Category_0_Examples.png)
140198
*Background images are Landsat 7 ETM+ false-color composites (bands 5, 4, 3). RGI7 outlines are shown in red, while lake
141199
outlines are shown in white. (a) Eklutna Glacier (RGI2000-v7.0-G-01-10928) in Alaska. Landsat image acquired 1999-07-31.
142200
(b) Unnamed glacier (RGI2000-v7.0-G-01-11048) in Alaska (region 01). Landsat image acquired 1999-07-31. (c) Harris
143201
Glacier (RGI2000-v7.0-G-01-08628) in Alaska (region 01). Landsat image acquired 2000-08-09. (d) Hispar Glacier, with
144-
numerous supraglacial ponds (RGI2000-v7.0-G-14-21670) in South Asia West (region 14). Landsat image acquired 2000-09-11.
202+
numerous supraglacial ponds (RGI2000-v7.0-G-14-21670) in South Asia West (region 14). Landsat image acquired 2000-09-11.*
145203

146204
### Ambiguous lake termini
147205

@@ -175,7 +233,7 @@ includes exclusively glaciers that are definitely not lake-terminating is helpfu
175233

176234
### Workflow using existing lake inventory
177235

178-
We have provided a Python script (`scripts/assign_flag.py`) that utilizes an existing ice-marginal
236+
We have provided a Python script (`scripts/assign_lake_flag.py`) that utilizes an existing ice-marginal
179237
lake inventory to produce a limited subset of RGI glaciers that should be manually verified for lake-terminating status.
180238

181239
We have compiled a list of known [datasets here](https://github.com/GLIMS-RGI/lake_terminating/blob/main/Lake_databases_termini.csv).
@@ -228,7 +286,7 @@ The contributors to the lake inventory should provide a csv file with the follow
228286

229287
| `rgi_id` | `lake_cat` | `image_id` | `image_date` | `inventory_doi` | `contributor` |
230288
|-------------------------|:----------:|:----------------------------------------:|:------------:|:----------------------------------:|:-------------:|
231-
| RGI2000-v7.0-G-01-08604 | 1 | LT05_L1TP_066017_19990927_20200907_02_T1 | 1999/09/27 | https://doi.org/10.18739/A2MK6591G | Armstrong |
289+
| RGI2000-v7.0-G-01-08604 | 3 | LT05_L1TP_066017_19990927_20200907_02_T1 | 1999-09-27 | https://doi.org/10.18739/A2MK6591G | Armstrong |
232290

233291
The fields are defined as:
234292

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
rgi_id,auto_term,lake_cat,image_id,notes,image_date,contributor,inventory_doi
2+
RGI2000-v7.0-G-15-06763,9,3,,,,,doi:10.5194/essd-12-2169-2020

0 commit comments

Comments
 (0)