{"action":"opened","issue":{"url":"https://api.github.com/repos/fatiando/fatiando/issues/259","repository_url":"https://api.github.com/repos/fatiando/fatiando","labels_url":"https://api.github.com/repos/fatiando/fatiando/issues/259/labels{/name}","comments_url":"https://api.github.com/repos/fatiando/fatiando/issues/259/comments","events_url":"https://api.github.com/repos/fatiando/fatiando/issues/259/events","html_url":"https://github.com/fatiando/fatiando/issues/259","id":134417968,"number":259,"title":"Possible bug with seismic wave simulation","user":{"login":"NoisyLeon","id":12902257,"avatar_url":"https://avatars.githubusercontent.com/u/12902257?v=3","gravatar_id":"","url":"https://api.github.com/users/NoisyLeon","html_url":"https://github.com/NoisyLeon","followers_url":"https://api.github.com/users/NoisyLeon/followers","following_url":"https://api.github.com/users/NoisyLeon/following{/other_user}","gists_url":"https://api.github.com/users/NoisyLeon/gists{/gist_id}","starred_url":"https://api.github.com/users/NoisyLeon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NoisyLeon/subscriptions","organizations_url":"https://api.github.com/users/NoisyLeon/orgs","repos_url":"https://api.github.com/users/NoisyLeon/repos","events_url":"https://api.github.com/users/NoisyLeon/events{/privacy}","received_events_url":"https://api.github.com/users/NoisyLeon/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-02-17T22:22:03Z","updated_at":"2016-02-17T22:22:03Z","closed_at":null,"body":"Hi,\r\nI found a bug with elastic_sh() and scalar(). \r\nTry the following script, you will see that u1 and u2 have a phase shift for the major arrival, although they have the same distance to the source. The full waveform should not be the same due to reflections from boundaries, but the major arrival window should be exactly the same.\r\n \r\n\"\"\"\r\nSeismic: 2D finite difference simulation of elastic SH wave propagation\r\n\"\"\"\r\nimport numpy as np\r\nfrom matplotlib import animation\r\nfrom fatiando import gridder\r\nfrom fatiando.seismic import wavefd\r\nfrom fatiando.vis import mpl\r\nimport matplotlib.pyplot as plt\r\n# Set the parameters of the finite difference grid\r\nshape = (500, 500)\r\narea = [0, 60000, 0, 60000]\r\n# Make a density and S wave velocity model\r\ndensity = 2400 * np.ones(shape)\r\nvelocity = 3700\r\nmu = wavefd.lame_mu(velocity, density)\r\n\r\n# Make a wave source from a mexican hat wavelet\r\nsources = [wavefd.GaussSource(35000, 35000, area, shape, 100, 1, delay=2)]\r\n\r\n# Get the iterator for the simulation\r\ndt = wavefd.maxdt(area, shape, velocity)\r\nduration = 20\r\nmaxit = int(duration / dt)\r\nstations = [[30000, 30000], [40000, 40000] ]# x, z coordinate of the seismometer\r\nsnapshot=None\r\nsimulation = wavefd.elastic_sh(mu, density, area, dt, maxit, sources, stations,\r\n                               snapshot, padding=100, taper=0.01)\r\n\r\n\r\nt, u, seismograms = simulation.next()\r\n\r\nimport matplotlib.pyplot as plt\r\nu1=seismograms[0]\r\nu2=seismograms[1]\r\n\r\nplt.plot(t, u1, 'x')\r\nplt.plot(t, u2, 'o')\r\nplt.show()"}}