W3RA Explorer is a lightweight QGIS plugin for clicking on a gridded NetCDF product and plotting the time series at the nearest grid cell.
It now supports two NetCDF styles:
- legacy yearly W3RA variables such as
Sg_EU_2010,Sg_EU_2011, with matchingtime_YYYY - standard 3D variables such as
S0,Ss,Sd,Sg,Sr,Load_total, stored on(time, y, x)or(time, lat, lon)
- opens a NetCDF file from QGIS
- lets you click on the map to inspect the nearest grid cell
- plots the raw time series and anomalies
- overlays optional fits: linear, polynomial, exponential, Gaussian smoothing, Fourier
- includes a backend runner for grouped Stage 1, grouped-to-layered export, Stage 2 residual runs, and NPZ-to-NetCDF export
- works well for W3RA grids and for grouped/layered inversion products exported from your backend
The plugin entry point is valid and the Python files compile successfully. The main limitation is that this repository is only the plugin code: full runtime verification still requires a local QGIS installation with the needed Python packages available inside the QGIS Python environment.
- QGIS 3.x
- Python modules available in the QGIS Python environment:
numpymatplotlibnetCDF4PyQt5scipy
Optional conversion utilities also use:
geopandasshapelypandasscipy.io
- Zip this plugin folder so the ZIP contains:
__init__.pyW3RAExplorer.pymetadata.txt
- In QGIS, open
Plugins -> Manage and Install Plugins -> Install from ZIP. - Select the ZIP file.
- Enable
W3RA Explorer.
- Open QGIS.
- Add a base map or any layer that helps you click in the correct geographic area.
- Start the plugin from the toolbar or plugin menu.
- Choose a NetCDF file.
- Click near the grid cell you want to inspect.
- Pick the variable from the dialog.
- Review the plotted series and optional regression overlays.
The plugin reads the series directly from the NetCDF file. You do not need to convert the grid to a dense point layer for the basic click-and-plot workflow.
The plugin now adds a second action: W3RA Backend Runner.
Use it when you want to:
- run grouped Stage 1 on Bologna InSAR/W3RA inputs
- derive layered inference from grouped results
- run the Stage 2 residual Swin step
- export grouped or layered
.npzoutputs to a plugin-ready NetCDF file
Recommended path inside the dialog:
- Run
Stage 1 Grouped. - Run
Export Layered Inferenceif you wantS0,Ss,Sd,Sg,Sr. - Optionally run
Stage 2 Residualif you want the hybrid grouped refinement. - Run
Export NPZ To NetCDF. - Click
Load NetCDF In Explorer. - Click on the map to inspect grouped or layered time series.
Use the existing conversion script:
python3 tools/w3ra_mat_2netcdf.py \
--input-dir /path/to/w3ra_mat_dir \
--latlon-file /path/to/LatLon.mat \
--output-file /tmp/W3RA_2010_2024.ncThis repo now includes a backend bridge for grouped or layered inversion outputs:
python3 tools/inversion_npz_to_netcdf.py \
--input /home/ubuntu/work/insar_mcmc/outputs_layered_inference_from_grouped_full/layered_inference_from_grouped.npz \
--output /tmp/layered_inference_for_qgis.nc \
--mode layered \
--time-origin 2017-01-04Or for the grouped Stage 1 product:
python3 tools/inversion_npz_to_netcdf.py \
--input /home/ubuntu/work/insar_mcmc/outputs_stage1_bologna_real_full_grouped_quick/stage1_bologna_real_results.npz \
--output /tmp/grouped_inference_for_qgis.nc \
--mode grouped \
--time-origin 2017-01-04After export, open the resulting .nc file with the plugin and click on the map.
The most practical backend path is:
- run the grouped Stage 1 inversion
- optionally derive layered outputs from the grouped posterior
- export the result to a standard NetCDF product
- let QGIS visualize and interrogate that product
This avoids pushing millions of dense InSAR points into the QGIS canvas when your real goal is grouped or gridded water-content time series.
For dense InSAR points, do not use shapefiles with full time-series arrays per feature. That is slow in both storage and rendering.
Prefer:
- gridded NetCDF or raster layers for map display
- decimated preview points only when needed
- on-click retrieval from the original cube
- tiled products for heavy workflows
- GeoPackage instead of Shapefile if you must store vector features
In your case, the existing grouped and tiled inversion outputs are already a better visualization target than raw dense InSAR points.