BiologicalRecordsCentre / SPRING

Repository for tracking issues for the SPRING (EU Pollinator Monitoring) project
GNU General Public License v3.0
0 stars 0 forks source link

Moth data entry - counts for inside and outside the trap #4

Closed DavidRoy closed 2 years ago

DavidRoy commented 2 years ago

Two column input for abundance: count individuals inside the trap count individuals outside the trap

JimBacon commented 2 years ago

If you are proposing that one occurrence record should have two different abundances, this may need careful consideration.

The cache tables, and hence reports, use the occurrence attribute marked with the system function of sex_stage_count to determine the count of an occurrence.

If we have two such attributes for an occurrence, the cache builder may not perform as expected. I can't quite figure in my head what the query will do but it might randomly return one or the other.

DavidRoy commented 2 years ago

Agreed. Needs some thinking through. One option is to submit a single total abundance but capture the separate breakdowns in two additional occurrence attributes?

JimBacon commented 2 years ago

Other options include:

The database set up and reporting would be identical in both these cases but the latter would be more effort to implement.

We could also create an input grid with two count columns that creates two occurrences behind the scenes. That is not an out-of-the-box solution and would need a couple of days development I should think.

The situation is analogous to recording male and female counts where we choose to create two occurrences distinguished by an attribute for sex.

JimBacon commented 2 years ago

The solution implemented is to have 3 attributes: Qty, Qty Inside and Qty Outside. JavaScript is used to hide the Qty column and to calculate its value from the sum of the other two. The maths allows for the fact that '0' means absent and ' ' means present but not counted. E.g. '0' + ' ' = ' ' Only the Qty attribute is given the sex-stage-count system function.