Array
Class PamArray

java.lang.Object
  extended by Array.PamArray
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class PamArray
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable

Author:
Doug Gillespie

Contains information on the hydrophone array. Individual hydrophones ar not given channel numbers - channel numbers are the position of the hydrophone in the arraylist.

This class should eventually be extended so that Hydrophones positions can be updated dynamically and functions added to give distances / angles between them, interpolate the hydrophones position based on the ships track, etc.

See Also:
Hydrophone, PamArray, Serialized Form

Field Summary
static int ARRAY_TYPE_STATIC
           
static int ARRAY_TYPE_TOWED
           
private  java.lang.String arrayFile
           
private  int arrayLocator
           
private  java.lang.String arrayName
           
private  int arrayType
           
private  LatLong fixedLatLong
           
private  GpsDataUnit fixedPointDataUnit
           
private  PamDataBlock<GpsDataUnit> fixedPointReferenceBlock
           
static int HEADING_TYPE_MAGNETIC
           
static int HEADING_TYPE_NONE
           
static int HEADING_TYPE_SHIP
           
static int HEADING_TYPE_TRUE
           
private  int headingType
           
private  java.util.ArrayList<Hydrophone> hydrophoneArray
           
private  HydrophoneLocator hydrophoneLocator
           
static long serialVersionUID
           
private  double speedOfSound
           
private  double speedOfSoundError
           
private  java.util.ArrayList<Streamer> streamers
           
static int TILT_TYPE_NONE
           
static int TILT_TYPE_UPDOWN
           
private  int tiltType
           
 
Constructor Summary
PamArray(java.lang.String arrayName, int arrayType)
           
 
Method Summary
 int addHydrophone(Hydrophone hydrophone)
           
 void addStreamer(Streamer streamer)
           
private  void checkDefStreamer()
           
 void checkHydrophoneIds()
          Ensures that hydrophone numbering in in sequential order
 void clearArray()
           
 PamArray clone()
           
static PamArray createSimpleArray(java.lang.String arrayName, double y0, double depth, double separation, int nElements, double sensitivity, double gain, double[] bandwidth)
          Create a simple linear array.
 PamVector getAbsHydrophoneVector(int iPhone)
          Get the true location vector for a hydrophone element which is the phone vector + the array vector.
 java.lang.String getArrayFile()
           
 java.lang.String getArrayFileName()
           
 int getArrayLocator()
           
 java.lang.String getArrayName()
           
 int getArrayType()
           
 double[][] getDimensionLimits()
          Get the limits of the dimensions of the entire array.
 LatLong getFixedLatLong()
           
 PamDataBlock<GpsDataUnit> getFixedPointReferenceBlock()
           
 int getHeadingType()
           
 Hydrophone getHydrophone(int channel)
           
 java.util.ArrayList<Hydrophone> getHydrophoneArray()
           
 int getHydrophoneCount()
          Gets the size of the hydrophone array which is implicitly the hydrophone count.
 HydrophoneLocator getHydrophoneLocator()
           
 double[][] getLocalGeometry(LatLong referenceLatLong, long timeMilliseconds)
          Gets a local array geometry in metres, based on the reference location and on the locator.
 double[][] getLocalGeometry(long timeMilliseconds)
          Gets a local array geometry in metres, based on the reference location and on the locator.
(package private)  int getNumStreamers()
           
 double getSeparation(int a1, int a2)
           
 double getSeparationError(int a1, int a2)
          Get the error in the separation between two hydrophones along the axis joining the two phones
 double getSeparationError(int a1, int a2, PamVector direction)
          Get the separation error in a given direction
 PamVector getSeparationErrorVector(int a1, int a2)
          Gets the error of the separation between two hydrophones as a vector.
 double getSeparationInSeconds(int channelMap)
          Get the separation of two hydrophones - hopefully, channelMap will contain just two set bits !
 double getSeparationInSeconds(int a1, int a2)
           
 double getSpeedOfSound()
           
 double getSpeedOfSoundError()
           
 Streamer getStreamer(int row)
           
 int getStreamerHydrophoneCount(int iStreamer)
           
 int getTiltType()
           
 void notifyModelChanged(int changeType)
           
 boolean removeHydrophone(Hydrophone hydrophone)
           
 void removeStreamer(int row)
           
 void setArrayFile(java.lang.String arrayFile)
           
 void setArrayLocator(int arrayLocator)
           
 void setArrayName(java.lang.String arrayName)
           
 void setArrayType(int arrayType)
           
 void setFixedLatLong(LatLong fixedLatLong)
           
 void setHeadingType(int headingType)
           
 void setSpeedOfSound(double speedOfSound)
           
 void setSpeedOfSoundError(double speedOfSoundError)
           
