leouieda/fatiando — pull request #67 by eusoubrasileiro (2013-10-21 23:01:02+00:00)
Title: Wavefd esg acoustic

Equivalent Staggered Grid Acoustic 3D ready to use. Di Bartolo et al. (2012). :clap:

Need to write a cookbook example (don't have idea of how using Mayavi).
Need to discuss 3D sources ICoord's...

@hbueno take a look to see it this suites you... now let's go to migration!

I like nice pictures. :dart:

Used this code here to test:.

from fatiando.seismic import wavefd
import numpy as np

# Set the parameters of the finite difference grid 3D
shape = (100, 100, 100)
ds = 100. # spacing
area = [0, shape[0]*ds, 0, shape[1]*ds, 0, shape[2]*ds]
# Set the parameters of the finite difference grid
velocity = np.zeros(shape)+6000. # m/s
density = np.zeros(shape)+1000. # kg/m^3
velocity[:50, :50, :50] = 0. # difraction example in 3D
fc = 12.5
sources = [wavefd.GaussSource((55*ds, 55*ds, 45*ds), area, shape, 10**(-8), fc)]
dt = wavefd.maxdt(area, shape, np.max(velocity)) # SSG max dt
duration = 1.5
maxit = int(duration/dt)
stations = [[45*ds, 45*ds, 65*ds], [65*ds, 65*ds, 30*ds]] # x, y, z coordinate of the seismometer
snapshots = 1 # every 1 iterations plots one
simulation = wavefd.scalar3_esg(velocity, density, area, dt, maxit, sources, stations, snapshots)

for i in xrange(maxit-2):
t, u, seismogram = simulation.next()
print t

![maya_volume](https://f.cloud.github.com/assets/4503573/1377231/3cbc756a-3aa3-11e3-82a6-2bd48314f507.png)
![3dplanesmayvi100](https://f.cloud.github.com/assets/4503573/1377232/3cbccbaa-3aa3-11e3-95e7-6778ab09bc74.png)