API allows scenes without Copernicus DEM coverage over the antimeridian to be submitted for processing

Open
#1,989 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
api, backend

Research direction

Start by reading hyp3_api.validation.check_dem_coverage() and trace how it uses granule polygons when checking Copernicus DEM coverage. Reproduce the antimeridian case with the example Sentinel-1 scene and verify that the API rejects scenes whose geometry has no DEM coverage. The issue does not name a test file; add or locate a validation test for the example geometry and confirm ordinary coverage checks still work.

Written by the indexing model from the issue text.

Description

bug

Scenes crossing the antimeridian that do not have Copernicus DEM coverage can be submitted for RTC/InSAR processing but will ultimately fail during processing.

For example, an RTC_GAMMA job for S1A_IW_GRDH_1SDV_20201218T063902_20201218T063931_035736_042E94_0235 can be submitted to the API, but fails during processing with hyp3lib.exceptions.DemError: Copernicus GLO-30 Public DEM does not intersect this geometry:

https://hyp3-api.asf.alaska.edu/jobs/26cec4ea-db07-4dcb-832b-878861515c17

12/27/2023 11:18:48 PM - INFO - Downloading https://sentinel1.asf.alaska.edu/GRD_HD/SA/S1A_IW_GRDH_1SDV_20201218T063902_20201218T063931_035736_042E94_0235.zip
12/27/2023 11:19:02 PM - INFO - Unzipping S1A_IW_GRDH_1SDV_20201218T063902_20201218T063931_035736_042E94_0235.zip
12/27/2023 11:19:12 PM - INFO - Downloading orbit file for S1A_IW_GRDH_1SDV_20201218T063902_20201218T063931_035736_042E94_0235
12/27/2023 11:19:14 PM - INFO - Downloading https://zipper.dataspace.copernicus.eu/download/0d7cb598-ba10-4702-bad4-310bee81538a
12/27/2023 11:19:17 PM - INFO - Got orbit file S1A_OPER_AUX_POEORB_OPOD_20210318T220737_V20201217T225942_20201219T005942.EOF from provider ESA
12/27/2023 11:19:17 PM - INFO - Parameters for this run:
12/27/2023 11:19:17 PM - INFO -     SAFE directory            : S1A_IW_GRDH_1SDV_20201218T063902_20201218T063931_035736_042E94_0235.SAFE
12/27/2023 11:19:17 PM - INFO -     Output resolution         : 30.0
12/27/2023 11:19:17 PM - INFO -     Radiometry                : gamma0
12/27/2023 11:19:17 PM - INFO -     Scale                     : power
12/27/2023 11:19:17 PM - INFO -     Speckle filter            : False
12/27/2023 11:19:17 PM - INFO -     DEM matching              : False
12/27/2023 11:19:17 PM - INFO -     Include DEM               : False
12/27/2023 11:19:17 PM - INFO -     Include inc. angle map    : False
12/27/2023 11:19:17 PM - INFO -     Include scattering area   : False
12/27/2023 11:19:17 PM - INFO -     Include RGB decomposition : False
12/27/2023 11:19:17 PM - INFO -     Orbit file                : S1A_OPER_AUX_POEORB_OPOD_20210318T220737_V20201217T225942_20201219T005942.EOF
12/27/2023 11:19:17 PM - INFO -     Output name               : S1A_IW_20201218T063902_DVP_RTC30_G_gpuned_D962
12/27/2023 11:19:17 PM - INFO -     DEM name                  : copernicus
12/27/2023 11:19:17 PM - INFO - Preparing DEM
Traceback (most recent call last):
  File "/usr/local/bin/hyp3_gamma", line 8, in <module>
    sys.exit(main())
  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 111, in rtc
    product_name = rtc_sentinel_gamma(
  File "/usr/local/lib/python3.10/dist-packages/hyp3_gamma/rtc/rtc_sentinel.py", line 345, in rtc_sentinel_gamma
    dem_image, dem_par, dem_type = prepare_dem(safe_dir, dem_name, bbox, dem, resolution)
  File "/usr/local/lib/python3.10/dist-packages/hyp3_gamma/rtc/rtc_sentinel.py", line 169, in prepare_dem
    prepare_dem_geotiff(dem_tif, geometry, pixel_size)
  File "/usr/local/lib/python3.10/dist-packages/hyp3_gamma/dem.py", line 97, in prepare_dem_geotiff
    raise DemError(f'Copernicus GLO-30 Public DEM does not intersect this geometry: {geometry}')
hyp3lib.exceptions.DemError: Copernicus GLO-30 Public DEM does not intersect this geometry: MULTIPOLYGON (((179.752365 -21.707975,180.0 -22.5992797013829,180.0 -23.497875754304,177.795349 -24.019802,177.341919 -22.276783,179.752365 -21.707975)),((-179.765747 -23.442419,-180 -23.497875754304,-180 -22.5992797013829,-179.765747 -23.442419)))

The hyp3_api.validation.check_dem_coverage() validator does not account for granule polygons crossing the antimeridian, so the polygon is assumed to wrap the wrong way around the earth.

Dominant language
Python
Stars
53
Forks
13
Avg merge
1d 2h
Merged PRs (30d)
20

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ASFHyP3/hyp3

All issues in ASFHyP3/hyp3

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.