Package deepWhistle
Class MaskedFFTProcess
java.lang.Object
PamguardMVC.PamProcess
deepWhistle.MaskedFFTProcess
- All Implemented Interfaces:
PamObserver,ProcessAnnotator
- Direct Known Subclasses:
DeepWhistleProcess
PamProcess that applies a mask to the real-part of incoming FFTDataUnit objects.
This initial implementation buffers a defined number of seconds of FFT slices
then sends a batch to a worker thread to compute masks and apply them.
-
Field Summary
Fields inherited from class PamguardMVC.PamProcess
outputDataBlocks, parentDataBlock, processName -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected List<FFTDataUnit> applyMask(List<FFTDataUnit> batch) Default batch processor.voidCalled from the PamControlled unit when a PamControlled unit is removed from the model.getMask()Get the Mask used to process the FFT data.protected PamDataBlockGet the output masked FFT data block.intintGet the number of FFT units that are buffered before processing.voidnewData(PamObservable o, PamDataUnit arg) voidpamStart()Called for each process to tell it to start (may not be necessary for processes which are listening for data anyway).voidpamStop()Stops the process.voidCalled for each process before any of them receive the PamStart commandbooleanNew version of prepareProcess which get's called from PAMController prior to PAMGuard starting up.voidsetMask(PamFFTMask mask) Set the Mask used to process the FFT data.voidsetMaxPendingBatches(int maxPendingBatches) Configure the maximum number of in-flight batches allowed before newData blocks.voidsetSampleRate(float sampleRate, boolean notify) New sample rateMethods inherited from class PamguardMVC.PamProcess
absMillisecondsToSamples, absSamplesToMilliseconds, addData, addMultiPlexDataBlock, addOutputDataBlock, changedThreading, clearOldData, createAnnotations, doClearOldData, dumpBufferStatus, flushDataBlockBuffers, getAncestorDataBlock, getAnnotation, getChainPosition, getCompatibleDataUnits, getCpuPercent, getFrequencyRange, getLastSourceNotificationObject, getLastSourceNotificationType, getMuiltiplexDataBlock, getNumAnnotations, getNumMuiltiplexDataBlocks, getNumOutputDataBlocks, getObserverName, getObserverObject, getOfflineData, getOfflineData, getOutputDataBlock, getOutputDataBlocks, getPamControlledUnit, getParentDataBlock, getParentDataBlocks, getParentProcess, getProcessCheck, getProcessName, getRawSourceDataBlock, getRawSourceDataBlock, getRequiredDataHistory, getSampleRate, getSourceDataBlock, getSourceProcess, hasOutputDatablock, isCanMultiThread, isClearAtStart, isExternalProcess, isMultiplex, makePamProcess, masterClockUpdate, noteNewSettings, notifyModelChanged, processNewBuoyData, receiveSourceNotification, relMillisecondsToSamples, relSamplesToMilliseconds, removeAllDataBlocks, removeAllMultiPlexDataBlocks, removeMultiPlexDataBlock, removeObservable, removeOutputDatablock, resetDataBlocks, saveViewerData, setCanMultiThread, setExternalProcess, setMultiplex, setParentDataBlock, setParentDataBlock, setProcessCheck, setProcessName, setupProcess, toString, updateData
-
Constructor Details
-
MaskedFFTProcess
-
-
Method Details
-
pamStart
public void pamStart()Description copied from class:PamProcessCalled for each process to tell it to start (may not be necessary for processes which are listening for data anyway).- Specified by:
pamStartin classPamProcess
-
pamStop
public void pamStop()Description copied from class:PamProcessStops the process.- Specified by:
pamStopin classPamProcess
-
destroyProcess
public void destroyProcess()Description copied from class:PamProcessCalled 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:
destroyProcessin classPamProcess
-
newData
- Overrides:
newDatain classPamProcess
-
setSampleRate
public void setSampleRate(float sampleRate, boolean notify) Description copied from interface:PamObserverNew sample rate- Specified by:
setSampleRatein interfacePamObserver- Overrides:
setSampleRatein classPamProcess- Parameters:
sampleRate-notify- Notify other PamObservers and PamObservables in the chain.
-
prepareProcess
public void prepareProcess()Description copied from class:PamProcessCalled for each process before any of them receive the PamStart command- Overrides:
prepareProcessin classPamProcess
-
prepareProcessOK
public boolean prepareProcessOK()Description copied from class:PamProcessNew version of prepareProcess which get's called from PAMController prior to PAMGuard starting up. If a single process returns false from this function, startup will be aborted.For backwards compatibility (to save the need to modify every process) there is a default function which simply calls the older prepareProcess() function, then return true, but processes which might fail can override this and return false instead if they so wish.
Initial motivation for this function was to stop millions of empty files being created when the watchdog is running but the DAQ can't start.
- Overrides:
prepareProcessOKin classPamProcess- Returns:
- true if it's looking highly likely that the process is going to start OK.
-
applyMask
Default batch processor. Applies mask to the real part of each FFTDataUnit. Subclasses should override this to implement deep-learning mask generation. The method is called on a worker thread and should return the list of processed FFTDataUnit objects (typically the same objects with their ComplexArray modified or replaced). -
getInputFFTData
- Returns:
- the input FFT data block
-
getMask
Get the Mask used to process the FFT data. -
setMask
Set the Mask used to process the FFT data. -
getMaskFFTParams
-
getUnitsToBuffer
public int getUnitsToBuffer()Get the number of FFT units that are buffered before processing.- Returns:
- the number of FFT data units to buffer before processing.
-
setMaxPendingBatches
public void setMaxPendingBatches(int maxPendingBatches) Configure the maximum number of in-flight batches allowed before newData blocks. -
getMaxPendingBatches
public int getMaxPendingBatches() -
getMaskedFFTDataBlock
Get the output masked FFT data block.- Returns:
- the masked FFT data block.
-