Skip to content

Commit e66c17a

Browse files
committed
Code clean up
1 parent 595846a commit e66c17a

File tree

2 files changed

+5
-15
lines changed

2 files changed

+5
-15
lines changed

docs/source/examples/raven_filter_example.py

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -44,23 +44,11 @@
4444
row1 = centery - v0
4545
row2 = centery + v0 + 1
4646
listx = np.arange(width1) - centerx
47-
48-
print(np.arange(width1))
49-
print(listx)
50-
print(listx / u0)
51-
5247
filtershape = 1.0 / (1.0 + np.power(listx / u0, 2 * n))
5348
filtershapepad2d = np.zeros((row2 - row1, filtershape.size))
5449
filtershapepad2d[:] = np.float64(filtershape)
5550
filtercomplex = filtershapepad2d + filtershapepad2d * 1j
5651

57-
print("Centery: ", centery, "Row1: ", row1, "Row2: ", row2)
58-
59-
# plt.figure()
60-
# plt.imshow(filtercomplex.real)
61-
# plt.title("Uncorrected image")
62-
# plt.show()
63-
6452
# Generate filter objects
6553
a = pyfftw.empty_aligned((height1, width1), dtype='complex128', n=16)
6654
b = pyfftw.empty_aligned((height1, width1), dtype='complex128', n=16)
@@ -73,16 +61,18 @@
7361
sino[row1:row2] = sino[row1:row2] * filtercomplex
7462
sino = ifft_object(fft.ifftshift(sino))
7563

76-
plt.figure()
77-
7864
#subplot(r,c) provide the no. of rows and columns
7965
f, axarr = plt.subplots(2,2)
8066

8167
# use the created array to output your multiple images. In this case I have stacked 4 images vertically
8268
axarr[0, 0].imshow(sinogram_padded)
69+
axarr[0, 0].set_title('Original sinogram')
8370
axarr[0, 1].imshow(sinogram_padded - sinogram_gpu_filter.get().real)
71+
axarr[0, 1].set_title('Difference of original and GPU filtered')
8472
axarr[1, 0].imshow(sinogram_padded - sino.real)
73+
axarr[1, 0].set_title('Difference of original and CPU filtered')
8574
axarr[1, 1].imshow(sinogram_gpu_filter.get().real - sino.real)
75+
axarr[1, 1].set_title('Difference of GPU and CPU filtered')
8676

8777
plt.show()
8878

httomolibgpu/misc/raven_filter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ def raven_filter(
128128

129129
raven_filt(grid_dims, block_dims, params)
130130

131-
# raven_fil already doing ifftshifting
131+
# raven_filt already doing ifftshifting
132132
# fft_data = ifftshift(fft_data_shifted)
133133
data = ifft2(fft_data, axes=(-2, -1), overwrite_x=True)
134134

0 commit comments

Comments
 (0)