예제 #1
0
    def test_get_coordinate_at_distance(self):
        bins = np.arange(10)
        G = Geostatistic(self.x, lags=bins)

        with self.assertRaises(ValueError):  # missing center
            lon, lat = G.get_coordinates_at_distance(2.5, dist_threshold=1.)
        G.set_center_position(5., -20.)
        lon, lat = G.get_coordinates_at_distance(2.5, dist_threshold=1.)
예제 #2
0
    def test_get_coordinate_at_distance(self):
        bins = np.arange(10)
        G = Geostatistic(self.x, lags=bins)

        with self.assertRaises(ValueError):  # missing center
            lon, lat = G.get_coordinates_at_distance(2.5, dist_threshold=1.)
        G.set_center_position(5., -20.)
        lon, lat = G.get_coordinates_at_distance(2.5, dist_threshold=1.)
예제 #3
0
    def test_center_pos(self):
        bins = np.arange(10)
        G = Geostatistic(self.x, lags=bins)
        # forgot to set center
        with self.assertRaises(ValueError):
            G._get_center_pos()

        G.set_center_position(-10., -60.)
        i_lat, i_lon = G._get_center_pos()
        self.assertEqual(i_lat, 0)
        self.assertEqual(i_lon, 0)

        G.set_center_position(9., 48.)
        i_lat, i_lon = G._get_center_pos()
        self.assertEqual(i_lat, 54)
        self.assertEqual(i_lon, 19)

        G.set_center_position(-10.1, 48.)
        i_lat, i_lon = G._get_center_pos()
        self.assertEqual(i_lat, 54)
        self.assertEqual(i_lon, 0)
예제 #4
0
    def test_center_pos(self):
        bins = np.arange(10)
        G = Geostatistic(self.x, range_bins=bins)
        # forgot to set center
        with self.assertRaises(ValueError):
            G._get_center_pos()

        G.set_center_position(-10., -60.)
        i_lat, i_lon = G._get_center_pos()
        self.assertEqual(i_lat, 0)
        self.assertEqual(i_lon, 0)

        G.set_center_position(9., 48.)
        i_lat, i_lon = G._get_center_pos()
        self.assertEqual(i_lat, 54)
        self.assertEqual(i_lon, 19)

        G.set_center_position(-10.1, 48.)
        i_lat, i_lon = G._get_center_pos()
        self.assertEqual(i_lat, 54)
        self.assertEqual(i_lon, 0)
예제 #5
0
 def test_set_center(self):
     bins = np.arange(10)
     G = Geostatistic(self.x, lags=bins)
     G.set_center_position(5., -20.)
     self.assertEqual(G.lon_center, 5.)
     self.assertEqual(G.lat_center, -20.)
예제 #6
0
 def test_percentiles(self):
     bins = np.arange(10)
     G = Geostatistic(self.x, lags=bins)
     G.set_center_position(5., -20.)
     p = [0.05, 0.1, 0.5]
     G.plot_percentiles(p, ax=None, logy=False, ref_lags=None)
예제 #7
0
 def test_plot(self):
     bins = np.arange(3) / 6.
     G = Geostatistic(self.x, lags=bins)
     G.set_center_position(0., 0.)
     G.plot_semivariogram()
예제 #8
0
 def test_set_center(self):
     bins = np.arange(10)
     G = Geostatistic(self.x, range_bins=bins)
     G.set_center_position(5., -20.)
     self.assertEqual(G.lon_center, 5.)
     self.assertEqual(G.lat_center, -20.)
예제 #9
0
 def test_percentiles(self):
     bins = np.arange(10)
     G = Geostatistic(self.x, lags=bins)
     G.set_center_position(5., -20.)
     p = [0.05, 0.1, 0.5]
     G.plot_percentiles(p, ax=None, logy=False, ref_lags=None)
예제 #10
0
 def test_plot(self):
     bins = np.arange(3) / 6.
     G = Geostatistic(self.x, lags=bins)
     G.set_center_position(0., 0.)
     G.plot_semivariogram()