PamguardMVC
Class PamDataUnit

java.lang.Object
  extended by PamguardMVC.PamDataUnit
Direct Known Subclasses:
AcousticDataUnit, AISDataUnit, AngleDataUnit, BeakedDataUnit, BeakedExperimentData, DaqStatusDataUnit, DepthDataUnit, GpsDataUnit, IshmaelDataUnit, LandmarkDataUnit, ListeningEffortData, MapComment, NMEADataUnit, RecorderDataUnit, ShoreStationDataUnit, SimDataUnit, TerrellaStandardDataSetUnit, ThingHeard, UserInputDataUnit, VRDataUnit

public abstract class PamDataUnit
extends Object

Author:
Doug Gillespie

Class for units of PAM data.

PamDataUnit's are held in ArrayLists within PamDataBlocks.

When a PamDataUnit is added to a PamDataBlock any PamProcesses that subscribe to that PamDataBlock receive a notification and can retrieve the PamDataUnits from the block.

Any data derived from acoustic data should subclass from AcousticDataUnit

See Also:
PamDataBlock, AcousticDataUnit

Field Summary
protected  int absBlockIndex
          Absolute block index, needed for searches once NPDU's start getting deleted off the front of the storage
protected  int channelBitmap
          map of channels used in the data.
protected  AbstractLocalisation localisation
          Localisation information
protected  LatLong oLL
           
protected  long timeMilliseconds
          time the NewPamDataUnit was created based using standard Java time
 
Constructor Summary
PamDataUnit(long timeMilliseconds)
           
 
Method Summary
 int getAbsBlockIndex()
           
 int getChannelBitmap()
           
 int getDatabaseIndex()
           
 int getDatabaseUpdateOf()
           
protected  GpsData getGpsPosition()
          Used when no hydrophone information is specified to get the nearest ships GPS position.
 long getLastUpdateTime()
           
 AbstractLocalisation getLocalisation()
           
 LatLong getOriginLatLong(boolean recalculate)
          Get the latlongof the mean hydrophone position at the time of this detection.
 double getPairAngle(int pair, boolean recalculate)
          Return the angle between pairs of hydorphones.
 PamDataBlock getParentDataBlock()
           
 long getTimeMilliseconds()
           
 int getUpdateCount()
           
 void setAbsBlockIndex(int absBlockIndex)
           
 void setChannelBitmap(int channelBitmap)
           
 void setDatabaseIndex(int databaseIndex)
           
 void setDatabaseUpdateOf(int databaseUpdateOf)
           
 void setLastUpdateTime(long lastUpdateTime)
           
 void setLocalisation(AbstractLocalisation localisation)
           
 void setOriginLatLong(LatLong oll)
           
 void setParentDataBlock(PamDataBlock parentDataBlock)
           
 void setTimeMilliseconds(long timeMilliseconds)
           
 void updateDataUnit(long updateTime)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

timeMilliseconds

protected long timeMilliseconds
time the NewPamDataUnit was created based using standard Java time


absBlockIndex

protected int absBlockIndex
Absolute block index, needed for searches once NPDU's start getting deleted off the front of the storage


channelBitmap

protected int channelBitmap
map of channels used in the data.

N.B the PamDataBlock also has a channelBitmap. The channelBitmap in a PamDataBlock is a list of channels that might be present in the data units. The channelBitmap in the data unit represents channels that are actually present in that data unit. For instance, if sampling 2 channels (ch0 and ch1) of raw audio data, the channelBitmap in the data block would equal 3, but the channel maps in the data units (which contain one channel of data each) will alternate between 1 and 2.

note that these are the software channels and that there may not be a 1:1 relationship between software channels and hydrophones.

This parameter is included in PamDataUnit and not in the subclass AcousticDataUnit since it is sometimes needed by non acoustic data.


localisation

protected AbstractLocalisation localisation
Localisation information


oLL

protected LatLong oLL
Constructor Detail

PamDataUnit

public PamDataUnit(long timeMilliseconds)
Method Detail

setAbsBlockIndex

public void setAbsBlockIndex(int absBlockIndex)

setParentDataBlock

public void setParentDataBlock(PamDataBlock parentDataBlock)

setTimeMilliseconds

public void setTimeMilliseconds(long timeMilliseconds)

getAbsBlockIndex

public int getAbsBlockIndex()

getParentDataBlock

public PamDataBlock getParentDataBlock()

getTimeMilliseconds

public long getTimeMilliseconds()

updateDataUnit

public void updateDataUnit(long updateTime)

getUpdateCount

public int getUpdateCount()

getChannelBitmap

public int getChannelBitmap()

setChannelBitmap

public void setChannelBitmap(int channelBitmap)

getLocalisation

public AbstractLocalisation getLocalisation()
Returns:
Returns the localisation.

setLocalisation

public void setLocalisation(AbstractLocalisation localisation)
Parameters:
localisation - The localisation to set.

getOriginLatLong

public LatLong getOriginLatLong(boolean recalculate)
Get the latlongof the mean hydrophone position at the time of this detection.

Parameters:
recalculate -
Returns:
Lat long of detectin origin (usually the position of the reference hydrophone at time of detection)

setOriginLatLong

public void setOriginLatLong(LatLong oll)

getPairAngle

public double getPairAngle(int pair,
                           boolean recalculate)
Return the angle between pairs of hydorphones. For a n channel detection, n-1 pair angles are calulcated, each being the bearing, realtive to north, from the pair+1th hydrophone TO the 0th hydropone (i.e. for a 2 channel array, there is one pair calculated and it's from channel 1 to channel 0, which is the most useful. If other inter pair angles are required, then it should easy to calculate them from these values.

Parameters:
pair -
recalculate -
Returns:
angle clockwise from North in degrees.

getGpsPosition

protected GpsData getGpsPosition()
Used when no hydrophone information is specified to get the nearest ships GPS position.

Returns:
GPS data closest to the time of the detection

getLastUpdateTime

public long getLastUpdateTime()

setLastUpdateTime

public void setLastUpdateTime(long lastUpdateTime)

getDatabaseIndex

public int getDatabaseIndex()

setDatabaseIndex

public void setDatabaseIndex(int databaseIndex)

getDatabaseUpdateOf

public int getDatabaseUpdateOf()

setDatabaseUpdateOf

public void setDatabaseUpdateOf(int databaseUpdateOf)