Package tethys.pamdata
Class AutoTethysProvider
java.lang.Object
tethys.pamdata.AutoTethysProvider
- All Implemented Interfaces:
TethysDataProvider
- Direct Known Subclasses:
ClickEventTethysDataProvider
,ClickTethysDataProvider
,DLTethysDataProvider
,IshmaelTethysProvider
,RWTethysDataProvider
,TethysNoiseDataProvider
,WhistleMoanTethysProvider
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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddUserDefined
(nilus.Detection.Parameters parameters, String parameterName, String parameterValue) boolean
canExportLocalisations
(nilus.GranularityEnumType granularityType) See if it's possible for this block to export localisations.nilus.Detection
createDetection
(PamDataUnit dataUnit, TethysExportParams tethysExportParams, StreamExportParams streamExportParams) 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.nilus.AlgorithmType
getAlgorithm
(Collection collection) Get Algorithm information for a Tethys Detections documentnilus.AlgorithmType.Parameters
Get the algorithm parameters.nilus.GranularityEnumType[]
Get a list of allowed granularity types for this outputnilus.DescriptionType
getDescription
(nilus.Deployment deployment, TethysExportParams tethysExportParams) Get DescriptionType object to include in a Tethys Detections document.Get a standard Method string for each detector.Get a name for the detections documents.void
getEffortKinds
(PDeployment pDeployment, List<nilus.DetectionEffortKind> effortKinds, StreamExportParams exportParams) Fill in the effort kind list for the top of a Detections document.Get localisation info for the datablock.nilus.AlgorithmType.Parameters
Localisation parameters.boolean
granularityOK
(nilus.GranularityEnumType granularityType) Granularity is OK for export.boolean
True if the datablock is detections.boolean
static double
roundDecimalPlaces
(double value, int decPlaces) static double
roundSignificantFigures
(double value, int sigFigs) void
setAddFrequencyInfo
(boolean addFrequencyInfo) boolean
wantExportDialogCard
(ExportWizardCard wizPanel) See if a particular card should be used in the export wizard.
-
Constructor Details
-
AutoTethysProvider
-
-
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 interfaceTethysDataProvider
- Returns:
- Tethys DescriptionType object, which contains infromation about detections
-
getAlgorithm
Description copied from interface:TethysDataProvider
Get Algorithm information for a Tethys Detections document- Specified by:
getAlgorithm
in interfaceTethysDataProvider
- 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 interfaceTethysDataProvider
- 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 interfaceTethysDataProvider
- Parameters:
dataUnit
- PAMGuard data unit- Returns:
- Detection Tethys Detection object.
-
addUserDefined
-
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 interfaceTethysDataProvider
- Parameters:
effortKinds
- tethys object list to add to.
-
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 interfaceTethysDataProvider
- 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 interfaceTethysDataProvider
- Returns:
- list of granularities.
-
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 interfaceTethysDataProvider
- 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
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 interfaceTethysDataProvider
- Returns:
-
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 interfaceTethysDataProvider
- 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 interfaceTethysDataProvider
- Returns:
-
granularityOK
public boolean granularityOK(nilus.GranularityEnumType granularityType) Granularity is OK for export.- Parameters:
granularityType
-- Returns:
-
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 interfaceTethysDataProvider
- Returns:
-
isAddFrequencyInfo
public boolean isAddFrequencyInfo()- Returns:
- the addFrequencyInfo
-
setAddFrequencyInfo
public void setAddFrequencyInfo(boolean addFrequencyInfo) - Parameters:
addFrequencyInfo
- the addFrequencyInfo to set
-