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
FieldsModifier and TypeFieldDescriptionThe average waveform.Chi^2 value for the click train.The classifications for the click train.static intThe default FFT length for the average templates.Fields inherited from class PamguardMVC.PamDataUnit
absBlockIndex, localisation - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionvoidaddCtClassification(CTClassification ctClassification) Adds a classification for the click train.intaddSubDetection(PamDataUnit subDetection) Add a sub detection to the sub detection list.intaddSubDetections(List<PamDataUnit> list) Add multiple sub detections from a list.voidaddToAverageWaveform(PamDataUnit dataUnit) Adds to the average waveform is the data unit contains raw info.voidvoidClear all classification results from the data unitvoidForce an update of the IDI calculation.double[]Get an average spectrum for the data unit.double[]Get an average waveform for the data unit.intGet 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.booleanCheck whether a click train should be junkedvoidRemove all sub detection information.voidsetAverageWaveform(AverageWaveform averageWaveform2) Set the average waveform.voidsetClassificationIndex(int i) The index of the classification (this is to set one classification as the "master" classifications).voidsetCTAlgorithmInfo(CTAlgorithmInfo ctAlgorithmInfo) Set the click train algorithm info class.voidSet the chi^2 value for the click train.voidsetIDIInfo(IDIInfo idiInfo) Set the current IDI info.voidsetJunkTrain(boolean junkTrain) Set whther a click train should be junked.Methods inherited from class clickTrainDetector.CTDetectionGroupDataUnit
calcMinMaxAng, calcStartSample, calcSummaryUnits, clearSummaryDataUnits, getAngleRange, getSummaryUnitsMethods 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, sortSubDetectionsMethods 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, getGpsPosition, 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:SuperDetectionAdd multiple sub detections from a list.- Overrides:
 addSubDetectionsin classCTDetectionGroupDataUnit- Parameters:
 list- List of new sub detections- Returns:
 - total number of sub detections now in the super detection
 
 - 
addSubDetection
Description copied from class:SuperDetectionAdd a sub detection to the sub detection list.- Overrides:
 addSubDetectionin 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:SuperDetectionRemove all sub detection information.- Overrides:
 removeAllSubDetectionsin 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:PamDataUnitReturn an html formatted summary string describing the detection which can be used in tooltips anywhere in PAMGuard.- Overrides:
 getSummaryStringin 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:RawDataHolderGet arrays of raw audio data, one per channel. Assume that the array matches getChannelMap() !- Specified by:
 getWaveDatain 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:RawDataHolderGet 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:
 getDataTransformsin interfaceRawDataHolder- Returns:
 - the data transforms object.
 
 - 
setIDIInfo
Set the current IDI info.- Parameters:
 idiInfo- - the IDI info.
 
 -