예제 #1
0
    def test_n_dimensional_gravity_List1968(self):
        """
        Tests :func:`colour.phenomenons.rayleigh.gravity_List1968`
        definition n-dimensional arrays support.
        """

        g = 978.03560705760003
        np.testing.assert_almost_equal(
            gravity_List1968(),
            g,
            decimal=7)

        g = np.tile(g, 6)
        np.testing.assert_almost_equal(
            gravity_List1968(),
            g,
            decimal=7)

        g = np.reshape(g, (2, 3))
        np.testing.assert_almost_equal(
            gravity_List1968(),
            g,
            decimal=7)

        g = np.reshape(g, (2, 3, 1))
        np.testing.assert_almost_equal(
            gravity_List1968(),
            g,
            decimal=7)
예제 #2
0
    def test_n_dimensional_gravity_List1968(self):
        """
        Tests :func:`colour.phenomenons.rayleigh.gravity_List1968`
        definition n-dimensional arrays support.
        """

        g = 978.03560706
        np.testing.assert_almost_equal(
            gravity_List1968(),
            g,
            decimal=7)

        g = np.tile(g, 6)
        np.testing.assert_almost_equal(
            gravity_List1968(),
            g,
            decimal=7)

        g = np.reshape(g, (2, 3))
        np.testing.assert_almost_equal(
            gravity_List1968(),
            g,
            decimal=7)

        g = np.reshape(g, (2, 3, 1))
        np.testing.assert_almost_equal(
            gravity_List1968(),
            g,
            decimal=7)
예제 #3
0
    def test_nan_gravity_List1968(self):
        """
        Tests :func:`colour.phenomenons.rayleigh.gravity_List1968` definition
        nan support.
        """

        cases = [-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]
        cases = set(permutations(cases * 3, r=1))
        for case in cases:
            latitude = case
            altitude = case
            gravity_List1968(latitude, altitude)
예제 #4
0
    def test_gravity_List1968(self):
        """
        Tests :func:`colour.phenomenons.rayleigh.gravity_List1968` definition.
        """

        self.assertAlmostEqual(gravity_List1968(0, 0), 978.03560706, places=7)

        self.assertAlmostEqual(
            gravity_List1968(45, 1500), 980.15334386, places=7)

        self.assertAlmostEqual(
            gravity_List1968(48.8567, 35), 980.95241784, places=7)
예제 #5
0
    def test_nan_gravity_List1968(self):
        """
        Tests :func:`colour.phenomenons.rayleigh.gravity_List1968` definition
        nan support.
        """

        cases = [-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]
        cases = set(permutations(cases * 3, r=1))
        for case in cases:
            latitude = case
            altitude = case
            gravity_List1968(latitude, altitude)
예제 #6
0
    def test_gravity_List1968(self):
        """
        Tests :func:`colour.phenomenons.rayleigh.gravity_List1968` definition.
        """

        self.assertAlmostEqual(
            gravity_List1968(0, 0),
            978.0356070576,
            places=7)

        self.assertAlmostEqual(
            gravity_List1968(45, 1500),
            980.1533438638013,
            places=7)

        self.assertAlmostEqual(
            gravity_List1968(48.8567, 35),
            980.9524178426182,
            places=7)