[general]
name=InSAR Suite
description=Integrated suite for loading, processing and analysis of PSI displacement data
version=3.3.4
qgisMinimumVersion=4.00
qgisMaximumVersion=4.99
supportsQt6=True
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. Output can be saved as a permanent GeoPackage.
 - InSAR Report: generates a PSI summary sheet for a study area (hand-drawn, loaded from a polygon file, or picked from a layer already in the project), with PS count, density, areal coverage, kinematic coherence, mean visibility and velocity ± standard deviation for both ascending and descending datasets, plus the mean EWUD vector (angle ± circular standard deviation, velocity, E, U components ± standard deviation), all automatically filtered to the study area. 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.3.4 - 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 used alongside this QGIS 4 branch's Python environment (confirmed with numpy/scipy versions matching QGIS 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 otherwise.
  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.
  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, 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 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.
  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.3.3 - 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 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. No new dependencies required. Same feature as InSAR Suite 3.2.5 for QGIS 3.
  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. Also fixed three unqualified Qt6 enums in the InSAR Report module (QgsUnitTypes.AreaSquareMeters, Qt.Key_Escape) missed by the earlier QGIS 4 porting pass, flagged by the plugin repository's Qt6 compatibility check.
  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.3.1 - 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.3.0 - Porting and compatibility with QGIS 4 / Qt6.
  Fixed direct PyQt5 imports, unqualified Qt/QGIS enums (Qt.AlignmentFlag, QDialog.DialogCode, QMessageBox.StandardButton, Qgis.MessageLevel, etc.), QVariant/QMetaType handling for field types, standalone script loading via runpy, a GDAL id/fid conflict on GeoPackage output, and a coherent-PS matching bug unrelated to QGIS 4.
  New: InSAR Polygons now supports direct saving to GeoPackage (as already available in VIS/EWUD).
