Class CTDataUnit

All Implemented Interfaces:
Comparable<PamDataUnit>, PamDetection, AcousticDataUnit, RawDataHolder

public class CTDataUnit extends CTDetectionGroupDataUnit implements RawDataHolder, AcousticDataUnit
Data unit for a click train which holds a series of data units grouped into a click train.
Author:
Jamie Macaulay
  • Field Details

    • chi2

      public Double chi2
      Chi^2 value for the click train.
    • ctClassifications

      public ArrayList<CTClassification> ctClassifications
      The classifications for the click train. This is a list of classifiers which have PASSED. i.e. which have an speciesID>0. Only the first classification gets loaded in from the database.
    • averageWaveform

      public AverageWaveform averageWaveform
      The average waveform.
    • defaultFFTLen

      public static int defaultFFTLen
      The default FFT length for the average templates. Made static because of the super constructor adding clicks in function addDetectionList
  • Constructor Details

    • CTDataUnit

      public CTDataUnit(long timeMilliseconds)
  • Method Details

    • addSubDetections

      public int addSubDetections(List<PamDataUnit> list)
      Description copied from class: SuperDetection
      Add multiple sub detections from a list.
      Overrides:
      addSubDetections in class CTDetectionGroupDataUnit
      Parameters:
      list - List of new sub detections
      Returns:
      total number of sub detections now in the super detection
    • addSubDetection

      public int addSubDetection(PamDataUnit subDetection)
      Description copied from class: SuperDetection
      Add a sub detection to the sub detection list.
      Overrides:
      addSubDetection in class SuperDetection<PamDataUnit>
      Parameters:
      subDetection - - the sub detection to add.
      Returns:
      - the total number of sub detections now in the list. .
    • checkAverageWaveformInfo

      public void checkAverageWaveformInfo()
    • addToAverageWaveform

      public void addToAverageWaveform(PamDataUnit dataUnit)
      Adds to the average waveform is the data unit contains raw info.
      Parameters:
      dataUnit - - the data unit to add.
    • removeAllSubDetections

      public void removeAllSubDetections()
      Description copied from class: SuperDetection
      Remove all sub detection information.
      Overrides:
      removeAllSubDetections in class SuperDetection<PamDataUnit>
    • getCTChi2

      public Double getCTChi2()
      Get the chi^2 value for the click train. Can be null if the click train algorithm does not calculate it.
      Returns:
      the chi2 algorithm.
    • setCTChi2

      public void setCTChi2(Double chi2)
      Set the chi^2 value for the click train.
      Parameters:
      chi - ^2 the chi^2 value to set.
    • getCtClassifications

      public ArrayList<CTClassification> getCtClassifications()
      Get the click train's classification.
      Returns:
      the ctClassification
    • averageWaveform

      public AverageWaveform averageWaveform()
    • getAverageWaveform

      public double[] getAverageWaveform()
      Get an average waveform for the data unit.
      Returns:
      the average waveform
    • getAverageSpectra

      public double[] getAverageSpectra()
      Get an average spectrum for the data unit.
      Returns:
      the average spectrum
    • addCtClassification

      public void addCtClassification(CTClassification ctClassification)
      Adds a classification for the click train.
      Parameters:
      ctClassification - the ctClassification to set
    • clearClassifiers

      public void clearClassifiers()
      Clear all classification results from the data unit
    • getIDIInfo

      public IDIInfo getIDIInfo()
      Get the IDI info for the data
      Returns:
      the IDIInfo for the click train.
    • forceIDIUpdater

      public void forceIDIUpdater()
      Force an update of the IDI calculation. This should be used if data unit information changes. The IDI is automaticaly updated when new data units are added to the CTData unit.
    • isJunkTrain

      public boolean isJunkTrain()
      Check whether a click train should be junked
      Returns:
      true to junk train
    • setJunkTrain

      public void setJunkTrain(boolean junkTrain)
      Set whther a click train should be junked.
      Parameters:
      junkTrain - - true to junk train.
    • getSummaryString

      public String getSummaryString()
      Description copied from class: PamDataUnit
      Return an html formatted summary string describing the detection which can be used in tooltips anywhere in PAMGuard.
      Overrides:
      getSummaryString in class PamDataUnit<PamDataUnit,SuperDetection>
      Returns:
      summary string
    • setClassificationIndex

      public void setClassificationIndex(int i)
      The index of the classification (this is to set one classification as the "master" classifications). This is usually just for convenience, the index could be calculated by finding the first non zero species code in the classification list.
      Parameters:
      i - - the classification index.
    • getClassificationIndex

      public int getClassificationIndex()
      Get the the classification index (this is to set one classification as the "master" classifications). invalid input: '<'0 indicates that no classification was passed.
      Parameters:
      i - - the classification index.
    • setAverageWaveform

      public void setAverageWaveform(AverageWaveform averageWaveform2)
      Set the average waveform.
      Parameters:
      averageWaveform2 - - the average waveform to set.
    • getWaveData

      public double[][] getWaveData()
      Description copied from interface: RawDataHolder
      Get arrays of raw audio data, one per channel. Assume that the array matches getChannelMap() !
      Specified by:
      getWaveData in interface RawDataHolder
      Returns:
      arrays of raw data by channel
    • setCTAlgorithmInfo

      public void setCTAlgorithmInfo(CTAlgorithmInfo ctAlgorithmInfo)
      Set the click train algorithm info class.
      Parameters:
      ctAlgorithmInfo -
    • getCTAlgorithmInfo

      public CTAlgorithmInfo getCTAlgorithmInfo()
      Set the click train algorithm info class. This provides extra information from the click, train algorithm used.
      Parameters:
      ctAlgorithmInfo - - the click train algorithm info.
    • getDataTransforms

      public RawDataTransforms getDataTransforms()
      Description copied from interface: RawDataHolder
      Get the raw data transforms class. This handles standard data transforms that are often used in raw data units, e.g. calculating the spectrum, filtering waveforms, getting data as an int16 (short) array, etc.
      Specified by:
      getDataTransforms in interface RawDataHolder
      Returns:
      the data transforms object.
    • setIDIInfo

      public void setIDIInfo(IDIInfo idiInfo)
      Set the current IDI info.
      Parameters:
      idiInfo - - the IDI info.