Package tethys.pamdata
Class AutoTethysProvider
java.lang.Object
tethys.pamdata.AutoTethysProvider
- All Implemented Interfaces:
 TethysDataProvider
- Direct Known Subclasses:
 ClickEventTethysDataProvider,ClickTethysDataProvider,ClickTrainTethysProvider,DetectionGroupTethysProvider,DLTethysDataProvider,GPLTethysProvider,Group3DTethysProvider,IshmaelTethysProvider,RoccaTethysProvider,RWTethysDataProvider,TethysNoiseDataProvider,WhistleMoanTethysProvider,WslClassTethysProvider
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
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionstatic ElementaddUserDefined(nilus.Detection.Parameters parameters, String parameterName, String parameterValue) booleancanExportLocalisations(nilus.GranularityEnumType granularityType) See if it's possible for this block to export localisations.nilus.DetectioncreateDetection(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.AlgorithmTypegetAlgorithm(Collection collection) Get Algorithm information for a Tethys Detections documentnilus.AlgorithmType.ParametersGet the algorithm parameters.nilus.GranularityEnumType[]Get a list of allowed granularity types for this outputnilus.DescriptionTypegetDescription(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.voidgetEffortKinds(PDeployment pDeployment, List<nilus.DetectionEffortKind> effortKinds, StreamExportParams exportParams) Fill in the effort kind list for the top of a Detections document.Get the localisation algorithm (if there is one).Get localisation info for the datablock.nilus.AlgorithmType.ParametersLocalisation parameters.protected PamDataBlockbooleangranularityOK(nilus.GranularityEnumType granularityType) Granularity is OK for export.booleanTrue if the datablock is detections.booleanpackAnnotation(DataAnnotation annotation, PamDataUnit dataUnit) static doubleroundDecimalPlaces(double value, int decPlaces) static doubleroundSignificantFigures(double value, int sigFigs) voidsetAddFrequencyInfo(boolean addFrequencyInfo) booleanwantExportDialogCard(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:TethysDataProviderGet DescriptionType object to include in a Tethys Detections document.- Specified by:
 getDescriptionin interfaceTethysDataProvider- Parameters:
 deployment-tethysExportParams-- Returns:
 - Tethys DescriptionType object, which contains infromation about detections
 
 - 
getAlgorithm
Description copied from interface:TethysDataProviderGet Algorithm information for a Tethys Detections document- Specified by:
 getAlgorithmin 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:TethysDataProviderGet the algorithm parameters.- Specified by:
 getAlgorithmParametersin interfaceTethysDataProvider- Returns:
 
 - 
createDetection
public nilus.Detection createDetection(PamDataUnit dataUnit, TethysExportParams tethysExportParams, StreamExportParams streamExportParams) Description copied from interface:TethysDataProviderCreate 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:
 createDetectionin interfaceTethysDataProvider- Parameters:
 dataUnit- PAMGuard data unittethysExportParams-streamExportParams-- Returns:
 - Detection Tethys Detection object.
 
 - 
packAnnotation
 - 
addUserDefined
 - 
getEffortKinds
public void getEffortKinds(PDeployment pDeployment, List<nilus.DetectionEffortKind> effortKinds, StreamExportParams exportParams) Description copied from interface:TethysDataProviderFill 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:
 getEffortKindsin interfaceTethysDataProvider- Parameters:
 pDeployment-effortKinds- tethys object list to add to.exportParams-
 - 
getDetectionsMethod
Description copied from interface:TethysDataProviderGet 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:
 getDetectionsMethodin interfaceTethysDataProvider- Returns:
 
 - 
getAllowedGranularities
public nilus.GranularityEnumType[] getAllowedGranularities()Description copied from interface:TethysDataProviderGet a list of allowed granularity types for this output- Specified by:
 getAllowedGranularitiesin interfaceTethysDataProvider- Returns:
 - list of granularities.
 
 - 
getDetectionsName
Description copied from interface:TethysDataProviderGet 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:
 getDetectionsNamein 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:TethysDataProviderSee 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:
 wantExportDialogCardin interfaceTethysDataProvider- Parameters:
 wizPanel-- Returns:
 
 - 
getTethysControl
- Returns:
 - the tethysControl
 
 - 
hasDetections
public boolean hasDetections()Description copied from interface:TethysDataProviderTrue 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:
 hasDetectionsin interfaceTethysDataProvider- Returns:
 
 - 
canExportLocalisations
public boolean canExportLocalisations(nilus.GranularityEnumType granularityType) Description copied from interface:TethysDataProviderSee if it's possible for this block to export localisations. This may depend on the selected granularity.- Specified by:
 canExportLocalisationsin interfaceTethysDataProvider- Parameters:
 granularityType-- Returns:
 
 - 
granularityOK
public boolean granularityOK(nilus.GranularityEnumType granularityType) Granularity is OK for export.- Parameters:
 granularityType-- Returns:
 
 - 
getLocalisationAlgorithm
Description copied from interface:TethysDataProviderGet the localisation algorithm (if there is one). This is generally found automatically from the datablock, but it may be necessary to override.- Specified by:
 getLocalisationAlgorithmin interfaceTethysDataProvider- Returns:
 - Localisation Algorithm, or null.
 
 - 
getLocalisationInfo
Description copied from interface:TethysDataProviderGet localisation info for the datablock. Can be null, but probably never is. More likely to have a zero of available types;- Specified by:
 getLocalisationInfoin interfaceTethysDataProvider- Returns:
 
 - 
getPamDataBlock
- Returns:
 - the pamDataBlock
 
 - 
isAddFrequencyInfo
public boolean isAddFrequencyInfo()- Returns:
 - the addFrequencyInfo
 
 - 
setAddFrequencyInfo
public void setAddFrequencyInfo(boolean addFrequencyInfo) - Parameters:
 addFrequencyInfo- the addFrequencyInfo to set
 
 -