PyGeoFetch 2.7.0.6__py3-none-any.whl → 2.7.0.7__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.7.0.6.4"
33
+ __version__ = "2.7.0.7.4"
34
34
  __author__ = "PyGeoFetch Contributors"
35
35
  __license__ = "MIT"
36
36
 
@@ -175,17 +175,28 @@ def read_crop_offset(path: Union[str, Path]) -> Tuple[float, float]:
175
175
  which is the correct default: no crop means local and full-scene
176
176
  coordinates are already the same thing.
177
177
  """
178
+ import math
179
+
178
180
  import rasterio
179
181
 
180
182
  try:
181
183
  with rasterio.open(path) as src:
182
184
  tags = src.tags()
183
- return (
184
- float(tags.get("crop_row_off", 0.0)),
185
- float(tags.get("crop_col_off", 0.0)),
186
- )
185
+ row = float(tags.get("crop_row_off", 0.0))
186
+ col = float(tags.get("crop_col_off", 0.0))
187
187
  except Exception:
188
188
  return (0.0, 0.0)
189
+ # Files cropped before 2026-11-09 may carry fractional offsets, but rasterio read them from the NEAREST whole
190
+ # pixel (half rounds up). The data's true origin is that whole pixel, so use it: taking the fractional value
191
+ # misregistered every pair by the difference of its two dates' fractions (up to ~0.5 px).
192
+ snapped = (float(math.floor(row + 0.5)), float(math.floor(col + 0.5)))
193
+ if snapped != (row, col):
194
+ logger.info(
195
+ "%s: fractional crop offset (%.3f, %.3f) in the tags; the data starts at whole pixel (%d, %d) "
196
+ "(rasterio rounds window offsets), which is what the geometry now uses",
197
+ Path(str(path)).name, row, col, int(snapped[0]), int(snapped[1]),
198
+ )
199
+ return snapped
189
200
 
190
201
 
191
202
  def collocate_by_geocoding(
@@ -714,13 +714,21 @@ class SLCExtractor:
714
714
 
715
715
  # Clamp to the actual raster extent -- the padded window
716
716
  # can legitimately extend past the real data bounds.
717
- col_off_clamped = max(0, col_off)
718
- row_off_clamped = max(0, row_off)
717
+ # Whole pixels only: rasterio reads a window with fractional
718
+ # offsets starting at the NEAREST whole pixel, so a fractional
719
+ # offset recorded in the tags (as before 2026-11-09) put the
720
+ # crop's true origin up to half a pixel away from where the
721
+ # orbit geometry assumed it, differently for every date. That
722
+ # misregistered pairs by up to ~0.5 px in azimuth and range.
723
+ import math
724
+
725
+ col_off_clamped = max(0, int(math.floor(col_off)))
726
+ row_off_clamped = max(0, int(math.floor(row_off)))
719
727
  width_clamped = min(
720
- width - (col_off_clamped - col_off), src.width - col_off_clamped
728
+ int(math.ceil(col_off + width)) - col_off_clamped, src.width - col_off_clamped
721
729
  )
722
730
  height_clamped = min(
723
- height - (row_off_clamped - row_off), src.height - row_off_clamped
731
+ int(math.ceil(row_off + height)) - row_off_clamped, src.height - row_off_clamped
724
732
  )
725
733
 
726
734
  if width_clamped <= 0 or height_clamped <= 0:
@@ -514,7 +514,7 @@ class InterferogramGenerator:
514
514
  TOPS pairs only (default True).
515
515
  esd_ambiguity_scan: How to pick the whole number of ESD ambiguities (~0.11 px each) that ESD cannot see:
516
516
  "auto" (default) keeps k = 0 when cross-correlation pins the first-stage offset to
517
- better than a quarter ambiguity and runs the coherence scan otherwise; "always" or
517
+ better than half an ambiguity and runs the coherence scan otherwise; "always" or
518
518
  "never" force it.
519
519
  use_gpu: Use CuPy GPU acceleration if available.
520
520
  memory_guard: "warn" (default) | "raise" | "off". Compares the estimated peak memory of a pair with the
@@ -3425,8 +3425,9 @@ class InterferogramGenerator:
3425
3425
  picked k = -2 and k = -1 where phase closure showed k = 0 was right (a wrong k leaves exactly k fringes per
3426
3426
  burst along track, invisible at the seams). "auto" therefore keeps k = 0 when the first-stage
3427
3427
  coregistration already pins the constant azimuth offset to well within half an ambiguity, i.e. when
3428
- cross-correlation supports the fit and RMS / sqrt(n) < ambiguity / 4, and scans only otherwise
3429
- (geometry-only first stage, or too few / too noisy cross-correlation points).
3428
+ cross-correlation supports the fit and RMS / sqrt(n) < ambiguity / 2, and scans only otherwise
3429
+ (geometry-only first stage, or too few / too noisy cross-correlation points). On the full Mexico City
3430
+ stack the scan also chose k = +1 and +2 for pairs just above an ambiguity/4 limit.
3430
3431
  """
