Jpp - the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JAcousticsSupportkit.hh
Go to the documentation of this file.
1 #ifndef __JACOUSTICS__JACOUSTICSSUPPORTKIT__
2 #define __JACOUSTICS__JACOUSTICSSUPPORTKIT__
3 
4 #include <cmath>
5 
6 /**
7  * \file
8  *
9  * Acoustics toolkit.
10  * \author mdejong
11  */
12 namespace JACOUSTICS {}
13 namespace JPP { using namespace JACOUSTICS; }
14 
15 namespace JACOUSTICS {
16 
17  static const double TOAMIN_S = 0.0000000; //!< Minimal allowed time-of-arrival [s]
18  static const double TOAMAX_S = 0.6310912; //!< Maximal allowed time-of-arrival [s]
19 
20 
21  /**
22  * Auxiliary data structure for calculation of attenuation length.
23  *
24  * Attenuation accourding to Ainslie and McColm, J. Acoust. Soc. AM. 103 (3) 1671 1998.
25  * See also http://resource.npl.co.uk/acoustics/techguides/seaabsorption/physics.html for numerical values.
26  */
28  /**
29  * Constructor.
30  *
31  * \param T temperature [C]
32  * \param S salinity [pm]
33  * \param pH pH
34  */
35  JAttenuationLength(const double T,
36  const double S,
37  const double pH) :
38  T (T),
39  S (S),
40  pH(pH)
41  {}
42 
43 
44  /**
45  * Get attentuation length.
46  *
47  * \param D_m depth [m]
48  * \param f_kHz frequency [kHz]
49  * \return attenuation length [m]
50  */
51  double operator()(const double D_m,
52  const double f_kHz) const
53  {
54  const double z = D_m * 1.0e-3;
55  const double f1 = 0.78 * sqrt(S/35.0) * exp(T/26.0);
56  const double f2 = 42.0 * exp(T/17.0);
57  const double a1 = 0.106 * f1*(f_kHz*f_kHz) / (f_kHz*f_kHz + f1*f1) * exp((pH-8.0)/0.56);
58  const double a2 = 0.52 * (1.0 + T/43.0) * (S/35.0) * f2 * f_kHz*f_kHz / (f_kHz*f_kHz + f2*f2) * exp(-z/6.0);
59  const double a0 = 0.00049 * exp(-T/27.0 + z/17.0) * f_kHz*f_kHz;
60  const double A = a0 + a1 + a2;
61 
62  return 10.0 / (A*log(10.0));
63  }
64 
65  double T;
66  double S;
67  double pH;
68  };
69 
70 
71  /**
72  * Function object to calculate attenutation length.
73  */
74  static const JAttenuationLength getAttenuationLength(13.2, // temperature [deg]
75  38.0, // salinity [pm]
76  8.0); // pH
77 }
78 
79 #endif
double operator()(const double D_m, const double f_kHz) const
Get attentuation length.
static const double TOAMIN_S
Minimal allowed time-of-arrival [s].
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable STRING $argv[2] set_array QUANTILES set_variable FORMULA *[0] exp(-0.5 *(x-[1])*(x-[1])/([2]*[2]))" set_variable MODULE `getModule -a $DETECTOR -L "$STRING 0"` typeset -Z 4 STRING JOpera1D -f hydrophone.root
static const double TOAMAX_S
Maximal allowed time-of-arrival [s].
JAttenuationLength(const double T, const double S, const double pH)
Constructor.
static const JAttenuationLength getAttenuationLength(13.2, 38.0, 8.0)
Function object to calculate attenutation length.
Auxiliary data structure for calculation of attenuation length.
source $JPP_DIR setenv csh $JPP_DIR eval JShellParser o a A