Glacier working directories¶
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 : base_dir = os.path.join(oggm.gettempdir(), 'OGGM_docs', 'GlacierDir') In : entity = gpd.read_file(get_demo_file('HEF_MajDivide.shp')).iloc In : gdir = oggm.GlacierDirectory(entity, base_dir=base_dir) In : gdir.dir Out: '/tmp/OGGM/OGGM_docs/GlacierDir/RGI50-11/RGI50-11.00/RGI50-11.00897' In : gdir.rgi_id, gdir.rgi_area_km2