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.
Initalising a glacier directory¶
If no directory has been created yet, a GlacierDirectory requires an RGI entity as input:
In [1]: base_dir = os.path.join(os.path.expanduser('~'), 'OGGM_docs', 'GlacierDir')
In [2]: entity = gpd.GeoDataFrame.from_file(get_demo_file('HEF_MajDivide.shp')).iloc[0]
In [3]: gdir = oggm.GlacierDirectory(entity, base_dir=base_dir)
In [4]: gdir.dir
Out[4]: '/home/docs/OGGM_docs/GlacierDir/RGI50-11/RGI50-11.00/RGI50-11.00897'
In [5]: gdir.rgi_id, gdir.rgi_area_km2