def test_array_transff_wavenumber(self): coords = np.array([[10., 60., 0.], [200., 50., 0.], [-120., 170., 0.], [-100., -150., 0.], [30., -220., 0.]]) coords /= 1000. coordsll = np.zeros(coords.shape) for i in np.arange(len(coords)): coordsll[i, 0], coordsll[i, 1] = utlLonLat(0., 0., coords[i, 0], coords[i, 1]) klim = 40. kstep = klim / 2. transff = array_transff_wavenumber(coords, klim, kstep, coordsys='xy') transffll = array_transff_wavenumber(coordsll, klim, kstep, coordsys='lonlat') transffth = np.array( [[3.13360360e-01, 4.23775796e-02, 6.73650243e-01, 4.80470652e-01, 8.16891615e-04], [2.98941684e-01, 2.47377842e-01, 9.96352135e-02, 6.84732871e-02, 5.57078203e-01], [1.26523678e-01, 2.91010683e-01, 1.00000000e+00, 2.91010683e-01, 1.26523678e-01], [5.57078203e-01, 6.84732871e-02, 9.96352135e-02, 2.47377842e-01, 2.98941684e-01], [8.16891615e-04, 4.80470652e-01, 6.73650243e-01, 4.23775796e-02, 3.13360360e-01]]) np.testing.assert_array_almost_equal(transff, transffth, decimal=6) np.testing.assert_array_almost_equal(transffll, transffth, decimal=6)
def test_array_transff_freqslowness(self): coords = np.array( [[10.0, 60.0, 0.0], [200.0, 50.0, 0.0], [-120.0, 170.0, 0.0], [-100.0, -150.0, 0.0], [30.0, -220.0, 0.0]] ) coords /= 1000.0 coordsll = np.zeros(coords.shape) for i in np.arange(len(coords)): coordsll[i, 0], coordsll[i, 1] = utlLonLat(0.0, 0.0, coords[i, 0], coords[i, 1]) slim = 40.0 fmin = 1.0 fmax = 10.0 fstep = 1.0 sstep = slim / 2.0 transff = array_transff_freqslowness(coords, slim, sstep, fmin, fmax, fstep, coordsys="xy") transffll = array_transff_freqslowness(coordsll, slim, sstep, fmin, fmax, fstep, coordsys="lonlat") transffth = np.array( [ [0.41915119, 0.33333333, 0.32339525, 0.24751548, 0.67660475], [0.25248452, 0.41418215, 0.34327141, 0.65672859, 0.33333333], [0.24751548, 0.25248452, 1.00000000, 0.25248452, 0.24751548], [0.33333333, 0.65672859, 0.34327141, 0.41418215, 0.25248452], [0.67660475, 0.24751548, 0.32339525, 0.33333333, 0.41915119], ] ) np.testing.assert_array_almost_equal(transff, transffth, decimal=6) np.testing.assert_array_almost_equal(transffll, transffth, decimal=6)
def test_array_transff_freqslowness(self): coords = np.array([[10., 60., 0.], [200., 50., 0.], [-120., 170., 0.], [-100., -150., 0.], [30., -220., 0.]]) coords /= 1000. coordsll = np.zeros(coords.shape) for i in np.arange(len(coords)): coordsll[i, 0], coordsll[i, 1] = utlLonLat(0., 0., coords[i, 0], coords[i, 1]) slim = 40. fmin = 1. fmax = 10. fstep = 1. sstep = slim / 2. transff = array_transff_freqslowness(coords, slim, sstep, fmin, fmax, fstep, coordsys='xy') transffll = array_transff_freqslowness(coordsll, slim, sstep, fmin, fmax, fstep, coordsys='lonlat') transffth = np.array( [[0.41915119, 0.33333333, 0.32339525, 0.24751548, 0.67660475], [0.25248452, 0.41418215, 0.34327141, 0.65672859, 0.33333333], [0.24751548, 0.25248452, 1.00000000, 0.25248452, 0.24751548], [0.33333333, 0.65672859, 0.34327141, 0.41418215, 0.25248452], [0.67660475, 0.24751548, 0.32339525, 0.33333333, 0.41915119]]) np.testing.assert_array_almost_equal(transff, transffth, decimal=6) np.testing.assert_array_almost_equal(transffll, transffth, decimal=6)