private  void setStaticMasterReference()
           
 void setTiltType(int tiltType)
           
 void setupFixedPointReferenceBlock()
           
 java.lang.String toString()
           
 int updateHydrophone(int oldIndex, Hydrophone hydrophone)
           
 void updateStreamer(int iStreamer, Streamer newStreamer)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ARRAY_TYPE_TOWED

public static final int ARRAY_TYPE_TOWED
See Also:
Constant Field Values

ARRAY_TYPE_STATIC

public static final int ARRAY_TYPE_STATIC
See Also:
Constant Field Values

HEADING_TYPE_NONE

public static final int HEADING_TYPE_NONE
See Also:
Constant Field Values

HEADING_TYPE_TRUE

public static final int HEADING_TYPE_TRUE
See Also:
Constant Field Values

HEADING_TYPE_MAGNETIC

public static final int HEADING_TYPE_MAGNETIC
See Also:
Constant Field Values

HEADING_TYPE_SHIP

public static final int HEADING_TYPE_SHIP
See Also:
Constant Field Values

TILT_TYPE_NONE

public static final int TILT_TYPE_NONE
See Also:
Constant Field Values

TILT_TYPE_UPDOWN

public static final int TILT_TYPE_UPDOWN
See Also:
Constant Field Values

serialVersionUID

public static final long serialVersionUID
See Also:
Constant Field Values

streamers

private java.util.ArrayList<Streamer> streamers

hydrophoneArray

private java.util.ArrayList<Hydrophone> hydrophoneArray

speedOfSound

private double speedOfSound

speedOfSoundError

private double speedOfSoundError

arrayName

private java.lang.String arrayName

arrayFile

private java.lang.String arrayFile

fixedLatLong

private LatLong fixedLatLong

tiltType

private int tiltType

headingType

private int headingType

arrayType

private int arrayType

arrayLocator

private int arrayLocator

fixedPointReferenceBlock

private transient PamDataBlock<GpsDataUnit> fixedPointReferenceBlock

fixedPointDataUnit

private transient GpsDataUnit fixedPointDataUnit

hydrophoneLocator

private transient HydrophoneLocator hydrophoneLocator
Constructor Detail

PamArray

public PamArray(java.lang.String arrayName,
                int arrayType)
Method Detail

notifyModelChanged

public void notifyModelChanged(int changeType)

addHydrophone

public int addHydrophone(Hydrophone hydrophone)

removeHydrophone

public boolean removeHydrophone(Hydrophone hydrophone)

updateHydrophone

public int updateHydrophone(int oldIndex,
                            Hydrophone hydrophone)

getHydrophone

public Hydrophone getHydrophone(int channel)

clearArray

public void clearArray()

getHydrophoneArray

public java.util.ArrayList<Hydrophone> getHydrophoneArray()

getHydrophoneCount

public int getHydrophoneCount()
Gets the size of the hydrophone array which is implicitly the hydrophone count.

Returns:
The values reflecting the size of the hydrophone array with 0 being zero or a null object reference.

getStreamerHydrophoneCount

public int getStreamerHydrophoneCount(int iStreamer)
Parameters:
iStreamer - streamer Id
Returns:
number of hydrophone elements associated with that streamer.

checkHydrophoneIds

public void checkHydrophoneIds()
Ensures that hydrophone numbering in in sequential order


getSeparation

public double getSeparation(int a1,
                            int a2)
Parameters:
a1 - phone 1
a2 - phone 2
Returns:
separation between two hydrophons in metres

getAbsHydrophoneVector

public PamVector getAbsHydrophoneVector(int iPhone)
Get the true location vector for a hydrophone element which is the phone vector + the array vector.

Parameters:
iPhone - hydrophone number
Returns:
absolute location.

getSeparationInSeconds

public double getSeparationInSeconds(int channelMap)
Get the separation of two hydrophones - hopefully, channelMap will contain just two set bits !

Parameters:
channelMap -
Returns:
the separation between two hydrophones in milliseconds

getSeparationInSeconds

public double getSeparationInSeconds(int a1,
                                     int a2)
Parameters:
a1 - phone 1
a2 - phone 2
Returns:
separation of two hydrophones in seconds.

getSeparationError

public double getSeparationError(int a1,
                                 int a2)
Get the error in the separation between two hydrophones along the axis joining the two phones

Parameters:
a1 - phone 1
a2 - phone 1
Returns:
error in m.

getSeparationError

public double getSeparationError(int a1,
                                 int a2,
                                 PamVector direction)
Get the separation error in a given direction

Parameters:
a1 - phone 1
a2 - phone 2
direction - direction of interest.
Returns:
error in that direction

