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.
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 , 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).
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).
|||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.|
This is a list of the files that can be found in the glacier directory or its divides:
- The apparent mass-balance data needed for the inversion.
- 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.
- A list of :py:class:oggm.Centerline instances, sorted by flow order.
- The monthly climate timeseries for this glacier, stored in a netCDF file.
- A geotiff file containing the DEM (reprojected into the local grid).
- A string with the source of the topo file (ASTER, SRTM, ...).
- A shapely.LineString of the coordinates of the downstream line (flowing out of the glacier until the border of the domain) for each divide.
- 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).
- A salem.Grid handling the georeferencing of the local grid.
- A netcdf file containing several gridded data variables such as topography, the glacier masks and more (see the netCDF file metadata).
- List of dicts containing the data needed for the inversion.
- List of dicts containing the output data from the inversion.
- Dict of fs and fd as computed by the inversion optimisation.
- A csv with three values: the local scalars mu*, t*, bias
- 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).
- List of flowlines ready to be run by the model.
- A pandas.Series with the (year, mu) data.
- The glacier outlines in the local projection.