Class GenericTOADCalculator

java.lang.Object
PamguardMVC.toad.GenericTOADCalculator
All Implemented Interfaces:
PamSettings, SettingsNameProvider, TOADCalculator
Direct Known Subclasses:
ClickTOADCalculator, WSLToadCalculator

public class GenericTOADCalculator extends Object implements TOADCalculator, PamSettings
Generic TOAD calculator which does it's best by any type of sound. Can be used when specific datablocks claim not to have a TOAD Calculator. It will do it's best to make sensible options based on the type of data block in use.
Author:
dg50
  • Constructor Details

    • GenericTOADCalculator

      public GenericTOADCalculator(SettingsNameProvider settingsNameProvider)
      Parameters:
      settingsNameProvider -
      dataBlock - this is the detection source block and may not be where it's going to get the timing data from ...
  • Method Details

    • setTOADSourceParams

      public void setTOADSourceParams(GenericTOADSourceParams toadSourceParams)
    • getTOADInformation

      public TOADInformation getTOADInformation(List<PamDataUnit> dataUnits, double sampleRate, int channelMap, SnapshotGeometry geometry)
      Generate TOAD information for a whole load of data units (or just one - maybe needs a simpler list if there is only one to avoid having to make lots of lists of just one data unit !)
      Note that any fancy operations that involve waveform envelopes, etc, are generally handled by the FFTOrganiser. However, this function does need some way of filtering the FFT data for the final cross correlation...
      Specified by:
      getTOADInformation in interface TOADCalculator
      Parameters:
      channelMap - wanted channels ? Do we need this parameter ?
      dtaUnits - Data units, which are assumed to be of the same sound. If not, then this function should be called separately for sounds considered part of the same group.
      Returns:
    • getMaxDelays

      public double[][] getMaxDelays(SnapshotGeometry geometry, int channelMap, PamDataUnit dataUnit)
      Get a 2D array of maximum time delays between channels.
      Parameters:
      geometry - current geometry
      channelMap - channel map
      dataUnit - data unit (needed to find acquisition source)
      Returns:
      2D array of max delays in seconds.
    • getDelayMeasurementParams

      public DelayMeasurementParams getDelayMeasurementParams()
    • getSettingsPane

      public ManagedSettingsPane<?> getSettingsPane(Window parent, PamDataBlock<?> detectionSource)
      Specified by:
      getSettingsPane in interface TOADCalculator
      Returns:
      A settings pane to configure any TOAD options.
    • hasTOADDialog

      public boolean hasTOADDialog()
      Description copied from interface: TOADCalculator
      Flag to say there is a full settings dialog
      Specified by:
      hasTOADDialog in interface TOADCalculator
      Returns:
      true if there is a dialog
    • showTOADDialog

      public boolean showTOADDialog(Object parentWindow)
      Description copied from interface: TOADCalculator
      Show the dialog,
      Specified by:
      showTOADDialog in interface TOADCalculator
      Parameters:
      parentWindow - AWT or FX parent.
      Returns:
      true if OK was pressed and everything OK
    • getUnitName

      public String getUnitName()
      Specified by:
      getUnitName in interface SettingsNameProvider
      Returns:
      A Name specific to this instance of the particular class, e.g. Sperm whale detector, Beaked whale detector, etc.
    • getUnitType

      public String getUnitType()
      Specified by:
      getUnitType in interface PamSettings
      Returns:
      A Name specific to the type, e.g. Click detector
    • getSettingsReference

      public Serializable getSettingsReference()
      Specified by:
      getSettingsReference in interface PamSettings
      Returns:
      The serialisable object that will be stored
    • getSettingsVersion

      public long getSettingsVersion()
      Specified by:
      getSettingsVersion in interface PamSettings
      Returns:
      An integer version number for the settings
    • restoreSettings

      public boolean restoreSettings(PamControlledUnitSettings pamControlledUnitSettings)
      Specified by:
      restoreSettings in interface PamSettings
      Returns:
      true if successful The object performs final checks (if needed) and then casts the settings data pamcontrolledunitSettings.settings into the correct type and uses as required
    • getDetectorDataBlock

      public PamDataBlock<?> getDetectorDataBlock()
      Returns:
      the detectorDataBlock
    • setDetectorDataBlock

      public void setDetectorDataBlock(PamDataBlock<?> detectorDataBlock)
      Parameters:
      detectorDataBlock - the detectorDataBlock to set
    • getFftDataOrganiser

      public FFTDataOrganiser getFftDataOrganiser()
      Returns:
      the fftDataOrganiser
    • setFftDataOrganiser

      public void setFftDataOrganiser(FFTDataOrganiser fftDataOrganiser)
      Parameters:
      fftDataOrganiser - the fftDataOrganiser to set
    • isCanUseEnvelope

      public boolean isCanUseEnvelope()
      Returns:
      the canUseEnvelope
    • setCanUseEnvelope

      public void setCanUseEnvelope(boolean canUseEnvelope)
      Parameters:
      canUseEnvelope - the canUseEnvelope to set
    • isCanUseLeadingEdge

      public boolean isCanUseLeadingEdge()
      Returns:
      the canUseLeadingEdge
    • setCanUseLeadingEdge

      public void setCanUseLeadingEdge(boolean canUseLeadingEdge)
      Parameters:
      canUseLeadingEdge - the canUseLeadingEdge to set
    • getTimingSource

      public PamDataBlock<?> getTimingSource()
      Returns:
      the timingSource
    • setTimingSource

      public void setTimingSource(PamDataBlock<?> timingSource)
      Parameters:
      timingSource - the timingSource to set