Skip to content

Commit

Permalink
Moving rest analyses to new g.part5_analyseSegment function #687
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentvanhees committed Sep 1, 2023
1 parent 59887b0 commit b6e61da
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
17 changes: 2 additions & 15 deletions R/g.part5.R
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,8 @@ g.part5 = function(datadir = c(), metadatadir = c(), f0=c(), f1=c(),
fullFilename = fullfilenames[i],
add_one_day_to_next_date,
lightpeak_available, tail_expansion_log,
foldernamei = foldername[i])
foldernamei = foldername[i],
sibreport = sibreport)
# Extract essential object to be used as input for the next
# segment
indexlog = gas$indexlog
Expand All @@ -523,20 +524,6 @@ g.part5 = function(datadir = c(), metadatadir = c(), f0=c(), f1=c(),
ws3new = timeList$epochSize
if (doNext == TRUE) next
}
#=======================================================
# nap/sib/nonwear overlap analysis
#=======================================================
if (params_output[["do.sibreport"]] == TRUE) {
# sibreport = sibreport_backup
restAnalyses = g.part5.analyseRest(sibreport = sibreport, dsummary = dsummary,
ds_names = ds_names, fi = fi, di = di,
time = ts$time[sse[ts$diur[sse] == 0]],
tz = params_general[["desiredtz"]])
fi = restAnalyses$fi
di = restAnalyses$di
dsummary = restAnalyses$dsummary
ds_names = restAnalyses$ds_names
}
#===============================================
# FOLDER STRUCTURE
if (params_output[["storefolderstructure"]] == TRUE) {
Expand Down
15 changes: 14 additions & 1 deletion R/g.part5_analyseSegment.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ g.part5_analyseSegment = function(indexlog, timeList, levelList,
add_one_day_to_next_date,
lightpeak_available,
tail_expansion_log,
foldernamei) {
foldernamei, sibreport) {
# unpack list objects:
# indexlog
fileIndex = indexlog$fileIndex
Expand Down Expand Up @@ -449,6 +449,19 @@ g.part5_analyseSegment = function(indexlog, timeList, levelList,
fi = fi + length(luxperseg$values)
}
}
#=======================================================
# nap/sib/nonwear overlap analysis
#=======================================================
if (params_output[["do.sibreport"]] == TRUE) {
restAnalyses = g.part5.analyseRest(sibreport = sibreport, dsummary = dsummary,
ds_names = ds_names, fi = fi, di = si,
time = ts$time[sse[ts$diur[sse] == 0]],
tz = params_general[["desiredtz"]])
fi = restAnalyses$fi
si = restAnalyses$di
dsummary = restAnalyses$dsummary
ds_names = restAnalyses$ds_names
}
#===============================================
# FOLDER STRUCTURE
if (params_output[["storefolderstructure"]] == TRUE) {
Expand Down

0 comments on commit b6e61da

Please sign in to comment.