def test_legendre_functions(self): degree = 20 latitudes = [float(v) for v in range(-90, 91, 5)] for latitude in latitudes: self._assert_allclose( legendre(latitude, degree), self.reference(latitude, degree) )
def get_series(cls, degree, latitude, longitude, radius): rad_series = relradpow(radius, degree, is_internal=cls.is_internal) sin_series, cos_series = lonsincos(longitude, degree) p_series, dp_series = legendre(latitude, degree) return rad_series, sin_series, cos_series, p_series, dp_series
def test_legendre_functions_zero_degree(self): self._assert_allclose(legendre(0, 0), ([1.0], [0.0])) self._assert_allclose(legendre(-90, 0), ([1.0], [0.0])) self._assert_allclose(legendre(+90, 0), ([1.0], [0.0]))