Class MLGridBearingLocaliser2
java.lang.Object
Localiser.algorithms.timeDelayLocalisers.bearingLoc.MLGridBearingLocaliser2
- All Implemented Interfaces:
 BearingLocaliser,LocalisationAlgorithm,LocalisationAlgorithmInfo
- Direct Known Subclasses:
 MLLineBearingLocaliser2
Revamp of the earlier MLGridBearingLocaliser but with a more sensible 
 coordinate frame. 
Now oriented the 'globe' differently, so that the first angle can be between -Pi and +Pi or between 0 and 2Pi. The second angle is the elevation angle which is either up (+ve angles) or down (-ve angles) having a range of -Pi/2 to +Pi/2. This change will only affect data from volumetrica arrays when the animal is at significant depth.
Now oriented the 'globe' differently, so that the first angle can be between -Pi and +Pi or between 0 and 2Pi. The second angle is the elevation angle which is either up (+ve angles) or down (-ve angles) having a range of -Pi/2 to +Pi/2. This change will only affect data from volumetrica arrays when the animal is at significant depth.
- Author:
 - Doug Gillespie
 
- 
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassFor passing to Tethys output. - 
Constructor Summary
ConstructorsConstructorDescriptionMLGridBearingLocaliser2(int[] hydrophoneList, long timMillis, double timingError) MLGridBearingLocaliser2(int hydrophoneBitMap, long timMillis, double timingError)  - 
Method Summary
Modifier and TypeMethodDescriptionGet information about the localisation algorithm.Get the algorithm nameGet the principle axis of the arrayintintGet a hydrophone map for this localiserdouble[][]intGet the likely content flags for this localiser.getLocalizationOptionsPanel(Window parent, LocalizationBuilder locBuilder) Get options panel to either build into the export dialog or to show as a separate dialog (in which case export wizard will show a button).Get the algorithm parameters.Get something that can make LocalisationType objects of a form a bit bespoke to the type of localiser.double[][]localise(double[] delays, long timeMillis) Calculate angles theta and phi, based on a set of delays.double[][]localiseByBisection(double[] delays) double[][]localiseByCrawl(double[] delays, long timeMillis) voidprepare(int[] arrayElements, long timMillis, double timingError) Do any preparation necessary (e.g.voidsetAnalysisAngles(double[] thetaRange, double[] phiRange) Set the angles to analyse and call the prepare method to set everything up.protected intthetaAngleToBin(double theta) Convert an angle into a bin, constrained to 0 invalid input: '<'= bin invalid input: '<' nBinsprotected doublethetaBinToAngle(double bin) Convert a bin into an angle. 
- 
Constructor Details
- 
MLGridBearingLocaliser2
public MLGridBearingLocaliser2(int hydrophoneBitMap, long timMillis, double timingError)  - 
MLGridBearingLocaliser2
public MLGridBearingLocaliser2(int[] hydrophoneList, long timMillis, double timingError)  
 - 
 - 
Method Details
- 
prepare
public void prepare(int[] arrayElements, long timMillis, double timingError) Description copied from interface:BearingLocaliserDo any preparation necessary (e.g. creation of look up tables)- Specified by:
 preparein interfaceBearingLocaliser- Parameters:
 arrayElements- list of hydrophone array elements in the sub array for this localiser.timMillis- , current time for this localisationtimingError- expected timing error for each measurement (typically 1/12 of an ADC bin, or less if interpolation is being used in the cross correlation function).
 - 
getLocalisationContents
public int getLocalisationContents()Description copied from interface:LocalisationAlgorithmInfoGet the likely content flags for this localiser.- Specified by:
 getLocalisationContentsin interfaceLocalisationAlgorithmInfo- Returns:
 - localisation flags.
 - See Also:
 
 - 
thetaBinToAngle
protected double thetaBinToAngle(double bin) Convert a bin into an angle.- Parameters:
 bin- bin index- Returns:
 - angle
 
 - 
thetaAngleToBin
protected int thetaAngleToBin(double theta) Convert an angle into a bin, constrained to 0 invalid input: '<'= bin invalid input: '<' nBins- Parameters:
 theta- angle- Returns:
 - bin
 
 - 
getArrayAxis
Description copied from interface:BearingLocaliserGet the principle axis of the array- Specified by:
 getArrayAxisin interfaceBearingLocaliser- Returns:
 - for a linear array this will be a vector along the array;
for a planar array, this will be the vector on the plane between two hydrophones which is closest to the y axis.
 
 - 
getArrayType
public int getArrayType()- Specified by:
 getArrayTypein interfaceBearingLocaliser- Returns:
 - the type of array - linear, planar, volumetric, etc.
 
 - 
localise
public double[][] localise(double[] delays, long timeMillis) Description copied from interface:BearingLocaliserCalculate angles theta and phi, based on a set of delays. The number of delays should be equal to n(n-1)/2 where n is the number of hydrophone elements in the sub array.- Specified by:
 localisein interfaceBearingLocaliser- Parameters:
 delays- array of delay times.timeMillis- of this detection. This is relatively unused except in situation where hydrophone elements are moving relative to each other with time.- Returns:
 - theta, phi and their estimated errors all in radians. 
 
Data are packed into a two row array, the first row of which contains one or two angles, the second (optional) row contains the errors on those angles.
 
 - 
localiseByCrawl
public double[][] localiseByCrawl(double[] delays, long timeMillis)  - 
localiseByBisection
public double[][] localiseByBisection(double[] delays)  - 
getHydrophoneMap
public int getHydrophoneMap()Description copied from interface:BearingLocaliserGet a hydrophone map for this localiser- Specified by:
 getHydrophoneMapin interfaceBearingLocaliser- Returns:
 - bitmap of used hydrophones.
 
 - 
setAnalysisAngles
public void setAnalysisAngles(double[] thetaRange, double[] phiRange) Set the angles to analyse and call the prepare method to set everything up. Use the array elements, time, and timing error to the values that have already been specified- Parameters:
 thetaRange- the range for theta angles, specified in radians as [min max step]phiRange- the range for phi angles, specified in radians as [min max step]
 - 
getLikelihoodLUT
public double[][] getLikelihoodLUT()- Returns:
 - the likelihoodLUT
 
 - 
getAlgorithmName
Description copied from interface:LocalisationAlgorithmInfoGet the algorithm name- Specified by:
 getAlgorithmNamein interfaceLocalisationAlgorithmInfo- Returns:
 - algorithm name
 
 - 
getParameters
Description copied from interface:LocalisationAlgorithmInfoGet the algorithm parameters. Something else can turn these into xml for Tethys.- Specified by:
 getParametersin interfaceLocalisationAlgorithmInfo- Returns:
 - algorithm parameters object. Might be null;
 
 - 
getAlgorithmInfo
Description copied from interface:LocalisationAlgorithmGet information about the localisation algorithm.- Specified by:
 getAlgorithmInfoin interfaceLocalisationAlgorithm- Returns:
 - algorithm information.
 
 - 
getTethysCreator
Description copied from interface:LocalisationAlgorithmGet something that can make LocalisationType objects of a form a bit bespoke to the type of localiser. This may be better than having the standard functions in LocalizationBuilder guess what's best.- Specified by:
 getTethysCreatorin interfaceLocalisationAlgorithm- Returns:
 - can be null in which case standard functions will do the best they can.
 
 - 
getLocalizationOptionsPanel
public LocalizationOptionsPanel getLocalizationOptionsPanel(Window parent, LocalizationBuilder locBuilder) Description copied from interface:LocalisationAlgorithmInfoGet options panel to either build into the export dialog or to show as a separate dialog (in which case export wizard will show a button). Can be null if no options.- Specified by:
 getLocalizationOptionsPanelin interfaceLocalisationAlgorithmInfo- Parameters:
 locBuilder-- Returns:
 - options panel or null if there are no options.
 
 
 -