예제 #1
0
 def test_relradpow_external_with_custom_radius(self):
     assert_allclose(
         relradpow(4.0, 10, reference_radius=2.0, is_internal=False),
         [0.5, 1, 2, 4, 8, 16, 32, 64, 128, 256, 512]
     )
     assert_allclose(
         relradpow(1.1, 256, reference_radius=1.0, is_internal=False),
         self.reference_external(1.1, 256)
     )
예제 #2
0
 def test_relradpow_internal_with_custom_radius(self):
     assert_allclose(
         relradpow(4.0, 10, reference_radius=2.0, is_internal=True),
         [
             0.25, 0.125, 0.0625, 0.03125, 0.015625, 0.0078125, 0.00390625,
             0.001953125, 0.0009765625, 0.00048828125, 0.000244140625,
         ]
     )
     assert_allclose(
         relradpow(1.1, 256, reference_radius=1.0, is_internal=True),
         self.reference_internal(1.1, 256)
     )
예제 #3
0
 def test_relradpow_internal(self):
     assert_allclose(
         relradpow(2*6371.2, 10, is_internal=True),
         [
             0.25, 0.125, 0.0625, 0.03125, 0.015625, 0.0078125, 0.00390625,
             0.001953125, 0.0009765625, 0.00048828125, 0.000244140625,
         ]
     )
     assert_allclose(
         relradpow(1.1*6371.2, 256, is_internal=True),
         self.reference_internal(1.1, 256)
     )
예제 #4
0
 def test_relradpow_zero_degree_internal(self):
     assert_allclose(relradpow(2.0, 0, 1.0, is_internal=True), [0.25])
예제 #5
0
 def test_relradpow_zero_degree_external(self):
     assert_allclose(relradpow(2.0, 0, 1.0, is_internal=False), [0.5])
예제 #6
0
 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
예제 #7
0
 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