wolfhece.report.compare_arrays

Module Contents

class wolfhece.report.compare_arrays.ArrayDifferenceLayout(title: str, filename='', ox=0, oy=0, tx=0, ty=0, parent=None, is2D=True, idx='', plotted=True, mapviewer=None, need_for_wx=False, bbox=None, find_minmax=True, shared=False, colors=None)[source]

Bases: wolfhece.report.common.DefaultLayoutA4

Inheritance diagram of wolfhece.report.compare_arrays.ArrayDifferenceLayout

Layout for comparing two arrays in a report.

1 cadre pour la zone traitée avec photo de fond ign + contour vectoriel 1 cadre avec zoom plus large min 250m 1 cadre avec matrice ref + contour vectoriel 1 cadre avec matrice à comparer + contour vectoriel 1 cadre avec différence 1 cadre avec valeurs de synthèse

1 cadre avec histogramme 1 cadre avec histogramme des différences

_hitograms[source]
_arrays[source]
class wolfhece.report.compare_arrays.CompareArraysLayout(title: str, filename='', ox=0, oy=0, tx=0, ty=0, parent=None, is2D=True, idx='', plotted=True, mapviewer=None, need_for_wx=False, bbox=None, find_minmax=True, shared=False, colors=None)[source]

Bases: wolfhece.report.common.DefaultLayoutA4

Inheritance diagram of wolfhece.report.compare_arrays.CompareArraysLayout

Enum for default layout options.

_summary[source]
_arrays[source]
_diff_rect[source]
class wolfhece.report.compare_arrays.CompareArraysLayout2(title: str, filename='', ox=0, oy=0, tx=0, ty=0, parent=None, is2D=True, idx='', plotted=True, mapviewer=None, need_for_wx=False, bbox=None, find_minmax=True, shared=False, colors=None)[source]

Bases: wolfhece.report.common.DefaultLayoutA4

Inheritance diagram of wolfhece.report.compare_arrays.CompareArraysLayout2

Enum for default layout options.

_summary[source]
_arrays[source]
_diff_rect[source]
class wolfhece.report.compare_arrays.ArrayDifference(reference: wolfhece.wolf_array.WolfArray, to_compare: wolfhece.wolf_array.WolfArray, index: int, label: numpy.ndarray)[source]

Class to manage the difference between two WolfArray objects.

_dpi = 600[source]
default_size_hitograms = (12, 6)[source]
default_size_arrays = (10, 10)[source]
_fontsize = 6[source]
reference[source]
to_compare[source]
index[source]
label[source]
_background = 'IGN'[source]
_contour = None[source]
_external_border = None[source]
property contour: wolfhece.wolf_array.vector[source]

Get the contour of the difference part.

property external_border: wolfhece.wolf_array.vector[source]

Get the bounds of the difference part.

property _summary_text[source]

Generate a summary text for the report.

set_palette_distribute(minval: float, maxval: float, step: int = 0)[source]

Set the palette for both arrays.

set_palette(values: list[float], colors: list[tuple[int, int, int]])[source]

Set the palette for both arrays based on specific values.

plot_position(figax: tuple[matplotlib.pyplot.Figure, matplotlib.pyplot.Axes] = None) tuple[matplotlib.pyplot.Figure, matplotlib.pyplot.Axes][source]

Plot the reference array.

plot_position_scaled(scale=4, figax: tuple[matplotlib.pyplot.Figure, matplotlib.pyplot.Axes] = None) tuple[matplotlib.pyplot.Figure, matplotlib.pyplot.Axes][source]

Plot the reference array.

plot_reference(figax: tuple[matplotlib.pyplot.Figure, matplotlib.pyplot.Axes] = None) tuple[matplotlib.pyplot.Figure, matplotlib.pyplot.Axes][source]

Plot the reference array.

plot_to_compare(figax: tuple[matplotlib.pyplot.Figure, matplotlib.pyplot.Axes] = None) tuple[matplotlib.pyplot.Figure, matplotlib.pyplot.Axes][source]

Plot the array to compare.

property difference: wolfhece.wolf_array.WolfArray[source]

Get the difference between the two arrays.

plot_difference(figax: tuple[matplotlib.pyplot.Figure, matplotlib.pyplot.Axes] = None) tuple[matplotlib.pyplot.Figure, matplotlib.pyplot.Axes][source]

Plot the array to compare.

_plot_histogram_reference(figax: tuple[matplotlib.pyplot.Figure, matplotlib.pyplot.Axes] = None, density=True, alpha=0.5, **kwargs) tuple[matplotlib.pyplot.Figure, matplotlib.pyplot.Axes][source]

Plot histogram of the reference array.

_plot_histogram_to_compare(figax: tuple[matplotlib.pyplot.Figure, matplotlib.pyplot.Axes] = None, density=True, alpha=0.5, **kwargs) tuple[matplotlib.pyplot.Figure, matplotlib.pyplot.Axes][source]

Plot histogram of the array to compare.

plot_histograms(figax: tuple[matplotlib.pyplot.Figure, matplotlib.pyplot.Axes] = None, density=True, alpha=0.5, **kwargs) tuple[matplotlib.pyplot.Figure, matplotlib.pyplot.Axes][source]

