Package clickDetector
Class ClickDetector
java.lang.Object
PamguardMVC.PamProcess
clickDetector.ClickDetector
- All Implemented Interfaces:
PamObserver
,ProcessAnnotator
Main click detector process.
Observes a raw data block, filters and thresholds the data to create Click objects
- Author:
- Doug Gillespie
- See Also:
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
If the multi-threading has been changed, make sure to call setupProcess to take that into accountboolean
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.void
void
Called from the PamControlled unit when a PamControlled unit is removed from the model.findChannelGroupDetector
(int channelBitmap) boolean
flushDataBlockBuffers
(long maxWait) Work through all the output datablocks and wait for their internal buffers to flush through.Gte the aquisition process associated with the click detector.getChannelGroupDetector
(int i) Get the click classifier annotation time.long
A list of data block class types which are compatible as parent data blocks for the PamProcess.getDelayMeasurementParams
(ClickDetection pamDetection) Get appropriate delay measurement parameters depending on the click type.double[]
getFFTFilter
(FFTFilterParams fftFilterParams) Get an FFT filter, mainly used to generate filtered waveforms within click detections.double[]
Get the range of frequencies over which the data in this process are likely to be present.Get information about the internal bearing localiser.int
long
long
long
void
masterClockUpdate
(long timeMilliseconds, long sampleNumber) double[]
measureDelays
(ClickDetection click) Measure time delays between raw waveforms within a single click detection (multiple channels within) a single group.void
newData
(PamObservable obs, PamDataUnit newData) void
void
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
Called for each process before any of them receive the PamStart commandvoid
processNewBuoyData
(BuoyStatusDataUnit buoyStatus, PamDataUnit dataUnit) void
secondTimer
(long sampleNumber) void
setSampleRate
(float sampleRate, boolean notify) New sample ratevoid
setTargetMotionLocaliser
(TargetMotionLocaliser<GroupDetection> targetMotionLocaliser) void
called for every process once the systemmodel has been created.boolean
wantClick
(ClickDetection click, ClickIdInformation idInfo) Return true if the click should be processed and stored.Methods inherited from class PamguardMVC.PamProcess
absMillisecondsToSamples, absSamplesToMilliseconds, addData, addMultiPlexDataBlock, addOutputDataBlock, clearOldData, createAnnotations, dumpBufferStatus, getAncestorDataBlock, getAnnotation, getChainPosition, getCpuPercent, getLastSourceNotificationObject, getLastSourceNotificationType, getMuiltiplexDataBlock, getNumAnnotations, getNumMuiltiplexDataBlocks, getNumOutputDataBlocks, getObserverName, getObserverObject, getOfflineData, getOfflineData, getOutputDataBlock, getOutputDataBlocks, getPamControlledUnit, getParentDataBlock, getParentDataBlocks, getParentProcess, getProcessCheck, getProcessName, getRawSourceDataBlock, getRawSourceDataBlock, getSampleRate, getSourceDataBlock, getSourceProcess, hasOutputDatablock, isCanMultiThread, isExternalProcess, isMultiplex, makePamProcess, noteNewSettings, notifyModelChanged, prepareProcessOK, receiveSourceNotification, relMillisecondsToSamples, relSamplesToMilliseconds, removeAllDataBlocks, removeAllMultiPlexDataBlocks, removeMultiPlexDataBlock, removeObservable, removeOutputDatablock, resetDataBlocks, saveViewerData, setCanMultiThread, setExternalProcess, setMultiplex, setParentDataBlock, setParentDataBlock, setProcessCheck, setProcessName, toString, updateData
-
Constructor Details
-
ClickDetector
-
-
Method Details
-
setSampleRate
public void setSampleRate(float sampleRate, boolean notify) Description copied from interface:PamObserver
New sample rate- Specified by:
setSampleRate
in interfacePamObserver
- Overrides:
setSampleRate
in classPamProcess
- 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 classPamProcess
-
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 classPamProcess
- 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
- Returns:
- The main output click data block.
-
getOfflineEventDataBlock
- Returns:
- the offlineEventDataBlock
-
getRequiredDataHistory
- Specified by:
getRequiredDataHistory
in interfacePamObserver
- Overrides:
getRequiredDataHistory
in classPamProcess
- Parameters:
arg
- optional argument from PamObservable- Returns:
- time in milliseconds required by data held in PamObservable
-
secondTimer
public void secondTimer(long sampleNumber) -
newData
- Overrides:
newData
in classPamProcess
-
masterClockUpdate
public void masterClockUpdate(long timeMilliseconds, long sampleNumber) - Specified by:
masterClockUpdate
in interfacePamObserver
- Overrides:
masterClockUpdate
in classPamProcess
-
prepareProcess
public void prepareProcess()Description copied from class:PamProcess
Called for each process before any of them receive the PamStart command- Overrides:
prepareProcess
in classPamProcess
-
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 classPamProcess
-
processNewBuoyData
- Overrides:
processNewBuoyData
in classPamProcess
-
pamStop
public void pamStop()Description copied from class:PamProcess
Stops the process.- Specified by:
pamStop
in classPamProcess
-
getStartTimeMillis
public long getStartTimeMillis() -
getClickControl
-
getSamplesProcessed
public long getSamplesProcessed() -
getClickCount
public long getClickCount() -
getTriggerDataBlock
-
getOutputClickData
-
getDelayMeasurementParams
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
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
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 classPamProcess
- Parameters:
maxWait
- maxWait time in milliseconds.- Returns:
- true if successful, or false if there was a timeout.
-
wantClick
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
-
getTriggerFunctionDataBlock
-
getTrackedClicks
-
getHilbert
-
notifyArrayChanged
public void notifyArrayChanged() -
findChannelGroupDetector
-
getClickBinaryDataSource
- Returns:
- the clickBinaryDataSource
-
getFFTFilter
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
-
getOfflineEventLogging
- Returns:
- the offlineEventLogging
-
setTargetMotionLocaliser
-
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 classPamProcess
- Returns:
- a list of PamDataBlock sub class types which can be used as parent data blocks for the process.
-
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 classPamProcess
-
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 classPamProcess
-
getLocaliserInfo
Get information about the internal bearing localiser. Will have to do just for the first sub detector.- Returns:
-