Glacier working directories

See also: GlacierDirectory

The majority of OGGM tasks are so-called “entity tasks”. They are standalone operations to be realized on one single glacier entity. These tasks are executed sequentially: they often need input generated by the previous task(s).

In order to avoid complicated chains of arguments, each task will read the input data from a glacier-specific directory and writes its output into the same directory, making the new data available for further computations.

These data files and their names are standardized and listed in the oggm.cfg module. If you want to implement your own task you’ll have to add an entry to this file too.

Glacier divides

The glacier outlines provided by the RGI are the result of an automated (sometimes manually corrected) delineation procedure. In some cases, the RGI glacier is not the outline of a single glacier (in the dynamical sense) but is the outline of a “glacier complex”. OGGM does not (yet) implement a method to divide these glacier complexes into individual glaciers [1], but it does have a framework to deal with user provided glacier divides.

An RGI entity can have one or more “divides”, stored as polygons in a separate shapefile (oggm.cfg.set_divides_db()). Several OGGM tasks (such as compute_centerlines()) can work properly on single glaciers only, as shown on the example below (left: with divides, right: without).

_images/test_centerlines_1.5+.png _images/test_nodivide_1.5+.png

The divides are handled as sub-directories in the glacier directory: each sub-directory stores the files specific to that divide. All the glaciers have at least one divide (“divide_01”), the divide ID 0 being reserved for the root directory which contains files concerning the entire RGI glacier. The tasks that work on divides only can be recognized by their div_id=None keyword argument (they also implement the divide_task decorator).

[1]Kienholz, C., Hock, R., & Arendt, A. a. (2013). A new semi-automatic approach for dividing glacier complexes into individual glaciers. Journal of Glaciology, 59(217), 925–937.

cfg.BASENAMES

This is a list of the files that can be found in the glacier directory or its divides:

apparent_mb.nc
The apparent mass-balance data needed for the inversion.
catchment_indices.pkl
A list of len n_centerlines, each element conaining a numpy array of the indices in the glacier grid which represent the centerline’s catchment area.
centerlines.pkl
A list of :py:class:oggm.Centerline instances, sorted by flow order.
climate_monthly.nc
The monthly climate timeseries for this glacier, stored in a netCDF file.
dem.tif
A geotiff file containing the DEM (reprojected into the local grid).
dem_source.pkl
A string with the source of the topo file (ASTER, SRTM, ...).
downstream_line.pkl
A shapely.LineString of the coordinates of the downstream line (flowing out of the glacier until the border of the domain) for each divide.

find_initial_glacier_params.pkl

geometries.pkl
A dict containing the shapely.Polygons of a divide. The “polygon_hr” entry contains the geometry transformed to the local grid in (i, j) coordinates, while the “polygon_pix” entry contains the geometries transformed into the coarse grid (the i, j elements are integers). The “polygon_area” entry contains the area of the polygon as computed by Shapely (it is needed because the divides will have their own area which is not obtained from the RGI file).
glacier_grid.pkl
A salem.Grid handling the georeferencing of the local grid.
gridded_data.nc
A netcdf file containing several gridded data variables such as topography, the glacier masks and more (see the netCDF file metadata).
inversion_flowlines.pkl
A “better” version of the Centerlines, now on a regular spacing i.e., not on the gridded (i, j) indices. The tails of the tributaries are cut out to make more realistic junctions. They are now “1.5D” i.e., with a width.
inversion_input.pkl
List of dicts containing the data needed for the inversion.
inversion_output.pkl
List of dicts containing the output data from the inversion.
inversion_params.pkl
Dict of fs and fd as computed by the inversion optimisation.
local_mustar.csv
A csv with three values: the local scalars mu*, t*, bias
major_divide.pkl
A simple integer in the glacier root directory (divide 00) containing the ID of the “major divide”, i.e. the one really flowing out of the glacier (the other downstream lines flowing into the main branch).
model_flowlines.pkl
List of flowlines ready to be run by the model.
mu_candidates.pkl
A pandas.Series with the (year, mu) data.
outlines.shp
The glacier outlines in the local projection.

past_model.pkl

past_models.pkl