public class PamArray
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable
Contains information on the hydrophone array. Individual hydrophones are 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.
Hydrophone
,
PamArray
,
Serialized FormModifier and Type | Field and Description |
---|---|
static int |
ORIGIN_INTERPOLATE |
static int |
ORIGIN_USE_LATEST |
static int |
ORIGIN_USE_PRECEEDING |
static long |
serialVersionUID |
Constructor and Description |
---|
PamArray(java.lang.String arrayName,
java.lang.Class hydrophoneLocatorClass) |
Modifier and Type | Method and Description |
---|---|
int |
addHydrophone(Hydrophone hydrophone) |
int |
addStreamer(Streamer streamer)
Add a streamer and return the streamer id which will be one less than the number of streamers.
|
void |
arrayDeserialized()
called just after the array settings have been loaded so that
data can be loaded back into the Hydrophone localisers.
|
void |
checkHydrophoneIds()
Ensures that hydrophone numbering in in sequential order
|
void |
clearArray() |
PamArray |
clone() |
Streamer |
cloneStreamer()
Clone a streamer, doing a hard clone of all hydrophones, localiser
stuff, etc.
|
Streamer |
cloneStreamer(Streamer aStreamer)
Clone a streamer, doing a hard clone of all hydrophones, localiser
stuff, etc.
|
static PamArray |
createSimpleArray(java.lang.String arrayName,
double y0,
double height,
double separation,
int nElements,
double sensitivity,
double gain,
double[] bandwidth)
Create a simple linear array.
|
Streamer |
findStreamer(java.lang.String streamerName) |
PamVector |
getAbsHydrophoneVector(int iPhone,
long timeMillis)
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() |
java.lang.Class |
getArrayLocatorClass() |
java.lang.String |
getArrayName() |
int |
getArrayShape() |
double[][] |
getDimensionLimits()
Get the limits of the dimensions of the entire array.
|
Hydrophone |
getHiddenHydrophone(int channel)
public version of getHydrophone().
|
java.util.ArrayList<Hydrophone> |
getHydrophoneArray() |
double |
getHydrophoneCoordinate(int iHydrophone,
int iCoordinate,
long timeMilliseconds)
Get a hydrophone coordinate
referenced to the nominal array position (GPS for towed systems, a fixed point, etc.)
|
double |
getHydrophoneCoordinateError(int iHydrophone,
int iCoordinate,
long timeMilliseconds)
Get a hydrophone coordinate error
|
double[] |
getHydrophoneCoordinateErrors(int iHydrophone,
long timeMilliseconds)
Get the hydrophone coordinate errors as a three element (x,y,z) vector.
|
double[] |
getHydrophoneCoordinates(int iHydrophone,
long timeMilliseconds)
Get the hydrophone coordinates as a three element (x,y,z) vector
referenced to the nominal array position (GPS for towed systems, a fixed point, etc.)
|
int |
getHydrophoneCount()
Gets the size of the hydrophone array which is implicitly
the hydrophone count.
|
int |
getHydrophoneInterpolation() |
HydrophoneLocator |
getHydrophoneLocator() |
double |
getHydrophoneSensitivityAndGain(int hydrophoneChannel)
Get the hydrophone sensitivity and gain added together.
|
PamSymbol |
getHydrophoneSymbol(int iHydrophone)
Get the preferred symbol for a given hydrophone.
|
double |
getHydrophoneX(int iHydrophone,
long timeMilliseconds)
Get a hydrophone x coordinate for a given time
|
double |
getHydrophoneY(int iHydrophone,
long timeMilliseconds)
Get a hydrophone y coordinate for a given time
|
double |
getHydrophoneZ(int iHydrophone,
long timeMilliseconds)
Get a hydrophone z coordinate for a given time
|
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.
|
double |
getMaxPhoneSeparation(int phoneMap,
long timeMillis)
Get the max phone separation in metres.
|
double |
getMaxPhoneSeparation(long timeMillis)
Get the max phone separation in metres for all hydrophones in the array.
|
int |
getNumStreamers() |
int |
getOriginInterpolation() |
double |
getPerpendicularError(int a1,
int a2,
long timeMillis)
Get the error in the plane perpendicular to the line separating
two hydrophones.
|
double |
getPerpendicularError(int a1,
int a2,
PamVector direction) |
int |
getPhonesForStreamer(int streamerId)
Get a bitmap of hydrophones used with a particular streamer.
|
int |
getPhonesForStreamer(Streamer streamer)
Get a bitmap of hydrophones used with a particular streamer.
|
double |
getSeparation(int a1,
int a2,
long timeMillis) |
double |
getSeparationError(int a1,
int a2,
long timeMillis)
Get the error in the separation between two hydrophones along
the axis joining the two phones
|
double |
getSeparationError(int a1,
int a2,
PamVector direction,
long timeMillis)
Get the separation error in a given direction
|
PamVector |
getSeparationErrorVector(int a1,
int a2,
long timeMillis)
Gets the error of the separation between two hydrophones as a vector.
|
double |
getSeparationInSeconds(int a1,
int a2,
long timeMillis) |
double |
getSeparationInSeconds(int channelMap,
long timeMillis)
Get the separation of two hydrophones - hopefully, channelMap
will contain just two set bits !
|
double |
getSpeedOfSound() |
double |
getSpeedOfSoundError() |
Streamer |
getStreamer(int streamerIndex)
Get the streamer at a specific index.
|
Streamer |
getStreamer(int streamerIndex,
long timeMilliseconds)
Get the streamer at a specififed time.
|
int |
getStreamerCount()
Get the number of different streamers (not the number of streamer data units)
|
StreamerDataUnit |
getStreamerDataUnit(int streamerIndex,
long timeMilliseconds) |
int |
getStreamerForPhone(int phoneId)
Get the streamer id for a particular hydrophone
|
int |
getStreamerHydrophoneCount(int iStreamer) |
double |
getTimeDelayError(int a1,
int a2,
long timeMillis) |
double |
getWobbleRadians(int a1,
int a2,
long timeMillis) |
int |
indexOfStreamer(Streamer aStreamer)
Get the index of a specified streamer.
|
void |
notifyModelChanged(int changeType,
boolean initComplete) |
void |
prepareToSerialize()
Called just before the array is serialised into Pam settings
so it can get data out of the localisers, etc.
|
boolean |
removeHydrophone(Hydrophone hydrophone) |
void |
removeStreamer(int row) |
void |
setArrayFile(java.lang.String arrayFile) |
void |
setArrayName(java.lang.String arrayName) |
void |
setArrayShape(int arrayShape) |
boolean |
setHydrophoneFilter(int iPhone,
double phoneFilter)
Set the hydrophone bandwidth
|
boolean |
setHydrophoneGain(int iPhone,
double phoneGain)
Set the hydrophone preamplifier gain
|
void |
setHydrophoneInterpolation(int hydrophoneInterpolation) |
void |
setOriginInterpolation(int originInterpolation) |
void |
setSpeedOfSound(double speedOfSound) |
void |
setSpeedOfSoundError(double speedOfSoundError) |
java.lang.String |
toString() |
int |
updateHydrophone(int oldIndex,
Hydrophone hydrophone) |
void |
updateStreamer(int iStreamer,
Streamer newStreamer) |
void |
updateStreamer(long timeMilliseconds,
int iStreamer,
java.lang.String name,
double[] coord,
double[] coordError,
OriginSettings originSettings,
LocatorSettings locatorSettings)
Update a streamer with information from elsewhere in PAMGuard - currently called from the
network receiver when new buoy gps data arrive.
|
void |
updateStreamer(long timeMilliseconds,
Streamer newStreamerData)
Update a streamer with information from elsewhere in PAMGuard - currently called from the
DIFAR module.
|
public static final int ORIGIN_USE_LATEST
public static final int ORIGIN_INTERPOLATE
public static final int ORIGIN_USE_PRECEEDING
public static final long serialVersionUID
public PamArray(java.lang.String arrayName, java.lang.Class hydrophoneLocatorClass)
public void notifyModelChanged(int changeType, boolean initComplete)
public int addHydrophone(Hydrophone hydrophone)
public boolean removeHydrophone(Hydrophone hydrophone)
public int updateHydrophone(int oldIndex, Hydrophone hydrophone)
public Hydrophone getHiddenHydrophone(int channel)
channel
- public void clearArray()
public java.util.ArrayList<Hydrophone> getHydrophoneArray()
public int getHydrophoneCount()
public int getStreamerHydrophoneCount(int iStreamer)
iStreamer
- streamer Idpublic void checkHydrophoneIds()
public double getSeparation(int a1, int a2, long timeMillis)
a1
- phone 1a2
- phone 2public PamVector getAbsHydrophoneVector(int iPhone, long timeMillis)
iPhone
- hydrophone numberpublic void updateStreamer(int iStreamer, Streamer newStreamer)
public void updateStreamer(long timeMilliseconds, int iStreamer, java.lang.String name, double[] coord, double[] coordError, OriginSettings originSettings, LocatorSettings locatorSettings)
Any parameters that are null will not be updated.
iStreamer
- Streamer indexname
- Streamer namecoord
- Streamer coordinatescoordError
- streamer coordinate errorsoriginSettings
- origin settings (what the streamer is referenced to)locatorSettings
- locator settings (not yet used).public void updateStreamer(long timeMilliseconds, Streamer newStreamerData)
timeMilliseconds
- newStreamerData
- public double getSeparationInSeconds(int channelMap, long timeMillis)
channelMap
- public double getSeparationInSeconds(int a1, int a2, long timeMillis)
a1
- phone 1a2
- phone 2public double getMaxPhoneSeparation(long timeMillis)
public double getMaxPhoneSeparation(int phoneMap, long timeMillis)
this will not currently work if hydrophones are in different clusters
phoneMap
- bit map of used hydrophones.public double getSeparationError(int a1, int a2, long timeMillis)
a1
- phone 1a2
- phone 1public double getSeparationError(int a1, int a2, PamVector direction, long timeMillis)
a1
- phone 1a2
- phone 2direction
- direction of interest.public double getWobbleRadians(int a1, int a2, long timeMillis)
public double getPerpendicularError(int a1, int a2, long timeMillis)
a1
- hydrophone 1a2
- hydrophone 2public double getPerpendicularError(int a1, int a2, PamVector direction)
a1
- a2
- direction
- public PamVector getSeparationErrorVector(int a1, int a2, long timeMillis)
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 errors are ignored.
If the hydrophones are in different streamers, then the streamer errors are also incorporated.
a1
- phone number 1a2
- phone number 2timeMillis
- the current time in millisecondspublic double getTimeDelayError(int a1, int a2, long timeMillis)
a1
- phone number 1a2
- phone number 2timeMillis
- public static PamArray createSimpleArray(java.lang.String arrayName, double y0, double height, double separation, int nElements, double sensitivity, double gain, double[] bandwidth)
arrayName
- namey0
- y position of first hydrophonedepth
- depthseparation
- separation between each elementnElements
- number of eleemntssensitivity
- hydrophone sensitivitygain
- preamp gainbandwidth
- preamp bandwidthpublic double getSpeedOfSound()
public void setSpeedOfSound(double speedOfSound)
speedOfSound
- speed of sound in m/spublic double getSpeedOfSoundError()
public void setSpeedOfSoundError(double speedOfSoundError)
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getArrayFileName()
public PamArray clone()
clone
in class java.lang.Object
public java.lang.String getArrayFile()
public void setArrayFile(java.lang.String arrayFile)
arrayFile
- The arrayFile to set.public java.lang.String getArrayName()
public void setArrayName(java.lang.String arrayName)
arrayName
- The arrayName to set.public HydrophoneLocator getHydrophoneLocator()
public double[][] getLocalGeometry(long timeMilliseconds)
The coordinate system is referenced to the reference latLong of the array locator at timeMilliseconds.
timeMilliseconds
- time geometry required forpublic double[][] getLocalGeometry(LatLong referenceLatLong, long timeMilliseconds)
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.
referenceLatLong
- reference position for x,y systemtimeMilliseconds
- time geometry required forpublic int getNumStreamers()
public int indexOfStreamer(Streamer aStreamer)
aStreamer
- public Streamer getStreamer(int streamerIndex)
streamerIndex
- public int getStreamerCount()
public Streamer getStreamer(int streamerIndex, long timeMilliseconds)
streamerIndex
- - the streamer index you wish to findtimeMilliseconds
- - the time in millis.public StreamerDataUnit getStreamerDataUnit(int streamerIndex, long timeMilliseconds)
public Streamer findStreamer(java.lang.String streamerName)
public Streamer cloneStreamer()
public Streamer cloneStreamer(Streamer aStreamer)
streamer
- to clone.public double[][] getDimensionLimits()
public int getPhonesForStreamer(Streamer streamer)
streamer
- Hydrophone streamer.public int getPhonesForStreamer(int streamerId)
streamerId
- Hydrophone streamer index.public int getStreamerForPhone(int phoneId)
phoneId
- hydrophone indexpublic int addStreamer(Streamer streamer)
streamer
- public void removeStreamer(int row)
public int getArrayShape()
public void setArrayShape(int arrayShape)
arrayShape
- set the array shape - point, line, plane or volumetric.public java.lang.Class getArrayLocatorClass()
public double getHydrophoneSensitivityAndGain(int hydrophoneChannel)
hydrophoneChannel
- hydrophone hardware numberpublic double[] getHydrophoneCoordinates(int iHydrophone, long timeMilliseconds)
Hydrophone locators which want to vary location as a function of time should override this function and use the timeMilliseconds parameter to get the true location of the hydrophones in their own way.
iHydrophone
- hydrophone numbertimeMilliseconds
- time of locationpublic double[] getHydrophoneCoordinateErrors(int iHydrophone, long timeMilliseconds)
Hydrophone locators which want to vary this error as a function of time should override this function and use the timeMilliseconds parameter to get the true errors in their own way.
iHydrophone
- hydrophone numbertimeMilliseconds
- time of locationpublic double getHydrophoneCoordinate(int iHydrophone, int iCoordinate, long timeMilliseconds)
Hydrophone locators which want to vary location as a function of time should override this function and use the timeMilliseconds parameter to get the true location of the hydrophones in their own way.
iHydrophone
- hydrophone numberiCoordinate
- coordinate number (0,1,2 for x,y,z);timeMilliseconds
- time of locationpublic double getHydrophoneCoordinateError(int iHydrophone, int iCoordinate, long timeMilliseconds)
Hydrophone locators which want to vary this error as a function of time should override this function and use the timeMilliseconds parameter to get the true errors in their own way.
iHydrophone
- hydrophone numberiCoordinate
- coordinate number (0,1,2 for x,y,z);timeMilliseconds
- time of locationpublic double getHydrophoneX(int iHydrophone, long timeMilliseconds)
iHydrophone
- hydrophone numbertimeMilliseconds
- time in millisecondspublic double getHydrophoneY(int iHydrophone, long timeMilliseconds)
iHydrophone
- hydrophone numbertimeMilliseconds
- time in millisecondspublic double getHydrophoneZ(int iHydrophone, long timeMilliseconds)
iHydrophone
- hydrophone numbertimeMilliseconds
- time in millisecondspublic PamSymbol getHydrophoneSymbol(int iHydrophone)
iHydrophone
- hydrophone numberpublic void prepareToSerialize()
public void arrayDeserialized()
public int getOriginInterpolation()
public void setOriginInterpolation(int originInterpolation)
originInterpolation
- the originInterpolation to setpublic int getHydrophoneInterpolation()
public void setHydrophoneInterpolation(int hydrophoneInterpolation)
hydrophoneInterpolation
- the hydrophoneInterpolation to setpublic boolean setHydrophoneGain(int iPhone, double phoneGain)
iPhone
- hydrophone indexphoneGain
- preamplifier gainpublic boolean setHydrophoneFilter(int iPhone, double phoneFilter)
iPhone
- hydrophone indexphoneGain
- preamplifier bandwidth