3431
3432
  policy = getattr(self, "_esd_ambiguity_scan", "auto")
3432
3433
  if policy == "always":
@@ -3438,10 +3439,10 @@ class InterferogramGenerator:
3438
3439
  if mode in (None, "geometry_only") or not n or rms is None:
3439
3440
  return True, f"first stage without cross-correlation support (mode {mode})"
3440
3441
  sigma = float(rms) / max(float(n), 1.0) ** 0.5
3441
- if sigma < ambiguity_px / 4:
3442
+ if sigma < ambiguity_px / 2:
3442
3443
  return False, (f"first stage {mode} from {n} cross-correlation points pins the offset to "
3443
- f"{sigma:.3f} px (< ambiguity/4 = {ambiguity_px / 4:.3f} px)")
3444
- return True, f"first stage offset uncertain ({sigma:.3f} px >= ambiguity/4 = {ambiguity_px / 4:.3f} px)"
3444
+ f"{sigma:.3f} px (< ambiguity/2 = {ambiguity_px / 2:.3f} px)")
3445
+ return True, f"first stage offset uncertain ({sigma:.3f} px >= ambiguity/2 = {ambiguity_px / 2:.3f} px)"
3445
3446
 
3446
3447
  def _resolve_esd_ambiguity(self, ref_complex, sec_complex, ambiguity_px: float, k_max: int = 4,
3447
3448
  max_cols: int = 1536, k_limit: int = 15):
pygeofetch/meta.yaml CHANGED
@@ -1,4 +1,4 @@
1
- {% set version = "2.7.0.6.4" %}
1
+ {% set version = "2.7.0.7.4" %}
2
2
 
3
3
  package:
4
4
  name: pygeofetch
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pygeofetch
3
- Version: 2.7.0.6
3
+ Version: 2.7.0.7
4
4
  Summary: Universal satellite data pipeline + geospatial processing platform
5
5
  Author-email: Samuel Appiah Kubi <appiahkubis14@gmail.com>
6
6
  License: MIT License
@@ -371,7 +371,7 @@ If you use PyGeoFetch in your research or operational work, please cite it using
371
371
  title = {PyGeoFetch: A Unified Python Framework for Multi-Provider Satellite Data Acquisition, Pre-download Quality Control, and Geospatial Processing},
372
372
  year = {2026},
373
373
  publisher = {Zenodo},
374
- version = {2.7.0.6.1},
374
+ version = {2.7.0.7.1},
375
375
  doi = {10.5281/zenodo.22087230},
376
376
  url = {https://doi.org/10.5281/zenodo.22087230}
377
377
  }
@@ -1,5 +1,5 @@
1
- pygeofetch/__init__.py,sha256=O18_DPgWq5U5jEMmXFnCK8Bfp2Rrs6uOQ93W07Fmkhg,2107
2
- pygeofetch/meta.yaml,sha256=sc3OupnE1gfT0Ns2pyT3QT8NJalX_h5heL4-8Um8AYI,1284
1
+ pygeofetch/__init__.py,sha256=4UMGqimX-8ALiylE8OCiKucRqecNrMdNG3BqFtikJUc,2107
2
+ pygeofetch/meta.yaml,sha256=ZzcWq_SeWSxpeCl5tu2bho3PxJ0mp4ptoZ7VKxT8RME,1284
3
3
  pygeofetch/cli/__init__.py,sha256=QZMIIHEgmjGFieucqq9fZ5uephxP9-jdu1s8Q4qqw8o,30
4
4
  pygeofetch/cli/auth_commands.py,sha256=OUYbInPaERvAfNZ_NmAF3azHoJm14cGn_ZTQtxjjcs4,7871
5
5
  pygeofetch/cli/classify_commands.py,sha256=0att8QoTKPa-z24NXLTW-iXbpkBWZTxjoZkV1eNwHeU,4739
@@ -45,17 +45,17 @@ pygeofetch/insar/annotation.py,sha256=hQf_SnvcMpKanCdIaX3yTdygxhd57sJtz_3_L83zRm
45
45
  pygeofetch/insar/atmosphere.py,sha256=frOTzYxIz33L4vPxbCQ4fVSkY2c_BZqHwIUoi4grK2Y,23032
