Class GlobalMedium

java.lang.Object
PamController.soundMedium.GlobalMedium

public class GlobalMedium extends Object
Defines the assumed medium that sound is propogating through i.e. water or air. Other mediums may be added by adding a new enum and modifying switch statements. For example if PAMGuard is used in any space missions to the water moons of Saturn or perhaps someone wants to see how well a dolphin swims through custard.
Author:
Jamie Macaulay
  • Constructor Details

    • GlobalMedium

      public GlobalMedium()
  • Method Details

    • getDefaultSoundSpeed

      public static double getDefaultSoundSpeed(GlobalMedium.SoundMedium currentMedium)
      Get the default sound speed for the medium.
      Parameters:
      currentMedium - - the current medium.
      Returns:
      the default sound speed in meters per second.
    • getdBreference

      public static double getdBreference(GlobalMedium.SoundMedium currentMedium)
      Get the reference unit commonly used for this medium e.g. 1uPa in water and 20uPa in air
      Returns:
      the reference unit commonly used for the medium.
    • getDefaultSens

      public static double getDefaultSens(GlobalMedium.SoundMedium currentMedium)
      Get the default sensitivity of a reciever in dB referenced to the medium dependent reference value. This will be highly variable but just to get in a few tens of dB of where it should.
      Returns:
      the reference unit commonly used for the medium.
    • getRecieverString

      public static String getRecieverString(GlobalMedium.SoundMedium currentMedium, boolean caps, boolean plural)
      Hydrophones are used under water and microphones in air. Need to change these words around...
      Parameters:
      currentMedium - - the current medium e.g. water, air.
      caps - true to capitalise the first letter of the string.
      plural - - true to pluralise the string.
      Returns:
      the string describing the reciever.
    • getToolTip

      public static String getToolTip(GlobalMedium.SoundMedium currentMedium)
    • getZString

      public static String getZString(GlobalMedium.SoundMedium currentMedium, boolean caps, boolean plural)
      Get a string description of the z dimensions e.g. depth or height.
      Parameters:
      currentMedium - - the current medium e.g. water, air.
      caps - true to capitalise the first letter of the string.
      plural - - true to pluralise the string.
      Returns:
      the string description of the Z dimensions
    • getdBSensRefString

      public static String getdBSensRefString(GlobalMedium.SoundMedium currentMedium)
      Get a string description of the Pascal reference for receiver sensitivities in dB.
      Parameters:
      currentMedium - - the current medium. return string of dB reference
    • getdBSensOffset

      public static double getdBSensOffset(GlobalMedium.SoundMedium currentMedium)
      Get the dB offset to convert form sensitivity value units to received amplitude units. Sensitivity values in PG are always stored in the same reference as received amplitude. However they may be different units in the display because terrestrial acoustics is annoying.

      Add this to input from display to get stored unit. Subtract to get display units.

      Parameters:
      currentMedium - - the current medium.
      Returns:
      the daB offset.
    • getdBRefString

      public static String getdBRefString(GlobalMedium.SoundMedium currentMedium)
      Get a string description of the Pascal reference for the dB
      Parameters:
      currentMedium - - the current medium.
      Returns:
      string of dB reference
    • getZCoeff

      public static double getZCoeff(GlobalMedium.SoundMedium currentMedium)
      Get the z coefficient value for displays. Height are always stored so that +z points up (i.e. -g). In display height is input as depth as so must be multiplied by -1 before being stored. In air height is more sensible to think of as +z and so does not need multiplied (or multiplied by 1). The height coefficient is the value height inputs are multiplied before being stored. @see getZString
      Parameters:
      currentMedium - - the current medium.
      Returns:
      the height coefficient.
    • getDefaultAmplitudeScales

      public static double[] getDefaultAmplitudeScales(GlobalMedium.SoundMedium currentMedium)
      Get default amplitude scales for display for different medium
      Parameters:
      currentMedium - - the current medium.
      Returns:
      the minimum and maximum amplitude in dB
    • getDefaultdBHzScales

      public static double[] getDefaultdBHzScales(GlobalMedium.SoundMedium currentMedium)
      Get default dB/Hz scales for display for different medium
      Parameters:
      currentMedium - - the current medium.
      Returns:
      the minimum and maximum amplitude in dB/Hz