Class PamArray
- All Implemented Interfaces:
Serializable
,Cloneable
,ManagedParameters
- Author:
- Doug Gillespie
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.
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final long
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
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
called just after the array settings have been loaded so that data can be loaded back into the Hydrophone localisers.void
Ensures that hydrophone numbering in in sequential ordervoid
clone()
Clone a streamer, doing a hard clone of all hydrophones, localiser stuff, etc.cloneStreamer
(Streamer aStreamer) Clone a streamer, doing a hard clone of all hydrophones, localiser stuff, etc.static PamArray
createSimpleArray
(String arrayName, double y0, double height, double separation, int nElements, double sensitivity, double gain, double[] bandwidth) Create a simple linear array.findStreamer
(String streamerName) getAbsHydrophoneVector
(int iPhone, long timeMillis) Get the true location vector for a hydrophone element which is the phone vector + the array vector.int
Return the type of array this is (e.g.double
getClipLevel
(int hydrophoneChannel) Get the clip level - this is the level at which a signal will clip using the specified DAQ system.double[][]
Get the limits of the dimensions of the entire array.getHiddenHydrophone
(int channel) public version of getHydrophone().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 errordouble[]
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 streamer positionint
Gets the size of the hydrophone array which is implicitly the hydrophone count.int
double
getHydrophoneSensitivityAndGain
(int hydrophoneChannel) Get the hydrophone sensitivity and gain added together.getHydrophoneSymbol
(int iHydrophone) Get the preferred symbol for a given hydrophone.getHydrophoneVector
(int iPhone, long timeMillis) Get the hydrophone coordinates for a given time.double
getHydrophoneX
(int iHydrophone, long timeMilliseconds) Get a hydrophone x coordinate for a given timedouble
getHydrophoneY
(int iHydrophone, long timeMilliseconds) Get a hydrophone y coordinate for a given timedouble
getHydrophoneZ
(int iHydrophone, long timeMilliseconds) Get a hydrophone z coordinate for a given timegetHydroponeData
(int hydrophoneIndex, long timeMilliseconds) Get data for a specific hydrophone at a specific time.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
int
Get a set of data that describes all of the parameters in a classdouble
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 phonesdouble
getSeparationError
(int a1, int a2, PamVector direction, long timeMillis) Get the separation error in a given directiongetSeparationErrorVector
(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 !getSnapshotGeometry
(long timeMillis) Get a snapshot geometry for the entire array for a given time.double
double
getStreamer
(int streamerIndex) Get the streamer at a specific index.int
Get the number of different streamers (not the number of streamer data units)getStreamerData
(int streamerIndex, long timeMilliseconds) Get the streamer information for the given time.int
getStreamerForPhone
(int phoneId) Get the streamer id for a particular hydrophoneint
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
newStreamer
(long timeMilliseconds, Streamer newStreamerData) Update a streamer and create a new StreamerDataUnit based on an existing streamer from elsewhere in PAMGuard - currently called from the DIFAR invalid input: '&' network receiver modules.void
newStreamerFromUpdate
(long timeMilliseconds, int iStreamer, 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
notifyModelChanged
(int changeType, boolean initComplete) void
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
(String arrayFile) void
setArrayName
(String arrayName) void
setArrayShape
(int arrayShape) void
setDefaultSensitivity
(double defaultRecieverSens) Set all sensitivities on all hydrophones to a new valueboolean
setHydrophoneFilter
(int iPhone, double phoneFilter) Set the hydrophone bandwidthboolean
setHydrophoneGain
(int iPhone, double phoneGain) Set the hydrophone preamplifier gainvoid
setHydrophoneInterpolation
(int hydrophoneInterpolation) void
setInstrumentId
(String instrumentId) void
setInstrumentType
(String instrumentType) void
setOriginInterpolation
(int originInterpolation) void
setSpeedOfSound
(double speedOfSound) void
setSpeedOfSoundError
(double speedOfSoundError) toString()
int
updateHydrophone
(int oldIndex, Hydrophone hydrophone) void
updateStreamer
(int iStreamer, Streamer newStreamer) void
updateStreamerAndDataUnit
(long timeMilliseconds, Streamer newStreamerData) Update a streamer and update an existing StreamerDataUnit with information from elsewhere in PAMGuard.
-
Field Details
-
ORIGIN_USE_LATEST
public static final int ORIGIN_USE_LATEST- See Also:
-
ORIGIN_INTERPOLATE
public static final int ORIGIN_INTERPOLATE- See Also:
-
ORIGIN_USE_PRECEEDING
public static final int ORIGIN_USE_PRECEEDING- See Also:
-
serialVersionUID
public static final long serialVersionUID- See Also:
-
-
Constructor Details
-
PamArray
-
-
Method Details
-
getInstrumentType
-
setInstrumentType
-
getInstrumentId
-
setInstrumentId
-
notifyModelChanged
public void notifyModelChanged(int changeType, boolean initComplete) -
getSnapshotGeometry
Get a snapshot geometry for the entire array for a given time. will reuse the last value if at all possible.- Parameters:
timeMillis
- time in millis.- Returns:
- Snapshot geometry
-
addHydrophone
-
removeHydrophone
-
updateHydrophone
-
getHiddenHydrophone
public version of getHydrophone(). you probably shouldn't be calling this unless it's from within an array locator looking for nominal position data.- Parameters:
channel
-- Returns:
-
clearArray
public void clearArray() -
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, long timeMillis) - Parameters:
a1
- phone 1a2
- phone 2- Returns:
- separation between two hydrophones in metres
-
getAbsHydrophoneVector
Get the true location vector for a hydrophone element which is the phone vector + the array vector.- Parameters:
iPhone
- hydrophone number- Returns:
- absolute location.
-
getHydrophoneVector
Get the hydrophone coordinates for a given time. These are just the hydrophone coordinates, and do NOT include the array coordinates.- Parameters:
iPhone
-timeMillis
-- Returns:
-
updateStreamer
-
newStreamerFromUpdate
public void newStreamerFromUpdate(long timeMilliseconds, int iStreamer, 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.Any parameters that are null will not be updated.
- Parameters:
iStreamer
- Streamer indexname
- Streamer namecoord
- Streamer coordinatescoordError
- streamer coordinate errorsoriginSettings
- origin settings (what the streamer is referenced to)locatorSettings
- locator settings (not yet used).
-
newStreamer
Update a streamer and create a new StreamerDataUnit based on an existing streamer from elsewhere in PAMGuard - currently called from the DIFAR invalid input: '&' network receiver modules.This will not only update the streamer, but will also create a new streamer data unit and all that is associated with it.
- Parameters:
timeMilliseconds
-newStreamerData
- - the new streamer invalid input: '&' data unit will be based on this
-
updateStreamerAndDataUnit
Update a streamer and update an existing StreamerDataUnit with information from elsewhere in PAMGuard.- Parameters:
timeMilliseconds
-newStreamerData
-
-
getSeparationInSeconds
public double getSeparationInSeconds(int channelMap, long timeMillis) 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, long timeMillis) - Parameters:
a1
- phone 1a2
- phone 2- Returns:
- separation of two hydrophones in seconds.
-
getMaxPhoneSeparation
public double getMaxPhoneSeparation(long timeMillis) Get the max phone separation in metres for all hydrophones in the array.- Returns:
- max phone separation in metres.
-
getMaxPhoneSeparation
public double getMaxPhoneSeparation(int phoneMap, long timeMillis) Get the max phone separation in metres.this will not currently work if hydrophones are in different clusters
- Parameters:
phoneMap
- bit map of used hydrophones.- Returns:
- max phone separation in metres.
-
getSeparationError
public double getSeparationError(int a1, int a2, long timeMillis) Get the error in the separation between two hydrophones along the axis joining the two phones- Parameters:
a1
- phone 1a2
- phone 1- Returns:
- error in m.
-
getSeparationError
Get the separation error in a given direction- Parameters:
a1
- phone 1a2
- phone 2direction
- direction of interest.- Returns:
- error in that direction
-
getWobbleRadians
public double getWobbleRadians(int a1, int a2, long timeMillis) -
getPerpendicularError
public double getPerpendicularError(int a1, int a2, long timeMillis) Get the error in the plane perpendicular to the line separating two hydrophones.- Parameters:
a1
- hydrophone 1a2
- hydrophone 2- Returns:
- magnitude of error perpendicular to the line between them.
-
getPerpendicularError
- Parameters:
a1
-a2
-direction
-- Returns:
-
getSeparationErrorVector
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 errors are ignored.
If the hydrophones are in different streamers, then the streamer errors are also incorporated.
- Parameters:
a1
- phone number 1a2
- phone number 2timeMillis
- the current time in milliseconds- Returns:
- vector representing components of error in each direction.
-
getTimeDelayError
public double getTimeDelayError(int a1, int a2, long timeMillis) - Parameters:
a1
- phone number 1a2
- phone number 2timeMillis
-- Returns:
-
createSimpleArray
public static PamArray createSimpleArray(String arrayName, double y0, double height, double separation, int nElements, double sensitivity, double gain, double[] bandwidth) Create a simple linear array.- Parameters:
arrayName
- namey0
- y position of first hydrophoneseparation
- separation between each elementnElements
- number of eleemntssensitivity
- hydrophone sensitivitygain
- preamp gainbandwidth
- preamp bandwidthdepth
- depth- 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
-
getArrayFileName
-
clone
-
getArrayFile
- Returns:
- Returns the arrayFile.
-
setArrayFile
- Parameters:
arrayFile
- The arrayFile to set.
-
getArrayName
- Returns:
- Returns the arrayName.
-
setArrayName
- Parameters:
arrayName
- The arrayName to set.
-
getHydrophoneLocator
- Returns:
- Returns the fixedPointReferenceBlock.
-
getNumStreamers
public int getNumStreamers()- Returns:
- the number of streamers in the system.
-
indexOfStreamer
Get the index of a specified streamer.- Parameters:
aStreamer
-- Returns:
- index of streamer or -1.
-
getStreamer
Get the streamer at a specific index.- Parameters:
streamerIndex
-- Returns:
- reference to a streamer.
-
getStreamerCount
public int getStreamerCount()Get the number of different streamers (not the number of streamer data units)- Returns:
- number of unique streamers.
-
findStreamer
-
cloneStreamer
Clone a streamer, doing a hard clone of all hydrophones, localiser stuff, etc.- Returns:
- the new streamer reference (which will be added already to the array)
-
cloneStreamer
Clone a streamer, doing a hard clone of all hydrophones, localiser stuff, etc.- Parameters:
streamer
- to clone.- Returns:
- the new streamer reference (which will be added already to the array)
-
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.
-
getPhonesForStreamer
Get a bitmap of hydrophones used with a particular streamer.- Parameters:
streamer
- Hydrophone streamer.- Returns:
- bitmap of used hydrophones.
-
getPhonesForStreamer
public int getPhonesForStreamer(int streamerId) Get a bitmap of hydrophones used with a particular streamer.- Parameters:
streamerId
- Hydrophone streamer index.- Returns:
- bitmap of used hydrophones.
-
getStreamerForPhone
public int getStreamerForPhone(int phoneId) Get the streamer id for a particular hydrophone- Parameters:
phoneId
- hydrophone index- Returns:
- stramer index.
-
getHydroponeData
Get data for a specific hydrophone at a specific time. This is the raw hydrophone data, which may later get modified by a hydroponelocaliser.- Parameters:
hydrophoneIndex
-timeMilliseconds
-- Returns:
-
getStreamerData
Get the streamer information for the given time. Should always be able to return something. May be an existing object or may be able to interpret between them. Note that this is the basic streamer data and is NOT iterated through the origin systems or anything.- Parameters:
timeMilliseconds
-- Returns:
-
addStreamer
Add a streamer and return the streamer id which will be one less than the number of streamers.- Parameters:
streamer
-- Returns:
-
removeStreamer
public void removeStreamer(int row) -
getArrayShape
public int getArrayShape()- Returns:
- the array shape, this is either point, line, plane or volumetric
-
setArrayShape
public void setArrayShape(int arrayShape) - Parameters:
arrayShape
- set the array shape - point, line, plane or volumetric.
-
getArrayTypeString
Return the type of array this is (e.g. "Point Array", "Line Array", etc)- Returns:
-
getArrayLocatorClass
- Returns:
- the arrayLocator class. This is NOT the master locator, but the default class for the array which will get used by the sub locators running behind the master locator.
-
getHydrophoneSensitivityAndGain
public double getHydrophoneSensitivityAndGain(int hydrophoneChannel) Get the hydrophone sensitivity and gain added together.- Parameters:
hydrophoneChannel
- hydrophone hardware number- Returns:
- Sum of hydrophone sensitivity and gain.
-
getClipLevel
public double getClipLevel(int hydrophoneChannel) Get the clip level - this is the level at which a signal will clip using the specified DAQ system. The level is in dB re 1uPa if in water or dB re 20uPa if in air.- Parameters:
hydrophoneChannel
- - the hydrophone/microphone hardware number- Returns:
- the clip level.
-
getHydrophoneCoordinates
public double[] getHydrophoneCoordinates(int iHydrophone, long timeMilliseconds) Get the hydrophone coordinates as a three element (x,y,z) vector referenced to the streamer positionHydrophone 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.
- Parameters:
iHydrophone
- hydrophone numbertimeMilliseconds
- time of location- Returns:
- three element position vector.
-
getHydrophoneCoordinateErrors
public double[] getHydrophoneCoordinateErrors(int iHydrophone, long timeMilliseconds) Get the hydrophone coordinate errors as a three element (x,y,z) vector.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.
- Parameters:
iHydrophone
- hydrophone numbertimeMilliseconds
- time of location- Returns:
- three element error vector.
-
getHydrophoneCoordinate
public 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.)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.
- Parameters:
iHydrophone
- hydrophone numberiCoordinate
- coordinate number (0,1,2 for x,y,z);timeMilliseconds
- time of location- Returns:
- three element position vector.
-
getHydrophoneCoordinateError
public double getHydrophoneCoordinateError(int iHydrophone, int iCoordinate, long timeMilliseconds) Get a hydrophone coordinate errorHydrophone 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.
- Parameters:
iHydrophone
- hydrophone numberiCoordinate
- coordinate number (0,1,2 for x,y,z);timeMilliseconds
- time of location- Returns:
- three element error vector.
-
getHydrophoneX
public double getHydrophoneX(int iHydrophone, long timeMilliseconds) Get a hydrophone x coordinate for a given time- Parameters:
iHydrophone
- hydrophone numbertimeMilliseconds
- time in milliseconds- Returns:
- hydrophone x coordinate.
-
getHydrophoneY
public double getHydrophoneY(int iHydrophone, long timeMilliseconds) Get a hydrophone y coordinate for a given time- Parameters:
iHydrophone
- hydrophone numbertimeMilliseconds
- time in milliseconds- Returns:
- hydrophone y coordinate.
-
getHydrophoneZ
public double getHydrophoneZ(int iHydrophone, long timeMilliseconds) Get a hydrophone z coordinate for a given time- Parameters:
iHydrophone
- hydrophone numbertimeMilliseconds
- time in milliseconds- Returns:
- hydrophone z coordinate.
-
getHydrophoneSymbol
Get the preferred symbol for a given hydrophone.- Parameters:
iHydrophone
- hydrophone number- Returns:
- Symbol to plot
-
prepareToSerialize
public void prepareToSerialize()Called just before the array is serialised into Pam settings so it can get data out of the localisers, etc. -
arrayDeserialized
public void arrayDeserialized()called just after the array settings have been loaded so that data can be loaded back into the Hydrophone localisers. -
getOriginInterpolation
public int getOriginInterpolation()- Returns:
- the originInterpolation
-
setOriginInterpolation
public void setOriginInterpolation(int originInterpolation) - Parameters:
originInterpolation
- the originInterpolation to set
-
getHydrophoneInterpolation
public int getHydrophoneInterpolation()- Returns:
- the hydrophoneInterpolation
-
setHydrophoneInterpolation
public void setHydrophoneInterpolation(int hydrophoneInterpolation) - Parameters:
hydrophoneInterpolation
- the hydrophoneInterpolation to set
-
setHydrophoneGain
public boolean setHydrophoneGain(int iPhone, double phoneGain) Set the hydrophone preamplifier gain- Parameters:
iPhone
- hydrophone indexphoneGain
- preamplifier gain- Returns:
- true if set successfully
-
setHydrophoneFilter
public boolean setHydrophoneFilter(int iPhone, double phoneFilter) Set the hydrophone bandwidth- Parameters:
iPhone
- hydrophone indexphoneGain
- preamplifier bandwidth- Returns:
- true if set successfully
-
getParameterSet
Description copied from interface:ManagedParameters
Get a set of data that describes all of the parameters in a class- Specified by:
getParameterSet
in interfaceManagedParameters
- Returns:
- description of the parameters in a class.
-
setDefaultSensitivity
public void setDefaultSensitivity(double defaultRecieverSens) Set all sensitivities on all hydrophones to a new value- Parameters:
defaultRecieverSens
- - the new sensitivity to set in dB re 1V/uPa (units may differ depending on medium)
-