New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DOC: better document how to handle omitted coefficients in multilevel DWT reconstructions #303
Changes from 3 commits
370ff88
4e52cf4
3c804b1
e623c44
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -122,6 +122,17 @@ def waverec(coeffs, wavelet, mode='symmetric', axis=-1): | |
Axis over which to compute the inverse DWT. If not given, the | ||
last axis is used. | ||
|
||
Notes | ||
----- | ||
It may sometimes desired to run ``waverec`` with some sets of | ||
coefficients omitted. This can best be done by setting the corresponding | ||
arrays to zero arrays of matching shape and dtype. Explicitly removing | ||
list entries or setting them to ``None`` is not supported. | ||
|
||
Specifically, to ignore detail coefficients at level 2, one could do:: | ||
|
||
coeffs[-2] == numpy.zeros_like(coeffs[-2]) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
Examples | ||
-------- | ||
>>> import pywt | ||
|
@@ -251,6 +262,17 @@ def waverec2(coeffs, wavelet, mode='symmetric', axes=(-2, -1)): | |
------- | ||
2D array of reconstructed data. | ||
|
||
Notes | ||
----- | ||
It may sometimes desired to run ``waverec2`` with some sets of | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "sometimes be desired" There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. and same for waverecn |
||
coefficients omitted. This can best be done by setting the corresponding | ||
arrays to zero arrays of matching shape and dtype. Explicitly removing | ||
list or tuple entries or setting them to ``None`` is not supported. | ||
|
||
Specifically, to ignore all detail coefficients at level 2, one could do:: | ||
|
||
coeffs[-2] == tuple([numpy.zeros_like(v) for v in coeffs[-2]]) | ||
|
||
Examples | ||
-------- | ||
>>> import pywt | ||
|
@@ -436,6 +458,17 @@ def waverecn(coeffs, wavelet, mode='symmetric', axes=None): | |
------- | ||
nD array of reconstructed data. | ||
|
||
Notes | ||
----- | ||
It is sometimes desired to run ``waverecn`` with some sets of | ||
coefficients omitted. This can best be done by setting the corresponding | ||
arrays to zero arrays of matching shape and dtype. Explicitly removing | ||
list or dictionary entries or setting them to ``None`` is not supported. | ||
|
||
Specifically, to ignore all detail coefficients at level 2, one could do:: | ||
|
||
codffs[-2] = {k: numpy.zeros_like(v) for k, v in coeffs[-2].items()} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. typo: |
||
|
||
Examples | ||
-------- | ||
>>> import numpy as np | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"sometimes be desired"