DOC: rewrap docstring lines and remove unused import

This commit is contained in:
Tony S Yu
2012-09-11 23:46:26 -04:00
parent 7a9cb807d1
commit ae429011cf
+18 -22
View File
@@ -7,7 +7,7 @@ __all__ = ['inverse', 'wiener', 'LPIFilter2D']
__docformat__ = 'restructuredtext en'
import numpy as np
from scipy.fftpack import fftshift, ifftshift
from scipy.fftpack import ifftshift
eps = np.finfo(float).eps
@@ -50,13 +50,12 @@ class LPIFilter2D(object):
Parameters
----------
impulse_response : callable `f(r, c, **filter_params)`
Function that yields the impulse response. `r` and
`c` are 1-dimensional vectors that represent row and
column positions, in other words coordinates are
(r[0],c[0]),(r[0],c[1]) etc. `**filter_params` are
passed through.
Function that yields the impulse response. `r` and `c` are
1-dimensional vectors that represent row and column positions, in
other words coordinates are (r[0],c[0]),(r[0],c[1]) etc.
`**filter_params` are passed through.
In other words, example would be called like this:
In other words, `impulse_response` would be called like this:
>>> def impulse_response(r, c, **filter_params):
... pass
@@ -116,8 +115,9 @@ class LPIFilter2D(object):
def __call__(self, data):
"""Apply the filter to the given data.
*Parameters*:
data : (M,N) ndarray
Parameters
----------
data : (M,N) ndarray
"""
F, G = self._prepare(data)
@@ -142,9 +142,8 @@ def forward(data, impulse_response=None, filter_params={},
Other Parameters
----------------
predefined_filter : LPIFilter2D
If you need to apply the same filter multiple times over
different images, construct the LPIFilter2D and specify
it here.
If you need to apply the same filter multiple times over different
images, construct the LPIFilter2D and specify it here.
Examples
--------
@@ -176,17 +175,15 @@ def inverse(data, impulse_response=None, filter_params={}, max_gain=2,
filter_params : dict
Additional keyword parameters to the impulse_response function.
max_gain : float
Limit the filter gain. Often, the filter contains
zeros, which would cause the inverse filter to have
infinite gain. High gain causes amplification of
artefacts, so a conservative limit is recommended.
Limit the filter gain. Often, the filter contains zeros, which would
cause the inverse filter to have infinite gain. High gain causes
amplification of artefacts, so a conservative limit is recommended.
Other Parameters
----------------
predefined_filter : LPIFilter2D
If you need to apply the same filter multiple times over
different images, construct the LPIFilter2D and specify
it here.
If you need to apply the same filter multiple times over different
images, construct the LPIFilter2D and specify it here.
"""
if predefined_filter is None:
@@ -223,9 +220,8 @@ def wiener(data, impulse_response=None, filter_params={}, K=0.25,
Other Parameters
----------------
predefined_filter : LPIFilter2D
If you need to apply the same filter multiple times over
different images, construct the LPIFilter2D and specify
it here.
If you need to apply the same filter multiple times over different
images, construct the LPIFilter2D and specify it here.
"""
if predefined_filter is None: