in3Utils: Various Utilities Modules


The in3Utils.geoTrans module provides useful functions to operate transformations, comparison or interpolation on rasters, lines, points… Further information about the available functions can be found in in3Utils.geoTrans

Generate Topography

The in3Utils.generateTopo module provides functions to generate DEM files for idealized/generic topographies that can be used for snow avalanche simulations.

This module can generate the following topographies:

  • flat plane (FP)

  • inclined plane of constant slope (IP)

  • parabola - parabolic slope transitioning into a flat foreland (PF)

  • hockey stick - inclined plane of constant slope with a smooth transition to a flat foreland (HS)

  • bowl-shaped topography (BL)

  • helix-shaped topography (HX)

  • pyramid-shaped topography (PY)

Extra features can be added to the above topographies:

  • a channel can be introduced (then set channel=True).

    This channel can also be set to widen towards the top and bottom of the channel (then set narrowing=True). The channel can be added by either adding a ‘channel layer’ (max thickness=channel depth) on top of the topography (topoAdd=True) or by cutting them into the original topography (topoAdd=False).

  • in case of the parabola topography, a dam can be added by setting ``dam=True``.

This modules returns a 3D plot of the generated topography as well as an .asc file of the DEM data. The input parameters are defined in the respective configuration file in3Utils.generateTopoCfg.ini. Detailed information on the individual functions used to create the topographies can be found in in3Utils.generateTopo

To run generateTopo

  • first go to AvaFrame/avaframe

  • copy in3Utils/generateTopoCfg.ini to in3Utils/local_generateTopoCfg.ini and set the desired parameter values (if not, the default values are used)

  • run:

    python3 runScripts/


Topographies are generated using inclined and flat planes, parabolas, spheres and circles. Channels are introduced as half-sphere shaped features with smooth transition from the no-channel area to the channel using cumulative distribution functions.

Configuration parameters

In the case of the pyramid-shaped topography, the domain extent is defined by the max elevation (z0 - elevation of the appex point) and the slope of the pyramid facets (meanAlpha)

Domain parameters:


DEM spatial resolution [m]


total horizontal extent of the domain [m]


total vertical extent of the domain [m]

Topography parameters:


distance to the point where the slope transitions into a flat plane [m]


slope angle from the max. elevation to the start of the flat plane [°] - or slope of the inclined plane [°]


total fall height [m]


bowl radius [m]


radius for helix [m]


max elevation [m]


elevation of the flat plane [m]


radius of the smoothing circle [m]


topography types (FP, IP, PF, HS, BL, HX, PY - explanation given in the introductory description)


extent of the flat foreland for the pyramid in x


extent of the flat foreland for the pyramid in y


rotation angle for the pyramid

Flags for channels and plotting:


True - introduce channel; False - no channel


True - channel is wide at start and end and narrow in the middle part; False - channel is uniform


True - add channel layer; False: cut channel into original topography;


True - rotate pyramid along z-axis

Channel parameters:


standard channel radius


start and end half width of channel that is narrower in the middle part


standard deviation sigma


mean mu - represents upper part of the channel


mean mu - represents lower part of the channel

Get Release Area

in3Utils.getReleaseArea generates a release area for a topography created with in3Utils.generateTopo, this function is available for the following topographies:

  • flat plane (FP)

  • inclined plane (IP)

  • parabola (PF)

  • hockey stick (HS)

The release areas are defined as rectangular features build by four corner points, which are based on the following conditions:

  • prescribed vertical stretch in meters (difference in altitude)

  • prescribed volume of the release area

  • lower margin is located where the slope angle falls below 30°

  • if slope does not fall below 30 °, the upper margin is located xStart away from the upper margin of the DEM

The release areas can be saved as shapefile, .nxyz and .txt file. The required input parameters can be set in the respective configuration files in3Utils/getReleaseAreaCfg.ini and in3Utils.generateTopoCfg.ini. Detailed information on the individual functions used to create the release areas can be found in in3Utils.getReleaseArea

To run getReleaseArea

Following these steps, you can generate an avalanche test case including a DEM and a simple release area.

  • first go to AvaFrame/avaframe

  • copy in3Utils/generateTopoCfg.ini and in3Utils/getReleaseAreaCfg.ini to in3Utils/local_generateTopoCfg.ini and in3Utils/local_getReleaseAreaCfg.ini and set desired parameter values (if not, the default values are used)

  • run:




release area vertical stretch [m]


volume of snow in release area [m3]


release snow thickness [m]


upper margin of the release area distance in x from origin [m]


number of release area polygon points


True - copy the output to txt file


horizontal extent of release area for flat plane


slope angle that defines lower margin of release area


number of release area for name


name of release area feature in shapefile

Initialize Project

in3Utils.initializeProject provides functions to initialize a project, create the required directory structure and delete specified files or directories.

The main function in3Utils.initializeProject.initializeFolderStruct(), creates the folder structure required to perform avalanche simulations:

                ENT/            - entrainment areas
                LINES/          - avalanche paths
                POINTS/         - split points
                REL/            - release area scenario
                RES/            - resistance areas
                SECREL/ - secondary release areas
                .asc            - DEM

The path to this folder is specified in the configuration file avaframeCfg.ini, with the parameter avalancheDir.

To run

  • first go to AvaFrame/avaframe

  • copy avaframeCfg.ini to local_avaframeCfg.ini and set your desired avalanche directory name

  • run:



in3Utils.fileHandlerUtils gathers useful functions to create directories, read log files, extract information from logs, fetch and export data and fetch simulation info into a dataFrame. Details on these functions can be found in in3Utils.fileHandlerUtils.