wadpac / GGIR

Code corresponding to R package GGIR
https://wadpac.github.io/GGIR/
Apache License 2.0
94 stars 60 forks source link

Error in if (is.na(defaultGuiderOnset) == TRUE) { => Recording with 1 midnight that starts before 4am #1160

Closed vincentvanhees closed 2 months ago

vincentvanhees commented 2 months ago

In function g.sib.det we consider the first night if it starts after midnight and before 4am and refer to this as night 0. However, this goes wrong when there is only one midnight in the recording. In that case countmidn is 1 and it sets firstmidnighti to 1, by which the first4am < firstmidnighti later on in the function returns FALSE.

To fix this we need to set firstmidnighti = midnightsi[1].