25#ifndef GOBY_UTIL_SALINITY_H
26#define GOBY_UTIL_SALINITY_H
30#include <boost/units/quantity.hpp>
31#include <boost/units/systems/si.hpp>
33#include <boost/units/systems/temperature/celsius.hpp>
55 typename TemperatureUnit = boost::units::celsius::temperature,
56 typename PressureUnit =
decltype(boost::units::si::deci*
bar)>
57boost::units::quantity<boost::units::si::dimensionless>
59 boost::units::quantity<boost::units::absolute<TemperatureUnit> > temperature,
60 boost::units::quantity<PressureUnit>
pressure)
64 double T = quantity<absolute<celsius::temperature> >(temperature).value();
65 double P = quantity<decltype(si::deci * bar)>(
pressure).value();
67 return quantity<si::dimensionless>(
78template <
typename TemperatureUnit = boost::units::celsius::temperature,
79 typename DimensionlessUnit = boost::units::si::dimensionless,
80 typename PressureUnit =
decltype(boost::units::si::deci*
bar)>
83 boost::units::quantity<boost::units::absolute<TemperatureUnit> > temperature,
84 boost::units::quantity<PressureUnit>
pressure)
88 double T = quantity<absolute<celsius::temperature> >(temperature).value();
89 double P = quantity<decltype(si::deci * bar)>(
pressure).value();
103template <
typename TemperatureUnit = boost::units::celsius::temperature,
104 typename PressureUnit =
decltype(boost::units::si::deci*
bar)>
107 boost::units::quantity<boost::units::absolute<TemperatureUnit> > temperature,
108 boost::units::quantity<PressureUnit>
pressure)
static double compute(double CND, double T, double P, bool M)
static const boost::units::metric::bar_base_unit::unit_type bar
static const decltype((boost::units::si::milli *boost::units::si::siemen)/(boost::units::si::centi *boost::units::si::meters) milli_siemens_per_cm)
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< decltype(milli_siemens_per_cm)> conductivity(boost::units::quantity< DimensionlessUnit > salinity, boost::units::quantity< boost::units::absolute< TemperatureUnit > > temperature, boost::units::quantity< PressureUnit > pressure)
Calculates conductivity from salinity, temperature, and pressure Adapted from "Algorithms for computa...
boost::units::quantity< boost::units::si::dimensionless > salinity(boost::units::quantity< ConductivityUnit > conductivity, boost::units::quantity< boost::units::absolute< TemperatureUnit > > temperature, boost::units::quantity< PressureUnit > pressure)
Calculates salinity from conductivity, temperature, and pressure Adapted from "Algorithms for computa...
static const boost::units::quantity< decltype(milli_siemens_per_cm)> conductivity_at_standard
The global namespace for the Goby project.