getSeparationErrorVector

public PamVector getSeparationErrorVector(int a1,
                                          int a2)
Gets the error of the separation between two hydrophones as a vector.

If the hydrophones are in the same streamer, then the error is the error on the coordinate of each phone added in quadrature, and the streamer error are ignored.

If the hydrophones are in different streamers, then the streamer errors are also incorporated.

Parameters:
a1 - phone number 1
a2 - phone number 2
Returns:
vector representing components of error in each direction.

createSimpleArray

public static PamArray createSimpleArray(java.lang.String arrayName,
                                         double y0,
                                         double depth,
                                         double separation,
                                         int nElements,
                                         double sensitivity,
                                         double gain,
                                         double[] bandwidth)
Create a simple linear array.

Parameters:
arrayName - name
y0 - y position of first hydrophone
depth - depth
separation - separation between each element
nElements - number of eleemnts
sensitivity - hydrophone sensitivity
gain - preamp gain
bandwidth - preamp bandwidth
Returns:
new array

getSpeedOfSound

public double getSpeedOfSound()
Returns:
Speed of sound in m/s

setSpeedOfSound

public void setSpeedOfSound(double speedOfSound)
Parameters:
speedOfSound - speed of sound in m/s

getSpeedOfSoundError

public double getSpeedOfSoundError()

setSpeedOfSoundError

public void setSpeedOfSoundError(double speedOfSoundError)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getArrayFileName

public java.lang.String getArrayFileName()

clone

public PamArray clone()
Overrides:
clone in class java.lang.Object

getArrayFile

public java.lang.String getArrayFile()
Returns:
Returns the arrayFile.

setArrayFile

public void setArrayFile(java.lang.String arrayFile)
Parameters:
arrayFile - The arrayFile to set.

getFixedLatLong

public LatLong getFixedLatLong()
Returns:
Returns the fixedLatLong.

setFixedLatLong

public void setFixedLatLong(LatLong fixedLatLong)
Parameters:
fixedLatLong - The fixedLatLong to set.

setStaticMasterReference

private void setStaticMasterReference()

getArrayName

public java.lang.String getArrayName()
Returns:
Returns the arrayName.

setArrayName

public void setArrayName(java.lang.String arrayName)
Parameters:
arrayName - The arrayName to set.

getArrayType

public int getArrayType()
Returns:
Returns the arrayType.

setArrayType

public void setArrayType(int arrayType)
Parameters:
arrayType - The arrayType to set.

getHeadingType

public int getHeadingType()
Returns:
Returns the headingType.

setHeadingType

public void setHeadingType(int headingType)
Parameters:
headingType - The headingType to set.

getTiltType

public int getTiltType()
Returns:
Returns the tiltType.

setTiltType

public void setTiltType(int tiltType)
Parameters:
tiltType - The tiltType to set.

getFixedPointReferenceBlock

public PamDataBlock<GpsDataUnit> getFixedPointReferenceBlock()
Returns:
Returns the fixedPointReferenceBlock.

setupFixedPointReferenceBlock

public void setupFixedPointReferenceBlock()

getHydrophoneLocator

public HydrophoneLocator getHydrophoneLocator()

getArrayLocator

public int getArrayLocator()

setArrayLocator

public void setArrayLocator(int arrayLocator)

getLocalGeometry

public double[][] getLocalGeometry(long timeMilliseconds)
Gets a local array geometry in metres, based on the reference location and on the locator.

The coordinate system is referenced to the reference latLong of the array locator at timeMilliseconds.

Parameters:
timeMilliseconds - time geometry required for
Returns:
double array of arrays of positions

getLocalGeometry

public double[][] getLocalGeometry(LatLong referenceLatLong,
                                   long timeMilliseconds)
Gets a local array geometry in metres, based on the reference location and on the locator.

If the array is static, it will generally just return the geometry set in the array dialog

If the array is towed, then it will work out the latlongs of the hydrophones bases on the arraylocator type, it will then convert these back into geometric coordinates relative to the given reference position.

Parameters:
referenceLatLong - reference position for x,y system
timeMilliseconds - time geometry required for
Returns:
double array of arrays of positions

getNumStreamers

int getNumStreamers()
Returns:
the number of streamers in the system.

checkDefStreamer

private void checkDefStreamer()

getStreamer

public Streamer getStreamer(int row)

getDimensionLimits

public double[][] getDimensionLimits()
Get the limits of the dimensions of the entire array.

Returns:
a 3 by 2 double array of the min and max of x,y,z.

addStreamer

public void addStreamer(Streamer streamer)

updateStreamer

public void updateStreamer(int iStreamer,
                           Streamer newStreamer)

removeStreamer

public void removeStreamer(int row)