Skip to content

Commit

Permalink
Update getToaYaps.R
Browse files Browse the repository at this point in the history
  • Loading branch information
baktoft committed Oct 31, 2024
1 parent 6160195 commit d3ef2d6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion R/getToaYaps.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,14 @@ getToaYaps <- function(synced_dat, hydros, rbi_min, rbi_max, pingType=NULL){
}

# build toa-matrix...
union_matchtol <- ifelse(rbi_min < 3, 5, 10) # try to fix for very short BIs


ts_focal <- splusTimeSeries::signalSeries(pos=floor(synced_dat[hydro_idx==1,eposync*10]), data=synced_dat[hydro_idx==1,eposync*10])
for(i in 2:nrow(hydros)){
# print(i)
xi <- splusTimeSeries::signalSeries(pos=floor(synced_dat[hydro_idx==i,eposync*10]), data=synced_dat[hydro_idx==i,eposync*10])
ts_focal <- splusTimeSeries::seriesMerge(ts_focal, xi, pos="union", matchtol=10)
ts_focal <- splusTimeSeries::seriesMerge(ts_focal, xi, pos="union", matchtol=union_matchtol)
}
ts_focal <- as.matrix(as.data.frame(ts_focal))
ts_focal <- ts_focal/10
Expand Down

0 comments on commit d3ef2d6

Please sign in to comment.