From b8275dd1929c80147c62e0752f462d4ffc968620 Mon Sep 17 00:00:00 2001 From: Dan White Date: Fri, 23 Dec 2022 23:53:38 -0600 Subject: [PATCH] update analysis --- observations_analysis.sqbpro | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/observations_analysis.sqbpro b/observations_analysis.sqbpro index f793538..77a9813 100644 --- a/observations_analysis.sqbpro +++ b/observations_analysis.sqbpro @@ -1,13 +1,4 @@ -
INSERT OR REPLACE INTO times_index - SELECT id, strftime("%s", start), strftime("%s", end) -FROM observations -WHERE strftime("%s", start) <= strftime("%s", end);CREATE VIRTUAL TABLE times_index - USING rtree(id, start, end);select observer, count(vetted_status) from observations -WHERE vetted_status = "unknown" -GROUP BY observer -ORDER BY observer;select ground_station, norad_cat_id, count(id) from observations -GROUP BY ground_station, norad_cat_id -ORDER BY ground_station, count(id);create index if not exists gs_norad +
create index if not exists gs_norad_index on observations(ground_station, norad_cat_id); create index if not exists gs_index @@ -21,7 +12,26 @@ on observations(observer); create index if not exists observer_gs_index on observations(observer, ground_station); -select observer, ground_station, count(id) from observations +CREATE VIRTUAL TABLE IF NOT EXISTS times_index +USING rtree(id, start, end); + +INSERT OR REPLACE INTO times_index +SELECT id, strftime("%s", start), strftime("%s", end) +FROM observations +WHERE strftime("%s", start) <= strftime("%s", end); +select observer, count(vetted_status) from observations +WHERE vetted_status = "unknown" +GROUP BY observer +ORDER BY observer;select ground_station, norad_cat_id, count(id) from observations +GROUP BY ground_station, norad_cat_id +ORDER BY ground_station, count(id);select observer, ground_station, count(id) from observations GROUP BY observer, ground_station ORDER BY observer, count(id) DESC, ground_station; +select ground_station, observer, count(id) from observations +GROUP BY ground_station, observer +ORDER BY ground_station, count(id) DESC, observer; +-- WIP: how many different observers have used each GS? +select ground_station, count(*) from observations +GROUP BY ground_station, observer +ORDER BY count(distinct observer) DESC, ground_station;
-- 2.25.1