OGGM centerlines versus elevation-band flowlines: a quick comparison#

As of version 1.4, OGGM introduced a new way to compute flowlines: the so-called “elevation-band flowlines” (after Huss & Farinotti, 2012). This notebook allows you to compare the two methods based on the available glacier directories.

from oggm import cfg, utils, workflow, graphics
import matplotlib.pyplot as plt
cfg.initialize(logging_level='WARNING')
2023-03-07 12:25:54: oggm.cfg: Reading default parameters from the OGGM `params.cfg` configuration file.
2023-03-07 12:25:54: oggm.cfg: Multiprocessing switched OFF according to the parameter file.
2023-03-07 12:25:54: oggm.cfg: Multiprocessing: using all available processors (N=2)
# Pick the glacier you want! We try Hintereisferner
rgi_ids = ['RGI60-11.00897']

Get ready#

In order to open the same glacier on two different glacier directories, we trick: we set a new working directory for each case! This trick is not recommended for real runs: if you have a use case for such a workflow (the same glacier with different data, please get in touch with us).

# Geometrical centerline
# Where to store the data 
cfg.PATHS['working_dir'] = utils.gettempdir(dirname='OGGM-centerlines', reset=True)

# We start from prepro level 3 with all data ready - note the url here
base_url = 'https://cluster.klima.uni-bremen.de/~oggm/gdirs/oggm_v1.4/L3-L5_files/CRU/centerlines/qc3/pcp2.5/no_match/'
gdirs = workflow.init_glacier_directories(rgi_ids, from_prepro_level=3, prepro_border=40, prepro_base_url=base_url)
gdir_cl = gdirs[0]
gdir_cl
2023-03-07 12:25:54: oggm.workflow: init_glacier_directories from prepro level 3 on 1 glaciers.
2023-03-07 12:25:54: oggm.workflow: Execute entity tasks [gdir_from_prepro] on 1 glaciers
<oggm.GlacierDirectory>
  RGI id: RGI60-11.00897
  Region: 11: Central Europe
  Subregion: 11-01: Alps                            
  Name: Hintereisferner
  Glacier type: Glacier
  Terminus type: Land-terminating
  Status: Glacier or ice cap
  Area: 8.036 km2
  Lon, Lat: (10.7584, 46.8003)
  Grid (nx, ny): (199, 154)
  Grid (dx, dy): (50.0, -50.0)
# Elevation band flowline
# New working directory
cfg.PATHS['working_dir'] = utils.gettempdir(dirname='OGGM-elevbands', reset=True)

# Not the new url
base_url = 'https://cluster.klima.uni-bremen.de/~oggm/gdirs/oggm_v1.4/L3-L5_files/CRU/elev_bands/qc3/pcp2.5/no_match/'
gdirs = workflow.init_glacier_directories(rgi_ids, from_prepro_level=3, prepro_border=40, prepro_base_url=base_url)
gdir_eb = gdirs[0]
gdir_eb
2023-03-07 12:25:56: oggm.workflow: init_glacier_directories from prepro level 3 on 1 glaciers.
2023-03-07 12:25:56: oggm.workflow: Execute entity tasks [gdir_from_prepro] on 1 glaciers
<oggm.GlacierDirectory>
  RGI id: RGI60-11.00897
  Region: 11: Central Europe
  Subregion: 11-01: Alps                            
  Name: Hintereisferner
  Glacier type: Glacier
  Terminus type: Land-terminating
  Status: Glacier or ice cap
  Area: 8.036 km2
  Lon, Lat: (10.7584, 46.8003)
  Grid (nx, ny): (199, 154)
  Grid (dx, dy): (50.0, -50.0)

Glacier length and cross section#

fls_cl = gdir_cl.read_pickle('model_flowlines')
fls_eb = gdir_eb.read_pickle('model_flowlines')
/usr/local/pyenv/versions/3.10.10/lib/python3.10/site-packages/oggm/utils/_workflow.py:2939: UserWarning: Unpickling a shapely <2.0 geometry object. Please save the pickle again; shapely 2.1 will not have this compatibility.
  out = pickle.load(f)
f, (ax1, ax2) = plt.subplots(2, 1, figsize=(10, 14), sharex=True, sharey=True)
graphics.plot_modeloutput_section(fls_cl, ax=ax1)
ax1.set_title('Geometrical centerline')
graphics.plot_modeloutput_section(fls_eb, ax=ax2)
ax2.set_title('Elevation band flowline');
../_images/elevation_bands_vs_centerlines_11_0.png

Note that the elevation band flowline length is shorter than the geometrical centerline!

For more details, go to the glacier flowlines documentation where you can find detailed information about the two flowline types and also a guideline when to use which flowline method.

What’s next?#