Getting started¶
The ultimate goal of OGGM will be to hide the python workflow behind the model entirely, and run it only using configuration files and scripts. We are not there yet, and if you want to use and participate to the development of OGGM you’ll have to get your hands dirty. We hope however that the workflow is structured enough so that it is possible to jump in without having to understand all of its internals.
The few examples below are meant to illustrate the general design of OGGM, without going into the details of the implementation.
Imports¶
The following imports are necessary for all of the examples:
In [1]: import geopandas as gpd
In [2]: import oggm
In [3]: from oggm import cfg, tasks, graphics
In [4]: from oggm.utils import get_demo_file
Initialisation and GlacierDirectories¶
The first thing to do when running OGGM is to initialise it. This function will read the default configuration file which contains all user defined parameters:
In [5]: cfg.initialize()
These parameters are now accessible to all OGGM routines. For example, the
cfg.PARAMS
dict contains some runtime parameters, while cfg.PATHS
stores
the paths to the input files and the working directory (where the model output
will be written):
In [6]: cfg.PARAMS['topo_interp']
Out[6]: 'cubic'
In [7]: cfg.PARAMS['temp_default_gradient']