IshmaelLocator
Class IshLocProcess

java.lang.Object
  extended by PamguardMVC.PamProcess
      extended by IshmaelLocator.IshLocProcess
All Implemented Interfaces:
Annotator, PamObserver, SpectrogramMarkObserver
Direct Known Subclasses:
IshLocHyperbProcess, IshLocPairProcess

public abstract class IshLocProcess
extends PamProcess
implements SpectrogramMarkObserver

This is a superclass to a "real" localization class. It gathers the necessary data (samples, phone positions, etc.) for the subclass, then calls calcData(), which the subclass should define. Current children include IshLocPairProcess and IshLocHyperbProcess.

Author:
Dave Mellinger

Field Summary
(package private)  double[][] arraygeom
           
(package private)  double c
           
(package private)  int[] hydlist
           
 Complex[] inputData
           
(package private)  IshLocControl ishLocControl
           
(package private)  PamDataBlock<PamDetection> outputDataBlock
           
(package private)  Complex[] v1
           
(package private)  Complex[] v2
           
 
Fields inherited from class PamguardMVC.PamProcess
outputDataBlocks, processName, sampleRate
 
Fields inherited from interface Spectrogram.SpectrogramMarkObserver
MOUSE_DOWN, MOUSE_UP
 
Constructor Summary
IshLocProcess(IshLocControl ishLocControl)
           
 
Method Summary
(package private) abstract  IshLocalisation calcData(PamDetection outputUnit, int referencePhones, double[][] selectionSams, double rawSampleRate, double f0, double f1)
          calcData, which is declared here but defined only in subclasses, uses the selectionSams to calculate a location, which is returned.
 void doLocalisation(long startSam, long durationSam, double f0, double f1, PamRawDataBlock daqBlock)
          Do the localization for the call delineated by startMsec, durationMsec, f0, and f1.
 PamDataBlock getInputDataBlock()
          An IshLocProcess has one input stream (data block).
 java.lang.String getMarkObserverName()
           
abstract  java.lang.String getName()
           
 void newData(PamObservable o, PamDataUnit arg1)
          Data for localization can arrive from either an upstream data source or from the user drawing a box on the spectrogram.
 void pamStart()
          Called for each process to tell it to start (may not be necessary for processes which are listening for data anyway.
 void pamStop()
          Stops the process.
protected  void prepareMyParams()
           
 void setParentDataBlock(PamDataBlock newParentDataBlock)
          Set a parent data block with the default options of rethreading if set
 void setupConnections()
           
 void spectrogramNotification(SpectrogramDisplay display, int downUp, int channel, long startMsec, long durationMsec, double f0, double f1)
          Data for localization can arrive from either an upstream data source or from the user drawing a box on the spectrogram.
 
Methods inherited from class PamguardMVC.PamProcess
absMillisecondsToSamples, absSamplesToMilliseconds, addOutputDataBlock, changedThreading, clearOldData, createAnnotations, destroyProcess, fillXMLElement, fillXMLParameters, getAncestorDataBlock, getAnnotation, getBackendProcess, getChainPosition, getCpuPercent, getNumAnnotations, getNumOutputDataBlocks, getObserverName, getObserverObject, getOfflineData, getOutputDataBlock, getPamControlledUnit, getParentDataBlock, getParentProcess, getProcessName, getRawSourceDataBlock, getRequiredDataHistory, getSampleRate, getSourceDataBlock, getSourceProcess, isCanMultiThread, makePamProcess, masterClockUpdate, noteNewSettings, notifyModelChanged, prepareProcess, relMillisecondsToSamples, relSamplesToMilliseconds, removeObservable, removeOutputDatablock, saveViewerData, setBackendProcess, setCanMultiThread, setParentDataBlock, setProcessName, setSampleRate, setupProcess, toString, update, updateData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

arraygeom

double[][] arraygeom

c

double c

inputData

public Complex[] inputData

hydlist

int[] hydlist

v1

Complex[] v1

v2

Complex[] v2

ishLocControl

IshLocControl ishLocControl

outputDataBlock

PamDataBlock<PamDetection> outputDataBlock
Constructor Detail

IshLocProcess

public IshLocProcess(IshLocControl ishLocControl)
Method Detail

getName

public abstract java.lang.String getName()

setParentDataBlock

public void setParentDataBlock(PamDataBlock newParentDataBlock)
Description copied from class: PamProcess
Set a parent data block with the default options of rethreading if set

Overrides:
setParentDataBlock in class PamProcess
Parameters:
newParentDataBlock - source data block.

getInputDataBlock

public PamDataBlock getInputDataBlock()
An IshLocProcess has one input stream (data block). Return it, or null if it's not available.


setupConnections

public void setupConnections()

prepareMyParams

protected void prepareMyParams()

spectrogramNotification

public void spectrogramNotification(SpectrogramDisplay display,
                                    int downUp,
                                    int channel,
                                    long startMsec,
                                    long durationMsec,
                                    double f0,
                                    double f1)
Data for localization can arrive from either an upstream data source or from the user drawing a box on the spectrogram. This is the routine for capturing user box-drawing.

Specified by:
spectrogramNotification in interface SpectrogramMarkObserver
Parameters:
display - spectrogram display; ignored
downUp - mouse action (only MOUSE_UP events are used)
channel - which channel was drawn on; ignored
startMsec - in absolute msec (since 1970)
durationMsec -
f0,f1 - frequency range of the selection

newData

public void newData(PamObservable o,
                    PamDataUnit arg1)
Data for localization can arrive from either an upstream data source or from the user drawing a box on the spectrogram. This is the routine for data arriving from upstream.

Overrides:
newData in class PamProcess
Parameters:
arg1 - data arriving from upstream; type must be PamDetection (or a subclass of it)

doLocalisation

public void doLocalisation(long startSam,
                           long durationSam,
                           double f0,
                           double f1,
                           PamRawDataBlock daqBlock)
Do the localization for the call delineated by startMsec, durationMsec, f0, and f1.

Parameters:
startSam - in absolute msec (since 1970)
durationSam -
f0,f1 - frequency range to use in calculating the loc
daqProcess - the PamProcess producing raw audio data, needed for getting hydrophone info

getMarkObserverName

public java.lang.String getMarkObserverName()
Specified by:
getMarkObserverName in interface SpectrogramMarkObserver

calcData

abstract IshLocalisation calcData(PamDetection outputUnit,
                                  int referencePhones,
                                  double[][] selectionSams,
                                  double rawSampleRate,
                                  double f0,
                                  double f1)
                           throws noLocationFoundException
calcData, which is declared here but defined only in subclasses, uses the selectionSams to calculate a location, which is returned. Note that the class variables arraygeom[][] and c are available for use by the subclass.

Throws:
noLocationFoundException

pamStart

public void pamStart()
Description copied from class: PamProcess
Called for each process to tell it to start (may not be necessary for processes which are listening for data anyway.

Specified by:
pamStart in class PamProcess

pamStop

public void pamStop()
Description copied from class: PamProcess
Stops the process.

Specified by:
pamStop in class PamProcess