Package clickDetector

Class ClickDetector

java.lang.Object
PamguardMVC.PamProcess
clickDetector.ClickDetector
All Implemented Interfaces:
PamObserver, ProcessAnnotator

public class ClickDetector extends PamProcess
Main click detector process.

Observes a raw data block, filters and thresholds the data to create Click objects

Author:
Doug Gillespie
See Also:
  • Constructor Details

    • ClickDetector

      public ClickDetector(ClickControl clickControl)
  • Method Details

    • 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
      Parameters:
      notify - Notify other PamObservers and PamObservables in the chain.
    • setupProcess

      public void setupProcess()
      Description copied from class: PamProcess
      called for every process once the systemmodel has been created. this is a good time to check out and find input data blocks and similar tasks.
      Overrides:
      setupProcess in class PamProcess
    • getFrequencyRange

      public double[] getFrequencyRange()
      Description copied from class: PamProcess
      Get the range of frequencies over which the data in this process are likely to be present. Note that this is pretty crude and may not reflect the true range, for example, the click detector will return the limits of it's trigger filter, and there are plenty of sounds outside of that range which may have most of their energy well outside of the trigger range of the detector.
      Overrides:
      getFrequencyRange in class PamProcess
      Returns:
      Nominal frequency range for data in this block.
    • getDurationRange

      public double[] getDurationRange()
      Returns:
      the duration of clicks that can potentially be detected
    • createFilters

      public void createFilters()
    • newParameters

      public void newParameters()
    • getClickDataBlock

      public ClickDataBlock getClickDataBlock()
      Returns:
      The main output click data block.
    • getOfflineEventDataBlock

      public OfflineEventDataBlock getOfflineEventDataBlock()
      Returns:
      the offlineEventDataBlock
    • getRequiredDataHistory

      public long getRequiredDataHistory(PamObservable o, Object arg)
      Specified by:
      getRequiredDataHistory in interface PamObserver
      Overrides:
      getRequiredDataHistory in class PamProcess
      Parameters:
      arg - optional argument from PamObservable
      Returns:
      time in milliseconds required by data held in PamObservable
    • secondTimer

      public void secondTimer(long sampleNumber)
    • newData

      public void newData(PamObservable obs, PamDataUnit newData)
      Overrides:
      newData in class PamProcess
    • masterClockUpdate

      public void masterClockUpdate(long timeMilliseconds, long sampleNumber)
      Specified by:
      masterClockUpdate in interface PamObserver
      Overrides:
      masterClockUpdate in class 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
    • 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
    • processNewBuoyData

      public void processNewBuoyData(BuoyStatusDataUnit buoyStatus, PamDataUnit dataUnit)
      Overrides:
      processNewBuoyData in class PamProcess
    • pamStop

      public void pamStop()
      Description copied from class: PamProcess
      Stops the process.
      Specified by:
      pamStop in class PamProcess
    • getStartTimeMillis

      public long getStartTimeMillis()
    • getClickControl

      public ClickControl getClickControl()
    • getSamplesProcessed

      public long getSamplesProcessed()
    • getClickCount

      public long getClickCount()
    • getTriggerDataBlock

      public PamDataBlock<TriggerLevelDataUnit> getTriggerDataBlock()
    • getOutputClickData

      public PamDataBlock<ClickDetection> getOutputClickData()
    • getDelayMeasurementParams

      public DelayMeasurementParams getDelayMeasurementParams(ClickDetection pamDetection)
      Get appropriate delay measurement parameters depending on the click type. 31/11/2016 MO: originally this method was passed a PamDetection which was immediately cast to a Click Detection. All classes calling this method passed a ClickDetection anyway, and since we've now removed the PamDetection class I've just changed the parameter to ClickDetection and commented out the cast.
      Parameters:
      pamDetection -
      Returns:
      appropriate click delay measurement parameters.
    • completeClick

      public boolean completeClick(ClickDetection newClick)
      Once a click is detected, does everything else to it such as calculate bearing, check species, send to click train detector, etc.
      Returns:
      true if the tasks complete successfully and the click is to be kept. false otherwise.
    • measureDelays

      public double[] measureDelays(ClickDetection click)
      Measure time delays between raw waveforms within a single click detection (multiple channels within) a single group.
      Parameters:
      click - - the click detection
      Returns:
      a list of time delays between all channels in seconds.
    • flushDataBlockBuffers

      public boolean flushDataBlockBuffers(long maxWait)
      Description copied from class: PamProcess
      Work through all the output datablocks and wait for their internal buffers to flush through.

      This is used when stopping PAMGUARD to ensure that all data complete processing before anything else happens.

      Overrides:
      flushDataBlockBuffers in class PamProcess
      Parameters:
      maxWait - maxWait time in milliseconds.
      Returns:
      true if successful, or false if there was a timeout.
    • wantClick

      public boolean wantClick(ClickDetection click, ClickIdInformation idInfo)
      Return true if the click should be processed and stored.

      If there is no online classification, we want everything If there is classification, but we've not told it to discard, etc

      Parameters:
      click -
      idInfo -
      Returns:
    • getFilteredDataBlocks

      public PamRawDataBlock[] getFilteredDataBlocks()
    • getTriggerFunctionDataBlock

      public ClickTriggerFunctionDataBlock getTriggerFunctionDataBlock()
    • getTrackedClicks

      public PamDataBlock<PamDataUnit> getTrackedClicks()
    • getHilbert

      public Hilbert getHilbert()
    • notifyArrayChanged

      public void notifyArrayChanged()
    • findChannelGroupDetector

      public ClickDetector.ChannelGroupDetector findChannelGroupDetector(int channelBitmap)
    • getClickBinaryDataSource

      public ClickBinaryDataSource getClickBinaryDataSource()
      Returns:
      the clickBinaryDataSource
    • getFFTFilter

      public FFTFilter getFFTFilter(FFTFilterParams fftFilterParams)
      Get an FFT filter, mainly used to generate filtered waveforms within click detections.
      Parameters:
      fftFilterParams -
      Returns:
      FFT filter object.
    • getnChannelGroups

      public int getnChannelGroups()
      Returns:
      the nChannelGroups
    • getChannelGroupDetector

      public ClickDetector.ChannelGroupDetector getChannelGroupDetector(int i)
    • getOfflineEventLogging

      public OfflineEventLogging getOfflineEventLogging()
      Returns:
      the offlineEventLogging
    • setTargetMotionLocaliser

      public void setTargetMotionLocaliser(TargetMotionLocaliser<GroupDetection> targetMotionLocaliser)
    • getCompatibleDataUnits

      public ArrayList getCompatibleDataUnits()
      Description copied from class: PamProcess
      A list of data block class types which are compatible as parent data blocks for the PamProcess. This can return null, e.g. in the case of Acquisition process.
      Overrides:
      getCompatibleDataUnits in class PamProcess
      Returns:
      a list of PamDataBlock sub class types which can be used as parent data blocks for the process.
    • getClickAnnotationType

      public ClickClassificationType getClickAnnotationType()
      Get the click classifier annotation time. This annotates clicks with an array showing what classifiers were passed rather than just the first classifier to pass in the click type flag.
      Returns:
      the click classifier annotation type.
    • changedThreading

      public void changedThreading()
      If the multi-threading has been changed, make sure to call setupProcess to take that into account
      Overrides:
      changedThreading in class PamProcess
    • getAquisitionProcess

      public AcquisitionProcess getAquisitionProcess()
      Gte the aquisition process associated with the click detector.
      Returns:
      the Aquisition process.
    • destroyProcess

      public void destroyProcess()
      Description copied from class: PamProcess
      Called from the PamControlled unit when a PamControlled unit is removed from the model. Offers an opportunity to disconnect individual processed from the rest of the model. May be necessary to override to clean up some processes.
      Overrides:
      destroyProcess in class PamProcess
    • getLocaliserInfo

      public LocalisationAlgorithmInfo getLocaliserInfo()
      Get information about the internal bearing localiser. Will have to do just for the first sub detector.
      Returns: