Package clickDetector
Class ClickSpectrum
java.lang.Object
Layout.PamFramePlots
clickDetector.ClickDisplay
clickDetector.ClickSpectrum
- All Implemented Interfaces:
 PamSettings,SettingsNameProvider,PamObserver
- 
Field Summary
Fields - 
Constructor Summary
ConstructorsConstructorDescriptionClickSpectrum(ClickControl clickControl, ClickDisplayManager clickDisplayManager, clickDetector.ClickDisplayManager.ClickDisplayInfo clickDisplayInfo) ClickSpectrum(STClickControl clickControl, ClickDisplayManager clickDisplayManager, clickDetector.ClickDisplayManager.ClickDisplayInfo clickDisplayInfo) Constructor needed when creating the SoundTrap Click Detector - need to explicitly cast from STClickControl to ClickControl, or else constructor fails - 
Method Summary
Modifier and TypeMethodDescriptionvoidaddData(PamObservable o, PamDataUnit arg) Informs the PamObserver that new data have been added to the Observable classvoidvoidclickedOnClick(ClickDetection click) double[]convertTemplate(ClickTemplate clickTemplate, boolean log) This function converts a ClickTemplate to an fft which corresponds to the correct samplerate used in the current click data.doublecorrelate(double[] wave1, double[] wave2) Take two double arrays, not necessarily the same frequency or same number of bins and correlate;protected static GeneralPathdrawPolygon(double[] data, double maxVal, double xScale, double yScale, boolean log, Rectangle r) Create a closed normalised polygon from a double array.voidgetEventClick(ClickDetection newClick) getName()Get a unique name for the displaylonglongvoidvoidmasterClockUpdate(long milliSeconds, long sampleNumber) double[]meanSpectrum(ArrayList<double[]> eventSpectrums) voidnewClick(ClickDetection newClick) double[]normailiseSpectrum(double[] Spectrum) double[][]normailiseSpectrum(double[][] eventSpectrums) voidvoidreceiveSourceNotification(int type, Object object) Receive a notification from the data source - typically a change in DAQ status.voidcalled when an Observable (PamDataBlock) is removed from the systembooleanrestoreSettings(PamControlledUnitSettings pamControlledUnitSettings) voidsetClickTemplateParams(ClickSpectrumTemplateParams clickTemplateParams) voidsetSampleRate(float sampleRate, boolean notify) New sample rateprotected voidshowClick(ClickDetection newClick) voidupdateData(PamObservable observable, PamDataUnit pamDataUnit) Informs the PamObserver that existing data have been updatedMethods inherited from class clickDetector.ClickDisplay
created, getClickDisplayInfo, offlineDataChanged, pamStart, pamStopMethods inherited from class Layout.PamFramePlots
checkDualDisplay, getAxisPanel, getCopyMenuItem, getEastPanel, getFrame, getLeftPlotPanel, getNorthPanel, getPlotPanel, getRightPlotPanel, getSouthPanel, getWestPanel, repaint, setAxisPanel, setEastPanel, setFrame, setLeftPlotPanel, setNorthPanel, setPlotPanel, setRightPlotPanel, setSouthPanel, setWestPanel 
- 
Field Details
- 
isViewer
protected boolean isViewer 
 - 
 - 
Constructor Details
- 
ClickSpectrum
public ClickSpectrum(ClickControl clickControl, ClickDisplayManager clickDisplayManager, clickDetector.ClickDisplayManager.ClickDisplayInfo clickDisplayInfo)  - 
ClickSpectrum
public ClickSpectrum(STClickControl clickControl, ClickDisplayManager clickDisplayManager, clickDetector.ClickDisplayManager.ClickDisplayInfo clickDisplayInfo) Constructor needed when creating the SoundTrap Click Detector - need to explicitly cast from STClickControl to ClickControl, or else constructor fails- Parameters:
 clickControl-clickDisplayManager-clickDisplayInfo-
 
 - 
 - 
Method Details
- 
getObserverObject
- Specified by:
 getObserverObjectin interfacePamObserver- Returns:
 - the actual observer. In most cases concrete classes will just return 'this' in response. The exception is the Threaded observer, which will return the single thread observer.
 
 - 
drawPolygon
protected static GeneralPath drawPolygon(double[] data, double maxVal, double xScale, double yScale, boolean log, Rectangle r) Create a closed normalised polygon from a double array. The size of the array is based on the window width. ONLY use for drawing spectrums.- Parameters:
 data- - datatoDrawmaxVal- - maximum value of this dataxScale- - the value of each pixel in xyScale- -the value of each pixel in ylog- - whether thisis a log scale or not- Returns:
 
 - 
clearTemplates
public void clearTemplates() - 
getName
Description copied from class:PamFramePlotsGet a unique name for the display- Specified by:
 getNamein classPamFramePlots- Returns:
 - a unique name for the display.
 
 - 
newClick
 - 
showClick
 - 
getEventClick
 - 
convertTemplate
This function converts a ClickTemplate to an fft which corresponds to the correct samplerate used in the current click data.- Parameters:
 clickTemplate-- Returns:
 
 - 
getTemplateClick
public void getTemplateClick() - 
meanSpectrum
 - 
normailiseSpectrum
public double[] normailiseSpectrum(double[] Spectrum)  - 
normailiseSpectrum
public double[][] normailiseSpectrum(double[][] eventSpectrums)  - 
correlate
public double correlate(double[] wave1, double[] wave2) Take two double arrays, not necessarily the same frequency or same number of bins and correlate;- Returns:
 
 - 
getObserverName
- Specified by:
 getObserverNamein interfacePamObserver
 - 
getRequiredDataHistory
- Specified by:
 getRequiredDataHistoryin interfacePamObserver- Parameters:
 arg- optional argument from PamObservable- Returns:
 - time in milliseconds required by data held in PamObservable
 
 - 
noteNewSettings
public void noteNewSettings()- Specified by:
 noteNewSettingsin interfacePamObserver- Specified by:
 noteNewSettingsin classClickDisplay
 - 
removeObservable
Description copied from interface:PamObservercalled when an Observable (PamDataBlock) is removed from the system- Specified by:
 removeObservablein interfacePamObserver
 - 
setSampleRate
public void setSampleRate(float sampleRate, boolean notify) Description copied from interface:PamObserverNew sample rate- Specified by:
 setSampleRatein interfacePamObserver- Parameters:
 sampleRate-notify- Notify other PamObservers and PamObservables in the chain.
 - 
masterClockUpdate
public void masterClockUpdate(long milliSeconds, long sampleNumber) - Specified by:
 masterClockUpdatein interfacePamObserver
 - 
addData
Description copied from interface:PamObserverInforms the PamObserver that new data have been added to the Observable class- Specified by:
 addDatain interfacePamObserver
 - 
updateData
Description copied from interface:PamObserverInforms the PamObserver that existing data have been updated- Specified by:
 updateDatain interfacePamObserver
 - 
getStoredClick
 - 
clickedOnClick
- Overrides:
 clickedOnClickin classClickDisplay
 - 
getSettingsReference
- Specified by:
 getSettingsReferencein interfacePamSettings- Returns:
 - The serialisable object that will be stored
 
 - 
getSettingsVersion
public long getSettingsVersion()- Specified by:
 getSettingsVersionin interfacePamSettings- Returns:
 - An integer version number for the settings
 
 - 
getUnitName
- Specified by:
 getUnitNamein interfaceSettingsNameProvider- Returns:
 - A Name specific to this instance of the particular class, e.g. Sperm whale detector, Beaked whale detector, etc.
 
 - 
getUnitType
- Specified by:
 getUnitTypein interfacePamSettings- Returns:
 - A Name specific to the type, e.g. Click detector
 
 - 
getClickTemplateParams
 - 
setClickTemplateParams
 - 
restoreSettings
- Specified by:
 restoreSettingsin interfacePamSettings- Parameters:
 pamControlledUnitSettings-- Returns:
 - true if successful The object performs final checks (if needed) and then casts the settings data pamcontrolledunitSettings.settings into the correct type and uses as required
 
 - 
receiveSourceNotification
Description copied from interface:PamObserverReceive a notification from the data source - typically a change in DAQ status. See the constants listed in AcquisitionProcess for potential change types.- Specified by:
 receiveSourceNotificationin interfacePamObserver- Parameters:
 type- the type of changeobject- generic object added here so that we can include anything in the future
 
 -