Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
solldavid committed Jun 17, 2024
1 parent 3956a99 commit 24771ea
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 14 deletions.
1 change: 1 addition & 0 deletions docs/source/credits.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ Contributors
* `Wei Zhang <https://github.com/ZhangWeiGeo>`_, ZhangWeiGeo
* `Fedor Goncharov <https://github.com/fedor-goncharov>`_, fedor-goncharov
* `Alex Rakowski <https://github.com/alex-rakowski>`_, alex-rakowski
* `David Sollberger <https://github.com/solldavid>`_, solldavid
13 changes: 5 additions & 8 deletions examples/plot_wavelet.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
"""
Wavelet transform
=================
This example shows how to use the :py:class:`pylops.DWT` and
:py:class:`pylops.DWT2D` operators to perform 1- and 2-dimensional DWT.
This example shows how to use the :py:class:`pylops.DWT`,
:py:class:`pylops.DWT2D`, and :py:class:`pylops.DWTND` operators
to perform 1-, 2-, and N-dimensional DWT.
"""
import matplotlib.pyplot as plt
import numpy as np
Expand Down Expand Up @@ -70,8 +71,8 @@

###############################################################################
# Let us now try the same with a 3D volumetric model, where we use the
# N-dimensional DWT. Again, we only retain a quarter of the coefficients of
# the DWT.
# N-dimensional DWT. This time, we only retain 10 percent of the coefficients
# of the DWT.

nx = 128
ny = 256
Expand All @@ -91,10 +92,6 @@
Wop = pylops.signalprocessing.DWTND((nx, ny, nz), wavelet="haar", level=3)
y = Wop * m

yf = y.copy()
yf.flat[y.size // 4 :] = 0
iminv = Wop.H * yf

ratio = 0.1
yf = y.copy()
yf.flat[int(ratio * y.size) :] = 0
Expand Down
4 changes: 0 additions & 4 deletions pylops/signalprocessing/dwtnd.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ class DWTND(LinearOperator):
dims : :obj:`tuple`
Number of samples for each dimension
axes : :obj:`int`, optional
.. versionadded:: 2.0.0
Axis along which DWTND is applied
wavelet : :obj:`str`, optional
Name of wavelet type. Use :func:`pywt.wavelist(kind='discrete')` for
Expand All @@ -50,8 +48,6 @@ class DWTND(LinearOperator):
dtype : :obj:`str`, optional
Type of elements in input array.
name : :obj:`str`, optional
.. versionadded:: 2.0.0
Name of operator (to be used by :func:`pylops.utils.describe.describe`)
Attributes
Expand Down
4 changes: 2 additions & 2 deletions pytests/test_dwts.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def test_DWT2D_3dsignal(par):

@pytest.mark.parametrize("par", [(par3), (par4)])
def test_DWTND_3dsignal(par):
"""Dot-test and inversion for DWT2D operator for 3d signal"""
"""Dot-test and inversion for DWTND operator for 3d signal"""
DWTop = DWTND(
dims=(par["nt"], par["nx"], par["ny"]), axes=(0, 1, 2), wavelet="haar", level=3
)
Expand All @@ -168,7 +168,7 @@ def test_DWTND_3dsignal(par):

@pytest.mark.parametrize("par", [(par3), (par4)])
def test_DWTND_4dsignal(par):
"""Dot-test and inversion for DWT operator for 4d signal"""
"""Dot-test and inversion for DWTND operator for 4d signal"""
for axes in [(0, 1, 2), (0, 2, 3), (1, 2, 3), (0, 1, 3), (0, 1, 2, 3)]:
DWTop = DWTND(
dims=(par["nt"], par["nx"], par["ny"], par["nz"]),
Expand Down

0 comments on commit 24771ea

Please sign in to comment.