Demcompare module

The main demcompare module in demcompare_module file orchestrates the demcompare API from an input configuration file, hence, from an execution using the Demcompare CLI.

The configuration file specifies digital elevation models inputs to compare and also the pipeline to execute. This pipeline depends on the optional Coregistration and/or Statistics steps configuration.

If coregistration and/or statistics steps are to be computed, then each step orchestration will be handled by demcompare module as follows:

Coregistration step orchestration

../../_images/coreg_api.png

Fig. 11 Demcompare coregistration step orchestration

To perform the dems coregistration Coregistration, demcompare’s module performs the following steps:

  1. Loads the input dems using the dem_tools module’s load_dem function.

  2. Creates a Coregistration object and obtains the dem’s transformation object using the coregistration’s compute_coregistration function.

  3. Applies the obtained transformation to the secondary dem using the transformation’s apply_transform function.

For more details on the coregistration modules architecture, please see Coregistration modules.

Statistics step orchestration

../../_images/stats_api.png

Fig. 12 Demcompare’s orchestration for statistics step.

To perform the dems statistics Statistics, demcompare’s module performs the following steps:

  1. Loads the input dems using the dem_tools module’s load_dem function.

  2. Reprojects both dems to the same size and resolution using dem_tools module’s reproject_dems function.

  3. Computes the altitude difference dem using the dem_tools module’s compute_alti_diff_for_stats function.

  4. Creates a Stats_processing object and obtains the stats_dataset using the stats_processing’s compute_stats function.

Note

If coregistration has previously been done, the coregistration’s objects internal dems called reproj_coreg_ref and reproj_coreg_sec are used for the altitude difference computation, so that no manual reprojection needs to be done. Please see Statistics “With coregistration step” section for more details.

For more details on the statistics modules architecture, please see Stats module.

Module files description

In this module high level parameters of the input configuration are checked and default options are set when not already defined. Some helper functions to handle the output paths from the ` are also included here.

The logconf module in demcompare contains logging configuration functions.

Module containing the default output tree design architecture for demcompare’s output directory. This module contains the functions to create the output tree directory and defines where each output file is to be saved during a demcompare execution. By default, it considers that a pipeline execution with Coregistration and Statistics is run.