[general]
name=InSAR Suite
description=Integrated suite for loading, processing and analysis of PSI displacement data
version=3.2.8
qgisMinimumVersion=3.16
qgisMaximumVersion=3.99
author=Giovanni Montini
email=g.montini@appenninosettentrionale.it
license=GPL-2.0-or-later
about=InSAR Suite is an integrated QGIS plugin that brings together six tools for PSI (Persistent Scatterer Interferometry) data analysis into a single dedicated toolbar.

 - InSAR Load: loads PSI point layers from GeoPackage, Shapefile or GDB files using a polygon index layer, or reactivates an index already present in the project.
 - InSAR EWUD: decomposes LOS velocities from ascending/descending SAR data into East-West and Up-Down components, with automatic resampling grid creation (square or hexagonal cells). Outputs include Na and Nd fields (number of PS points used per cell).
 - InSAR VIS: calculates the detectable movement percentage (pc_mov) based on SAR acquisition geometry and terrain morphology derived from a DEM. Output can be saved as a permanent GeoPackage.
 - InSAR TS: time series analysis tools including data quality and homogeneity check (with skewness and kurtosis), automatic kinematic analysis, seasonal decomposition (STL), piecewise non-linear analysis, temporal anomaly detection, and multi-zone comparison. Supports DYYYYMMDD and YYYYMMDD date field formats.
 - InSAR Polygons: automatic delineation of deformation areas from PS data using buffer and geometric dissolve by velocity class, with hierarchical clipping and optional morphological smoothing.
 - InSAR Report: generates a summary sheet (PSI analysis card) for a study area (hand-drawn or loaded from file), with PS count, density, areal coverage, kinematic coherence, mean visibility and velocity for both ascending and descending datasets, plus the mean EWUD vector. Exportable as PNG or CSV.

