Skip to content

Commit

Permalink
Merge pull request #1222 from wadpac/issue1221_undo_change_part4_reDST
Browse files Browse the repository at this point in the history
undo 3 line changes from commit 3b9e2b7, fixes #1221
  • Loading branch information
vincentvanhees authored Nov 6, 2024
2 parents 90c4b3a + eb83e30 commit a9d043f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

- Part 1: Tidied up code in internal function detect_nonwear_clipping.R to ease future reviews. #1212

- Part 4: Undo changes to 3 line in g.part4 function from commit 3b9e2b7 (in between 3.1-1 and 3.1-2 release in June 2024) which broke functionality for handling sleep that starts before the double DST hour in the autumn and ends inside it. #1221

# CHANGES IN GGIR VERSION 3.1-4

- Part 3: Update threshold used for HorAngle to 60 degree, and auto-setting HASPT.ignore.invalid to NA when NotWorn guider is used. #1186
Expand Down
7 changes: 4 additions & 3 deletions R/g.part4.R
Original file line number Diff line number Diff line change
Expand Up @@ -814,9 +814,10 @@ g.part4 = function(datadir = c(), metadatadir = c(), f0 = f0, f1 = f1,
# in the autumn and ends inside the dst hour
negval = which(nocs < 0)
if (length(negval) > 0) {
kk0 = as.numeric(spocum.t$start[negval]) # episode onsets
kk1 = as.numeric(spocum.t$end[negval]) + 1 # episode endings
nocs[negval] = kk1 - kk0
kk0 = as.numeric(spocum.t$start[which(spocum.t$overlapGuider == 1)]) # episode onsets
kk1 = as.numeric(spocum.t$end[which(spocum.t$overlapGuider == 1)]) # episode endings
kk1[negval] = kk1[negval] + 1
nocs = kk1 - kk0
}
if (length(nocs) > 0) {
spocum.t.dur.noc = sum(nocs)
Expand Down

0 comments on commit a9d043f

Please sign in to comment.