tmcd82070 / CAMP_RST

R code for CAMP rotary screw trap platform
1 stars 1 forks source link

Not Fishing as Applied to Zero Deletions #62

Closed jasmyace closed 8 years ago

jasmyace commented 8 years ago

It's clear to me, after dealing with some trouble spots in the zero deletion code of Task 2.2, that "Not Fishing" doesn't apply to the time period before the start of a season, but on the same day. So, for example, if a season was from January 1st through June 30th, and the first trap was set at 6 pm on January 1st, then the Not Fishing period on January 1st before 6 pm isn't included anywhere. This makes sense, in that I can believe the season started on that day at 6 pm, and no earlier. Practically, this means that the first temporal record for the season is always a record that reports some valid fishing.

So now, let's say that the first non-zero catch was on February 1st, via a trapping instance that started at 6pm. Just to be clear, this means that the trap was running from January 1, through January 31st, over several trapping instances, but didn't catch anything. Suppose also on February 1st, that we have several hours when the trap wasn't fishing. By design, Connie's query, which pulls data from January 1st through June 30th, inserts a "Not fishing" record on February 1st. This is because this "Not fishing" period is sandwiched between two periods of valid fishing.

Now, I come in and delete out all those January zeros. So, the resulting first line of the temporal trapping stream is now the "Not fishing" record. This causes the R code to abort.

To remedy this, I throw out these "Not fishing" records that occur before the "start" of the season, as defined by the first instance of non-zero catch. So, the season programmatically "starts" now on February 1st, at 6 pm. Practically, this means that no imputation occurs for those hours on February 1st prior to the valid trapping instance that catches the first fish. So then, the catch could possibly be biased downward a bit on this first day, if some portion of the day resulted in a trap not fishing, thus necessitating imputation.

I thought I should make you aware of this small technicality.

jasmyace commented 8 years ago

Let me know if at some point this appears to cause a problem. For now, I'm closing the issue.