46
46
  pygeofetch/insar/atmosphere_core.py,sha256=enrcd-wCpc9uZgKIeYa2Wp5ZRpd6IhwkPUbbyOkeXGk,20880
47
47
  pygeofetch/insar/auto_fallback.py,sha256=zBZuFpfn4FCHmW9GZ_D5YbVEvA-yjFLCT4gizuSI_OE,14612
48
- pygeofetch/insar/coregister.py,sha256=bmM4tcAZiMDaqqwiPFyrGUFTJm_u5oDbOni6jOzPa0Q,74225
48
+ pygeofetch/insar/coregister.py,sha256=Z39BAT_WJ4oXwQ6OQA4i0j5lnRjV_A7LAqmWJYcLOSk,74956
49
49
  pygeofetch/insar/deburst.py,sha256=dzdB-jMupkalvUXoNxalLD31HNkMqyyXagpE5XSXT1g,8017
50
50
  pygeofetch/insar/errors.py,sha256=KTgmnGS05kgjZJdFAB3frPZC_eGrOE3xqZq-ORwOsd0,6625
51
51
  pygeofetch/insar/esd.py,sha256=PvvEUFPx1kvy6AI4pntowzUxssSeDK8FZfqw9nQhD2s,34392
52
- pygeofetch/insar/extraction.py,sha256=J6YjszYvHi6lizX5vGq71KuMLHmYqtdG-oDUUb60adg,41417
52
+ pygeofetch/insar/extraction.py,sha256=fZf9UOYhBvMkADniO9eCcqF6pfae2K0pa7hXGAnr8K4,41972
53
53
  pygeofetch/insar/feasibility.py,sha256=4301EIaqy4jtME1NaNvIwSyqJY7ZH39Hto6Uk0c_M5Q,13371
54
54
  pygeofetch/insar/flatearth.py,sha256=gSUdDcHlxs3P2TrUkKFkIwq7GftKVOit0A47CaBKIvc,13566
55
55
  pygeofetch/insar/geolocation.py,sha256=7T84uNHIXGmuOCvru9CJkFrnet4HX3t-thXXro2peRk,34163
56
56
  pygeofetch/insar/gpu.py,sha256=tMQSurv6EmmQMFU-e9--ssZo0YRUooPRHyU0V8jamIQ,5726
57
57
  pygeofetch/insar/hybrid_unwrap.py,sha256=PT4G9UPTrMqftaMjFd0i9DkwmtRZXAqN504eLYc22ds,18477
58
- pygeofetch/insar/interferogram.py,sha256=ib8bCmSLxQwqaX-rTlCXLWOsxYY86JtnNflhOFA2SU8,188375
58
+ pygeofetch/insar/interferogram.py,sha256=ErDVzXDvGkNlpQ_Vpwu_55sEYvqM8pS5rPZ1xmroaQg,188488
59
59
  pygeofetch/insar/ionosphere.py,sha256=erfzXKGxWLcLvNZznBCx42t6V05oO3M9q-nbrGzrKyc,30987
60
60
  pygeofetch/insar/learned_unwrap.py,sha256=lSX_u-2U5mm8lRKhO0xBMk1dVYcR3wDh6pFWcPdR350,45950
61
61
  pygeofetch/insar/logs.py,sha256=lQliMDJmt15NTz8Xgqg1EzENA3WUFY48u2xRqvSoB1U,2453
@@ -170,7 +170,14 @@ pygeofetch/viz/__init__.py,sha256=bSgK_f_goAHVQOfYu2nbPFVushvsy2hVKBvIBoGonyk,53
170
170
  pygeofetch/viz/insar.py,sha256=SaHBsbmvxAF4dLYptePX3wvKWV8Y2Sxqn8pFDjvyXuk,56742
171
171
  pygeofetch/viz/map.py,sha256=f8whny5mnz7gDsStNdgtVSpqTNHSDhSZoRT2Qs-Lvos,16403
172
172
  pygeofetch/viz/plot.py,sha256=JybD4qElJBOTvWCu7VllL5DqkKFYf5ttJdFfsgApfLE,56601
