PyGeoFetch 2.5.0__py3-none-any.whl → 2.6.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
pygeofetch/__init__.py CHANGED
@@ -30,7 +30,7 @@ CLI::
30
30
  pygeofetch doctor
31
31
  """
32
32
 
33
- __version__ = "2.5.0"
33
+ __version__ = "2.6.1"
34
34
  __author__ = "PyGeoFetch Contributors"
35
35
  __license__ = "MIT"
36
36
 
@@ -610,11 +610,14 @@ class PreflightGate:
610
610
  advisory," never "risk confirmed absent."
611
611
  """
612
612
  import tempfile
613
+ import shutil
614
+ import importlib
613
615
  try:
614
- from pygeofetch.providers.copernicus_nodes import fetch_annotation_zip
615
- from pygeofetch.core.orbits import fetch_orbit_file
616
- from pygeofetch.insar.stack_selection import select_burst_synchronized_dates
617
- from pygeofetch.insar.geolocation import geodetic_to_ecef
616
+ for _mod_name in (
617
+ "pygeofetch.providers.copernicus_nodes", "pygeofetch.core.orbits",
618
+ "pygeofetch.insar.stack_selection", "pygeofetch.insar.geolocation",
619
+ ):
620
+ importlib.import_module(_mod_name)
618
621
  except ImportError as exc:
619
622
  logger.info("Real pre-download burst check unavailable (%s).", exc)
620
623
  return None
@@ -625,6 +628,42 @@ class PreflightGate:
625
628
  logger.info("Real pre-download burst check: couldn't create a scratch dir (%s).", exc)
626
629
  return None
627
630
 
631
+ # REAL BUG FOUND AND FIXED: work_dir was never removed on any exit
632
+ # path -- not on success, not on the early "too few usable dates"
633
+ # return, not on the exception fallback. Every real call to this
634
+ # method (i.e. every real preflight run with attempt_real_burst_
635
+ # check=True, which is the default) left behind a full scratch
636
+ # directory of real annotation mini-zips and real, full orbit
637
+ # files (~4MB+ each) that was never cleaned up. Re-running the
638
+ # same preflight cell repeatedly while iterating on a notebook --
639
+ # completely normal, everyday usage -- accumulates one orphaned
640
+ # directory per run, unbounded, on whatever drive the OS temp
641
+ # folder lives on (on Windows, typically the same small system
642
+ # drive as everything else). A real, concrete, plausible path to
643
+ # exhausting that drive, which is a well-known way to make a
644
+ # Jupyter kernel become unresponsive or fail to save cleanly --
645
+ # matching a real report of a notebook going inactive with blank
646
+ # cell outputs immediately after a preflight run. The real body
647
+ # of this method is now factored into _run_real_burst_family_check
648
+ # below, wrapped here so work_dir is removed on every real exit
649
+ # path, success or failure, not just the ones tested before.
650
+ try:
651
+ return self._run_real_burst_family_check(selected, work_dir)
652
+ finally:
653
+ shutil.rmtree(work_dir, ignore_errors=True)
654
+
655
+ def _run_real_burst_family_check(self, selected: List[Any], work_dir: Path):
656
+ """
657
+ The real body of _try_real_burst_family_check(), factored out so
658
+ that method's own try/finally can guarantee work_dir cleanup on
659
+ every real exit path here -- including the early returns --
660
+ without duplicating the rmtree call at each one.
661
+ """
662
+ from pygeofetch.providers.copernicus_nodes import fetch_annotation_zip
663
+ from pygeofetch.core.orbits import fetch_orbit_file
664
+ from pygeofetch.insar.stack_selection import select_burst_synchronized_dates
665
+ from pygeofetch.insar.geolocation import geodetic_to_ecef
666
+
628
667
  safe_zips: Dict[str, Any] = {}
629
668
  orbit_files: Dict[str, Any] = {}
630
669
 
pygeofetch/meta.yaml CHANGED
@@ -1,4 +1,4 @@
1
- {% set version = "2.5.0" %}
1
+ {% set version = "2.6.1" %}
2
2
 
3
3
  package:
4
4
  name: pygeofetch
