Closed dnahodil closed 8 years ago
Nice work @dnahodil, I agree with all assumptions in your document except the one below:
It is assumed that there is a 1:1 relationship between tags and transmitters such that given a
tag_id
ortransmitter_id
you can determine the other.
This is not the case, running the following query returned ~550 tag_ids associated with > 1 transmitter_id
SELECT tag_id, COUNT(transmitter_id) FROM aatams.sensor GROUP BY tag_id HAVING COUNT(transmitter_id) > 1 ORDER BY tag_id
Thanks @xhoenner, that's very interesting and something we'll need to look into!
@ktattersall asked a while ago to Colin Simpfendorfer whether it is possible for a tag (identified by serial number) to have more than one transmitter embedded/attached.
His response was: "A serial number should only have a single tag ID code associated with it. It may be possible though that a serial number has two possible tag ID codes. Vemco tags with temp and pressure sensors transmitted two different tag ID codes (one for each parameter), but would have a single serial number. I can’t remember how the database handles this – we would need to check with @jkburges."
My understanding:
Yes, confusing.
Not sure of the best place to make this comment, so I'll make it here...
As the document added in this PR describes, the AATAMS app makes several assumptions. Another way of looking at is that the data which is served up by AATAMS can be categorised, IMO, in to "raw" or "derived" data. The former being that which does not rely on any assumptions, the latter being that which does.
Examples of raw data:
transmitter ID
was detected by receiver
at time
species
was tagged with tag
at time
and location
Examples of derived data:
detection
at station
/location
is valid
and attached to species
From a user's (i.e. a scientist using the data in a study) perspective, I think it is pretty important to make this distinction clear, and also to publish what assumptions are being made.
It's worth noting that this document is meant to record the assumptions that the web-app code makes. So even if we (the humans) know it to be different, if the code makes a certain assumption it should be documented. That way, if an assumption looks particularly dangerous, we have to update the code to remove that assumption (and can then undocument the assumption).
Thanks for the input, all.
I've updated the document to no longer include the assumption about 1:1 transmitters to tags. @jkburges showed me in the detection_view
definition that the database does take into account the possibility of a n:1 relationship here.
1:1 transmitters to tags
transmitter IDs to tags is 1:n
e.g. "A69-1303-1234" may be the transmitter ID for a sensor on more than one physical tag.
:headsplosion:
Got it, and we're still okay.
This can be merged, @julian1. The changes it describes are now on master.
We need to wait until we have confirmed the fix, and determined what the effect of these changes will be on the monthly reports, before we merge this document.
Pretty happy if anyone has feedback on this as I'm not really sure what a good format is to document these assumptions.