Skip to content

Commit

Permalink
only run longitudinal_axis extraction if sensor location is hip #1024
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentvanhees committed Jan 29, 2024
1 parent b60acb4 commit e19fd46
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions R/g.part3.R
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,16 @@ g.part3 = function(metadatadir = c(), f0, f1, myfun = c(),
load(paste(metadatadir, "/meta/basic/meta_", fnames[i], sep = ""))
load(paste(metadatadir, "/meta/ms2.out/", fnames[i], sep = ""))
if (M$filecorrupt == FALSE & M$filetooshort == FALSE) {
if (is.null(params_sleep[["longitudinal_axis"]])) {
# If user does not specify longitudinal axis explicitly then re-use
# estimated longitudinal axis from part 2
if (is.na(SUM$summary$if_hip_long_axis_id) == FALSE) {
params_sleep[["longitudinal_axis"]] = SUM$summary$if_hip_long_axis_id
} else {
# If not available default to 2
params_sleep[["longitudinal_axis"]] = 2
if (params_general[["sensor.location"]] == "hip") {
if (is.null(params_sleep[["longitudinal_axis"]])) {
# If user does not specify longitudinal axis explicitly then re-use
# estimated longitudinal axis from part 2
if (is.na(SUM$summary$if_hip_long_axis_id) == FALSE) {
params_sleep[["longitudinal_axis"]] = SUM$summary$if_hip_long_axis_id

Check warning on line 83 in R/g.part3.R

View check run for this annotation

Codecov / codecov/patch

R/g.part3.R#L83

Added line #L83 was not covered by tests
} else {
# If not available default to 2
params_sleep[["longitudinal_axis"]] = 2
}
}
}
SLE = g.sib.det(M, IMP, I, twd = c(-12,12),
Expand Down

0 comments on commit e19fd46

Please sign in to comment.