コード例 #1
0
ファイル: test_spatial.py プロジェクト: aptiko/pthelma
 def test_idw_three_points(self):
     add_point_to_layer(self.data_layer, 6.4, 7.8, 33.0)
     add_point_to_layer(self.data_layer, 9.5, 7.4, 94.0)
     add_point_to_layer(self.data_layer, 7.1, 4.9, 67.7)
     self.assertAlmostEqual(idw(self.point, self.data_layer),
                            64.090, places=3)
     self.assertAlmostEqual(idw(self.point, self.data_layer, alpha=2.0),
                            64.188, places=3)
コード例 #2
0
ファイル: test_spatial.py プロジェクト: aptiko/pthelma
 def test_idw_point_with_nan(self):
     add_point_to_layer(self.data_layer, 6.4, 7.8, 33.0)
     add_point_to_layer(self.data_layer, 9.5, 7.4, 94.0)
     add_point_to_layer(self.data_layer, 7.1, 4.9, 67.7)
     add_point_to_layer(self.data_layer, 7.2, 5.4, float('nan'))
     self.assertAlmostEqual(idw(self.point, self.data_layer),
                            64.090, places=3)
     self.assertAlmostEqual(idw(self.point, self.data_layer, alpha=2.0),
                            64.188, places=3)
コード例 #3
0
ファイル: test_spatial.py プロジェクト: aptiko/pthelma
 def test_idw_single_point(self):
     add_point_to_layer(self.data_layer, 5.3, 6.4, 42.8)
     self.assertAlmostEqual(idw(self.point, self.data_layer), 42.8)