54 |
# |
# |
55 |
# create array |
# create array |
56 |
# |
# |
57 |
receiver_line=[2*absorption_zone + i * (rangeRcv/(numRcvPerLine-1)) for i in xrange(numRcvPerLine) ] |
receiver_line=[2*absorption_zone + i * (rangeRcv/(numRcvPerLine-1)) for i in range(numRcvPerLine) ] |
58 |
# |
# |
59 |
# set source location with tag "source"" |
# set source location with tag "source"" |
60 |
# |
# |
79 |
rgEW=[] |
rgEW=[] |
80 |
mid_point=receiver_line[len(receiver_line)/2] |
mid_point=receiver_line[len(receiver_line)/2] |
81 |
|
|
82 |
for ix in xrange(len(receiver_line)): |
for ix in range(len(receiver_line)): |
83 |
if DIM == 2: |
if DIM == 2: |
84 |
rcvEW_locations.append((receiver_line[ix], depth)) |
rcvEW_locations.append((receiver_line[ix], depth)) |
85 |
rgEW.append( ( receiver_line[ix], 0.) ) |
rgEW.append( ( receiver_line[ix], 0.) ) |
91 |
rcvNS_locations=[] |
rcvNS_locations=[] |
92 |
rgNS=[] |
rgNS=[] |
93 |
|
|
94 |
for iy in xrange(len(receiver_line)): |
for iy in range(len(receiver_line)): |
95 |
rcvNS_locations.append((mid_point, receiver_line[iy], depth)) |
rcvNS_locations.append((mid_point, receiver_line[iy], depth)) |
96 |
rgNS.append( ( mid_point, receiver_line[iy]) ) |
rgNS.append( ( mid_point, receiver_line[iy]) ) |
97 |
# |
# |
99 |
# |
# |
100 |
if DIM == 2: |
if DIM == 2: |
101 |
domain=Rectangle(ceil(ne_z*width_x/depth),ne_z,l0=width_x,l1=depth, |
domain=Rectangle(ceil(ne_z*width_x/depth),ne_z,l0=width_x,l1=depth, |
102 |
diracPoints=src_locations, diracTags=src_tags) |
diracPoints=src_locations, diracTags=src_tags) |
103 |
else: |
else: |
104 |
domain=Brick(ceil(ne_z*width_x/depth),ceil(ne_z*width_y/depth),ne_z,l0=width_x,l1=width_y,l2=depth, |
domain=Brick(ceil(ne_z*width_x/depth),ceil(ne_z*width_y/depth),ne_z,l0=width_x,l1=width_y,l2=depth, |
105 |
diracPoints=src_locations, diracTags=src_tags) |
diracPoints=src_locations, diracTags=src_tags) |
106 |
wl=Ricker(frq) |
wl=Ricker(frq) |
107 |
m=whereNegative(Function(domain).getX()[DIM-1]-reflector_at) |
m=whereNegative(Function(domain).getX()[DIM-1]-reflector_at) |
108 |
v_p=v_p_bottom*m+v_p_top*(1-m) |
v_p=v_p_bottom*m+v_p_top*(1-m) |
120 |
mkDir('tmp') |
mkDir('tmp') |
121 |
n=0 |
n=0 |
122 |
while t < t_end: |
while t < t_end: |
123 |
t,p = sw.update(t+sampling_interval) |
t,p = sw.update(t+sampling_interval) |
124 |
tracerEW.addRecord(locEW(p)) |
tracerEW.addRecord(locEW(p)) |
125 |
if DIM==3: tracerNS.addRecord(locNS(p)) |
if DIM==3: tracerNS.addRecord(locNS(p)) |
126 |
print t, locEW(p)[:4], wl.getValue(t) |
print t, locEW(p)[:4], wl.getValue(t) |
127 |
if n%5 == 0 : saveSilo("tmp/u_%d.silo"%(n/5,), p=p) |
if n%5 == 0 : saveSilo("tmp/u_%d.silo"%(n/5,), p=p) |
128 |
n+=1 |
n+=1 |
129 |
tracerEW.write('lineEW.sgy') |
tracerEW.write('lineEW.sgy') |
130 |
if DIM == 3: tracerNS.write('lineNS.sgy') |
if DIM == 3: tracerNS.write('lineNS.sgy') |