Skip to content

Commit a776fc4

Browse files
authored
New attempts at docs (#1198)
1 parent 4fbb287 commit a776fc4

File tree

12 files changed

+67
-24
lines changed

12 files changed

+67
-24
lines changed

LICENSE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2014-2020, OGGM e.V. and OGGM Contributors
1+
Copyright (c) 2014-2021, OGGM e.V. and OGGM Contributors
22
All rights reserved.
33

44
Redistribution and use in source and binary forms, with or without

README.rst

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@
55

66
**OGGM is a modular open source model for glacier dynamics**
77

8-
The model accounts for glacier geometry (including contributory branches) and
9-
includes an explicit ice dynamics module. It can simulate past and
10-
future mass-balance, volume and geometry of (almost) any glacier in the world
11-
in a fully automated and extensible workflow. We rely exclusively on publicly
12-
available data for calibration and validation.
8+
OGGM is able to simulate past and
9+
future mass-balance, volume and geometry of (almost) any glacier in the world,
10+
in a fully automated and extensible workflow.
1311

12+
The model accounts for glacier geometry (including contributory branches) and
13+
includes an explicit ice dynamics module. We rely exclusively on publicly
14+
available data for calibration and validation. **OGGM is modular and
15+
supports novel modelling workflows**: it LOVES to be remixed and reused!
1416

1517
.. image:: docs/_static/ex_tasman.jpg
1618

docs/api.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ Tools to set-up and run OGGM.
2929
workflow.init_glacier_directories
3030
workflow.execute_entity_task
3131
workflow.gis_prepro_tasks
32+
workflow.download_ref_tstars
3233
workflow.climate_tasks
3334
workflow.inversion_tasks
3435
workflow.merge_glacier_tasks
@@ -193,6 +194,21 @@ but might use multiprocessing internally.
193194
global_tasks.compile_climate_statistics
194195

195196

197+
Command line interface (CLI)
198+
============================
199+
200+
These commands are available:
201+
202+
- ``oggm_netrc_credentials``
203+
- ``oggm_prepro``
204+
- ``oggm_benchmark``
205+
206+
.. autosummary::
207+
:toctree: generated/
208+
:nosignatures:
209+
210+
cli.prepro_levels.run_prepro_levels
211+
196212
Classes
197213
=======
198214

docs/cloud.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ to test the model, before you move on to more serious computations.
99

1010
.. image:: https://gke.mybinder.org/static/logo.svg
1111
:width: 25%
12-
:target: https://mybinder.org/v2/gh/OGGM/binder/master?urlpath=git-pull?repo=https://github.com/OGGM/tutorials%26amp%3Bbranch=master%26amp%3Burlpath=lab/tree/tutorials/notebooks/welcome.ipynb%3Fautodecode
12+
:target: https://mybinder.org/v2/gh/OGGM/binder/stable?urlpath=git-pull?repo=https://github.com/OGGM/tutorials%26amp%3Bbranch=master%26amp%3Burlpath=lab/tree/tutorials/notebooks/welcome.ipynb%3Fautodecode
1313

1414
Our `Binder <https://mybinder.org/>`_ test space is available to anyone, with no
1515
registration necessary. Using it is very simple. Just click on the
1616
link below to get you started!
1717

1818
.. image:: https://img.shields.io/badge/Launch-OGGM%20tutorials-579ACA.svg?style=popout&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAlCAYAAAAjt+tHAAAACXBIWXMAABcSAAAXEgFnn9JSAAAAB3RJTUUH4wENDyoWA+0MpQAAAAZiS0dEAP8A/wD/oL2nkwAACE5JREFUWMO9WAtU1FUaH1BTQVJJKx+4BxDEgWEGFIzIVUMzPVBauYng8Jr3AxxAHObBvP6MinIUJdLwrTwqzXzkWVMSLW3N7bTrtmvpno7l6WEb7snMB6DffvfOzJ87A5a27t5zvjP/x/1/v9/9Xve7IxA84BFXYBMIi+zBIoUrOCLbxD9PVLgE/9MRtdhKfycW2gfGFzkMCFgXV2CPEStdAyQqLui/BhiXU3lP8xJkzkclSu77SapqSEYRyZ2bE+TO0b8JdGKRozeRRZWDcHXDEuWuEQkyx8gkJTcirtA2VCh3DvJYwJGT7AUngu9PDJ9nGH5/yM9oBU+X1fK3sXlVQyQKVyyu5lkELcUVviZRcHvECtc+BNiNz+vF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Ptw3j4lbvvt8dAOTuE9gbdK9G5pjC+zr89BqhmSUCac0Wpk13vIAKLt/vqchb6/+Mi5odmq3lT8dohfs4I05X98fVr2LjAQvWUVR8GEl1BAKSediAnsccr4/Nt6YTFRmla3l1v1tkur8zKnYsKQj0lx4/Vt9C8Kf4CZNzQ4c+b4gam22Mf2iuLkIQ8/wA9nvZqq140FX/9v8E0P+5GDy3EbybEMA60RSHBYu+TDL0/dFM1QP4uyPDd1QLIxtVKuZuE66+QyznXhb8v0bkYrPf/ag/VIwYLzWHsdXzQYz/ABScQI1BUjcgAAAAAElFTkSuQmCC
19-
:target: https://mybinder.org/v2/gh/OGGM/binder/master?urlpath=git-pull?repo=https://github.com/OGGM/tutorials%26amp%3Bbranch=master%26amp%3Burlpath=lab/tree/tutorials/notebooks/welcome.ipynb%3Fautodecode
19+
:target: https://mybinder.org/v2/gh/OGGM/binder/stable?urlpath=git-pull?repo=https://github.com/OGGM/tutorials%26amp%3Bbranch=master%26amp%3Burlpath=lab/tree/tutorials/notebooks/welcome.ipynb%3Fautodecode
2020

2121
If you are new to the Jupyter Notebooks or to JupyterLab, you will probably
2222
find this `introduction to interactive notebooks`_ quite useful.

docs/input-data.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,10 @@ directories from the default urls. Here is a summary of the default configuratio
193193
it's also the precalibrated paramaters that will be used for the dynamical run.
194194
- frontal ablation by calving (at inversion and for the dynamical runs) is switched off
195195

196+
To see the code that generated these directories (for example if you want to
197+
make your own, visit :py:func:`cli.prepro_levels.run_prepro_levels`
198+
or this `file on github <https://github.com/OGGM/oggm/blob/master/oggm/cli/prepro_levels.py>`_).
199+
196200
The urls used by OGGM per default are listed here:
197201

198202
`https://cluster.klima.uni-bremen.de/~oggm/gdirs/oggm_v1.4/ <https://cluster.klima.uni-bremen.de/~oggm/gdirs/oggm_v1.4/>`_ + :

docs/inversion.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ glacier at :math:`t^*`. By construction, the flux is maximal at the equilibrium
6363
zero at the glacier tongue.
6464

6565
.. ipython:: python
66+
:okwarning:
6667
6768
@savefig example_plot_massflux.png width=100%
6869
example_plot_massflux()
@@ -107,6 +108,7 @@ step in OGGM is currently very simple, but provides nice looking maps:
107108

108109

109110
.. ipython:: python
111+
:okwarning:
110112
111113
tasks.catchment_area(gdir)
112114
@savefig plot_distributed_thickness.png width=80%

docs/mass-balance.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ recommend to use data from 1850 onwards.
9191

9292

9393
.. ipython:: python
94+
:okwarning:
9495
9596
@savefig plot_temp_ts.png width=100%
9697
example_plot_temp_ts() # the code for these examples is posted below
@@ -181,6 +182,7 @@ glacier geometry fixed at the RGI date** (e.g. 2003 for most glaciers in the
181182
European Alps).
182183

183184
.. ipython:: python
185+
:okwarning:
184186
185187
@savefig plot_mu_ts.png width=100%
186188
example_plot_mu_ts() # the code for these examples is posted below
@@ -201,6 +203,7 @@ were we have observations. We then compare the model output
201203
with the expected mass-balance and compute the model bias:
202204

203205
.. ipython:: python
206+
:okwarning:
204207
205208
@savefig plot_bias_ts.png width=100%
206209
example_plot_bias_ts() # the code for these examples is posted below

oggm/cli/prepro_levels.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def run_prepro_levels(rgi_version=None, rgi_reg=None, border=None,
7979
add_consensus=False, start_level=None,
8080
start_base_url=None, max_level=5, ref_tstars_base_url='',
8181
logging_level='WORKFLOW', disable_dl_verify=False):
82-
"""Does the actual job.
82+
"""Generate the preprocessed OGGM glacier directories for this OGGM version
8383
8484
Parameters
8585
----------

oggm/core/climate.py

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -907,9 +907,19 @@ def local_t_star(gdir, *, ref_df=None, tstar=None, bias=None,
907907
"""Compute the local t* and associated glacier-wide mu*.
908908
909909
If ``tstar`` and ``bias`` are not provided, they will be interpolated from
910-
the reference t* list.
910+
the reference t* list (``ref_df``).
911911
912-
Note: the glacier wide mu* is here just for indication. It might be
912+
If none of these are provided (the default), this list be obtained from
913+
the current working directory (``ref_tstars.csv`` and associated params
914+
``ref_tstars_params.json``). These files can either be generated with a
915+
call to ``compute_ref_t_stars`` if you know what you are doing, ot you
916+
can obtain pre-preprocessed lists from our servers:
917+
https://cluster.klima.uni-bremen.de/~oggm/ref_mb_params/
918+
919+
The best way to fetch them is to use
920+
:py:func:`oggm.workflow.download_ref_tstars`.
921+
922+
Note: the glacier wide mu* is output here just for indication. It might be
913923
different from the flowlines' mu* in some cases.
914924
915925
Parameters
@@ -934,19 +944,20 @@ def local_t_star(gdir, *, ref_df=None, tstar=None, bias=None,
934944
# Do our own interpolation
935945
if ref_df is None:
936946
# Use the the local calibration
947+
msg = ('If `ref_df` is not provided, please put a list of '
948+
'`ref_tstars.csv` and associated params '
949+
'`ref_tstars_params.json` in the working directory. '
950+
'Please see the documentation of local_t_star '
951+
'for more information.')
937952
fp = os.path.join(cfg.PATHS['working_dir'], 'ref_tstars.csv')
938953
if not os.path.exists(fp):
939-
raise InvalidWorkflowError('If ref_df is not given, provide '
940-
'`ref_tstars.csv` in the working '
941-
'directory')
954+
raise InvalidWorkflowError(msg)
942955
ref_df = pd.read_csv(fp)
943956

944957
# Check that the params are fine
945958
fp = os.path.join(cfg.PATHS['working_dir'], 'ref_tstars_params.json')
946959
if not os.path.exists(fp):
947-
raise InvalidWorkflowError('If ref_df is not given, provide '
948-
'`ref_tstars_params.json` in the '
949-
'working directory')
960+
raise InvalidWorkflowError(msg)
950961
with open(fp, 'r') as fp:
951962
ref_params = json.load(fp)
952963
for k, v in ref_params.items():

oggm/params.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ use_shape_factor_for_fluxbasedmodel =
287287
# This value could need more tuning
288288
downstream_min_shape = 0.0001
289289
# Angle defining the trapezoid bed shapes
290-
# https://docs.oggm.org/en/latest/ice-dynamics.html#bed-shapes
290+
# https://docs.oggm.org/en/stable/ice-dynamics.html#bed-shapes
291291
# Lambda = 1 means an angle of 63° (so quite steep)
292292
# Lambda = 2 means an angle of 45°
293293
trapezoid_lambdas = 2

0 commit comments

Comments
 (0)