173
- pygeofetch-2.7.0.6.dist-info/licenses/LICENSE,sha256=zavMyhODD6NvZTmmKFEtATrngwY4CU_NEtY7lhjxGnI,1075
173
+ pygeofetch-2.7.0.7.dist-info/licenses/LICENSE,sha256=zavMyhODD6NvZTmmKFEtATrngwY4CU_NEtY7lhjxGnI,1075
174
+ pygeofetch_crop_fix_part8/pygeofetch/insar/coregister.py,sha256=Z39BAT_WJ4oXwQ6OQA4i0j5lnRjV_A7LAqmWJYcLOSk,74956
175
+ pygeofetch_crop_fix_part8/pygeofetch/insar/esd.py,sha256=PvvEUFPx1kvy6AI4pntowzUxssSeDK8FZfqw9nQhD2s,34392
176
+ pygeofetch_crop_fix_part8/pygeofetch/insar/extraction.py,sha256=fZf9UOYhBvMkADniO9eCcqF6pfae2K0pa7hXGAnr8K4,41972
177
+ pygeofetch_crop_fix_part8/pygeofetch/insar/interferogram.py,sha256=ErDVzXDvGkNlpQ_Vpwu_55sEYvqM8pS5rPZ1xmroaQg,188488
178
+ pygeofetch_crop_fix_part8/pygeofetch/insar/tops.py,sha256=ozA8SjgqO6bN8cwwQzKlJS7sQqZmrabISBhRV8H_0hg,20847
179
+ pygeofetch_crop_fix_part8/tests/insar/test_crop_offset.py,sha256=bZHji2tcqyaXNfQsBNM71xxIEKkpIexom-hX5hj43qo,3737
180
+ pygeofetch_crop_fix_part8/tests/insar/test_tops_deramp.py,sha256=_j03trOmKoOt5-5hDSSnyq9xQZ2ZDaHPcRPTGiIjyRE,12641
174
181
  pygeofetch_tops_fix_part4/files/pygeofetch/insar/coregister.py,sha256=bmM4tcAZiMDaqqwiPFyrGUFTJm_u5oDbOni6jOzPa0Q,74225
175
182
  pygeofetch_tops_fix_part4/files/pygeofetch/insar/interferogram.py,sha256=UQb_l3oOhxR_Dy-f1Uc3YoqlzFz6SPCTz89EiuKn-U0,178492
176
183
  pygeofetch_tops_fix_part4/files/pygeofetch/insar/tops.py,sha256=-yIthiWED20u7t10m8M3AHEBaa8PDS_rvS-oDnYevgM,18459
@@ -195,8 +202,8 @@ pygeofetch_tops_fix_part7/pygeofetch/insar/tops.py,sha256=ozA8SjgqO6bN8cwwQzKlJS
195
202
  pygeofetch_tops_fix_part7/tests/insar/_fake_safe.py,sha256=-ntqxg2Ln-8ZHxC3Waq1qTbVNAj5Iwj40Bc49Q9kD_A,3356
196
203
  pygeofetch_tops_fix_part7/tests/insar/_tops_sim.py,sha256=t6-ahcc9unf2aLqFTmdMWMeN9gGgU7bFG2ddWS5ZVzY,4776
197
204
  pygeofetch_tops_fix_part7/tests/insar/test_tops_deramp.py,sha256=vWorPj79Y0Zwd0_seEV-t8WYeXOH_5oCgW1zUfnnC3s,12633
198
- pygeofetch-2.7.0.6.dist-info/METADATA,sha256=2dbyK0bAoDxCdoJkO10aVF5nxU6SK5nSCypefqgG_X4,25014
199
- pygeofetch-2.7.0.6.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
200
- pygeofetch-2.7.0.6.dist-info/entry_points.txt,sha256=dHiUXLF5xNJ8vgtXZoUQNleEMQUeDPZiKQOE1tW8SDY,55
201
- pygeofetch-2.7.0.6.dist-info/top_level.txt,sha256=9eHek70wg-Vt21GG0ulmDtyOF9Aov2JqpGwmXvMUs9I,115
202
- pygeofetch-2.7.0.6.dist-info/RECORD,,
205
+ pygeofetch-2.7.0.7.dist-info/METADATA,sha256=Ss5X3RcqapoR61c14ZxMugebWgHJTllNz3DSNLTeF3c,25014
206
+ pygeofetch-2.7.0.7.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
207
+ pygeofetch-2.7.0.7.dist-info/entry_points.txt,sha256=dHiUXLF5xNJ8vgtXZoUQNleEMQUeDPZiKQOE1tW8SDY,55
208
+ pygeofetch-2.7.0.7.dist-info/top_level.txt,sha256=7XVbuEgJvPCOra9MYwPp2Fdaxc-XCkIKVBFLm-XhJ-8,141
209
+ pygeofetch-2.7.0.7.dist-info/RECORD,,
@@ -1,4 +1,5 @@
1
1
  pygeofetch
2
+ pygeofetch_crop_fix_part8
2
3
  pygeofetch_tops_fix_part4
3
4
  pygeofetch_tops_fix_part5
4
5
  pygeofetch_tops_fix_part6