likelihoodDetectionModule.thresholdDetector
Class ThresholdDetectorProcess

java.lang.Object
  extended by PamguardMVC.PamProcess
      extended by likelihoodDetectionModule.thresholdDetector.ThresholdDetectorProcess
All Implemented Interfaces:
Annotator, PamObserver

public class ThresholdDetectorProcess
extends PamProcess

This PamProcess is the main maximum likelihood threshold detector logic. Its main features are: Initial signal/noise thresholding, secondary signal->guard band thresholding, and limiting the number of detections (per channel) by forcing a configurable amount of time to pass between consecutive detections. The output data are derivatives of PamDetection, and the data is logged to an SQL database as well (if the user has configured one).

Author:
Dave Flogeras

Field Summary
(package private)  double estimatedPeakTimeAccuracy
           
private  java.util.ArrayList<java.util.Map<java.lang.Integer,GuardBand>> guardBandMappings
           
private  PamDataBlock<NormalizedDataUnit> normalizedDataBlock
           
private  PamDataBlock<ThresholdDetectorDataUnit> outputDataBlock
           
private  double secondsBetweenDetections
           
private  java.util.ArrayList<SignalBand> signalBands
           
(package private)  java.lang.String targetIdentifier
           
private  java.util.ArrayList<Threshold> thresholds
           
 
Fields inherited from class PamguardMVC.PamProcess
outputDataBlocks, processName, sampleRate
 
Constructor Summary
ThresholdDetectorProcess(LikelihoodDetectionUnit ldu, java.lang.String targetIdentifier, double estimatedPeakTimeAccuracy, PamDataBlock signalEstimate, double secondsBetweenDetections, java.util.ArrayList<SignalBand> signalBands, java.util.ArrayList<GuardBand> guardBands)
          Constructor
 
Method Summary
 java.lang.String getProcessName()
           
 long getRequiredDataHistory(PamObservable o, java.lang.Object arg)
           
 void newData(PamObservable o, PamDataUnit arg)
           
 void pamStart()
          Called for each process to tell it to start (may not be necessary for processes which are listening for data anyway.
 void pamStop()
          Stops the process.
 void prepareProcess()
          Called for each process before any of them receive the PamStart command
 void setSampleRate(float sampleRate, boolean notify)
          New sample rate
 
Methods inherited from class PamguardMVC.PamProcess
absMillisecondsToSamples, absSamplesToMilliseconds, addOutputDataBlock, changedThreading, clearOldData, createAnnotations, destroyProcess, fillXMLElement, fillXMLParameters, getAncestorDataBlock, getAnnotation, getBackendProcess, getChainPosition, getCpuPercent, getNumAnnotations, getNumOutputDataBlocks, getObserverName, getObserverObject, getOfflineData, getOutputDataBlock, getPamControlledUnit, getParentDataBlock, getParentProcess, getRawSourceDataBlock, getSampleRate, getSourceDataBlock, getSourceProcess, isCanMultiThread, makePamProcess, masterClockUpdate, noteNewSettings, notifyModelChanged, relMillisecondsToSamples, relSamplesToMilliseconds, removeObservable, removeOutputDatablock, saveViewerData, setBackendProcess, setCanMultiThread, setParentDataBlock, setParentDataBlock, setProcessName, setupProcess, toString, update, updateData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

normalizedDataBlock

private PamDataBlock<NormalizedDataUnit> normalizedDataBlock

outputDataBlock

private PamDataBlock<ThresholdDetectorDataUnit> outputDataBlock

thresholds

private java.util.ArrayList<Threshold> thresholds

signalBands

private final java.util.ArrayList<SignalBand> signalBands

guardBandMappings

private java.util.ArrayList<java.util.Map<java.lang.Integer,GuardBand>> guardBandMappings

secondsBetweenDetections

private final double secondsBetweenDetections

targetIdentifier

final java.lang.String targetIdentifier

estimatedPeakTimeAccuracy

final double estimatedPeakTimeAccuracy
Constructor Detail

ThresholdDetectorProcess

public ThresholdDetectorProcess(LikelihoodDetectionUnit ldu,
                                java.lang.String targetIdentifier,
                                double estimatedPeakTimeAccuracy,
                                PamDataBlock signalEstimate,
                                double secondsBetweenDetections,
                                java.util.ArrayList<SignalBand> signalBands,
                                java.util.ArrayList<GuardBand> guardBands)
Constructor

Parameters:
ldu - Parent module
targetIdentifier - The free form string (user defined) describing the overall target.
estimatedPeakTimeAccuracy -
signalEstimate - The input data block
secondsBetweenDetections - The time, in seconds, that must pass between detections on a channel.
signalBands - List of all defined signal bands, must contain at least one.
guardBands - List of all defined noise bands, can be empty.
Method Detail

pamStart

public void pamStart()
Description copied from class: PamProcess
Called for each process to tell it to start (may not be necessary for processes which are listening for data anyway.

Specified by:
pamStart in class PamProcess

pamStop

public void pamStop()
Description copied from class: PamProcess
Stops the process.

Specified by:
pamStop in class PamProcess

newData

public void newData(PamObservable o,
                    PamDataUnit arg)
Overrides:
newData in class PamProcess

getProcessName

public java.lang.String getProcessName()
Overrides:
getProcessName in class PamProcess
Returns:
Name of the PamProcess

prepareProcess

public void prepareProcess()
Description copied from class: PamProcess
Called for each process before any of them receive the PamStart command

Overrides:
prepareProcess in class PamProcess

getRequiredDataHistory

public long getRequiredDataHistory(PamObservable o,
                                   java.lang.Object arg)
Specified by:
getRequiredDataHistory in interface PamObserver
Overrides:
getRequiredDataHistory in class PamProcess
Parameters:
o - PamObservable class requiring the data
arg - optional argument from PamObservable
Returns:
time in milliseconds requried by data held in PamObservable

setSampleRate

public void setSampleRate(float sampleRate,
                          boolean notify)
Description copied from interface: PamObserver
New sample rate

Specified by:
setSampleRate in interface PamObserver
Overrides:
setSampleRate in class PamProcess
notify - Notify other PamObservers and PamObservables in the chain.