def test_semivariogram_calculation(self): V = Variogram() x = np.random.random(100) lon = np.random.random(100) lat = np.random.random(100) lags = np.asarray([1., 2., 3., 4.]) V.semivariogram(x, lon, lat, lags, 1.)
def test_semivariogram_calculation(self): V = Variogram() x = np.random.random(100) lon = np.random.random(100) lat = np.random.random(100) lags = np.asarray([1.,2.,3.,4.]) V.semivariogram(x, lon, lat, lags, 1.)
def test_variogram_semivariance(self): V = Variogram() x = np.random.random(100) lon = np.random.random(100) * 10. - 90. lat = np.random.random(100) * 10. - 90. h_km = 20. dh_km = 2. # just test if it works; no reference solution yet g = V._semivariance(x, lon, lat, np.asarray([h_km]), dh_km)
def test_variogram_semivariance(self): V = Variogram() x = np.random.random(100) lon = np.random.random(100)*10.-90. lat = np.random.random(100)*10.-90. h_km = 20. dh_km = 2. # just test if it works; no reference solution yet g = V._semivariance(x, lon, lat, np.asarray([h_km]), dh_km)
def test_variogram_orthodrome(self): # example distance Berlin-Tokio # http://de.wikipedia.org/wiki/Orthodrome lat_berlin = 52.517 lon_berlin = 13.4 lat_tokio = 35.70 lon_tokio = 139.767 V = Variogram() r1 = V._orthodrome(lon_tokio, lat_tokio, lon_berlin, lat_berlin, radius=6370.*1000.) self.assertTrue(abs(r1-8918000.)<1000.) r2 = V._orthodrome(lon_berlin, lat_berlin, lon_tokio, lat_tokio, radius=6370.*1000.) self.assertTrue(abs(r2-8918000.)<1000.)
def test_variogram_orthodrome(self): # example distance Berlin-Tokio # http://de.wikipedia.org/wiki/Orthodrome lat_berlin = 52.517 lon_berlin = 13.4 lat_tokio = 35.70 lon_tokio = 139.767 V = Variogram() r1 = V._orthodrome(lon_tokio, lat_tokio, lon_berlin, lat_berlin, radius=6370. * 1000.) self.assertTrue(abs(r1 - 8918000.) < 1000.) r2 = V._orthodrome(lon_berlin, lat_berlin, lon_tokio, lat_tokio, radius=6370. * 1000.) self.assertTrue(abs(r2 - 8918000.) < 1000.)