Skip to content

Commit

Permalink
Updated scripts to handle complex numbers in Restriction
Browse files Browse the repository at this point in the history
  • Loading branch information
mrava87 committed Nov 26, 2024
1 parent 15c3fe7 commit 1317998
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
7 changes: 5 additions & 2 deletions scripts/2d/Interpolation_slopes.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@ def main(parser):

######### Multi-channel interpolation #########

# Turn to complex since we are now working with a complex model
Rop.dtype = np.complex128

# Let's start by setting the slope regularization term
D1op0 = FirstDerivative(dims=(nxorig, nt), axis=0, sampling=dx, order=5, edge=True, dtype="complex128")
D1op1 = FirstDerivative(dims=(nxorig, nt), axis=1, sampling=dt, order=5, edge=True, dtype="complex128")
Expand Down Expand Up @@ -201,7 +204,7 @@ def main(parser):

if not true_solution:
fig, axs = plt.subplots(2, 2, figsize=(12, 12), gridspec_kw={'height_ratios': [2, 1]})
axs[0, 0].imshow(data.T, cmap='gray', aspect='auto', vmin=-vlim, vmax=vlim,
axs[0, 0].imshow(data.real.T, cmap='gray', aspect='auto', vmin=-vlim, vmax=vlim,
extent=(x[0] / 1000, x[-1] / 1000, t[-1], t[0]))
axs[0, 0].set_title('Original')
axs[0, 0].set_xlabel('Offset (m)')
Expand Down Expand Up @@ -232,7 +235,7 @@ def main(parser):
axs[0, 0].set_title('Original')
axs[0, 0].set_xlabel('Offset (m)')
axs[0, 0].set_ylabel('TWT (s)')
axs[0, 1].imshow(data.T, cmap='gray', aspect='auto', vmin=-vlim, vmax=vlim,
axs[0, 1].imshow(data.real.T, cmap='gray', aspect='auto', vmin=-vlim, vmax=vlim,
extent=(x[0]/1000, x[-1]/1000, t[-1], t[0]))
axs[0, 1].set_title('Subsampled')
axs[0, 1].set_xlabel('Offset (m)')
Expand Down
3 changes: 3 additions & 0 deletions scripts/3d/Interpolation_slopes.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,9 @@ def main(parser):

######### Multi-channel interpolation #########

# Turn to complex since we are now working with a complex model
Rop.dtype = np.complex128

# Let's start by setting the slope regularization term
D1op0 = FirstDerivative(dims=(nyorig, nx, nt), axis=0, sampling=dy, order=5, edge=True, dtype=np_floatcconv)
D1op1 = FirstDerivative(dims=(nyorig, nx, nt), axis=2, sampling=dt, order=5, edge=True, dtype=np_floatcconv)
Expand Down

0 comments on commit 1317998

Please sign in to comment.