Exemplo n.º 1
0
    def test_sfl_trhph_vfltemp(self):
        """
        Test sfl_trhph_vfltemp function.

        Values based on those described in DPS as available on Alfresco:

        OOI (2012). Data Product Specification for Vent Fluid Temperature from
            TRHPH. Document Control Number 1341-00150.
            https://alfresco.oceanobservatories.org/ (See: Company Home >> OOI
            >> Controlled >> 1000 System Level >>
            1341-00150_Data_Product_Spec_TRHPHTE_OOI.pdf)

        Implemented by Christopher Wingard, April 2013
        """

        # calibration constants
        tc_slope = np.ones(24) * 4.22e-5
        ts_slope = np.ones(24) * 0.003

        #   V_ts, V_tc, T_ts, T
        test_array = np.array([
            [1.506,	0.000,	12.01,	12.0],
            [1.479,	0.015,	12.67,	17.1],
            [1.926,	0.001,	2.47,	2.1],
            [1.932,	0.274,	2.34,	69.5],
            [1.927,	0.306,	2.45,	77.5],
            [1.930,	0.393,	2.38,	99.0],
            [1.929,	0.383,	2.40,	96.6],
            [1.930,	0.388,	2.38,	97.8],
            [1.930,	0.469,	2.38,	117.8],
            [1.931,	1.077,	2.36,	268.3],
            [1.926,	1.288,	2.47,	320.6],
            [1.926,	1.305,	2.47,	324.8],
            [1.928,	1.319,	2.43,	328.2],
            [1.929,	1.318,	2.40,	328.0],
            [1.601,	0.091,	9.75,	29.7],
            [1.958,	0.407,	1.78,	102.0],
            [1.962,	1.216,	1.70,	302.2],
            [1.441,	-0.300,	13.61,	13.6],
            [1.441,	1.216,  13.61,	312.1],
            [1.321,	1.216,	16.68,	315.0],
            [1.110,	1.216,	22.60,	320.8],
            [1.600,	1.216,	9.77,	308.1],
            [1.590,	1.216,	10.01,	308.9],
            [1.591,	1.216,	9.98,	308.3],
        ])

        # set inputs
        V_ts = test_array[:, 0]
        V_tc = test_array[:, 1]

        # set known outputs
        T = test_array[:, 3]

        # calculate the Vent Fluid Temperature
        Tout = sflfunc.sfl_trhph_vfltemp(V_ts, V_tc, tc_slope, ts_slope)

        # How'd we do?
        np.testing.assert_allclose(Tout, T, rtol=0.1, atol=0.0)
Exemplo n.º 2
0
    def test_sfl_trhph_vfltemp(self):
        """
        Test sfl_trhph_vfltemp function.

        Values based on those described in DPS as available on Alfresco:

        OOI (2012). Data Product Specification for Vent Fluid Temperature from
            TRHPH. Document Control Number 1341-00150.
            https://alfresco.oceanobservatories.org/ (See: Company Home >> OOI
            >> Controlled >> 1000 System Level >>
            1341-00150_Data_Product_Spec_TRHPHTE_OOI.pdf)

        Implemented by Christopher Wingard, April 2013
        """

        # calibration constants
        tc_slope = np.ones(24) * 4.22e-5
        ts_slope = np.ones(24) * 0.003

        #   V_ts, V_tc, T_ts, T
        test_array = np.array([
            [1.506, 0.000, 12.01, 12.0],
            [1.479, 0.015, 12.67, 17.1],
            [1.926, 0.001, 2.47, 2.1],
            [1.932, 0.274, 2.34, 69.5],
            [1.927, 0.306, 2.45, 77.5],
            [1.930, 0.393, 2.38, 99.0],
            [1.929, 0.383, 2.40, 96.6],
            [1.930, 0.388, 2.38, 97.8],
            [1.930, 0.469, 2.38, 117.8],
            [1.931, 1.077, 2.36, 268.3],
            [1.926, 1.288, 2.47, 320.6],
            [1.926, 1.305, 2.47, 324.8],
            [1.928, 1.319, 2.43, 328.2],
            [1.929, 1.318, 2.40, 328.0],
            [1.601, 0.091, 9.75, 29.7],
            [1.958, 0.407, 1.78, 102.0],
            [1.962, 1.216, 1.70, 302.2],
            [1.441, -0.300, 13.61, 13.6],
            [1.441, 1.216, 13.61, 312.1],
            [1.321, 1.216, 16.68, 315.0],
            [1.110, 1.216, 22.60, 320.8],
            [1.600, 1.216, 9.77, 308.1],
            [1.590, 1.216, 10.01, 308.9],
            [1.591, 1.216, 9.98, 308.3],
        ])

        # set inputs
        V_ts = test_array[:, 0]
        V_tc = test_array[:, 1]

        # set known outputs
        T = test_array[:, 3]

        # calculate the Vent Fluid Temperature
        Tout = sflfunc.sfl_trhph_vfltemp(V_ts, V_tc, tc_slope, ts_slope)

        # How'd we do?
        np.testing.assert_allclose(Tout, T, rtol=0.1, atol=0.0)
    def test_sfl_trhph_vfltemp(self):
        """
        Test sfl_trhph_vfltemp function.

        Values based on those described in DPS as available on Alfresco:

        OOI (2012). Data Product Specification for Vent Fluid Temperature from
            TRHPH. Document Control Number 1341-00150.
            https://alfresco.oceanobservatories.org/ (See: Company Home >> OOI
            >> Controlled >> 1000 System Level >>
            1341-00150_Data_Product_Spec_TRHPHTE_OOI.pdf)

        Implemented by Christopher Wingard, April 2013
        """

        # calibration constants
        a = 1.98e-9
        b = -2.45e-6
        c = 9.28e-4
        d = -0.0888
        e = 0.731

        #   [  V_s,   V_c,   T_s,  T_c,  T_u,  T_lc,     T]
        test_array = np.array([
            [1.506, 0.000, 12.01, 0.00, 12.0, -0.206, 11.8],
            [1.479, 0.015, 12.67, 3.68, 16.3, -0.483, 15.9],
            [1.926, 0.001, 2.47, 0.25, 2.7, 0.497, 3.2],
            [1.932, 0.274, 2.34, 67.12, 69.5, -1.735, 67.7],
            [1.927, 0.306, 2.45, 74.96, 77.4, -1.648, 75.8],
            [1.930, 0.393, 2.38, 96.27, 98.7, -1.162, 97.5],
            [1.929, 0.383, 2.40, 93.82, 96.2, -1.234, 95.0],
            [1.930, 0.388, 2.38, 95.05, 97.4, -1.199, 96.2],
            [1.930, 0.469, 2.38, 114.89, 117.3, -0.497, 116.8],
            [1.931, 1.077, 2.36, 263.83, 266.2, 6.579, 272.8],
            [1.926, 1.288, 2.47, 315.52, 318.0, 7.797, 325.8],
            [1.926, 1.305, 2.47, 319.69, 322.2, 7.847, 330.0],
            [1.928, 1.319, 2.43, 323.12, 325.5, 7.883, 333.4],
            [1.929, 1.318, 2.40, 322.87, 325.3, 7.880, 333.2]
        ])

        # set inputs
        V_s = test_array[:, 0]
        V_c = test_array[:, 1]

        # set known outputs
        T = test_array[:, 6]

        # calculate the Vent Fluid Temperature
        Tout = sflfunc.sfl_trhph_vfltemp(V_s, V_c, a, b, c, d, e)

        # How'd we do?
        np.testing.assert_allclose(Tout, T, rtol=0.01, atol=0.0)