Commit Graph

17 Commits

Author SHA1 Message Date
D. Berge
c9b9a009af Speed up the events view.
We do this with the help of some denormalisation
and a handy trigger.

Closes #35.
2020-09-14 03:01:55 +02:00
D. Berge
b5b91d41c9 Reset event serial ids after re-import.
When the database is recreated, the sequences
used in the events_timed and events_seq tables
will be at their initial values, which will
almost certainly conflict with existing data
when it is imported via COPY.

With this commit, we set the current value for
those sequences to something usable.

Fixes #33.
2020-09-14 01:36:40 +02:00
D. Berge
bda11cc22f Add raw_shots_preplots view.
Used by the QC routines.
2020-09-10 20:50:08 +02:00
D. Berge
48f2931a13 Change type of info table value to JSONB 2020-09-10 20:49:39 +02:00
D. Berge
906dcc6a7e Make event id serial rather than plain integer 2020-09-06 14:49:42 +02:00
D. Berge
3e949f6185 Add meta fields to schema.
Many tables now have a JSON (jsonb) column to
hold unstructured data.
2020-09-06 13:37:11 +02:00
D. Berge
1a9f04aa98 Add NTBP status information to sequences summary 2020-09-01 12:17:21 +02:00
D. Berge
242d35ec80 Update schema: add project summary tables 2020-08-26 20:14:07 +02:00
D. Berge
f3e8205adc Update schema: add sequences summary view 2020-08-25 17:59:56 +02:00
D. Berge
a9ad5e1c08 Update schema: add NTBA columns.
NTBA = Not To Be Acquired. We will ignore those lines
and points in our views / queries when considering
missing shots / completion rates.
2020-08-25 17:58:03 +02:00
D. Berge
1b549655fa Update schema (events).
Some columns have been renamed:

* ts0 → tstamp
* shotNumber → point

The ts1 column from events_timed has been removed.

Labels attached to a sequence / shot without an event
have been removed. All labels are now associated with events.

Changes to event views.
2020-08-22 20:19:39 +02:00
D. Berge
a588bfcb68 Add timed event labels to events view 2020-08-18 10:41:15 +02:00
D. Berge
2ee9b0cac8 Add midnight shot synthetic event.
It inserts `LDSP` and `FDSP` labels, if those exist
in the `labels` table, on the last and first shotpoints
of the day when a sequence is shot through midnight.

The server timezone is always set to UTC so the midnight
shot implicitly refers to UTC through this.
2020-08-13 23:44:25 +02:00
D. Berge
9871aebde6 Add event tables and views.
Events can be associated either with a timestamp *or* with a
sequence + shotpoint (but not both, for data integrity reasons).

Events and shotpoints can also have “labels” associated with them.
The difference between a comment and a label is that the former
is free text while the latter is predefined and has associated
properties (currently only for display, but could also have QC
related properties such as ensuring that there is only one “FSP”
label per sequence and so on).

The `events` view puts everything together into a coherent view.
Note that this view may produce multiple rows for the same
timestamp or shotpoint, for instance when the event has both
a text comment and one or more labels.
2020-08-12 11:24:52 +02:00
D. Berge
e4c512f3a2 Add raw data summary views.
The raw_lines_summary and raw_lines_summary_geometry
views are analogous to final_lines_summary and
final_lines_summary_geometry respectively.

One difference of note is that the final_ version
may report negative missing shots, while the raw_
versions assume that the user is not interested in
anything outside the preplot.
2020-08-11 15:35:39 +02:00
D. Berge
09e5d9048a Update SQL schema.
- The raw_shots and final_shots tables contain *shots*,
  as the name says, and nothing else.

- The objref is made an integer. This is consistent with
  P1/11 usage and for anything else a relation can be used.

- Raw and final shot tables also include the corresponding
  preplot line as well as the shot number. The preplot line
  is explicit in the P1/11s that we have seen and can otherwise
  be derived from the source geometry in the P1/11 or P1/90
  headers (provided those headers are correct). It is the
  import process' business to figure out what the preplot
  lines are if those are not explicitly given in the data.

- As a result of the above, some of the views have been
  re-written, hopefully in a simpler way.

- The shot_count view has been removed as it was neither used
  nor useful.
2020-08-10 22:43:07 +02:00
D. Berge
4c5d29494c Initial commit 2020-08-08 23:59:13 +02:00