You are not logged in. Log in
|
|
Rain filteringFrom $1Table of contentsCombined revision comparison2015 Aug 10: code changed to assess number of blips based on existing filtering, not just unfiltered patch count. ... num.blips.cutoff <- 500 drop.crowded.scans <- function(x) { if (sum ... The function drop.crowded.scans() examines the number of blips ... num.blips.cutoff <- 500 ## increase default printing precision so timestamps are output with a single decimal digit options(digits=11) ## add a hook function to open a rainscans file when the blipmovie is opened (using the same base name) rss.add.hook("START_SOURCE", function(...) { rain.scans.file <<- file(paste(RSS$source$file.basename, ".rainscans.csv", sep=""), "w") cat ("timestamp,ts.string\n", file=rain.scans.file) }) plot.title.date.format <- "%Y %b %d %H:%M:%OS1" ## copy of GUI$plot.title.date.format so it works in batch mode too drop.crowded.scans <- function(x) { if (sum ... Version from 19:24, 15 Mar 2012... num.blips.cutoff <- 500 drop.crowded.scans <- function(x) { if ( ... The function drop.crowded.scans() examines the number of ... num.blips.cutoff <- 500 ## increase default printing precision so timestamps are output with a single decimal digit options(digits=11) ## add a hook function to open a rainscans file when the blipmovie is opened (using the same base name) rss.add.hook("START_SOURCE", function(...) { rain.scans.file <<- file(paste(RSS$source$file.basename, ".rainscans.csv", sep=""), "w") cat ("timestamp,ts.string\n", file=rain.scans.file) }) plot.title.date.format <- "%Y %b %d %H:%M:%OS1" ## copy of GUI$plot.title.date.format so it works in batch mode too drop.crowded.scans <- function(x) { if ( ... Current version2015 Aug 10: code changed to assess number of blips based on existing filtering, not just unfiltered patch count. ... num.blips.cutoff <- 500 drop.crowded.scans <- function(x) { if (sum(x) > num.blips.cutoff) ## if there are at least num.blips.cutoff blips return (rep(FALSE, length(x))) ## return a FALSE for each patch, filtering it out else return(NULL) ## otherwise, don't do any further filtering; could also return x with the same effect } ## now add the function to the PATCH_STATS hook, which calls it every scan ## right before anything is done with the blips rss.add.hook("PATCH_STATS", "norain", drop.crowded.scans, read.only=FALSE) ... The function drop.crowded.scans() examines the number of blips (namely sum(x)), and if this is larger than the cutoff, the function returns an all FALSE vector, which means no patches are accepted as blips. Otherwise, the function returns NULL to indicate it does not want to change the status of any blips. ... num.blips.cutoff <- 500 ## increase default printing precision so timestamps are output with a single decimal digit options(digits=11) ## add a hook function to open a rainscans file when the blipmovie is opened (using the same base name) rss.add.hook("START_SOURCE", function(...) { rain.scans.file <<- file(paste(RSS$source$file.basename, ".rainscans.csv", sep=""), "w") cat ("timestamp,ts.string\n", file=rain.scans.file) }) plot.title.date.format <- "%Y %b %d %H:%M:%OS1" ## copy of GUI$plot.title.date.format so it works in batch mode too drop.crowded.scans <- function(x) { if (sum(x) > num.blips.cutoff) { ## if we're really processing this scan (not just browsing through the blipmovie) ## then write timestamp in two formats if (RSS$play.state >= RSS$PS$PLAYING && !RSS$previewing) cat (RSS$scan.info$timestamp, ",", format(structure(RSS$scan.info$timestamp, class="POSIXct"), plot.title.date.format), "\n", sep="", file=rain.scans.file) return (rep(FALSE, length(x))) } else { return(NULL) } } rss.add.hook("PATCH_STATS", "norain", drop.crowded.scans, read.only=FALSE) ... |
Powered by MindTouch Core |