-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
overhaul batch processing mechanism: should be more reliable now, and…
… aggregation should not accidently and uncontrollably throw information away.
- Loading branch information
1 parent
8594cfd
commit c4859bc
Showing
12 changed files
with
268 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
new_wnd <- function(size_n, size_time) { | ||
structure( | ||
list( | ||
size_n = size_n, | ||
size_time = size_time | ||
), | ||
class = "wnd" | ||
) | ||
} | ||
|
||
#' @param n window length in discrete time steps (sampling steps) | ||
#' @noRd | ||
wnd_from_dim <- function(n, orig_sample_freq) { | ||
new_wnd( | ||
size_n = n, | ||
size_time = n / orig_sample_freq | ||
) | ||
} | ||
|
||
#' @param secs target window length in seconds. The exact window length | ||
#' depends on the original sample frequency `orig_sample_freq` | ||
#' @noRd | ||
wnd_from_secs <- function(secs, orig_sample_freq) { | ||
n <- round(secs * orig_sample_freq) | ||
|
||
wnd_from_dim(n, orig_sample_freq) | ||
} | ||
|
||
#' @param new_resolution relative window specified by a target resolution | ||
#' in seconds (distance between discrete time steps) | ||
#' @noRd | ||
wnd_from_resolution <- function(target_resolution, orig_sample_freq) { | ||
wnd_from_dim( | ||
floor(orig_sample_freq * target_resolution), | ||
orig_sample_freq | ||
) | ||
} | ||
|
||
#' @param target_size New total target size of `sc`. | ||
#' @noRd | ||
wnd_from_target_size <- function(target_size, sc) { | ||
stopifnot(inherits(sc, "fcwtr_scalogram")) | ||
|
||
wnd_from_dim( | ||
floor(sc_dim_time(sc) / target_size), | ||
attr(sc, "sample_freq") | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
Version: 1.0 | ||
ProjectId: 0048848a-100c-4b20-8eb8-b73e3c0400e4 | ||
|
||
RestoreWorkspace: Default | ||
SaveWorkspace: Default | ||
|
Oops, something went wrong.