Skip to content

Ground track swaths over a region, with an animation duration - #17

Merged
ptgrogan merged 3 commits into
mainfrom
region-swath-coverage
Nov 25, 2026
Merged

ptgrogan merged 3 commits into
mainfrom
region-swath-coverage

Conversation

@ptgrogan

@ptgrogan ptgrogan commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Adds the coverage of a region to the Ground Track Swaths analysis, and an animation duration that limits the size of swath results over long periods.

What it does

POST /analyze/swaths takes an optional region: a polygon, a known shape, or a country code.

  • Without a region: unclipped swath segments, as before.
  • With a region: swaths clipped to it, plus a summary:
    • the share of its area observed over time (equal-area projection, WGS 84)
    • its observations (when any part of it is observed), revisit, and longest gap
    • optionally, coincident swaths: areas two platforms observe in common within max_time_difference, between member satellites or between satellites/constellations. Coincident swaths require a region.

Animation duration: swath requests now accept display.

  • Orbit tracks, swath segments, and coincident segments are returned only over the animation.
  • With a region, footprints are still sampled over the whole period, so the summary does not depend on the animation length.
  • Without a region, footprints are sampled only over the animation.
  • Without display, the whole period is animated every step, as on main.

Parallelism: work is split into windows of time (TATC_SWATH_WINDOW_STEPS, default 1440 steps). Without coincidence, windows are also split by member satellite.

POST /generate/region: returns the simplified outline of a region (GeoJSON), for display.

GUI

  • One "Ground Track Swaths" analysis with a "Limit to a region" option and coincident-swath settings.
  • The "Animate" length now applies to swaths, replacing the old 3-day duration cap.
  • With a region, results show a table of the region's observations, a summary, and a CSV of swath segments. Saved runs over a region can be compared.
  • Analyses without a grid (swaths) show the region as an outline and hide the Grid button and grid settings.
  • The region (grid or outline) now hides while results are shown.

Code

  • swaths/ holds the request, tasks, and router.
  • The previous swath code in tracking/ is removed.
  • region/ and /analyze/region were never released and are folded in.

Testing

  • 202 tests pass; black and isort are clean.
  • New tests: tests/test_swaths_region.py (window independence, animation vs. summary, systems, known shapes, saved runs, invalid requests), tests/test_region_outline.py, and animation/saved-run tests in tests/test_swaths.py.
  • Not yet tested in a browser. Please check:
    • swaths with and without a region, and with coincidence
    • the region outline for CONUS, USA, and a latitude band (two parallels, no line along 180°)
    • switching between coverage and swaths
    • re-running and comparing saved runs

Review notes

  • API: instrument_index keeps its default of 0 on /analyze/swaths. The GUI sends null (all instruments).
  • Saved runs: a swaths run has a summary only with a region, and only those can be compared.
  • Deployment: deploy workers before or with the server, so the new tatc_app.swaths.tasks are registered.

Coverage and coincidence requests take optional sample_size options. The
size of each observation's sample is the larger of its pixel and pixel
spacing, along and across track (tatc.analysis.compute_sample_sizes), for
pointed instruments and conical instruments with a beam width and scan
sample spacing. Coverage results give each point's median and smallest
sample size and counts of its observations, gridded to cells and
summarized (SampleSizeSummary). An optional max_sample_size drops coarser
observations before coverage (or coincidence) is computed; requests
with it are rejected if an analyzed instrument has no pixels.

Chunk tasks may give several tagged results (untag flattens them);
cells are gridded by a shared helper (analysis.gridding), which
sufficiency now uses. The instrument form adds pixel counts, overlap, and
scan period of pointed instruments, and beam width and sample spacing of
conical ones; the GUI adds the options, display modes, table columns, a
summary section, and rows of the comparison of saved runs.
A region analysis (/analyze/region) samples the footprints of instruments
every step over the analysis period, clipped to a region (a polygon,
known shape, country, or the globe), in parallel by windows of time with
every member satellite (tatc.analysis.collect_footprints). It gives the
swath segments over the region, the share of its area observed over time
(measured in an equal-area projection of the WGS 84 ellipsoid), and its
observations (collect_region_observations) with their revisit and longest
gap.

With coincidence, each window also pairs its footprints with those up to
max_time_difference after them (find_coincident_ground_track), between
member satellites or between satellites and constellations, giving the
areas observed in common over time and the time between paired
footprints. Window boundaries do not change the results (tested against
a direct computation).

The GUI adds the analysis with its options, CZML of swaths and common
areas, a table of observations, a summary, and the comparison of saved
runs; saved runs accept region.
The swath analysis (/analyze/swaths) takes an optional region, replacing
the separate region analysis (/analyze/region, unreleased): without a
region it gives unclipped swaths as before; with one, swaths clipped to
it and the summary of its coverage (area observed over time,
observations, revisit, and optionally coincident swaths, which now need
a region). The code moves from region/ and tracking/ to swaths/, and
saved runs of swaths carry a summary only with a region.

Swath analyses accept display times to limit the animation: orbit tracks
and swath (and coincident) segments are given only over them, limiting
the size of results of long periods. With a region, footprints are still
sampled over the whole analysis period, so its summary does not depend
on the animation; without one, only over the animation. Without
coincidence, windows are analyzed in parallel by member satellite.

The GUI merges the analyses (a "Limit to a region" option), shows the
animation length for swaths, and drops the shortened default duration.
Analyses without a grid show the region by its outline (from a new
/generate/region endpoint) and hide the grid controls; a global region
of swaths is the whole globe; and the region hides over results.
@ptgrogan ptgrogan changed the title Region swath coverage Ground track swaths over a region, with an animation duration Nov 25, 2026
@ptgrogan
ptgrogan merged commit 2350c63 into main Nov 25, 2026
2 checks passed
@ptgrogan
ptgrogan deleted the region-swath-coverage branch November 25, 2026 07:06
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.

1 participant