Package clickTrainDetector
Class CTDataUnit
- All Implemented Interfaces:
Comparable<PamDataUnit>
,PamDetection
,AcousticDataUnit
,RawDataHolder
Data unit for a click train which holds a series of data units grouped into a click train.
- Author:
- Jamie Macaulay
-
Field Summary
Modifier and TypeFieldDescriptionThe average waveform.Chi^2 value for the click train.The classifications for the click train.static int
The default FFT length for the average templates. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addCtClassification
(CTClassification ctClassification) Adds a classification for the click train.int
addSubDetection
(PamDataUnit subDetection) Add a sub detection to the sub detection list.int
addSubDetections
(List<PamDataUnit> list) Add multiple sub detections from a list.void
addToAverageWaveform
(PamDataUnit dataUnit) Adds to the average waveform is the data unit contains raw info.void
void
Clear all classification results from the data unitvoid
Force an update of the IDI calculation.double[]
Get an average spectrum for the data unit.double[]
Get an average waveform for the data unit.int
Get the the classification index (this is to set one classification as the "master" classifications).Set the click train algorithm info class.Get the chi^2 value for the click train.Get the click train's classification.Get the raw data transforms class.Get the IDI info for the dataReturn an html formatted summary string describing the detection which can be used in tooltips anywhere in PAMGuard.double[][]
Get arrays of raw audio data, one per channel.boolean
Check whether a click train should be junkedvoid
Remove all sub detection information.void
setAverageWaveform
(AverageWaveform averageWaveform2) Set the average waveform.void
setClassificationIndex
(int i) The index of the classification (this is to set one classification as the "master" classifications).void
setCTAlgorithmInfo
(CTAlgorithmInfo ctAlgorithmInfo) Set the click train algorithm info class.void
Set the chi^2 value for the click train.void
setIDIInfo
(IDIInfo idiInfo) Set the current IDI info.void
setJunkTrain
(boolean junkTrain) Set whther a click train should be junked.Methods inherited from class clickTrainDetector.CTDetectionGroupDataUnit
calcMinMaxAng, calcStartSample, calcSummaryUnits, clearSummaryDataUnits, getAngleRange, getSummaryUnits
Methods inherited from class PamguardMVC.superdet.SuperDetection
addSubDetectionInfo, clearSubDetectionData, clearSubDetectionObjects, clearSubdetectionsRemoved, findSubDetection, findSubDetection, findSubDetection, findSubdetectionInfo, findSubDetectionInfo, getLoadedSubDetectionsCount, getPresentSubDetections, getSubDetection, getSubdetectionInfo, getSubDetectionInfo, getSubDetections, getSubDetectionsCount, getSubdetectionsRemoved, getSubDetectionSyncronisation, isAllowSubdetectionSharing, removeSubDetection, replaceSubDetection, sortSubDetections
Methods inherited from class PamguardMVC.PamDataUnit
addDataAnnotation, addSuperDetection, amplifyMeasuredAmplitudeByDB, amplifyMeasuredAmplitudeByLinear, calcSnapshotGeometry, clearOandAngles, clearUpdateCount, compareTo, findDataAnnotation, findDataAnnotation, freeData, getAbsBlockIndex, getAmplitudeDB, getAnnotationsSummaryString, getBasicData, getCalculatedAmlitudeDB, getChannelBitmap, getColourIndex, getDataAnnotation, getDatabaseIndex, getDatabaseUpdateOf, getDataUnitFileInformation, getDataUnitPopupMenu, getDurationInMilliseconds, getEndTimeInMilliseconds, getFrequency, getFrequencyOverlap, getHydrophoneBitmap, getHydrophoneHeading, getLastChangeTime, getLastSample, getLastUpdateTime, getLocalisation, getMeasuredAmplitude, getMeasuredAmplitudeType, getNoiseBackground, getNumDataAnnotations, getOriginLatLong, getParentDataBlock, getSampleDuration, getSampleDurationAsInt, getSeconds, getSequenceBitmap, getSequenceBitmapObject, getSignalExcess, getSignalSPL, getSnapshotGeometry, getStartSample, getSuperDetection, getSuperDetection, getSuperDetection, getSuperDetection, getSuperDetection, getSuperDetectionsCount, getSuperDetectionSyncronisation, getSuperId, getTimeDelaysSeconds, getTimeMilliseconds, getTimeNanoseconds, getTimeOverlap, getUID, getUpdateCount, isEmbryonic, isForceAmpRecalc, linAmplitudeToDB, removeDataAnnotation, removeDataAnnotation, removeSuperDetection, setAbsBlockIndex, setCalculatedAmlitudeDB, setChannelBitmap, setDatabaseIndex, setDatabaseUpdateOf, setDataUnitFileInformation, setDurationInMilliseconds, setEmbryonic, setForceAmpRecalc, setFrequency, setInfo, setLastUpdateTime, setLocalisation, setMeasuredAmpAndType, setMeasuredAmplitude, setMeasuredAmplitudeType, setNoiseBackground, setParentDataBlock, setSampleDuration, setSequenceBitmap, setSignalExcess, setSignalSPL, setSnapshotGeometry, setStartSample, setTimeDelaysSeconds, setTimeMilliseconds, setUID, setUniqueSuperDetection, sortOutputMaps, updateDataUnit
-
Field Details
-
chi2
Chi^2 value for the click train. -
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
The average waveform. -
defaultFFTLen
public static int defaultFFTLenThe 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
Description copied from class:SuperDetection
Add multiple sub detections from a list.- Overrides:
addSubDetections
in classCTDetectionGroupDataUnit
- Parameters:
list
- List of new sub detections- Returns:
- total number of sub detections now in the super detection
-
addSubDetection
Description copied from class:SuperDetection
Add a sub detection to the sub detection list.- Overrides:
addSubDetection
in classSuperDetection<PamDataUnit>
- Parameters:
subDetection
- - the sub detection to add.- Returns:
- - the total number of sub detections now in the list. .
-
checkAverageWaveformInfo
public void checkAverageWaveformInfo() -
addToAverageWaveform
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 classSuperDetection<PamDataUnit>
-
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
Set the chi^2 value for the click train.- Parameters:
chi
- ^2 the chi^2 value to set.
-
getCtClassifications
Get the click train's classification.- Returns:
- the ctClassification
-
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
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
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
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 classPamDataUnit<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
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 interfaceRawDataHolder
- Returns:
- arrays of raw data by channel
-
setCTAlgorithmInfo
Set the click train algorithm info class.- Parameters:
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
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 interfaceRawDataHolder
- Returns:
- the data transforms object.
-
setIDIInfo
Set the current IDI info.- Parameters:
idiInfo
- - the IDI info.
-