You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The insar workflow and INSAR_GAMMA jobs in HyP3 may fail with this stack trace when generating a water mask prior to phase unwrapping:
File "/usr/local/lib/python3.10/dist-packages/hyp3_gamma/__main__.py", line 38, in main
process_entry_point.load()()
File "/usr/local/lib/python3.10/dist-packages/hyp3_gamma/__main__.py", line 185, in insar
product_name = insar_sentinel_gamma(
File "/usr/local/lib/python3.10/dist-packages/hyp3_gamma/insar/ifm_sentinel.py", line 427, in insar_sentinel_gamma
coords, ref_point_info = unwrapping_geocoding(reference, secondary, step="man", rlooks=rlooks, alooks=alooks,
File "/usr/local/lib/python3.10/dist-packages/hyp3_gamma/insar/unwrapping_geocoding.py", line 253, in unwrapping_geocoding
get_water_mask(f"{ifgname}.adf.cc", width, lt, demw, demn, dempar)
File "/usr/local/lib/python3.10/dist-packages/hyp3_gamma/insar/unwrapping_geocoding.py", line 150, in get_water_mask
create_water_mask(f'{temp_dir}/tmpgtiff_mask_geo.tif', 'water_mask.tif')
File "/usr/local/lib/python3.10/dist-packages/hyp3_gamma/water_mask.py", line 71, in create_water_mask
mask = gpd.clip(mask, envelope)
File "/usr/local/lib/python3.10/dist-packages/geopandas/tools/clip.py", line 192, in clip
clipped = _clip_gdf_with_mask(gdf, combined_mask)
File "/usr/local/lib/python3.10/dist-packages/geopandas/tools/clip.py", line 69, in _clip_gdf_with_mask
] = gdf_sub.geometry.values[non_point_mask].intersection(mask)
File "/usr/local/lib/python3.10/dist-packages/geopandas/array.py", line 671, in intersection
self._binary_method("intersection", self, other), crs=self.crs
File "/usr/local/lib/python3.10/dist-packages/geopandas/array.py", line 611, in _binary_method
return getattr(vectorized, op)(left._data, right, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/geopandas/_vectorized.py", line 942, in intersection
return _binary_geo("intersection", data, other)
File "/usr/local/lib/python3.10/dist-packages/geopandas/_vectorized.py", line 306, in _binary_geo
data[:] = [
File "/usr/local/lib/python3.10/dist-packages/geopandas/_vectorized.py", line 307, in <listcomp>
getattr(s, op)(right) if s is not None and right is not None else None
File "/usr/lib/python3/dist-packages/shapely/geometry/base.py", line 689, in intersection
return geom_factory(self.impl['intersection'](self, other))
File "/usr/lib/python3/dist-packages/shapely/topology.py", line 72, in __call__
self._check_topology(err, this, other)
File "/usr/lib/python3/dist-packages/shapely/topology.py", line 37, in _check_topology
raise TopologicalError(
shapely.errors.TopologicalError: The operation 'GEOSIntersection_r' could not be performed. Likely cause is invalidity of the geometry <shapely.geometry.multipolygon.MultiPolygon object at 0x7f8d9ef30100>
To date, we've seen this error for these InSAR pairs run with looks=10x2 and apply_water_mask=true:
This issue was first observed on 2023-11-16 and was likely introduced with the water masking changes in hyp3-gamma v6.4.1.
Per @cirrusasf :
Version does not work for some pairs, for example, The error that hyp3-gamma throw outs is related to water_mask code. THe error: File "/usr/local/lib/python3.10/dist-packages/hyp3_gamma/water_mask.py", line 71, in create_water_mask
mask = gpd.clip(mask, envelope)
It turns out the that geopandas.clip() will fail if both mask and envelope are in projection coordinates and the mask is very large. If we change them into wgs84 coordinates, it works.
The text was updated successfully, but these errors were encountered:
The bug
The
insar
workflow andINSAR_GAMMA
jobs in HyP3 may fail with this stack trace when generating a water mask prior to phase unwrapping:To date, we've seen this error for these InSAR pairs run with
looks=10x2
andapply_water_mask=true
:This issue was first observed on 2023-11-16 and was likely introduced with the water masking changes in hyp3-gamma v6.4.1.
Per @cirrusasf :
Version does not work for some pairs, for example, The error that hyp3-gamma throw outs is related to water_mask code. THe error: File "/usr/local/lib/python3.10/dist-packages/hyp3_gamma/water_mask.py", line 71, in create_water_mask
mask = gpd.clip(mask, envelope)
It turns out the that geopandas.clip() will fail if both mask and envelope are in projection coordinates and the mask is very large. If we change them into wgs84 coordinates, it works.
The text was updated successfully, but these errors were encountered: