Skip to content

Commit

Permalink
remove comments related to horAngle tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jhmigueles committed Dec 11, 2024
1 parent a5b27bb commit 0319544
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 27 deletions.
23 changes: 0 additions & 23 deletions R/HASPT.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,6 @@ HASPT = function(angle, sptblocksize = 30, spt_max_gap = 60, ws3 = 5,
}
return(invalid)
}
# handle_spt_gaps = function(s2, e2, s3, e3,
# spt_max_gap_epochs) {
# outofsptblock = integer()
# if (length(s3) > 0) { # there are at least 1 gap between candidate guider windows
# gaps = matrix(0, length(s3), 3) #characteristics of all gaps in between guider periods
# for (gapi in 1:length(s3)) {
# gaps[gapi,1] = abs(e2[gapi] - s2[gapi]) # length of guider preceding gap
# gaps[gapi,2] = abs(e3[gapi] - s3[gapi]) # length of gap
# gaps[gapi,3] = abs(e2[gapi + 1] - s2[gapi + 1]) # length of guider following gap
# if (gaps[gapi, 2] < spt_max_gap_epochs &
# (gaps[gapi, 2] / (gaps[gapi, 1] + gaps[gapi, 3])) < 0.3) {
# # if gap is < than spt_max_gap (60 min)
# # & gap < 30% of surrounding candidate spt windows
# # then fill gap between candidate spt blocks
# outofsptblock = c(outofsptblock, gapi)
# }
# }
# }
# invisible(outofsptblock)
# }
# main code -----------------
if (HASPT.algo != "notused") {
if (HASPT.algo == "HDCZA") { # original, default
Expand Down Expand Up @@ -137,9 +117,6 @@ HASPT = function(angle, sptblocksize = 30, spt_max_gap = 60, ws3 = 5,
e3 = e3[-length(e3)]
}
}
# spt_max_gap_epochs = (60/ws3)*spt_max_gap*1
# outofsptblock = handle_spt_gaps(s2, e2, s3, e3,
# spt_max_gap_epochs)
outofsptblock = which((e3 - s3) < ((60/ws3)*spt_max_gap*1))
if (length(outofsptblock) > 0) { # only fill up gap if there are gaps
s4 = s3[outofsptblock]
Expand Down
4 changes: 0 additions & 4 deletions R/g.sib.det.R
Original file line number Diff line number Diff line change
Expand Up @@ -289,15 +289,13 @@ g.sib.det = function(M, IMP, I, twd = c(-12, 12),
}
}
if (length(params_sleep[["def.noc.sleep"]]) == 1) {
# if (params_sleep[["HASPT.algo"]][guider_to_use] == "HorAngle") spt_max_gap = 30
spt_estimate = HASPT(angle = tmpANGLE, ws3 = ws3,
sptblocksize = sptblocksize, spt_max_gap = spt_max_gap,
HASPT.algo = params_sleep[["HASPT.algo"]][guider_to_use],
invalid = invalid[qqq1:qqq2], # load only invalid time in the night of interest (i.e., qqq1:qqq2)
HDCZA_threshold = params_sleep[["HDCZA_threshold"]],
HASPT.ignore.invalid = params_sleep[["HASPT.ignore.invalid"]],
activity = tmpACC)
# spt_max_gap = 60
} else {
spt_estimate = list(SPTE_end = NULL, SPTE_start = NULL, tib.threshold = NULL, part3_guider = NULL)
}
Expand Down Expand Up @@ -336,15 +334,13 @@ g.sib.det = function(M, IMP, I, twd = c(-12, 12),
}
}
}
# if (params_sleep[["HASPT.algo"]][guider_to_use] == "HorAngle") spt_max_gap = 30
spt_estimate_tmp = HASPT(angle = tmpANGLE, ws3 = ws3,
sptblocksize = sptblocksize, spt_max_gap = spt_max_gap,
HASPT.algo = params_sleep[["HASPT.algo"]][guider_to_use],
invalid = invalid[newqqq1:newqqq2],
HDCZA_threshold = params_sleep[["HDCZA_threshold"]],
HASPT.ignore.invalid = params_sleep[["HASPT.ignore.invalid"]],
activity = ACC[newqqq1:newqqq2])
# spt_max_gap = 60
if (length(spt_estimate_tmp$SPTE_start) > 0) {
# If new SPTE_end is beyond noon (qqq2) then use the new SPTE_end
if (spt_estimate_tmp$SPTE_end + newqqq1 >= qqq2) {
Expand Down

0 comments on commit 0319544

Please sign in to comment.