From 1c6ef7ef0ba038ce5043f374e62bdf5f29710f8d Mon Sep 17 00:00:00 2001 From: Paul Grogan Date: Wed, 25 Nov 2026 22:55:36 -0700 Subject: [PATCH 1/4] Save runs under designs and compare them with the current results Saved runs may belong to a saved design: runs save under the saved design last opened or saved (the Analysis tab names it), list grouped under their designs, and move between designs. Designs count their runs, and deleting a design deletes its runs. GET /runs filters by design, and PATCH /runs changes a run's design (or none) as well as its name. The database schema (version 2) adds the design of runs; databases of version 1 migrate on first use, with their runs under no design. The runs dialog (now Compare runs) compares the current results, checked from the start, with saved runs, without saving them first; once saved, they compare as their saved run. The results dialog opens the comparison. --- src/static/analysis.js | 7 +- src/static/index.html | 16 +- src/static/index.js | 5 + src/static/library.js | 326 +++++++++++++++++++++++++++---- src/static/styles.css | 8 + src/tatc_app/library/database.py | 162 +++++++++++---- src/tatc_app/library/router.py | 58 +++++- src/tatc_app/library/schemas.py | 30 ++- tests/test_library.py | 116 +++++++++++ 9 files changed, 623 insertions(+), 105 deletions(-) diff --git a/src/static/analysis.js b/src/static/analysis.js index 41d30d3..82b488b 100644 --- a/src/static/analysis.js +++ b/src/static/analysis.js @@ -630,6 +630,8 @@ function showAnalysisData() { } const result = analysisResult.result; const type = analysisResult.type; + // results with a summary compare with saved runs (library.js) + const compare = result.summary && canCompareRuns(type) ? openRunsDialog : null; const number2 = function(v) { return Number(v).toFixed(2); }; // columns and values shared by the statistics of points const pointColumns = [ @@ -709,7 +711,8 @@ function showAnalysisData() { ? "Statistics of the coincident observations of each point over the analysis period: periods when enough platforms observe it at once." : "Statistics of each point over the analysis period. Overlapping observations by several satellites count once.") + (sufficiency ? " " + terms.revisitAxis + " runs from the end of one to the start of the next; times between samples run between their midpoints." : ""), - summary: result.summary ? function(container) { renderCoverageSummary(container, result.summary, terms); } : null + summary: result.summary ? function(container) { renderCoverageSummary(container, result.summary, terms); } : null, + onCompare: compare }); } else if (type == "latency") { const contacts = result.contacts; @@ -721,6 +724,7 @@ function showAnalysisData() { filename: "latency-points", note: "Statistics of each point over the analysis period.", summary: result.summary ? function(container) { renderLatencySummary(container, result.summary); } : null, + onCompare: compare, extras: [{ label: "Contacts CSV", filename: "latency-contacts.csv", @@ -787,6 +791,7 @@ function showAnalysisData() { note: "Periods over the analysis period when any part of the region is observed (overlapping observations merged). " + "Swaths show over the animation: click a row within it to jump to it.", summary: function(container) { renderRegionSummary(container, result.summary); }, + onCompare: compare, extras: [segments], onRowClick: function(row) { const start = Cesium.JulianDate.fromIso8601(row.start_utc); diff --git a/src/static/index.html b/src/static/index.html index cdcf7da..cbefb33 100644 --- a/src/static/index.html +++ b/src/static/index.html @@ -447,13 +447,14 @@
Orbit Preview
- -
+
@@ -938,7 +939,7 @@ - +
NameSatellitesSavedActions
NameSatellitesRunsSavedActions
@@ -955,7 +956,7 @@