30#ifndef GOBY_UTIL_SEAWATER_PRESSURE_H
31#define GOBY_UTIL_SEAWATER_PRESSURE_H
52template <
typename DepthUnit = boost::units::si::length,
53 typename LatitudeUnit = boost::units::degree::plane_angle>
54inline boost::units::quantity<
decltype(boost::units::si::deci *
bar)>
55pressure(boost::units::quantity<DepthUnit>
depth, boost::units::quantity<LatitudeUnit> latitude)
75 double DPTH = quantity<boost::units::si::length>(
depth).value();
76 double XLAT = quantity<degree::plane_angle>(latitude).value();
78 const double pi = goby::util::pi<double>;
80 double PLAT = std::abs(XLAT *
pi / 180);
81 double D = std::sin(PLAT);
82 double C1 = (5.92E-3) + (D * D) * (5.25E-3);
83 double P80 = ((1 - C1) - sqrt(((1 - C1) * (1 - C1)) - ((8.84E-6) * DPTH))) / 4.42E-6;
85 return P80 * boost::units::si::deci *
bar;
static const boost::units::metric::bar_base_unit::unit_type bar
boost::units::quantity< decltype(boost::units::si::deci *bar)> pressure(boost::units::quantity< DepthUnit > depth, boost::units::quantity< LatitudeUnit > latitude)
Calculates pressure from depth and latitude.
boost::units::quantity< boost::units::si::length > depth(boost::units::quantity< PressureUnit > pressure, boost::units::quantity< LatitudeUnit > latitude)
Calculates depth from pressure and latitude Adapted from "Algorithms for computation of fundamental p...
The global namespace for the Goby project.