Skip to content

Commit

Permalink
Ecocounter discontinuities table (#831)
Browse files Browse the repository at this point in the history
* first stab at a discontinuities table

* do REFERENCE correctly

* fix other syntax errors

where is my brain today

* add primary key to allow manual editing

* remove flow_id reference, add table comment

* remove outdated comment

* add some preliminary documentation

* re-wording
  • Loading branch information
Nate-Wessel authored Feb 7, 2024
1 parent af2c69d commit 890d214
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
7 changes: 7 additions & 0 deletions volumes/ecocounter/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@ Some of the newer sites have flows labelled in the system as "IN" and "OUT". Bel
From an email from Pierre, of Ecocounter:
> The IN and OUT disparities are configured during the setup of the counter. With the Zelt system that you own, there can only be two directions: IN and OUT, but there can be several flows. In the case of Murray Ross Parkway, some details about the direction were left in the comments section: IN – Northbound. In the following two examples, both counting sites have four loops installed on the bike paths, but in one case, four flows were configured, and only two for the second site. In the first example, both IN flows have the same name, but they have different flowId.
## Discontinuities

In January of 2024, it was determined that several sites were undercounting relative to other counting methods. To address this, the sensitivity of these sites was increased.
As a result of the change however, we now expect to have some degree of discontinuity in the data where counts before and after a certain point in time may not be directly comparable.

While we're still working through how best to handle this, we have recorded the times and sites that were effected in a new table, `ecocounter.discontinuities`.

## Using the Ecocounter API

The documentation for the Ecocounter API lives here: https://developers.eco-counter.com/
Expand Down
17 changes: 17 additions & 0 deletions volumes/ecocounter/tables/discontinuities.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
CREATE TABLE ecocounter.discontinuities (
uid serial PRIMARY KEY,
site_id numeric NOT NULL REFERENCES ecocounter.sites (site_id),
-- moment the change takes place
break timestamp NOT NULL,
-- approximate bounds if the precise time is not known
give_or_take interval,
-- required description of what changed - be verbose!
notes text NOT NULL
);

ALTER TABLE ecocounter.discontinuities OWNER TO ecocounter_admins;

GRANT SELECT ON ecocounter.discontinuities TO bdit_humans;

COMMENT ON TABLE ecocounter.discontinuities
IS 'Moments in time when data collection methods changed in such a way that we would expect clear pre- and post-change paradigms that may not be intercomparable.';

0 comments on commit 890d214

Please sign in to comment.