Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upProvide a public method for iradon_filters #4952
Conversation
f = np.zeros(size) | ||
f[0] = 0.25 | ||
f[1::2] = -1 / (np.pi * n) ** 2 | ||
f[1::2] = -1 / (np.pi * n[1::2])**2 |
emmanuelle
Sep 12, 2020
Member
was it a bug which you corrected? I don't understand why f is zero on even values of indices, this does not correspond to Kak and Slaney I think.
was it a bug which you corrected? I don't understand why f is zero on even values of indices, this does not correspond to Kak and Slaney I think.
emmanuelle
Sep 12, 2020
Member
ok I took a look at one of the previous PRs and apparently it's not the classical ramp filter which is used here. I'll try to understand better which filter is used here. Did you just make this change for the sake of a clearer syntax or is there a difference?
ok I took a look at one of the previous PRs and apparently it's not the classical ramp filter which is used here. I'll try to understand better which filter is used here. Did you just make this change for the sake of a clearer syntax or is there a difference?
hmaarrfk
Sep 14, 2020
Author
Member
I think at the time, the change was introduced for cleaner syntax.
I think at the time, the change was introduced for cleaner syntax.
hmaarrfk
Sep 14, 2020
Author
Member
The "fixes" for the filter performance were merged in a pervious PR.
The "fixes" for the filter performance were merged in a pervious PR.
rfezzani
Sep 14, 2020
Member
Your current refactoring of n
calculation is different from previous one:
>>> size = 10
>>> n1 = np.arange(0, size / 2 + 1, dtype=np.int)
>>> n2 = np.arange(size / 2 - 1, 0, -1, dtype=np.int)
>>> n = np.concatenate((n1, n2))
>>> n[1::2] # This PR refactoring
array([1, 3, 5, 3, 1])
>>> np.concatenate((np.arange(1, size / 2 + 1, 2, dtype=np.int),
np.arange(size / 2 - 1, 0, -2, dtype=np.int))) # Previous version
array([1, 3, 5, 4, 2])
I don't know which version is correct, but there is a difference...
Your current refactoring of n
calculation is different from previous one:
>>> size = 10
>>> n1 = np.arange(0, size / 2 + 1, dtype=np.int)
>>> n2 = np.arange(size / 2 - 1, 0, -1, dtype=np.int)
>>> n = np.concatenate((n1, n2))
>>> n[1::2] # This PR refactoring
array([1, 3, 5, 3, 1])
>>> np.concatenate((np.arange(1, size / 2 + 1, 2, dtype=np.int),
np.arange(size / 2 - 1, 0, -2, dtype=np.int))) # Previous version
array([1, 3, 5, 4, 2])
I don't know which version is correct, but there is a difference...
I'm not familiar with these methods but the code looks good to me. I'll let others more familiar with radon review/merge but it'd be good to get this in. @hmaarrfk could you please elaborate more on the motivation for the PR in the description? When making release notes, it's quite annoying to have to go back 7 links to figure out why this PR was made. (The PR you link to is also described as "continuation of...") |
Description
Continuation of #3099
Not sure why
#4950 was failing.
Checklist
./doc/examples
(new features only)./benchmarks
, if your changes aren't covered by anexisting benchmark
For reviewers
later.
__init__.py
.doc/release/release_dev.rst
.