Repository navigation
Improve docstring for Wiener restoration function - #7523
Conversation
| between the data adequacy that improve frequency restoration | ||
| and the prior adequacy that reduce frequency restoration (to | ||
| avoid noise artifacts). | ||
| Regularization parameter. Denoted by :math:`\lambda`: in the Notes |
There was a problem hiding this comment.
It would be good to specify the range of this parameter, which seems to be [0, 1], and say which bound corresponds to data adequacy vs. prior adequacy. I would need to go deeper in the source code to check.
| response. The transfer function must be of shape | ||
| `(N1, N2, ..., ND)` if `is_real is True`, | ||
| `(N1, N2, ..., ND // 2 + 1)` otherwise (see `np.fft.rfftn`). | ||
| ``(N1, N2, ..., ND)`` if `is_real is True`, |
There was a problem hiding this comment.
It's been a bit since I worked on this.
Before b8ce4d0, which generalized the function from 2D to ND, the docstring was:
The transfer function must be of shape `(M, N)` if
`is_real is True`, `(M, N // 2 + 1)` otherwise (see
`np.fft.rfftn`).
The new docstring adapted this to the n-dimensional case so that N1, ...., ND refers to the n-dimensional shape of the input image. So in 2D (N1, N2) would be equivalent to (M, N).
Sorry for stating the obvious though 😅
There was a problem hiding this comment.
Thank you so much, @m-albert! Your answer is definitely helpful. So I think I should replace ([P, ]M, N) ndarray line 18 with (N1, N2, ..., ND) ndarray and keep single backticks, based on my understanding of the numpydoc style guide.
Edit: Also, I believe it should be 'PSF' instead of 'transfer function' in this last sentence, because we just said that we speak of 'transfer function' in the complex case. Sorry, had to re-read the full parameter description!
| response. The transfer function must be of shape | ||
| `(N1, N2, ..., ND)` if `is_real is True`, | ||
| `(N1, N2, ..., ND // 2 + 1)` otherwise (see `np.fft.rfftn`). | ||
| ``(N1, N2, ..., ND)`` if `is_real is True`, |
There was a problem hiding this comment.
Thank you so much, @m-albert! Your answer is definitely helpful. So I think I should replace ([P, ]M, N) ndarray line 18 with (N1, N2, ..., ND) ndarray and keep single backticks, based on my understanding of the numpydoc style guide.
Edit: Also, I believe it should be 'PSF' instead of 'transfer function' in this last sentence, because we just said that we speak of 'transfer function' in the complex case. Sorry, had to re-read the full parameter description!
Description
Following up on #7477 (comment).
Checklist
./doc/examplesfor new featuresRelease note
For maintainers and optionally contributors, please refer to the instructions on how to document this PR for the release notes.