Class BeamOGramDataUnit

java.lang.Object
PamguardMVC.PamDataUnit<T,U>
PamguardMVC.DataUnit2D
beamformer.continuous.BeamOGramDataUnit
All Implemented Interfaces:
Comparable, AcousticDataUnit

public class BeamOGramDataUnit extends DataUnit2D implements AcousticDataUnit
Data output for the BaemOGram. This is beam data with a high angular resolution which is used for display purposes and for fine scale angle calculation.

The data may have 1, 2 or 3 dimensions, so are always stored in a 3D array, though often the size of the first two dimensions will be 1:
Dimension 1: Frequency
Dimension 2: Slant angle (strictly angle relative to the perpendicular to the array axis)
Dimension 3: Main angle - the angle relative to the main array axis.

Angle 1 - The main angle and the only angle for a linear array is last since this is the most common case and the data can be easily accessed as an array with a reference to data[0][0].

So for the simple case of a continuous beamformer, using a linear array, the data will already be averaged over frequency, so the dimension will be [1][1][nAngle1]. A 3D array beamformer may have both angles present, so will be [1][nAngle2][nAngle1].

Frequency information is only retained when doing detect-then-localise beam forming so that the information can be easily displayed on plots of frequency vs angle.

Author:
Doug Gillespie
  • Constructor Details

    • BeamOGramDataUnit

      public BeamOGramDataUnit(long timeMilliseconds, int channelBitmap, int sequenceBitmap, long startSample, long durationSamples, double[][][] beamOGramData, int fftSeqNumber)
  • Method Details

    • getBeamOGramData

      public double[][][] getBeamOGramData()
      Returns:
      the beamOGramData
    • setBeamOGramData

      public void setBeamOGramData(double[][][] beamOGramData)
      Parameters:
      beamOGramData - the beamOGramData to set
    • getNFrequencyBins

      public int getNFrequencyBins()
      Returns:
      the number of frequency bins
    • getNAngle2Bins

      public int getNAngle2Bins()
      Returns:
      the number of second angle bins
    • getNAngle1Bins

      public int getNAngle1Bins()
      Returns:
      the number of first angle bins
    • getAngleAngleData

      public double[][] getAngleAngleData(boolean average)
      Collapse the data down to just the two angular dimensions.
      Parameters:
      average - average the data (data are summed if this is false)
      Returns:
      a two dimensional array of data [angle2][Angle1]
    • getAngle1Data

      public double[] getAngle1Data(boolean average)
      Collapse the data onto a single main angle array
      Parameters:
      average - average the data (data are summed if this is false)
      Returns:
      one dimensional data along the main angle.
    • getFrequencyAngle1Data

      public double[][] getFrequencyAngle1Data(boolean average)
      Collapse the data onto a 2D array of frequency and main angle
      Parameters:
      average - average the data (data are summed if this is false)
      Returns:
      a two dimensional array of data [frequency][Angle1]
    • getMagnitudeData

      public double[] getMagnitudeData()
      Specified by:
      getMagnitudeData in class DataUnit2D
      Returns:
      data for plotting. Should be converted to the same scale as is used by the plot axis (usually dB, but might be counts or some other data type)
    • dataToDB

      public double[][] dataToDB(double[][] beamData)
      Convert a 2D array of magnitude data to a decibel scale
      Parameters:
      beamData - beam output data (magnitude squared)
      Returns:
      data scaled to dB re 1uPa/sqrt(Hz).
    • dataToDB

      public double[] dataToDB(double[] beamData)
      Convert a 1D array of magnitude data to a decibel scale
      Parameters:
      beamData - beam output data (magnitude squared)
      Returns:
      data scaled to dB re 1uPa/sqrt(Hz).
    • getFftSlice

      public int getFftSlice()
      Returns:
      the fftSlice
    • averageAngleAngleData

      public static double[][] averageAngleAngleData(List<BeamOGramDataUnit> beamOData)
      Average a list of beamogram data units over time , collapsing Frequency and also transposing so that angle1 is on x and angle2 on y.
      Parameters:
      beamOData - array list o BeamoGram data.
      Returns:
      double array of angle2 vs angle1 data.
    • averageFrequencyAngle1Data

      public static double[][] averageFrequencyAngle1Data(List<BeamOGramDataUnit> beamOData)
      Average a list of beamogram data units over time , collapsing Angle2 and also transposing so that angle1 is on x and frequency on y.
      Parameters:
      beamOData - array list o BeamoGram data.
      Returns:
      double array of frequency vs angle1 data.
    • getAverageAngle1Data

      public static double[] getAverageAngle1Data(List<BeamOGramDataUnit> beamOData)
      Average a list of BeamoGram dataunits over time, frequency and angle1 to get a single array of amplitude vs angle1.
      Parameters:
      beamOData - list o fBeamOGram data units
      Returns:
      anlge1 array.