Skip to content

Commit

Permalink
Merge branch 'master' into issue1046_integrate_feedback_ch123_Gaia
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentvanhees committed Sep 2, 2024
2 parents 33dfc76 + 593a5b2 commit 1e15e08
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
- Improved logging of what guider was used when using NotWorn and optional backup guider, #1156

- Skip night in part 4 csv report if guider was NotWorn, #1156

- Part 5: Fixed bug in g.part5.wakesleepwindows causing the first SPT window in a recording incorrectly to be defined from the first timestamp in the recording. For details see: #1192


# CHANGES IN GGIR VERSION 3.1-3

Expand Down
9 changes: 4 additions & 5 deletions R/g.part5.wakesleepwindows.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,10 @@ g.part5.wakesleepwindows = function(ts, part4_output, desiredtz, nightsi,
w0 = w1 = rep(0,length(part4_output$calendar_date))
# Round seconds to integer number of epoch lengths (needed if cleaningcode = 5).
round_seconds_to_epochSize = function(x, epochSize) {
temp = as.numeric(unlist(strsplit(x,":")))
if (length(temp) == 3) {
if (temp[3] / epochSize != round(temp[3] / epochSize)) {
x = paste0(temp[1],":",temp[2],":",round(temp[3] / epochSize)*epochSize)
}
if (length(as.numeric(unlist(strsplit(x,":")))) == 3) {
xPOSIX = as.POSIXct(x, format = "%H:%M:%S")
xPOSIX_rounded = as.POSIXct(round(as.numeric(xPOSIX) / epochSize) * epochSize)
x = format(xPOSIX_rounded, format = "%H:%M:%S")
} else {
x = ""
}
Expand Down

0 comments on commit 1e15e08

Please sign in to comment.