demcompare

Demcompare init module file. Demcompare aims at coregistering and comparing two Digital Elevation Models(DEM)

Subpackages

Submodules

Package Contents

Functions

run(json_file_path[, loglevel])

Demcompare RUN execution.

load_input_dems(→ Tuple[xarray.Dataset, Union[None, ...)

Loads the input dems according to the input cfg

run_coregistration(→ Tuple[xarray.Dataset, ...)

Runs the dems coregistration

compute_stats_after_coregistration(...)

Compute stats after coregistration

Attributes

__version__

__author__

__email__

demcompare.__version__[source]
demcompare.__author__ = 'CNES'[source]
demcompare.__email__ = 'cars@cnes.fr'[source]
demcompare.run(json_file_path: str, loglevel: int = logging.WARNING)[source]

Demcompare RUN execution.

Parameters:
  • json_file_path – Input Json configuration file

  • loglevel (int) – Choose Loglevel (default: WARNING)

demcompare.load_input_dems(cfg: internal_typing.ConfigType) Tuple[xarray.Dataset, None | xarray.Dataset][source]

Loads the input dems according to the input cfg

Parameters:

cfg (ConfigType) – input configuration

Returns:

input_ref and input_dem datasets or None

Return type:

Tuple(xr.Dataset, xr.dataset) The xr.Datasets containing :

  • im : 2D (row, col) xarray.DataArray float32

  • trans: 1D (trans_len) xarray.DataArray

demcompare.run_coregistration(cfg: internal_typing.ConfigType, input_ref: xarray.Dataset, input_sec: xarray.Dataset) Tuple[xarray.Dataset, xarray.Dataset, xarray.Dataset, xarray.Dataset][source]

Runs the dems coregistration

Parameters:
  • cfg (ConfigType) – coregistration configuration

  • input_ref – input ref

  • input_sec – input dem

Returns:

reproj_sec, reproj_ref, reproj_coreg_sec, reproj_coreg_ref

Return type:

Tuple(xr.Dataset, xr.dataset, xr.Dataset, xr.dataset) The xr.Datasets containing :

  • im : 2D (row, col) xarray.DataArray float32

  • trans: 1D (trans_len) xarray.DataArray

demcompare.compute_stats_after_coregistration(cfg: internal_typing.ConfigType, coreg_sec: xarray.Dataset, coreg_ref: xarray.Dataset, initial_sec: xarray.Dataset = None, initial_ref: xarray.Dataset = None) stats_dataset.StatsDataset[source]

Compute stats after coregistration

For the initial_dh and final_dh the alti_diff plot, the cdf and the pdf are computed if the output_dir has been specified in order to evaluate the coregistration effect.

For the final_dh, the different classification layers and metrics specified in the input cfg are also computed.

Parameters:
  • cfg (ConfigType) – configuration dictionary

  • coreg_sec (xr.Dataset) –

    coreg dem to align xr.DataSet containing :

    • image : 2D (row, col) xr.DataArray float32

    • georef_transform: 1D (trans_len) xr.DataArray

    • classification_layer_masks : 3D (row, col, indicator) xr.DataArray

  • coreg_ref (xr.Dataset) –

    coreg reference dem xr.DataSet containing :

    • image : 2D (row, col) xr.DataArray float32

    • georef_transform: 1D (trans_len) xr.DataArray

    • classification_layer_masks : 3D (row, col, indicator) xr.DataArray

  • initial_sec

    optional initial dem to align xr.DataSet containing :

    • image : 2D (row, col) xr.DataArray float32

    • georef_transform: 1D (trans_len) xr.DataArray

    • classification_layer_masks : 3D (row, col, indicator) xr.DataArray

  • initial_ref (xr.Dataset) –

    optional initial reference dem xr.DataSet containing :

    • image : 2D (row, col) xr.DataArray float32

    • georef_transform: 1D (trans_len) xr.DataArray

    • classification_layer_masks : 3D (row, col, indicator) xr.DataArray

Returns:

StatsDataset

Return type:

StatsDataset