@@ -0,0 +1,407 @@
1
+ Metadata-Version: 2.4
2
+ Name: pygeofetch
3
+ Version: 2.6.1
4
+ Summary: Universal satellite data pipeline + geospatial processing platform
5
+ Author-email: Samuel Appiah Kubi <appiahkubis14@gmail.com>
6
+ License: MIT License
7
+
8
+ Copyright (c) 2026 Samuel Appiah Kubi
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ of this software and associated documentation files (the "Software"), to deal
12
+ in the Software without restriction, including without limitation the rights
13
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ copies of the Software, and to permit persons to whom the Software is
15
+ furnished to do so, subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in all
18
+ copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
+ SOFTWARE.
27
+
28
+ Project-URL: Homepage, https://www.eocoreint.com/
29
+ Project-URL: Documentation, https://appiahkubis14.github.io/pygeofetch-docs/
30
+ Project-URL: Repository, https://github.com/EOCoreINT/pygeofetch
31
+ Project-URL: Bug Tracker, https://github.com/EOCoreINT/pygeofetch/issues
32
+ Keywords: satellite,remote-sensing,GIS,earth-observation,geospatial,SAR,Sentinel,Landsat
33
+ Classifier: Development Status :: 5 - Production/Stable
34
+ Classifier: Intended Audience :: Science/Research
35
+ Classifier: License :: OSI Approved :: MIT License
36
+ Classifier: Programming Language :: Python :: 3
37
+ Classifier: Programming Language :: Python :: 3.9
38
+ Classifier: Programming Language :: Python :: 3.10
39
+ Classifier: Programming Language :: Python :: 3.11
40
+ Classifier: Programming Language :: Python :: 3.12
41
+ Classifier: Topic :: Scientific/Engineering :: GIS
42
+ Requires-Python: >=3.9
43
+ Description-Content-Type: text/markdown
44
+ License-File: LICENSE
45
+ Requires-Dist: httpx>=0.27
46
+ Requires-Dist: click>=8.1
47
+ Requires-Dist: pydantic>=2.5
48
+ Requires-Dist: pydantic-settings>=2.1
49
+ Requires-Dist: PyYAML>=6.0
50
+ Requires-Dist: cryptography>=42.0
51
+ Requires-Dist: keyring>=24.3
52
+ Requires-Dist: tenacity>=8.2
53
+ Requires-Dist: python-dateutil>=2.9
54
+ Requires-Dist: requests>=2.31
55
+ Requires-Dist: anyio>=4.2
56
+ Requires-Dist: numpy>=1.26
57
+ Requires-Dist: tqdm>=4.66
58
+ Provides-Extra: geo
59
+ Requires-Dist: rasterio>=1.3; extra == "geo"
60
+ Requires-Dist: geopandas>=0.14; extra == "geo"
61
+ Requires-Dist: pyarrow>=15.0; extra == "geo"
62
+ Requires-Dist: shapely>=2.0; extra == "geo"
63
+ Requires-Dist: pyproj>=3.6; extra == "geo"
64
+ Provides-Extra: processor
65
+ Requires-Dist: rasterio>=1.3; extra == "processor"
66
+ Requires-Dist: rioxarray>=0.15; extra == "processor"
67
+ Requires-Dist: xarray>=2024.1; extra == "processor"
68
+ Requires-Dist: eoreader>=0.24; extra == "processor"
69
+ Requires-Dist: spyndex>=0.5; extra == "processor"
70
+ Requires-Dist: scipy>=1.12; extra == "processor"
71
+ Requires-Dist: scikit-image>=0.23; extra == "processor"
72
+ Requires-Dist: geopandas>=0.14; extra == "processor"
73
+ Provides-Extra: providers
74
+ Requires-Dist: eodag>=3.0; extra == "providers"
75
+ Provides-Extra: insar
76
+ Requires-Dist: sarxarray>=0.1; extra == "insar"
77
+ Requires-Dist: scipy>=1.12; extra == "insar"
78
+ Provides-Extra: ost
79
+ Requires-Dist: opensartoolkit>=3.0; extra == "ost"
80
+ Provides-Extra: viz
81
+ Requires-Dist: leafmap>=0.30; extra == "viz"
82
+ Requires-Dist: folium>=0.16; extra == "viz"
83
+ Requires-Dist: matplotlib>=3.7; extra == "viz"
84
+ Requires-Dist: localtileserver>=1.0.0; extra == "viz"
85
+ Requires-Dist: ipysheet>=0.6.0; extra == "viz"
86
+ Requires-Dist: ipyleaflet>=0.17.0; extra == "viz"
87
+ Requires-Dist: ipywidgets>=8.0.0; extra == "viz"
88
+ Requires-Dist: ipyevents>=2.0.2; extra == "viz"
89
+ Requires-Dist: ipyfilechooser>=0.6.0; extra == "viz"
90
+ Requires-Dist: sidecar>=0.6.0; extra == "viz"
91
+ Requires-Dist: bokeh>=3.0.0; extra == "viz"
92
+ Requires-Dist: seaborn>=0.12.0; extra == "viz"
93
+ Requires-Dist: plotly>=5.14.0; extra == "viz"
94
+ Requires-Dist: whitebox>=2.4.0; extra == "viz"
95
+ Requires-Dist: whiteboxgui>=2.4.0; extra == "viz"
96
+ Requires-Dist: geemap>=0.28.0; extra == "viz"
97
+ Requires-Dist: osmnx>=1.9.4; extra == "viz"
98
+ Requires-Dist: contextily>=1.9.4; extra == "viz"
99
+ Requires-Dist: xyzservices>=2023.10.0; extra == "viz"
100
+ Requires-Dist: mapclassify>=2.6.0; extra == "viz"
101
+ Requires-Dist: geoplot>=0.5.0; extra == "viz"
102
+ Requires-Dist: mplleaflet>=0.0.5; extra == "viz"
103
+ Requires-Dist: branca>=0.6.0; extra == "viz"
104
+ Requires-Dist: plotly-geo>=1.0.0; extra == "viz"
105
+ Requires-Dist: streamlit>=1.28.0; extra == "viz"
106
+ Requires-Dist: pyvista; extra == "viz"
107
+ Provides-Extra: viz-3d
108
+ Requires-Dist: keplergl>=0.3.0; extra == "viz-3d"
109
+ Provides-Extra: cloud
110
+ Requires-Dist: boto3>=1.34; extra == "cloud"
111
+ Requires-Dist: pystac>=1.9; extra == "cloud"
112
+ Requires-Dist: planetary-computer>=1.0; extra == "cloud"
113
+ Provides-Extra: notebook
114
+ Requires-Dist: ipython>=8.0; extra == "notebook"
115
+ Requires-Dist: ipywidgets>=8.0; extra == "notebook"
116
+ Requires-Dist: jupyter>=1.0; extra == "notebook"
117
+ Provides-Extra: schedule
118
+ Requires-Dist: croniter>=2.0; extra == "schedule"
119
+ Provides-Extra: dev
120
+ Requires-Dist: pytest>=8.0; extra == "dev"
121
+ Requires-Dist: pytest-cov>=4.1; extra == "dev"
122
+ Requires-Dist: pytest-mock>=3.12; extra == "dev"
123
+ Requires-Dist: ruff>=0.3; extra == "dev"
124
+ Requires-Dist: mypy>=1.8; extra == "dev"
125
+ Requires-Dist: build>=1.0; extra == "dev"
126
+ Requires-Dist: twine>=5.0; extra == "dev"
127
+ Provides-Extra: insar-full
128
+ Requires-Dist: snaphu>=0.1; extra == "insar-full"
129
+ Requires-Dist: scipy>=1.12; extra == "insar-full"
130
+ Provides-Extra: full
131
+ Requires-Dist: pygeofetch[cloud,geo,notebook,processor,providers,sar,schedule,viz]; extra == "full"
132
+ Provides-Extra: all
133
+ Requires-Dist: pygeofetch[full]; extra == "all"
134
+ Dynamic: license-file
135
+
136
+ <div align="center">
137
+
138
+ <img src="https://raw.githubusercontent.com/EOCoreINT/pygeofetch/main/icon/pygeofetch_logo.png" alt="PyGeoFetch Logo" width="350">
139
+
140
+ [![PyPI version](https://badge.fury.io/py/pygeofetch.svg)](https://pypi.org/project/pygeofetch/)
141
+ [![Python Versions](https://img.shields.io/pypi/pyversions/pygeofetch.svg)](https://pypi.org/project/pygeofetch/)
142
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
143
+ [![Tests](https://github.com/appiahkubis14/pygeofetch/actions/workflows/tests.yml/badge.svg)](https://github.com/appiahkubis14/pygeofetch/actions)
144
+ [![Coverage](https://codecov.io/gh/appiahkubis14/pygeofetch/branch/main/graph/badge.svg)](https://codecov.io/gh/appiahkubis14/pygeofetch)
145
+
146
+ **A unified satellite data and geospatial processing platform — one CLI, one Python API, 24 providers, and a fully verified InSAR chain.**
147
+
148
+ [Quick Start](#-quick-start) · [Mexico City Case Study](#-case-study-mapping-mexico-city-land-subsidence-with-insar) · [Case Study Repo ↗](https://github.com/EOCoreINT/mexico-subsidence-project) · [Documentation](https://appiahkubis14.github.io/pygeofetch-docs/) · [Notebooks](#-notebooks)
149
+
150
+ </div>
151
+
152
+ ---
153
+
154
+ ## Overview
155
+
156
+ pygeofetch is a production-ready framework for acquiring and processing Earth observation data. It provides authenticated, unified access to **24 satellite repositories** — Sentinel, Landsat, Planet, Maxar, Airbus, Copernicus, USGS, NASA, JAXA, and more — through a single CLI and Python API, and layers a complete geospatial processing engine on top.
157
+
158
+ Where pygeofetch goes further than most data-access libraries is in its **InSAR chain**: burst-aware coregistration, real flat-earth and topographic phase removal, ERA5 tropospheric and ionospheric correction, phase unwrapping, and SBAS time-series inversion — each stage independently verified against synthetic ground truth or real, published deformation studies, not assumed correct from theory alone. The [Mexico City case study](#-case-study-mapping-mexico-city-land-subsidence-with-insar) below walks through that chain end to end on real Sentinel-1 data.
159
+
160
+ **Core capabilities:**
161
+
162
+ | | |
163
+ |---|---|
164
+ | 🔐 **Authenticated access** | 24 providers, credentials stored via system keyring (Keychain / Credential Manager / Secret Service) |
165
+ | 🔍 **Federated search** | One query across all providers → STAC 1.0 GeoJSON / GeoParquet / CSV, with real footprint geometry where the provider supplies it |
166
+ | 📥 **Resilient downloads** | Parallel, resumable, checksum-verified, band-selective, atomic writes |
167
+ | ⚙️ **Preprocessing** | Atmospheric correction, cloud masking, reprojection, resampling, pan-sharpening, mosaicking |
168
+ | 📊 **17 spectral indices** | NDVI, EVI, SAVI, NDWI, MNDWI, NDBI, LST, Albedo, dNBR, GLCM texture, and more |
169
+ | 🌐 **Verified InSAR chain** | Coregistration → phase removal → atmospheric/ionospheric correction → unwrapping → SBAS inversion |
170
+ | 📋 **YAML pipelines** | Chainable, schedulable, repeatable workflows with full run history |
171
+
172
+ ---
173
+
174
+ <p align="center">
175
+ <img src="https://raw.githubusercontent.com/EOCoreINT/pygeofetch/main/docs/images/trend_map.png" width="48%" />
176
+ <img src="https://raw.githubusercontent.com/EOCoreINT/pygeofetch/main/docs/images/trend_classification.png" width="48%" />
177
+ </p>
178
+ <p align="center"><em>NDVI trend (2018–2024) and severity classification for the Obuasi Municipal District, Ghana — computed end-to-end with pygeofetch from boundary-clipped USGS Landsat data.</em></p>
179
+
180
+ Across 2018–2024, 32.0% of the district shows measurable vegetation decline (9.2% strong, 22.8% moderate), against 57.5% stable and 10.5% increasing. The decline is spatially concentrated west of −1.70° longitude, consistent with the district's documented small-scale mining activity — though an NDVI trend alone can't isolate cause from correlated signals like logging or agricultural clearing without ground verification. The eastern two-thirds of the district is overwhelmingly stable, which is itself informative: it suggests a localized driver rather than a district-wide seasonal artifact.
181
+
182
+ ---
183
+
184
+ ## Why pygeofetch
185
+
186
+ Satellite data access is fragmented — every provider has its own auth scheme, query API, and file format, and most tools that unify search stop well short of processing. pygeofetch is the only package that combines broad provider coverage with a full processing engine and a genuinely verified InSAR chain in one place.
187
+
188
+ | Feature | pygeofetch | EODAG | pystac-client | satpy | sentinelsat |
189
+ |---|---|---|---|---|---|
190
+ | Providers | **24** | 10+ | STAC only | Limited | Sentinel only |
191
+ | Processing engine | ✅ Full | ❌ | ❌ | Partial | ❌ |
192
+ | Spectral indices | ✅ 17+ | ❌ | ❌ | ❌ | ❌ |
193
+ | Full InSAR chain | ✅ Verified | ❌ | ❌ | ❌ | ❌ |
194
+ | Real footprint geometry | ✅ | ❌ | ✅ (STAC only) | ❌ | ❌ |
195
+ | YAML pipelines + scheduling | ✅ | ❌ | ❌ | ❌ | ❌ |
196
+ | Commercial providers | ✅ Planet/Maxar | ❌ | ❌ | ❌ | ❌ |
197
+
198
+ ---
199
+
200
+ ## Providers
201
+
202
+ **11 open-access providers**, no login required — including `planetary_computer`, `aws_earth`, `element84`, `noaa_big_data`, `esa_scihub`, `jaxa_earth`, and `geoserver_generic` for any OGC WMS/WFS/WCS endpoint.
203
+
204
+ **13 authenticated providers** — USGS, Copernicus CDSE, NASA Earthdata (+ Cloud), Alaska SAR Facility, OpenTopography, Planet Labs, Sentinel Hub, Maxar GBDX, Airbus OneAtlas, Google Earth Engine, TerraBotics, and Earth Explorer.
205
+
206
+ Every provider has been directly verified to return at minimum a correct bounding box; several are further confirmed to return real, precise footprint geometry against a live API response (marked in `pygeofetch providers info PROVIDER`). Run `pygeofetch providers list` for the full, current table.
207
+
208
+ ---
209
+
210
+ ## Installation
211
+
212
+ ```bash
213
+ pip install pygeofetch # core — free providers work immediately
214
+ pip install "pygeofetch[geo]" # + rasterio, geopandas, shapely
215
+ pip install "pygeofetch[insar]" # + native SBAS inversion, phase unwrapping
216
+ pip install "pygeofetch[insar-full]" # + MintPy passthrough for advanced corrections
217
+ pip install "pygeofetch[all]" # everything
218
+ ```
219
+
220
+ Requires Python 3.9+. Run `pygeofetch doctor` to verify your install and provider connectivity.
221
+
222
+ ---
223
+
224
+ ## ⚡ Quick Start
225
+
226
+ ```python
227
+ from pygeofetch import PyGeoFetch
228
+ from pygeofetch.models.search_query import SearchQuery, BoundingBox
229
+ from pygeofetch.models.download_task import DownloadOptions
230
+
231
+ client = PyGeoFetch()
232
+ client.add_credentials("copernicus", username="you@example.com", password="...")
233
+
234
+ results = client.search(
235
+ SearchQuery(bbox=BoundingBox.from_string("-74.1,40.6,-73.7,40.9"),
236
+ start_date="2024-01-01", cloud_cover_max=20),
237
+ providers=["copernicus", "planetary_computer", "aws_earth"],
238
+ )
239
+
240
+ downloads = client.download(results[:5], destination="./data/",
241
+ options=DownloadOptions(parallel=4, bands=["B02", "B03", "B04"]))
242
+
243
+ ndvi = client.indices.ndvi(red="B04.tif", nir="B08.tif")
244
+ ```
245
+
246
+ The equivalent is available as a CLI (`pygeofetch search run ...` / `pygeofetch download run ...`) and as chainable, schedulable YAML pipelines — see the [full CLI reference](#cli-reference) and [notebooks](#-notebooks).
247
+
248
+ ---
249
+
250
+ ## 🌐 Case Study: Mapping Mexico City Land Subsidence with InSAR
251
+
252
+ **Full project, notebook, and data:** [github.com/EOCoreINT/mexico-subsidence-project](https://github.com/EOCoreINT/mexico-subsidence-project)
253
+
254
+ Mexico City sits on a drained lakebed and is subsiding at some of the fastest rates on Earth as its aquifer is depleted. It's a demanding, real-world test for an InSAR chain: a huge, largely incoherent urban scene, a fragmented acquisition history, and a deformation signal large enough to make phase unwrapping genuinely hard. What follows is a condensed walkthrough of the [full project above](https://github.com/EOCoreINT/mexico-subsidence-project) — the pygeofetch InSAR chain run end to end against real Sentinel-1 data over Iztapalapa, no synthetic shortcuts. For the complete methodology, every intermediate number, and an unusually candid validation discussion, read the project README itself.
255
+
256
+ **1. Authenticated federated search.** `client.search()` against Copernicus Data Space for SLC scenes over the city (bbox `-99.183, 19.278, -99.003, 19.438`, July 2016 – September 2017) returns a stack of Sentinel-1A/1B candidates in seconds, filterable straight down to a single consistent track.
257
+
258
+ <p align="center"><img src="https://raw.githubusercontent.com/EOCoreINT/mexico-subsidence-project/main/analysis/data-search.png" width="85%" /></p>
259
+
260
+ Results carry real footprint geometry and drop straight onto a map via `MapViewer`, with hover info for scene ID, date, satellite, and provider — useful for spotting swath overlap before committing to a download.
261
+
262
+ <p align="center">
263
+ <img src="https://raw.githubusercontent.com/EOCoreINT/mexico-subsidence-project/main/analysis/search_1.png" width="48%" />
264
+ <img src="https://raw.githubusercontent.com/EOCoreINT/mexico-subsidence-project/main/analysis/search.png" width="48%" />
265
+ </p>
266
+
267
+ **2. DEM acquisition.** A matching search against OpenTopography returns seven DEM products for the AOI; pygeofetch downloads and clips the selected one (SRTM 30 m) automatically for topographic phase removal.
268
+
269
+ <p align="center"><img src="https://raw.githubusercontent.com/EOCoreINT/mexico-subsidence-project/main/analysis/dem_acquisition.png" width="85%" /></p>
270
+
271
+ **3. Preflight validation.** Before anything downloads, the `PreflightGate` checks search truncation, AOI coverage, temporal network connectivity, and burst-timing family compatibility from lightweight annotation XMLs — catching acquisitions that would waste compute before they cost bandwidth. This run avoided roughly 360 GB of downloads by excluding 48 of 115 candidate scenes at this stage alone.
272
+
273
+ <p align="center"><img src="https://raw.githubusercontent.com/EOCoreINT/mexico-subsidence-project/main/analysis/preflight-log.png" width="85%" /></p>
274
+
275
+ Real orbit state vectors then pre-filter the candidate pair list against Sentinel-1's own mission thresholds, rejecting pairs for excess burst-sync error, temporal baseline, or spatial baseline before any interferogram is attempted.
276
+
277
+ <p align="center"><img src="https://raw.githubusercontent.com/EOCoreINT/mexico-subsidence-project/main/analysis/pre-filter-for-interferogram.png" width="85%" /></p>
278
+
279
+ **4. Interferogram formation.** Of 2,211 theoretically possible pairs across 67 downloaded scenes, real orbit-based coregistration, per-burst Enhanced Spectral Diversity, deburst, and flat-earth/topographic phase removal reduce that to 78 valid pairs — the dense urban fringe pattern below is raw wrapped phase, before any correction.
280
+
281
+ <p align="center"><img src="https://raw.githubusercontent.com/EOCoreINT/mexico-subsidence-project/main/analysis/wrapped_phase.png" width="85%" /></p>
282
+
283
+ **5. Coherence.** Amplitude and coherence are estimated together for every pair; the urban core holds noticeably higher coherence (0.614) than the scene-wide average (0.508) — exactly the contrast expected between stable built structures and vegetated or agricultural surrounds.
284
+
285
+ <p align="center"><img src="https://raw.githubusercontent.com/EOCoreINT/mexico-subsidence-project/main/analysis/comparism.png" width="85%" /></p>
286
+
287
+ **6. Phase unwrapping.** SNAPHU (Chen & Zebker, 2001) resolves each wrapped interferogram into continuous phase, both as a raw array and reprojected onto the real city footprint. Reliable coverage is intentionally sparse (~0.1–0.2%) — dense vegetation cover means most of the scene decorrelates between 18–24 day passes, so the pipeline marks those pixels NaN rather than interpolating across them.
288
+
289
+ <p align="center">
290
+ <img src="https://raw.githubusercontent.com/EOCoreINT/mexico-subsidence-project/main/analysis/unwrapped_phase.png" width="48%" />
291
+ <img src="https://raw.githubusercontent.com/EOCoreINT/mexico-subsidence-project/main/analysis/unwrap.png" width="48%" />
292
+ </p>
293
+
294
+ **7. SBAS time-series inversion.** The full 58-date descending stack, once low-coherence and unreliable-reference-pixel pairs are excluded, fractures into 17 disconnected network "islands" — a genuine finding about this AOI's data quality, not a bug. The largest connected island (10 dates, 11 pairs) carries the final inversion, referenced near Cerro de la Estrella.
295
+
296
+ <p align="center"><img src="https://raw.githubusercontent.com/EOCoreINT/mexico-subsidence-project/main/analysis/1.png" width="85%" /></p>
297
+
298
+ The resulting velocity field, uncertainty map, reliability mask, and displacement time series recover a 2nd–98th-percentile vertical velocity of **−35.5 to −2.9 cm/year** where reliable pixels exist.
299
+
300
+ <p align="center"><img src="https://raw.githubusercontent.com/EOCoreINT/mexico-subsidence-project/main/analysis/island1_sbas_full_analysis.png" width="90%" /></p>
301
+
302
+ That result is **directionally consistent** — same sign, same order of magnitude — with the peer-reviewed peak of −39.1 cm/year reported for Iztapalapa by Cigna & Tapete (2021, *Remote Sensing of Environment*), a study built from 300+ scenes across six years. It is explicitly *not* a validated replication of that study: this run used a fraction of the data volume, and the project's own README is deliberately careful not to overclaim the comparison — worth reading in full if you want the honest version of what this number does and doesn't prove.
303
+
304
+ The full, runnable notebook — real search and download throughout, no synthetic substitutions — is [`mexico_city_full_confirmed (2).ipynb`](<https://github.com/EOCoreINT/mexico-subsidence-project/blob/main/mexico_city_full_confirmed%20(2).ipynb>) in the [mexico-subsidence-project](https://github.com/EOCoreINT/mexico-subsidence-project) repo; see also `piton_fournaise_full.ipynb` and `amatrice_full.ipynb` in [`notebooks/`](notebooks/) for the same chain applied to the 2021 Piton de la Fournaise eruption and the 2016 Amatrice earthquake.
305
+
306
+ ---
307
+
308
+ ## Processing Engine
309
+
310
+ **Preprocessing** (`client.preprocess`): `atmos` (DOS1/DOS2, Sen2Cor, FLAASH, 6S, iCOR) · `cloud_mask` · `cloud_fill` · `topo_correct` · `clip` · `reproject` · `resample` · `pansharpen` · `tile` · `mosaic` · `composite`
311
+
312
+ **Spectral indices** (`client.indices`): `ndvi` · `evi` · `savi` · `ndwi` · `mndwi` · `ndbi` · `ndsi` · `ndmi` · `nbr` / `dnbr` · `tct` · `pca` · `texture` (GLCM) · `lst` · `albedo` · `band_math`
313
+
314
+ **Post-processing** (`client.post`): `vectorize` → `smooth` → `regularize` → `zonal_stats` → `buffer` → `centroids` → `compress` → `cog`
315
+
316
+ **SAR** (`client.sar`): `despeckle` (Lee, Enhanced Lee, Frost, Gamma MAP) · `calibrate` (σ0/γ0/β0) · `flood_map` · `coherence`
317
+
318
+ **InSAR** (`pygeofetch.insar`): `SLCExtractor` · `InterferogramGenerator` · `AtmosphericCorrector` (elevation-correlated or real ERA5) · `IonosphericCorrector` (real IONEX/CDDIS) · `PhaseUnwrapper` (SNAPHU) · `SBASTimeSeries` · `DataValidator` · `InSARProject` (high-level, search-to-interferogram wrapper)
319
+
320
+ Full method signatures and options are in the [documentation](https://appiahkubis14.github.io/pygeofetch-docs/) and [`pygeofetch/insar/README.md`](pygeofetch/insar/README.md).
321
+
322
+ ---
323
+
324
+ ## YAML Pipelines
325
+
326
+ ```yaml
327
+ name: weekly-sentinel2-ndvi
328
+ schedule: "0 6 * * 1"
329
+ steps:
330
+ - search: {providers: [copernicus, aws_earth], date_range: last_7_days, cloud_cover: "0-10"}
331
+ - filter: {expression: "data.cloud_cover < 5"}
332
+ - download: {parallel: 4, output: ./raw/, bands: [B04, B08]}
333
+ - ndvi: {red: B04.tif, nir: B08.tif}
334
+ - vectorize: {threshold: 0.3, format: geojson}
335
+ - cog: {compress: deflate}
336
+ ```
337
+
338
+ ```bash
339
+ pygeofetch proc-pipeline run weekly-sentinel2.yaml --input scene.tif
340
+ pygeofetch pipeline schedule weekly-sentinel2.yaml --name ndvi-weekly
341
+ ```
342
+
343
+ Six built-in templates ship out of the box: `ndvi` · `change_detection` · `flood_map` · `urban_mapping` · `sar_analysis` · `land_cover`.
344
+
345
+ ---
346
+
347
+ ## CLI Reference
348
+
349
+ Every capability above is also exposed as a CLI command, grouped by area:
350
+
351
+ | Group | Example | Purpose |
352
+ |---|---|---|
353
+ | `auth` | `pygeofetch auth add copernicus --username U --password P` | Manage per-provider credentials |
354
+ | `providers` | `pygeofetch providers list --capabilities sar` | Discover and inspect providers |
355
+ | `search` | `pygeofetch search run --bbox "..." --providers aws_earth,copernicus` | Federated search, 7 output formats |
356
+ | `download` | `pygeofetch download run --from-search results.geojson --parallel 4` | Parallel, resumable downloads |
357
+ | `preprocess` | `pygeofetch preprocess clip scene.tif --bbox "..."` | Atmospheric correction, clipping, reprojection, etc. |
358
+ | `index` | `pygeofetch index ndvi --red B04.tif --nir B08.tif` | Spectral index computation |
359
+ | `post` | `pygeofetch post cog scene.tif --compress deflate` | Vectorization, zonal stats, COG conversion |
360
+ | `sar` | `pygeofetch sar coherence slc1.tif slc2.tif` | Despeckling, calibration, coherence, flood mapping |
361
+ | `proc-pipeline` / `pipeline` | `pygeofetch pipeline schedule weekly.yaml` | YAML pipeline execution and scheduling |
362
+ | `cache` / `config` | `pygeofetch cache prune --max-size 1GB` | Cache and configuration management |
363
+
364
+ Run `pygeofetch --help` or any subcommand with `--help` for the complete, current option list, or see the [CLI reference docs](https://appiahkubis14.github.io/pygeofetch-docs/).
365
+
366
+ ---
367
+
368
+ <!-- ## 📚 Notebooks
369
+
370
+ | Notebook | Topics |
371
+ |---|---|
372
+ | `01_getting_started.ipynb` | Install, doctor, first search, first download |
373
+ | `02_authentication_and_providers.ipynb` | All 24 providers, credentials, capability filters |
374
+ | `03_advanced_search.ipynb` | Federated search, CQL2 filters, output formats, caching |
375
+ | `04_download_and_postprocessing.ipynb` | Band selection, parallel downloads, post-processing |
376
+ | `05_pipelines_and_scheduling.ipynb` | YAML pipelines, scheduling, Python builder API |
377
+ | `06_real_world_workflows.ipynb` | NDVI time series, change detection, multi-sensor fusion |
378
+ | `07_copernicus_and_authenticated_providers.ipynb` | Copernicus, USGS, NASA, Planet, ASF, OpenTopography |
379
+ | `08_cli_complete_reference.ipynb` | Every CLI command with runnable examples |
380
+ | `09_processing_complete.ipynb` | Full processing engine: preprocessing, indices, SAR, pipelines |
381
+ | [`mexico_city_full_confirmed (2).ipynb`](<https://github.com/EOCoreINT/mexico-subsidence-project/blob/main/mexico_city_full_confirmed%20(2).ipynb>) ↗ | The [Mexico City case study](#-case-study-mapping-mexico-city-land-subsidence-with-insar) above, in a separate companion repo — real search/download, full InSAR chain, SBAS inversion |
382
+ | `piton_fournaise_full.ipynb` | Verified InSAR pipeline against the real April 2021 Piton de la Fournaise eruption |
383
+ | `amatrice_full.ipynb` | Verified InSAR pipeline against the real 2016 Amatrice, Italy earthquake |
384
+ | `provider_search_footprint_test.ipynb` | Search and footprint-map validation across all 24 providers |
385
+
386
+ ```bash
387
+ cd notebooks/ && jupyter lab
388
+ ``` -->
389
+
390
+ ---
391
+
392
+ ## Documentation
393
+
394
+ Full documentation: **https://appiahkubis14.github.io/pygeofetch-docs/** — CLI reference, provider auth guides, pipeline configuration, post-processing catalogue, and InSAR verification methodology.
395
+
396
+ ## Contributing
397
+
398
+ Contributions are welcome — see [CONTRIBUTING.md](CONTRIBUTING.md). Good first issues include extending real footprint geometry to remaining bbox-only providers, wiring stub providers to full API integrations, and adding new post-processing actions.
399
+
400
+ ```bash
401
+ git clone git@github.com:EOCoreINT/pygeofetch.git && cd pygeofetch
402
+ pip install -e ".[dev,all]" && pytest tests/unit/ -v
403
+ ```
404
+
405
+ ## License
406
+
407
+ MIT — see [LICENSE](LICENSE). © 2026 Samuel Appiah Kubi. Part of the **PyGeoVision** platform, alongside [pygeofetch](https://github.com/appiahkubis14/pygeofetch) itself.
@@ -1,5 +1,5 @@
1
- pygeofetch/__init__.py,sha256=GWQJPhEHRE912aufB3A3thLi87N5Zj_ZjsPVa08UQUA,1990
2
- pygeofetch/meta.yaml,sha256=5hj9c3zPaZ-aRyPnb1xpN-2jgrw7L_AB2qW3hfoLURg,1280
1
+ pygeofetch/__init__.py,sha256=ZCRJRFP3DKU1xf4yo6eQHjHKT4nUjWjWohebYE1Yc7M,1990
2
+ pygeofetch/meta.yaml,sha256=zSwzpicrlpHWUze00OmFGFoNRHRGkLaAY7WYMXsancA,1280
3
3
  pygeofetch/cli/__init__.py,sha256=QZMIIHEgmjGFieucqq9fZ5uephxP9-jdu1s8Q4qqw8o,30
4
4
  pygeofetch/cli/auth_commands.py,sha256=YqbrN_BYcAYCaUIYLpSJ_VIw35tKFUiD9Kc55SWbDWg,7742
5
5
  pygeofetch/cli/config_commands.py,sha256=1Pps0HLCLPODMlM6SFV8ru3IKCDpexSTz8uKIXvIIF8,3918
@@ -36,7 +36,7 @@ pygeofetch/insar/geolocation.py,sha256=-vwTYFhvutKjI4c_f-3BGkfV3XnnDUh5r7KwQbLlE
36
36
  pygeofetch/insar/gpu.py,sha256=E4Dx9-78s2GyKl2_dJrc6lXIHiy67tlqHlpkYue_418,3933
37
37
  pygeofetch/insar/interferogram.py,sha256=6T9k7LAGupWcib2S26fyacNwKi3DBP2jAKbTM8M2Bvw,111471
38
38
  pygeofetch/insar/ionosphere.py,sha256=vG60pyUtxyoJqLCMb_KjFEJvkDE1Bl8fqTzTTbrTIX8,30101
39
- pygeofetch/insar/preflight.py,sha256=s5MtHVNocHhWtQqudpcrhCvNCBUubfuB68Hd3EJlcQ0,39070
39
+ pygeofetch/insar/preflight.py,sha256=EDrSxzlPIrBHtYgcMyaoaBr7CmInvg6FlHRb9k6EJfw,41270
40
40
  pygeofetch/insar/provenance.py,sha256=b2Ql40ZVeI9xHwFUvstBl4npK2o4lua39sRcpZI_lAQ,1876
41
41
  pygeofetch/insar/splitspectrum_diagnostic.py,sha256=_IlfBs__BW7Yz2RwdmWxfrOspe67jHMgJPyNyzK_rYE,7705
42
42
  pygeofetch/insar/stack_selection.py,sha256=FaRBXDNnLwwiXPGeALSW1AaUdpLFOEepVTgEGVfNC4o,37555
@@ -108,9 +108,9 @@ pygeofetch/utils/validators.py,sha256=f-k3mGFP4byjimyDymhPEdsz5I16jZacx1HSnwrARj
108
108
  pygeofetch/viz/__init__.py,sha256=xf2C9IL4n3bv3oxk8RYkogq7nkuNyt18V-urAoXWRQY,449
109
109
  pygeofetch/viz/map.py,sha256=vYO99NvTumCAVXVtXcEzMx_cpmH-FvSVNWl8X0PNSgE,15494
110
110
  pygeofetch/viz/plot.py,sha256=I16rdOWb80gcjYDsDvTMzuyek7QHgUNOQxY2RejBAPs,53675
111
- pygeofetch-2.5.0.dist-info/licenses/LICENSE,sha256=zavMyhODD6NvZTmmKFEtATrngwY4CU_NEtY7lhjxGnI,1075
112
- pygeofetch-2.5.0.dist-info/METADATA,sha256=frDzX4t6B0Vc_j-ggBrzZUHzgJS9KEsjQCZ7OHD0YBQ,43254
113
- pygeofetch-2.5.0.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
114
- pygeofetch-2.5.0.dist-info/entry_points.txt,sha256=dHiUXLF5xNJ8vgtXZoUQNleEMQUeDPZiKQOE1tW8SDY,55
115
- pygeofetch-2.5.0.dist-info/top_level.txt,sha256=rOmnZargIfNk99fwVOqt6OJyJvpSTBBAYO5HU37yhHk,11
116
- pygeofetch-2.5.0.dist-info/RECORD,,
111
+ pygeofetch-2.6.1.dist-info/licenses/LICENSE,sha256=zavMyhODD6NvZTmmKFEtATrngwY4CU_NEtY7lhjxGnI,1075
112
+ pygeofetch-2.6.1.dist-info/METADATA,sha256=Lp15FqyJcP359D5zenSKnO98FmOLT92Rvk2RffGoUtw,25946
113
+ pygeofetch-2.6.1.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
114
+ pygeofetch-2.6.1.dist-info/entry_points.txt,sha256=dHiUXLF5xNJ8vgtXZoUQNleEMQUeDPZiKQOE1tW8SDY,55
115
+ pygeofetch-2.6.1.dist-info/top_level.txt,sha256=rOmnZargIfNk99fwVOqt6OJyJvpSTBBAYO5HU37yhHk,11
116
+ pygeofetch-2.6.1.dist-info/RECORD,,