Class BasicClickIdentifier

java.lang.Object
clickDetector.ClickClassifiers.basic.BasicClickIdentifier
All Implemented Interfaces:
ClickIdentifier, ClickTypeProvider, PamSettings, SettingsNameProvider

public class BasicClickIdentifier extends Object implements ClickIdentifier, PamSettings
Author:
Doug Gillespie

Identifies individual clicks to type (e.g. porpoise, beaked whale, etc) using methods developed by Marjolaine Caillat, SMRU, in 2005.

Classification is based on the following:

  • Relative energy in two different frequency bands
  • Peak spectral frequency in the click
  • The width of the main frequency peak
  • The duration of the click
Multiple click types may be defined. If multile click types are defined, then the FIRST type to satisfy all criteria is selected.
  • Constructor Details

    • BasicClickIdentifier

      public BasicClickIdentifier(ClickControl clickControl)
      Parameters:
      clickDetector -
  • Method Details

    • getMenuItem

      public JMenuItem getMenuItem(Frame parentFrame)
      Returns a JMenuItem which will launch a dialog for defining different click types.
      Specified by:
      getMenuItem in interface ClickIdentifier
    • haveClickTypes

      public boolean haveClickTypes()
      Quick check to see if any click types have been defined
      Returns:
      true if click types are defined
    • identify

      public ClickIdInformation identify(ClickDetection click)
      Identifies a click.
      Specified by:
      identify in interface ClickIdentifier
      Parameters:
      click - A click from the detector
      Returns:
      the unique number code identifying the click type.
    • 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
    • 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
    • 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
    • getSymbol

      public PamSymbol getSymbol(ClickDetection click)
      Specified by:
      getSymbol in interface ClickIdentifier
      Returns:
      the PamSymbol associated with a particular click
    • getSpeciesList

      public String[] getSpeciesList()
      Description copied from interface: ClickTypeProvider
      Get a list of species names.
      Specified by:
      getSpeciesList in interface ClickTypeProvider
      Returns:
      list speces names.
    • getSymbols

      public PamSymbol[] getSymbols()
      Description copied from interface: ClickIdentifier
      Get symbols for each click type.
      Specified by:
      getSymbols in interface ClickIdentifier
      Returns:
      the symbols for type.
    • codeToListIndex

      public int codeToListIndex(int code)
      Description copied from interface: ClickTypeProvider
      Returns the index in the list for the click type.
      Specified by:
      codeToListIndex in interface ClickTypeProvider
      Parameters:
      code - - the click type code
      Returns:
      the index.
    • getSpeciesName

      public String getSpeciesName(int code)
      Specified by:
      getSpeciesName in interface ClickIdentifier
    • getDialogPanel

      public ClassifyDialogPanel getDialogPanel(Frame windowFrame)
      Specified by:
      getDialogPanel in interface ClickIdentifier
    • getParamsInfo

      public String getParamsInfo(ClickDetection click)
      Specified by:
      getParamsInfo in interface ClickIdentifier
    • getCodeList

      public int[] getCodeList()
      Returns a list of the currently-defined click types / species codes
      Specified by:
      getCodeList in interface ClickTypeProvider
      Returns:
      int array with the codes
    • getCommonParams

      public ClickTypeCommonParams getCommonParams(int code)
      Return the superclass of the click type parameters class - currently used for accessing the alarm functions. Subclasses include ClickTypeParams and SweepClassifierSet.
      Specified by:
      getCommonParams in interface ClickIdentifier
      Parameters:
      code - the click type to check
      Returns:
      the ClickTypeCommonParams object related to the species code
    • getZeroCrossingStats

      public ZeroCrossingStats[] getZeroCrossingStats(ClickDetection click)
      method used to get zero crossing data from sweep identifier. Return null for basic identifier 2014/07/25 MO
      Specified by:
      getZeroCrossingStats in interface ClickIdentifier
      Parameters:
      click - the clickDetection to examine
      Returns:
    • getPeakSearchRange

      public double[] getPeakSearchRange(ClickDetection click)
      method used to get peak frequency search range from sweep identifier. Return null for basic identifier 2014/08/03 MO
      Specified by:
      getPeakSearchRange in interface ClickIdentifier
      Parameters:
      click - the clickDetection to examine
      Returns:
    • getClickLength

      public double getClickLength(ClickDetection click)
      Returns the click length for the sweep classifier, using the times returned by the SweepClassifierWorker method getLengthData. In the case of a different classifier, a 0 is returned 2014/10/13 MO
      Specified by:
      getClickLength in interface ClickIdentifier
      Parameters:
      click - the current click detection
      Returns:
      the click duration, in seconds
    • getIdParameters

      public BasicClickIdParameters getIdParameters()
      Get ID params for the basic click identifier.
      Returns:
      the params for basic clicks classifier.
    • setIdParameters

      public void setIdParameters(BasicClickIdParameters idParameters)
      Set the ID params for the basic click classifier.
      Parameters:
      idParameters -
    • getClassifierPane

      public ClassifyPaneFX getClassifierPane()
      Description copied from interface: ClickIdentifier
      A pane which holds specific settings for the click classifier type selected.
      Specified by:
      getClassifierPane in interface ClickIdentifier
      Returns:
      the classifier pane
    • pamSymbol2SymbolData

      public static SymbolData[] pamSymbol2SymbolData(PamSymbol[] pamSymbols)
      Convert an aray of pam symbols to an array of symbol data.
      Parameters:
      pamSymbols - - the pam symbol array to convert.
      Returns:
      an array of symbol data correpsondiong to the pam symbols.
    • getSymbolsData

      public SymbolData[] getSymbolsData()
      Description copied from interface: ClickTypeProvider
      Get a list of symbols for each species corresponding to getSpeciesList.
      Specified by:
      getSymbolsData in interface ClickTypeProvider
      Returns:
      list of species symbols.