Class TMGroupLocInfo

java.lang.Object
Localiser.detectionGroupLocaliser.TMGroupLocInfo
All Implemented Interfaces:
GroupLocInfo

public class TMGroupLocInfo extends Object implements GroupLocInfo
Takes a PamDetection with sub detections and has functions to generate various types of information for a localiser. Mainly useful for target motion localisation, but may be applied to other scenarios, e.g. a group of DIFAR buoys.

Information generated
Time Delays - time delays of all detections. Visualised as a gigantic array where each detection represents a different set of hydrophones.
Hydrophone positions (Cartesian and latitude, longitude)
Vectors and bearings.

Author:
Jamie Macaulay
  • Constructor Details

  • Method Details

    • getParentDetection

      public SuperDetection getParentDetection()
      Description copied from interface: GroupLocInfo
      Returns the parent detection which contains sub detections which will be used in a group localisation.
      Specified by:
      getParentDetection in interface GroupLocInfo
      Returns:
      a parent detection which should contain two or more sub detections.
    • getDetectionCount

      public int getDetectionCount()
      Get the number if sub detections
      Specified by:
      getDetectionCount in interface GroupLocInfo
      Returns:
      the number of sub detections.
    • getRotationVectors

      public PamQuaternion[] getRotationVectors(boolean recalc)
      Get the rotation vector (a quaternion) for each detection
      Parameters:
      force - a recalculation of the angles.
      Returns:
      the quaternion for each detection - usually represents the rotation of the array
    • getTimeDelays

      public ArrayList<ArrayList<Double>> getTimeDelays(boolean recalc)
      Get the time delays for each pmaDetection. Time delays are added into a ragged array were each row represents one detection and the time delays of that detection follow the indexM1 and indexM2 convention in AbstractLocalisation
      Parameters:
      force - a recalculation of the time delays
      Returns:
      array of time delays for each detections
    • getTimeDelayErrors

      public ArrayList<ArrayList<Double>> getTimeDelayErrors(boolean recalc)
      Get the time delays for each pmaDetection. Time delays are added into a ragged array were each row represents one detection and the time delays of that detection follow the indexM1 and indexM2 convention in AbstractLocalisation
      Parameters:
      force - a recalculation of the time delays
      Returns:
      array of time delays for each detections
    • getRawWorldVectors

      public PamVector[][] getRawWorldVectors(boolean recalc)
      Get the real world vectors for all detections and presents in an array. The real word vectors are relative to the earth surface. Thus they are the bearings vectors from an array, rotated by the true heading, pitch and roll of the array.
      Parameters:
      recalc - - true to force recalculation of the vectors
      Returns:
    • getHydrophonePos

      public ArrayList<ArrayList<double[]>> getHydrophonePos()
      Description copied from interface: GroupLocInfo
      Returns the positions of the hydrophones for every detection, relative to (0,0,0) for every pamDetection.
      Specified by:
      getHydrophonePos in interface GroupLocInfo
      Returns:
      a list of hydrophone positions. Each invalid input: '<'ArrayListinvalid input: '<'double[]> corresponds to the hydrophone positions for one PamDetection.
    • getOrigins

      public PamVector[] getOrigins()
      Description copied from interface: GroupLocInfo
      Returns the origin of the hydrophone array for each detection point- this is in meters relative to 0,0,0;
      Specified by:
      getOrigins in interface GroupLocInfo
      Returns:
      the vector of a PamDetections origin were (0,0,0) is the origin.
    • getGPSReference

      public LatLong getGPSReference()
      Description copied from interface: GroupLocInfo
      The GPS point which corresponds to (0,0,0) in the cartesian system.
      Specified by:
      getGPSReference in interface GroupLocInfo
      Returns:
      the lat long which has been used for the (0,0,0) reference.
    • metresToLatLong

      public LatLong metresToLatLong(PamVector pt)
      Description copied from interface: GroupLocInfo
      Convert a point in your Cartesian Co-ordinate frame
      Specified by:
      metresToLatLong in interface GroupLocInfo
      Parameters:
      pt - - a point
      Returns:
    • latLongToMetres

      public PamVector latLongToMetres(LatLong ll)
      Specified by:
      latLongToMetres in interface GroupLocInfo
      Parameters:
      ll - - the GPS Co-Ordinate
      Returns:
    • getReferenceHydrophones

      public int getReferenceHydrophones()
      Get a bitmnap of reference hydrophones for the group
      Specified by:
      getReferenceHydrophones in interface GroupLocInfo
      Returns:
      a bitmap of the reference hydrophones
    • getTimeMillis

      public Long getTimeMillis()
      Return average time for the target motion event.
      Specified by:
      getTimeMillis in interface GroupLocInfo
      Returns:
      the time in millis
    • getHeadingVectors

      @Deprecated public static PamVector[] getHeadingVectors(PamQuaternion[] eulerAngles)
      Deprecated.
      Convenince codce for extracting the heading from an array of quaternions.
      Parameters:
      eulerAngles - - an array of rotation angles.
      Returns:
      an array of vectors which contain vectors representing only the heading.
    • getBeamLatLong

      public GpsData getBeamLatLong(LatLong localised)
      Description copied from interface: GroupLocInfo
      Get the beam latitude and longitude.
      Specified by:
      getBeamLatLong in interface GroupLocInfo
      Returns:
    • getTimeDelays

      public ArrayList<ArrayList<Double>> getTimeDelays()
      Description copied from interface: GroupLocInfo
      Returns the time delays for each detection. The number of time delays per detection is going to be based on the number of hydrophones in the array.
      Specified by:
      getTimeDelays in interface GroupLocInfo
      Returns:
      a list of time delays. Each ArrayList corresponds to the time delays calculated from a PamDetection. Time delays are related to channel numbers by the indexM1 and indexM2 functions in AbstractLocalisation.
    • getTimeDelayErrors

      public ArrayList<ArrayList<Double>> getTimeDelayErrors()
      Description copied from interface: GroupLocInfo
      Returns the time delay errors for each detection. This should be based on the uncertainty in spacing between hydrophones for target motion analysis.
      Specified by:
      getTimeDelayErrors in interface GroupLocInfo
      Returns:
      a list of time delay errors. Each ArrayList corresponds to the time delays calculated from a PamDetection. Time delays are related to channel numbers by the indexM1 and indexM2 functions in AbstractLocalisation.
    • getWorldVectors

      public PamVector[] getWorldVectors(int side)
      Description copied from interface: GroupLocInfo
      The real world vectors for each detection. There may be an ambiguity in the vectors in which case each AbstractLocalisation will contain two world vectors per detections e.g. for a stereo array there are two bearings whilst for a 3D towed array there would usually be only one three dimensional bearing. A list of vectors corresponding to one ambiguity is returned here.
      Specified by:
      getWorldVectors in interface GroupLocInfo
      Returns:
      a 2D array of world vectors corresponding to each ambiguity in the currentDetectionsGroup. The size of the array is the same as the number of sub detections. A bearing may be null if not used. If side> the no. ambiguities null is returned
    • getWorldVectorErrors

      public PamVector[] getWorldVectorErrors(int side)
      Description copied from interface: GroupLocInfo
      The error for world vectors
      Specified by:
      getWorldVectorErrors in interface GroupLocInfo
      Returns:
      the error for world vectors The size of the array is the same as the number of sub detections. A bearing may be null if not used. If side> the no. ambiguities null is returned
    • getAmbiguityCount

      public int getAmbiguityCount(int dim)
      Description copied from interface: GroupLocInfo
      Get the number of ambiguities expected from bearings. Solving a loclaisation for different numbers of dimensions can introduce a different number of ambiguities.
      Specified by:
      getAmbiguityCount in interface GroupLocInfo
      Returns:
      the number of ambiguities e.g. for stereo towed array will usually be 2.
    • getRotationVectors

      public PamQuaternion[] getRotationVectors()
      Description copied from interface: GroupLocInfo
      Get the Euler angles for each detection. It assumed that the hydrophones within a single PamDetection (usually referred to as a group) will be from rigid array, hence share the same rotation angles.

      Note on Rotation Angles: We need to know the position and depth of the array but we also must know the rotation of the array. It would be nice to store the rotation as vector, however a unit vector cannot describe fully the rotation of the array. e.g say we have the unit vector (-0.71 0.0 0.71), this would describe a heading of 270 and pitch of 45 degrees. However this unit vector tells us nothing about the roll (tilt) of the array. This is because we had to start off with a unit vector (0,1,0) to rotate to begin with. We can transform co-ordinate systems all we want but a unit vector will only ever tell us two Euler angles. Hence we have to store euler angles as a PamQuaternion (a 4 element vector) not a PamVector (a 3 element vector).

      Specified by:
      getRotationVectors in interface GroupLocInfo
      Returns:
      An array of PamQuaternion angles representing each PamDetection. If a quaternion is null the array is assumed to have no rotation.
      See Also:
    • getBeamTime

      public long getBeamTime(LatLong locLatLong)
      Calculate the beam time. This is not the time that the vessel was at the beam latitude and longitude but the time the streamer passed that point. Note that if there are multiple streamers passing the point the streamer lengths are averaged and used as our beam latitude and longitude. We use the model for each streamer to to work out when it passed the beam latitude and longitude point.
      Specified by:
      getBeamTime in interface GroupLocInfo
      Parameters:
      locLatLong - - the latitude and longitude of the localisation.
      Returns:
      the time at which the hydrophone array passed the beam latitude and longitude point.
    • setupTMBearings

      public void setupTMBearings()
      If a target motion localisation is occurring from a stereo array there maybe two possible results. For some localisation algorithms the bearings will need to be sorted before localisation. This functions separates the bearings belonging to different ambiguities.