From eb1b43734074cbbed0e913303267e540a2d08d59 Mon Sep 17 00:00:00 2001 From: abradley60 Date: Fri, 13 Nov 2026 11:57:59 +1030 Subject: [PATCH 1/3] secondary antimeridian check for burst bounds --- sar_pipeline/pipelines/isce3_rtc/cli.py | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/sar_pipeline/pipelines/isce3_rtc/cli.py b/sar_pipeline/pipelines/isce3_rtc/cli.py index b844dfe8..8fb73953 100644 --- a/sar_pipeline/pipelines/isce3_rtc/cli.py +++ b/sar_pipeline/pipelines/isce3_rtc/cli.py @@ -520,14 +520,26 @@ def get_data_for_scene_and_make_run_config( "Downloading DEM Using the bounds covering the required bursts only." ) combined_burst_geom = shapely.ops.unary_union(burst_geoms_to_process) + # Run a secondary test to ensure burst shape does not cross antimeridian. + # Early 2016 scenes show scene geometries that DONT cross, but actually DO. logger.info( f"The shape covering the required bursts is : {combined_burst_geom}" ) - logger.info( - f"The bounds covering the required bursts are : {combined_burst_geom.bounds}" - ) - logger.info("Using the bounds for the required bursts.") - dem_bounds = combined_burst_geom.bounds + if check_shape_crosses_antimeridian(combined_burst_geom): + logger.warning( + f"The burst geometry crosses the antimeridian. scene : {scene}, burst shape : {combined_burst_geom}" + ) + # correct the burst bounds for the antimeridian crossing + dem_bounds = get_bounds_for_antimeridian_shape(combined_burst_geom) + logger.info( + f"Getting the corrected combined bursts bounds crossing the antimeridian : {dem_bounds}" + ) + else: + logger.info( + f"The bounds covering the required bursts are : {combined_burst_geom.bounds}" + ) + logger.info("Using the bounds for the required bursts.") + dem_bounds = combined_burst_geom.bounds logger.info(f"Downloading DEM type `{dem_type}` to path : {DEM_PATH}") if dem_type == "cop_glo30": From 24be5f095d0710487486e102f169885a8c94dd58 Mon Sep 17 00:00:00 2001 From: abradley60 Date: Fri, 13 Nov 2026 12:36:44 +1030 Subject: [PATCH 2/3] add buffer for antimeridian scenes --- sar_pipeline/pipelines/isce3_rtc/cli.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/sar_pipeline/pipelines/isce3_rtc/cli.py b/sar_pipeline/pipelines/isce3_rtc/cli.py index 8fb73953..e49fc544 100644 --- a/sar_pipeline/pipelines/isce3_rtc/cli.py +++ b/sar_pipeline/pipelines/isce3_rtc/cli.py @@ -522,19 +522,21 @@ def get_data_for_scene_and_make_run_config( combined_burst_geom = shapely.ops.unary_union(burst_geoms_to_process) # Run a secondary test to ensure burst shape does not cross antimeridian. # Early 2016 scenes show scene geometries that DONT cross, but actually DO. - logger.info( - f"The shape covering the required bursts is : {combined_burst_geom}" - ) if check_shape_crosses_antimeridian(combined_burst_geom): logger.warning( f"The burst geometry crosses the antimeridian. scene : {scene}, burst shape : {combined_burst_geom}" ) + # bursts cross even though the scene footprint does not; flag it for the DEM buffer + scene_crosses_antimeridian = True # correct the burst bounds for the antimeridian crossing dem_bounds = get_bounds_for_antimeridian_shape(combined_burst_geom) logger.info( f"Getting the corrected combined bursts bounds crossing the antimeridian : {dem_bounds}" ) else: + logger.info( + f"The shape covering the required bursts is : {combined_burst_geom}" + ) logger.info( f"The bounds covering the required bursts are : {combined_burst_geom.bounds}" ) @@ -557,12 +559,17 @@ def get_data_for_scene_and_make_run_config( ) elif dem_type in ["REMA_32", "REMA_10", "REMA_2"]: dem_resolution = int(dem_type.split("_")[1]) + buffer_pixels = int(40_000 / dem_resolution) # 40 km buffer at any resolution + if scene_crosses_antimeridian: + # shortcut: dem_handler only converts bbox corners to 3031, missing the edge bulge at 180°. + # Extra buffer covers typical scenes; pass densified 3031 bounds if coverage still fails. + buffer_pixels = int(buffer_pixels * 1.5) get_rema_dem_for_bounds( bounds=dem_bounds, bounds_src_crs=4326, save_path=DEM_PATH, resolution=dem_resolution, - buffer_pixels=1200, + buffer_pixels=buffer_pixels, ellipsoid_heights=True, download_geoid=True, geoid_tif_path=dem_folder / f"{scene}_geoid.tif", From 01e6f7eec10ad8931002a615769d7c97fdda0f53 Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Mon, 16 Nov 2026 02:26:23 +0000 Subject: [PATCH 3/3] revert padding for consistency --- sar_pipeline/pipelines/isce3_rtc/cli.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sar_pipeline/pipelines/isce3_rtc/cli.py b/sar_pipeline/pipelines/isce3_rtc/cli.py index e49fc544..ba7af616 100644 --- a/sar_pipeline/pipelines/isce3_rtc/cli.py +++ b/sar_pipeline/pipelines/isce3_rtc/cli.py @@ -559,7 +559,8 @@ def get_data_for_scene_and_make_run_config( ) elif dem_type in ["REMA_32", "REMA_10", "REMA_2"]: dem_resolution = int(dem_type.split("_")[1]) - buffer_pixels = int(40_000 / dem_resolution) # 40 km buffer at any resolution + # 38.4 km buffer at any resolution (1200 pix @ 32m) + buffer_pixels = int(38_400 / dem_resolution) if scene_crosses_antimeridian: # shortcut: dem_handler only converts bbox corners to 3031, missing the edge bulge at 180°. # Extra buffer covers typical scenes; pass densified 3031 bounds if coverage still fails.