Skip to content

Commit 1317998

Browse files
committed
Updated scripts to handle complex numbers in Restriction
1 parent 15c3fe7 commit 1317998

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

scripts/2d/Interpolation_slopes.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,9 @@ def main(parser):
154154

155155
######### Multi-channel interpolation #########
156156

157+
# Turn to complex since we are now working with a complex model
158+
Rop.dtype = np.complex128
159+
157160
# Let's start by setting the slope regularization term
158161
D1op0 = FirstDerivative(dims=(nxorig, nt), axis=0, sampling=dx, order=5, edge=True, dtype="complex128")
159162
D1op1 = FirstDerivative(dims=(nxorig, nt), axis=1, sampling=dt, order=5, edge=True, dtype="complex128")
@@ -201,7 +204,7 @@ def main(parser):
201204

202205
if not true_solution:
203206
fig, axs = plt.subplots(2, 2, figsize=(12, 12), gridspec_kw={'height_ratios': [2, 1]})
204-
axs[0, 0].imshow(data.T, cmap='gray', aspect='auto', vmin=-vlim, vmax=vlim,
207+
axs[0, 0].imshow(data.real.T, cmap='gray', aspect='auto', vmin=-vlim, vmax=vlim,
205208
extent=(x[0] / 1000, x[-1] / 1000, t[-1], t[0]))
206209
axs[0, 0].set_title('Original')
207210
axs[0, 0].set_xlabel('Offset (m)')
@@ -232,7 +235,7 @@ def main(parser):
232235
axs[0, 0].set_title('Original')
233236
axs[0, 0].set_xlabel('Offset (m)')
234237
axs[0, 0].set_ylabel('TWT (s)')
235-
axs[0, 1].imshow(data.T, cmap='gray', aspect='auto', vmin=-vlim, vmax=vlim,
238+
axs[0, 1].imshow(data.real.T, cmap='gray', aspect='auto', vmin=-vlim, vmax=vlim,
236239
extent=(x[0]/1000, x[-1]/1000, t[-1], t[0]))
237240
axs[0, 1].set_title('Subsampled')
238241
axs[0, 1].set_xlabel('Offset (m)')

scripts/3d/Interpolation_slopes.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,9 @@ def main(parser):
171171

172172
######### Multi-channel interpolation #########
173173

174+
# Turn to complex since we are now working with a complex model
175+
Rop.dtype = np.complex128
176+
174177
# Let's start by setting the slope regularization term
175178
D1op0 = FirstDerivative(dims=(nyorig, nx, nt), axis=0, sampling=dy, order=5, edge=True, dtype=np_floatcconv)
176179
D1op1 = FirstDerivative(dims=(nyorig, nx, nt), axis=2, sampling=dt, order=5, edge=True, dtype=np_floatcconv)

0 commit comments

Comments
 (0)