Plot histograms of both arrays.

plot_histograms_difference(figax: tuple[matplotlib.pyplot.Figure, matplotlib.pyplot.Axes] = None, density=True, alpha=1.0, **kwargs) tuple[matplotlib.pyplot.Figure, matplotlib.pyplot.Axes][source]

Plot histogram of the difference between the two arrays.

_complete_report(layout: ArrayDifferenceLayout)[source]

Complete the report with the arrays and histograms.

create_report(output_file: str | pathlib.Path = None) pathlib.Path[source]

Create a page report for the array difference.

class wolfhece.report.compare_arrays.CompareArrays(reference: wolfhece.wolf_array.WolfArray | str | pathlib.Path, to_compare: wolfhece.wolf_array.WolfArray | str | pathlib.Path)[source]
_dpi = 600[source]
default_size_arrays = (10, 10)[source]
_fontsize = 6[source]
array_reference: wolfhece.wolf_array.WolfArray[source]
array_to_compare: wolfhece.wolf_array.WolfArray[source]
labeled_array: numpy.ndarray = None[source]
num_features: int = 0[source]
nb_cells: list = [][source]
difference_parts: dict[int, ArrayDifference][source]
_pdf_path = None[source]
_background = 'IGN'[source]
property difference: wolfhece.wolf_array.WolfArray[source]
get_zones()[source]

Get a Zones object containing the differences.

plot_position(figax: tuple[matplotlib.pyplot.Figure, matplotlib.pyplot.Axes] = None) tuple[matplotlib.pyplot.Figure, matplotlib.pyplot.Axes][source]

Plot the reference array with a background.

plot_cartoweb(figax: tuple[matplotlib.pyplot.Figure, matplotlib.pyplot.Axes] = None) tuple[matplotlib.pyplot.Figure, matplotlib.pyplot.Axes][source]

Plot the reference array with a background.

plot_topo_grey(figax: tuple[matplotlib.pyplot.Figure, matplotlib.pyplot.Axes] = None) tuple[matplotlib.pyplot.Figure, matplotlib.pyplot.Axes][source]

Plot the reference array with a background.

plot_reference(figax: tuple[matplotlib.pyplot.Figure, matplotlib.pyplot.Axes] = None) tuple[matplotlib.pyplot.Figure, matplotlib.pyplot.Axes][source]

Plot the reference array.

plot_to_compare(figax: tuple[matplotlib.pyplot.Figure, matplotlib.pyplot.Axes] = None) tuple[matplotlib.pyplot.Figure, matplotlib.pyplot.Axes][source]

Plot the array to compare.

plot_difference(figax: tuple[matplotlib.pyplot.Figure, matplotlib.pyplot.Axes] = None) tuple[matplotlib.pyplot.Figure, matplotlib.pyplot.Axes][source]

Plot the difference between the two arrays.

localize_differences(threshold: float = 0.0, ignored_patche_area: float = 1.0) numpy.ndarray[source]

Localize the differences between the two arrays and label them.

Parameters:
  • threshold – The threshold value to consider a difference significant.

  • ignored_patche_area – The area of patches to ignore (in m²).

property summary_text: list[str][source]

Generate a summary text for the report.

_complete_report(layout: CompareArraysLayout)[source]

Complete the report with the global summary and individual differences.

plot_histogram_features(figax: tuple[matplotlib.pyplot.Figure, matplotlib.pyplot.Axes] = None, density=True, alpha=0.5, **kwargs) tuple[matplotlib.pyplot.Figure, matplotlib.pyplot.Axes][source]

Plot histogram of the number of cells in each feature.

plot_histogram_features_difference(figax: tuple[matplotlib.pyplot.Figure, matplotlib.pyplot.Axes] = None, density=True, alpha=1.0, **kwargs) tuple[matplotlib.pyplot.Figure, matplotlib.pyplot.Axes][source]

Plot histogram of the volume in each feature for the difference.

_complete_report2(layout: CompareArraysLayout)[source]

Complete the report with the individual differences.

create_report(output_file: str | pathlib.Path = None, append_all_differences: bool = True, nb_max_differences: int = -1) None[source]

Create a page report for the array comparison.

property pdf_path: pathlib.Path[source]

Return the path to the generated PDF report.

class wolfhece.report.compare_arrays.CompareArrays_wx(reference: wolfhece.wolf_array.WolfArray | str | pathlib.Path, to_compare: wolfhece.wolf_array.WolfArray | str | pathlib.Path, ignored_patche_area: float = 2.0, nb_max_patches: int = 10, threshold: float = 0.01, dpi=200, **kwargs)[source]

Bases: wolfhece.report.pdf.PDFViewer

Inheritance diagram of wolfhece.report.compare_arrays.CompareArrays_wx

A sized frame.

Controls added to its content pane will automatically be added to the panes sizer.

_report[source]
on_close(event)[source]

Handle the close event to clean up resources

get_zones() wolfhece.wolf_array.Zones[source]

Get the zones from the report.