Class AutoTethysProvider

java.lang.Object
tethys.pamdata.AutoTethysProvider
All Implemented Interfaces:
TethysDataProvider
Direct Known Subclasses:
ClickEventTethysDataProvider, ClickTethysDataProvider, DLTethysDataProvider, IshmaelTethysProvider, RWTethysDataProvider, TethysNoiseDataProvider, WhistleMoanTethysProvider

public abstract class AutoTethysProvider extends Object implements TethysDataProvider
Automatically provides Tethys data for a PAMGuard datablock. Does most of what needs to be done, though individual modules will want to override this, call the base createDetection function and then add a few more bespoke elements.
Author:
dg50
  • Constructor Details

  • Method Details

    • getDescription

      public nilus.DescriptionType getDescription(nilus.Deployment deployment, TethysExportParams tethysExportParams)
      Description copied from interface: TethysDataProvider
      Get DescriptionType object to include in a Tethys Detections document.
      Specified by:
      getDescription in interface TethysDataProvider
      Returns:
      Tethys DescriptionType object, which contains infromation about detections
    • getAlgorithm

      public nilus.AlgorithmType getAlgorithm(Collection collection)
      Description copied from interface: TethysDataProvider
      Get Algorithm information for a Tethys Detections document
      Specified by:
      getAlgorithm in interface TethysDataProvider
      Parameters:
      collection - Detections or Localisations may have different parameter sets.
      Returns:
      Algorithm information
    • getLocalisationParameters

      public nilus.AlgorithmType.Parameters getLocalisationParameters()
      Localisation parameters. Some localisers don't actually have any parameters, but Tethys requires a parameters element, so if there aren't any, set a dummy
      Returns:
    • getAlgorithmParameters

      public nilus.AlgorithmType.Parameters getAlgorithmParameters()
      Description copied from interface: TethysDataProvider
      Get the algorithm parameters.
      Specified by:
      getAlgorithmParameters in interface TethysDataProvider
      Returns:
    • createDetection

      public nilus.Detection createDetection(PamDataUnit dataUnit, TethysExportParams tethysExportParams, StreamExportParams streamExportParams)
      Description copied from interface: TethysDataProvider
      Create a Tethys Detection object from a PamDataUnit.
      It's OK for this to return null if for some reason the unit shouldn't be stored.
      Specified by:
      createDetection in interface TethysDataProvider
      Parameters:
      dataUnit - PAMGuard data unit
      Returns:
      Detection Tethys Detection object.
    • addUserDefined

      public Element addUserDefined(nilus.Detection.Parameters parameters, String parameterName, String parameterValue)
    • getEffortKinds

      public void getEffortKinds(PDeployment pDeployment, List<nilus.DetectionEffortKind> effortKinds, StreamExportParams exportParams)
      Description copied from interface: TethysDataProvider
      Fill in the effort kind list for the top of a Detections document. This must contain a list of every species that's going to be output within this effort period. Any species assigned to an actual detection must be in this list, or the document will be rejected.
      Specified by:
      getEffortKinds in interface TethysDataProvider
      Parameters:
      effortKinds - tethys object list to add to.
    • getDetectionsMethod

      public String getDetectionsMethod()
      Description copied from interface: TethysDataProvider
      Get a standard Method string for each detector. This can be a bit verbose and might even have a reference to a paper ? Is this the best place for this ?
      Specified by:
      getDetectionsMethod in interface TethysDataProvider
      Returns:
    • getAllowedGranularities

      public nilus.GranularityEnumType[] getAllowedGranularities()
      Description copied from interface: TethysDataProvider
      Get a list of allowed granularity types for this output
      Specified by:
      getAllowedGranularities in interface TethysDataProvider
      Returns:
      list of granularities.
    • getDetectionsName

      public String getDetectionsName()
      Description copied from interface: TethysDataProvider
      Get a name for the detections documents. This will be appended to the Deployment name and may also have a number after it.
      Note that the name isn't really important since all the matching between different documents is done internally, but it helps to make everything human readable.
      Specified by:
      getDetectionsName in interface TethysDataProvider
      Returns:
      A name, similar to datablock.getLongDataName(), but no spaces.
    • roundDecimalPlaces

      public static double roundDecimalPlaces(double value, int decPlaces)
    • roundSignificantFigures

      public static double roundSignificantFigures(double value, int sigFigs)
    • wantExportDialogCard

      public boolean wantExportDialogCard(ExportWizardCard wizPanel)
      Description copied from interface: TethysDataProvider
      See if a particular card should be used in the export wizard. This may not be the best way of doing this, but will do for now.
      Specified by:
      wantExportDialogCard in interface TethysDataProvider
      Returns:
    • getTethysControl

      public TethysControl getTethysControl()
      Returns:
      the tethysControl
    • hasDetections

      public boolean hasDetections()
      Description copied from interface: TethysDataProvider
      True if the datablock is detections. This will (nearly) always be true or the block wouldn't have a TethysDataProvider, however there may be one or two localisers that should really only output localisation information.
      Specified by:
      hasDetections in interface TethysDataProvider
      Returns:
    • canExportLocalisations

      public boolean canExportLocalisations(nilus.GranularityEnumType granularityType)
      Description copied from interface: TethysDataProvider
      See if it's possible for this block to export localisations. This may depend on the selected granularity.
      Specified by:
      canExportLocalisations in interface TethysDataProvider
      Returns:
    • granularityOK

      public boolean granularityOK(nilus.GranularityEnumType granularityType)
      Granularity is OK for export.
      Parameters:
      granularityType -
      Returns:
    • getLocalisationInfo

      public TethysLocalisationInfo getLocalisationInfo()
      Description copied from interface: TethysDataProvider
      Get localisation info for the datablock. Can be null, but probably never is. More likely to have a zero of available types;
      Specified by:
      getLocalisationInfo in interface TethysDataProvider
      Returns:
    • isAddFrequencyInfo

      public boolean isAddFrequencyInfo()
      Returns:
      the addFrequencyInfo
    • setAddFrequencyInfo

      public void setAddFrequencyInfo(boolean addFrequencyInfo)
      Parameters:
      addFrequencyInfo - the addFrequencyInfo to set