def test_atg(self):
        # check values from Fofonoff and Millard(1983)
        atg_ck = 3.255976e-4
        s_ck = 40.0
        t_ck = 40
        p_ck = 10000

        atg_calc = Oc.atg(s=s_ck, t=t_ck, p=p_ck)

        self.assertAlmostEqual(atg_calc, atg_ck, places=1)
import logging

from hyo2.soundspeed.profile.oceanography import Oceanography as Oc
from hyo2.abc.lib.logging import set_logging

ns_list = ["hyo2.soundspeed", "hyo2.soundspeedmanager", "hyo2.soundspeedsettings"]
set_logging(ns_list=ns_list)

logger = logging.getLogger(__name__)

# check values from Fofonoff and Millard(1983)
atg_ck = 3.255976e-4
s_ck = 40.0
t_ck = 40
p_ck = 10000
atg_calc = Oc.atg(s=s_ck, t=t_ck, p=p_ck)
logger.info("Adiabatic Temperature Gradient: %g <> %g" % (atg_calc, atg_ck))

theta_ck = 36.89073
s_ck = 40
t0_ck = 40
p0_ck = 10000
p_ref_ck = 0
theta_calc = Oc.pot_temp(s=s_ck, t=t0_ck, p=p0_ck, pr=p_ref_ck)
logger.info("Theta: %g <> %g" % (theta_calc, theta_ck))
t0_calc = Oc.in_situ_temp(s=s_ck, t=theta_ck, p=p0_ck, pr=p_ref_ck)
logger.info("Temp: %.3f <> %.3f" % (t0_calc, t0_ck))

cr_ck = 1.1
t_ck = 40.0
s_ck = 38.999