You are not logged in. Log in
|
|
How do I vary the hot score threshold with range?From $1Table of contentsNo headers(The cold score parameter is deprecated: you should always set it to the same value as the hot score threshold.) ## a classification threshold that varies the hot score threshold with range ## ## You can save this file in the radR/scripts folder so that it can be easily ## sourced from the radR menu. ## ## Here, we use the GUI-defined hot score threshold, but reduce it linearly by ## a fixed amount per km of range. threshold.decrease.per.km <- 0.5 ## a hook function which will reclassify samples based on the changing hot score threshold myclassify <- function(classmat, n) { ## create a hot score threshold vector (one entry for each sample slot) ## You can move this calculation outside this function if you will not ## be changing threshold.decrease.per.km while radR runs. ## We do a global-level assignment (<<-) so the vector can be examined from the console. hst <<- as.integer(1024 * (RSS$blip.score.threshold[1] - (0:(RSS$scan.info$samples.per.pulse - 1)) * threshold.decrease.per.km * RSS$scan.info$sample.dist / 1000)) ## reset the class to COLD classmat[] <- as.integer(RSS$CLASS.VAL$cold) ## compare each sample's score to the vector of thresholds; "hot" is a logical vector. hot <- RSS$score.mat[] >= hst classmat[hot] <- as.integer(RSS$CLASS.VAL$hot) nhot <- sum(hot) return(c(length(classmat) - nhot, nhot, 0)) } ## add this function to the CLASSIFY hook rss.add.hook("CLASSIFY", myclassify) There are a few key points:
Was this page helpful?
Tags: (Edit tags)
|
Powered by MindTouch Core |