Skip to content

Commit 41320c1

Browse files
committed
minor: fixed naming of variables in deblending tutorial
1 parent ac4c97d commit 41320c1

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

tutorials/deblending.py

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -208,14 +208,14 @@
208208
p = Sop1.H * data.ravel()
209209
preshape = p.reshape(nwins[0], nwins[1], nop1[0], nop1[1])
210210

211-
ix = 16
211+
it = 16 # index of window along time axis for plotting
212212
fig, axs = plt.subplots(2, 4, figsize=(12, 5))
213213
fig.suptitle("Data patches")
214-
for i in range(4):
215-
axs[0][i].imshow(np.fft.fftshift(np.abs(preshape[i, ix]).T, axes=1))
214+
for i, ix in enumerate(range(4)):
215+
axs[0][i].imshow(np.fft.fftshift(np.abs(preshape[ix, it]).T, axes=1))
216216
axs[0][i].axis("tight")
217217
axs[1][i].imshow(
218-
np.real((Fop.H * preshape[i, ix].ravel()).reshape(nwin)).T,
218+
np.real((Fop.H * preshape[ix, it].ravel()).reshape(nwin)).T,
219219
cmap="gray",
220220
vmin=-30,
221221
vmax=30,
@@ -228,14 +228,13 @@
228228
p_pseudo = Sop1.H * data_pseudo.ravel()
229229
p_pseudoreshape = p_pseudo.reshape(nwins[0], nwins[1], nop1[0], nop1[1])
230230

231-
ix = 16
232231
fig, axs = plt.subplots(2, 4, figsize=(12, 5))
233232
fig.suptitle("Pseudo-deblended patches")
234-
for i in range(4):
235-
axs[0][i].imshow(np.fft.fftshift(np.abs(p_pseudoreshape[i, ix]).T, axes=1))
233+
for i, ix in enumerate(range(4)):
234+
axs[0][i].imshow(np.fft.fftshift(np.abs(p_pseudoreshape[ix, it]).T, axes=1))
236235
axs[0][i].axis("tight")
237236
axs[1][i].imshow(
238-
np.real((Fop.H * p_pseudoreshape[i, ix].ravel()).reshape(nwin)).T,
237+
np.real((Fop.H * p_pseudoreshape[ix, it].ravel()).reshape(nwin)).T,
239238
cmap="gray",
240239
vmin=-30,
241240
vmax=30,
@@ -248,14 +247,13 @@
248247
p_inv = Sop1.H * data_inv.ravel()
249248
p_invreshape = p_inv.reshape(nwins[0], nwins[1], nop1[0], nop1[1])
250249

251-
ix = 16
252250
fig, axs = plt.subplots(2, 4, figsize=(12, 5))
253251
fig.suptitle("Deblended patches")
254-
for i in range(4):
255-
axs[0][i].imshow(np.fft.fftshift(np.abs(p_invreshape[i, ix]).T, axes=1))
252+
for i, ix in enumerate(range(4)):
253+
axs[0][i].imshow(np.fft.fftshift(np.abs(p_invreshape[ix, it]).T, axes=1))
256254
axs[0][i].axis("tight")
257255
axs[1][i].imshow(
258-
np.real((Fop.H * p_invreshape[i, ix].ravel()).reshape(nwin)).T,
256+
np.real((Fop.H * p_invreshape[ix, it].ravel()).reshape(nwin)).T,
259257
cmap="gray",
260258
vmin=-30,
261259
vmax=30,

0 commit comments

Comments
 (0)