homepage=https://github.com/montinigeo/InSAR_Suite
tracker=https://github.com/montinigeo/InSAR_Suite/issues
repository=https://github.com/montinigeo/InSAR_Suite
tags=InSAR, PSI, persistent scatterer, SAR, deformation, displacement, time series, EGMS, Sentinel-1, remote sensing, geohazard, subsidence, landslide
pip_dependencies=pandas,numpy,matplotlib,scipy,statsmodels,pyproj,mplcursors
icon=icons/icon_suite.png
category=Analysis
hasProcessingProvider=no
experimental=no
deprecated=no
server=no
changelog=3.2.8 - Bug fix.
  Fixed a crash affecting the InSAR Report module, the InSAR VIS module's output layer creation, and the TS "Analisi cinematica automatica" tool's "Carica tabella in QGIS" button on recent QGIS 3 LTR point releases (confirmed on 3.44.13): these releases deprecated the QVariant-based QgsField constructor in favour of QMetaType, and in some cases raise an error rather than a warning. Field type resolution now automatically prefers QMetaType when available, falling back to the older QVariant form on installations where QMetaType is not present, so the plugin works correctly across the whole QGIS 3.16-3.99 range regardless of point release.
  Also fixed a related deprecation warning from QgsMapLayerComboBox.setFilters()/QgsMapLayerProxyModel.setFilters() (deprecated since QGIS 3.34 in favour of the Qgis.LayerFilter flag-based signature) across the Report, VIS, EWUD and TS modules' layer selectors; the plugin now uses the modern flag-based form when available, falling back to the legacy integer form on older installations.
  Also removed the plugin's dependency on the third-party "pwlf" library, which was found to crash (IndexError inside its internal least-squares routine) on some combinations of numpy/scipy versions bundled with recent QGIS 3 LTR point releases (confirmed on 3.44.13), affecting both the InSAR Report module's acceleration detection and the TS "Analisi non lineare piecewise" tool. Both now use a self-contained, numpy-only piecewise linear fit (continuous "hinge function" parametrization solved via ordinary least squares), which is deterministic, does not depend on any non-linear optimizer, and produces results equivalent to before. No functional change is expected for correctly-working installations; installations previously affected by the crash should now work correctly. The "pwlf" package is no longer a required dependency.
  Also fixed a bug introduced while addressing the pwlf issue above: the special string values for the statsmodels seasonal_decompose parameter extrapolate_trend ('freq' and, on installations where the deprecated 'freq' form was replaced with 'period', both) were found to raise an internal TypeError on some installations (depending on whether the series index has a recognized frequency), silently disabling seasonal removal in the Report and TS piecewise tools and breaking the TS "Scomposizione stagionale STL" chart entirely. The Report module and the TS piecewise tool only need the seasonal component (not the trend), which is only marginally affected by this parameter, so extrapolate_trend is no longer passed there at all, avoiding the problematic code path entirely; the STL decomposition chart, which does need an extrapolated trend for its plot, now passes an explicit integer instead of either special string, which is not affected by the same issue.
  Also fixed a remaining deprecation warning from QgsMapLayerComboBox.setFilters(): even when passing a value built from the modern Qgis.LayerFilter flag enum, combining two or more flags with the bitwise OR operator did not always produce an instance of the expected Qgis.LayerFilters "flags" container type, causing the call to still resolve to the deprecated integer-based overload. The combined value is now explicitly wrapped in Qgis.LayerFilters before being passed, ensuring the modern overload is always used when available.
  Also fixed the same QgsField-constructor deprecation crash described above (see the earlier entry about the InSAR Report, VIS and TS "Analisi cinematica automatica" modules) in the InSAR Polygons module's output layer creation, which had been missed by the earlier fix; field type resolution there now uses the same QMetaType/QVariant-compatible helper as the rest of the plugin.
  Also fixed a MatplotlibDeprecationWarning in the TS "Qualità del dato" tool's boxplot chart: the 'vert' parameter was deprecated in Matplotlib 3.11 in favour of 'orientation'. The modern parameter is now tried first, falling back to the older 'vert' form if it raises a TypeError (older Matplotlib versions), so the plugin remains compatible with the whole range of Matplotlib versions bundled with QGIS 3.16-3.99.
  Also fixed the actual root cause of the recurring QgsField constructor deprecation warnings in the Report, VIS, TS and Polygons modules, which the earlier fixes above did not fully resolve: the plugin's QMetaType/QVariant compatibility helper was looking up field type names (e.g. "String", "Date", "DateTime") directly on QMetaType.Type, but that enum uses the underlying Qt class names for non-primitive types ("QString", "QDate", "QDateTime") rather than the simplified names used by the older QVariant.Type enum, causing the lookup to silently fail and fall back to the deprecated QVariant form for every field type except the ones whose name happens to be spelled the same on both enums (Int, Double, Bool, LongLong). The helper now translates these names correctly before querying QMetaType.Type, confirmed via direct inspection in the QGIS Python console on a real 3.44.x installation.
  3.2.7 - New feature.
  Added acceleration detection to the InSAR Report module: for each dataset (ascending/descending), a piecewise linear regression with exactly 2 fixed segments (1 breakpoint, whose optimal position is still found automatically) is fitted to the mean coherent-PS time series, after removing the seasonal component (thermal/hydrological, typical of PSI data; period estimated from the actual acquisition cadence). The ratio between the two segments' velocities is reported (configurable threshold, default 1.5), along with the breakpoint date; a direction reversal between the two segments is flagged separately. The segment count is deliberately fixed at 2, not BIC-selected: a meaningful velocity ratio requires exactly two velocities to compare, and free-knot piecewise models tend to make BIC favor more segments than genuinely warranted (see the TS module changelog note below). Also added the number of EWUD cells falling within the study area, shown next to the mean EWUD vector.
  Bug fix: corrected a wrong pwlf attribute name (".rss" instead of ".ssr") in the TS "Analisi non lineare piecewise" tool, which caused its BIC-based automatic segment count selection to silently fail (always falling back to the same default instead of genuinely testing segment counts via BIC). Also fixed non-deterministic results from pwlf's optimizer by setting a fixed random seed, and removed the seasonal component before the fit for the same reason as above. The default for "Numero massimo di segmenti" is now 2 (was 5), still adjustable by the user; note that, unlike the Report module, this tool still uses BIC to pick among 2-5 segments and can occasionally favor more segments than a geologist would expect, due to the free-knot BIC effect described above -- this is a known limitation of the underlying method, not a bug, and is left to the user's judgement for now.
  Text fix: corrected inconsistent terminology used in the InSAR Report module's interface (window titles, log messages, tooltip, CSV export header) and documentation, for consistency with the rest of the plugin. No functional change.
  3.2.5 - New feature.
  Added the InSAR Report module: generates a PSI summary sheet for a study area (hand-drawn on the map, loaded from a polygon file, or picked from a layer already in the project), with PS count, density (PS/kmq), areal coverage (buffer method, configurable radius, automatically computed in a metric/projected CRS even if source data is in geographic coordinates; labeled "copertura areale" — coverage, not distribution), kinematic coherence (configurable threshold), mean visibility ± standard deviation (from a VIS layer, filtered to the study area) and mean velocity ± standard deviation (total and coherent-only) for both ascending and descending datasets, plus the mean EWUD vector (angle ± circular standard deviation, velocity ± standard deviation, E and U components ± standard deviation, all filtered to the study area even if the source EWUD/VIS layers cover a wider extent). The EWUD angle now uses circular statistics (vector mean) instead of an arithmetic mean, correcting a bias near the 0°/360° boundary; the resultant length R (directional coherence indicator) is shown as a tooltip. Results can be exported as PNG or CSV. No new dependencies required.
  3.2.3 - Bug fix.
  Fixed permanent saving of the EWUD grid: the "id" field was being interpreted by GDAL as a candidate for the GeoPackage primary key, which could alter the order/correspondence of values after reloading (resulting in null Va/Vd/Na/Nd fields in Centroidi_EWUD/Poligoni_EWUD). The field was renamed to "grid_id", unambiguous for GDAL. Computation now always happens in memory, with file saving as a separate step.
  3.2.2 - Bug fixes.
  Fixed coherent-PS matching in the TS module (kinematic analysis, decomposition, non-linear analysis) when the source layer has no field literally named "CODE": now falls back consistently to the internal feature ID, as already done during the analysis phase.
  Fixed fixed layer naming in EWUD (grid, Centroidi_EWUD, Poligoni_EWUD): saved layers now take the name of the file they were saved to, so different runs saved under different names are no longer indistinguishable in the layer list.
  Code quality cleanup (removed try/except/pass blocks flagged by security scanning, redundant imports, explicit iface import in standalone scripts).
