Skip to content

Require a matching mission when checking for an existing orbit - #87

Merged
scottstanie merged 2 commits into
scottstanie:masterfrom
yuankailiu:fix-skip-check-mission
Sep 21, 2026
Merged

scottstanie merged 2 commits into
scottstanie:masterfrom
yuankailiu:fix-skip-check-mission

Conversation

@yuankailiu

@yuankailiu yuankailiu commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor

Hello Scott,

find_scenes_to_download() skips a scene as soon as any orbit file in the save
directory covers its same start time:

if any(parsed_file.start_time in orbit for orbit in current_eofs):

The check only looks at the validity window, so an orbit belonging to a different platform (s1a, s1b, s1c, ...) counts just as well.

I think POEORB windows run the same 22:59~22:59 time span for every S1 mission, which means that once the save
directory holds one mission's file for a given day, scenes from the other missions on tht same day are treated as already downloaded, thus will be ignored.

For example, with

S1B_OPER_AUX_POEORB_OPOD_20210313T235723_V20180720T225942_20180722T005942.EOF
already in the save directory, the scene

S1A_IW_SLC__1SDV_20180721T225743_20180721T225813_022898_027BD5_F737
is treated as "already have EOF file" and no S1A orbit is ever fetched.

Nothing fails at this point and eof exits 0, so the missing stuff is invisible until something downstream goes looking for that orbit which is not there. For me, it shows up on stacks that mix S1A/S1B/S1C.

This PR adds the mission check to the condition... Please take a look if it is helpful.

find_scenes_to_download() decided a scene already had its orbit by testing
time containment alone:

    if any(parsed_file.start_time in orbit for orbit in current_eofs):

Orbit validity windows are near-identical across missions, so an orbit for
a *different* mission covering the same window silently satisfies the check.
An S1B POEORB covering V20180720T225942_20180722T005942 makes an S1A scene
from 2018-07-21T22:57 look already-downloaded, and its S1A orbit is never
fetched. Nothing errors -- the scene is simply logged as "already have EOF
file", and the gap only surfaces later in a downstream processor that looks
for a same-mission orbit and finds none.

On one Sentinel-1 stack (2789 scenes, S1A/S1B/S1C mixed) this left 206
acquisition dates with no correct-mission orbit.

Also require the mission to match.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@yuankailiu yuankailiu changed the title Only skip a scene when an orbit for the same mission exists Require a matching mission when checking for an existing orbit Sep 20, 2026
@scottstanie

Copy link
Copy Markdown
Owner

Thanks for catching this! checking that there's not another similar edge case with RESORBs too

@scottstanie

scottstanie commented Sep 21, 2026 •

Copy link
Copy Markdown
Owner

Ok so Claude's follow up commits: two scenes from different platforms sharing a start second drop a mission from missions
Added regression tests for this too

The skip-if-already-downloaded check now requires a matching mission, but
the de-duplication of already-seen scenes a few lines above still keyed on
the start time alone. Two scenes from different platforms sharing a start
second would drop one mission from `missions`, which `download_eofs` zips
against `orbit_dts` -- the same silently-missing-orbit failure.

`find_scenes_to_download` had no coverage of the skip branch at all, since
the existing test never puts an .EOF in the save directory. Tests now cover
another mission's orbit not suppressing a scene, a matching mission's orbit
still suppressing it, and two missions sharing a start time both surviving.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@scottstanie
scottstanie force-pushed the fix-skip-check-mission branch from 2e8822a to 665ff4b Compare September 21, 2026 14:06
@scottstanie
scottstanie merged commit 1b20ef0 into scottstanie:master Sep 21, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants