public abstract class AbstractLocalisation
extends java.lang.Object
Each AbstractLocalisation should be uniquely linked to a single PamDataUnit, since this class is abstract, where the actual data are stored (in the data unit or in the localisation) is up to the programmer.
This class has been through a number of iterations during 2007 and may well go through a few more before we are all happy with it. The main problem has been whether to reference positions purely by a hydrophone number, a time, a distance and bearing, or simply by a LatLong. It's ended up as a mixture of both.
Things are made worse by ambiguities which means that there may be one or more of each type of information. The key is to correctly set the types of information held within a particular localisation so that other parts of Pamguard may query it and act accordingly. It is vital that the PamDataBlock which will hold the PamDataUnits associated with a localisation have their localisationContents member correctly set to the full range of POSSIBLE localisation information types for the data units they will contain. This is important for the database and the various displays, which will all query the PamDataBlocks before the contain any PamDataUnits in order to see which columns to put in database tables, whether or not the data within a PamDataBlock may plot on a particular display, etc.
PamDataUnit
,
PamDataBlock
Modifier and Type | Field and Description |
---|---|
static int |
HAS_AMBIGUITY |
static int |
HAS_BEARING |
static int |
HAS_BEARINGERROR |
static int |
HAS_DEPTH |
static int |
HAS_DEPTHERROR |
static int |
HAS_LATLONG |
static int |
HAS_PERPENDICULARERRORS
Errors parallel and perpendicular to the ships track.
|
static int |
HAS_RANGE |
static int |
HAS_RANGEERROR |
static int |
HAS_XY |
static int |
HAS_XYZ |
Constructor and Description |
---|
AbstractLocalisation(PamDataUnit pamDataUnit,
int locContents,
int referenceHydrophones) |
AbstractLocalisation(PamDataUnit pamDataUnit,
int locContents,
int referenceHydrophones,
int arrayType,
PamVector[] arrayAxis) |
Modifier and Type | Method and Description |
---|---|
void |
addLocContents(int flagsToAdd) |
boolean |
bearingAmbiguity() |
double[] |
getAngleErrors() |
double[] |
getAngles() |
PamVector[] |
getArrayOrientationVectors() |
double |
getBearing()
Deprecated.
|
double |
getBearing(int iSide)
Deprecated.
|
double |
getBearingError()
Deprecated.
|
double |
getBearingError(int iSide) |
double |
getBearingReference()
Get the reference bearing in radians.
|
double |
getDepth()
Deprecated.
|
double |
getDepth(int iSide) |
double |
getDepthError()
Deprecated.
|
double |
getDepthError(int iSide) |
double |
getErrorDirection(int iSide)
Get an angle that the errors are to be plotted relative to.
|
LatLong |
getLatLong(int iSide)
Return the latlong for a location.
|
int |
getLocContents() |
int |
getNumLatLong() |
GpsData |
getOriginLatLong() |
double |
getParallelError(int iSide)
Get the error parallel to the trackline (in meters)
|
PamDataUnit |
getParentDetection() |
double |
getPerpendiculaError(int iSide)
Get the error perpedicular to the track line (in meters)
|
double[] |
getPlanarAngles()
returns angles projected onto the surface of a plane defined by the
first two (or first in the case of a linear array) array axis directions.
|
PamVector |
getPlanarVector()
Get a unit vector pointing towards this localisation
in the coordinate frame of the array geometry.
|
double |
getRange()
Deprecated.
|
double |
getRange(int iSide)
Get the range for a specific side (where ambiguity exists)
|
double |
getRangeError()
Deprecated.
|
double |
getRangeError(int iSide) |
PamVector[] |
getRealWorldVectors()
Get vectors to the detection in real world (relative to earths surface)
coordinates.
|
int |
getReferenceHydrophones() |
int |
getSubArrayType() |
double[] |
getTimeDelayErrors()
Time delay errors
|
double[] |
getTimeDelays()
Time delays in seconds.
|
PamVector[] |
getWorldVectors()
Get vectors pointing at this localisation in a real world coordinate frame.
|
boolean |
hasLocContent(int requiredContent)
Check that the localisation has specific content.
|
static java.util.ArrayList<java.lang.Integer> |
indexM1(int numberOfHydrophones) |
static java.util.ArrayList<java.lang.Integer> |
indexM2(int numberOfHydrophones)
IndexM1 and IndexM2 specify which hydrophones to calculate time delays between.
|
int |
removeLocContents(int flagsToRemove) |
void |
setArrayAxis(PamVector[] arrayAxis)
Set the array axis - one, two or three axes defining the principle
orientations of the array used for the localisation.
|
void |
setLocContents(int locContents) |
void |
setParentDetection(PamDetection parentDetection) |
void |
setReferenceHydrophones(int referenceHydrophones) |
void |
setSubArrayType(int arrayType)
Set the type of array (or sub array) used for this particular localisation
This may not be the entire array if detection was only on some channels.
|
public static final int HAS_BEARING
public static final int HAS_RANGE
public static final int HAS_DEPTH
public static final int HAS_BEARINGERROR
public static final int HAS_RANGEERROR
public static final int HAS_DEPTHERROR
public static final int HAS_LATLONG
public static final int HAS_XY
public static final int HAS_XYZ
public static final int HAS_AMBIGUITY
public static final int HAS_PERPENDICULARERRORS
public AbstractLocalisation(PamDataUnit pamDataUnit, int locContents, int referenceHydrophones)
public AbstractLocalisation(PamDataUnit pamDataUnit, int locContents, int referenceHydrophones, int arrayType, PamVector[] arrayAxis)
public int getSubArrayType()
Added DG 6 January 2010
public void setSubArrayType(int arrayType)
arrayType
- public PamVector[] getArrayOrientationVectors()
public void setArrayAxis(PamVector[] arrayAxis)
arrayAxis
- array axis vectors.public double[] getPlanarAngles()
In an ideal world, this plane will be aligned with the sea surface, in which case it will be relatively easy to convert these angles to a surface angle. However, the choice of array primary and secondary axes may vary a lot (depending on hydrophone order) and there is no implicit guarantee that these angles will be relative to the real x and y axis of the array.
For a linear array
this will just be +/- the theta angle, or the getBearing(0) angle and
there will be two of them, reflecting lr ambiguity.
For a planar array, the
angle will probably be a single angle, but will be projected onto the
plane of the array.
For a volumetric array, it will be a projection of the
two angles.
To use these data though, it will also be necessary to know the orientation of the principle axes of the array. For a linear array, this will just be the line of the array. For a planar and volumetric array, these may depend on the type of localiser used. The array axes should be available in arrayAxes.
The planar angles will be correct relative to the two primary array axis directions.
public PamVector getPlanarVector()
public PamVector[] getWorldVectors()
public PamVector[] getRealWorldVectors()
public double[] getAngles()
For a point array, null should be returned.
For a line array a single angle is returned which is the angle relative to the first orientation vector with 0 being in line with the orientation vector (can be thought of as colatitude).
For a planar or volumetric array, two angles should be returned, the first being the colatitude, the second being the longitude which will be between 0 and pi for a planar array and either -pi to pi or 0 to 2pi for a volumetric array.
public double[] getAngleErrors()
For a point array, null should be returned.
For a line array a single error is returned which is the angle relative to the first orientation vector with 0 being in line with the orientation vector (can be thought of as colatitude).
For a planar or volumetric array, two errors should be returned, the first being the error on colatitude, the second being the longitude which will be between 0 and pi for a planar array and either -pi to pi or 0 to 2pi for a volumetric array.
public static java.util.ArrayList<java.lang.Integer> indexM2(int numberOfHydrophones)
public static java.util.ArrayList<java.lang.Integer> indexM1(int numberOfHydrophones)
public double[] getTimeDelays()
public double[] getTimeDelayErrors()
public int getLocContents()
public void setLocContents(int locContents)
locContents
- a set of flags specifying which data are available within this localisation object.public void addLocContents(int flagsToAdd)
flagsToAdd
- localisation flags to add to existing flags.public int removeLocContents(int flagsToRemove)
flagsToRemove
- bitmap of localisation flags to remove.public boolean hasLocContent(int requiredContent)
requiredContent
- specified contentpublic PamDataUnit getParentDetection()
public void setParentDetection(PamDetection parentDetection)
parentDetection
- Parent detection containing this localisation informationpublic int getReferenceHydrophones()
public void setReferenceHydrophones(int referenceHydrophones)
referenceHydrophones
- a bitmap of hydrophone numbers that form a reference position for this localisation@Deprecated public double getBearing()
@Deprecated public double getBearing(int iSide)
iSide
- which side is the bearing ongetBearingReference
public double getBearingReference()
public boolean bearingAmbiguity()
@Deprecated public double getRange()
public double getRange(int iSide)
iSide
- @Deprecated public double getDepth()
public double getDepth(int iSide)
@Deprecated public double getBearingError()
public double getBearingError(int iSide)
iSide
- @Deprecated public double getRangeError()
public double getRangeError(int iSide)
@Deprecated public double getDepthError()
public double getDepthError(int iSide)
public GpsData getOriginLatLong()
public LatLong getLatLong(int iSide)
iSide
- 0, 1, 2, etc.public int getNumLatLong()
public double getPerpendiculaError(int iSide)
iSide
- 0, 1, 2, etc.public double getParallelError(int iSide)
iSide
- 0, 1, 2, etc.public double getErrorDirection(int iSide)
iSide
-