pylops.Smoothing1D

class pylops.Smoothing1D(nsmooth, dims, axis=-1, dtype='float64', name='S')[source]

1D Smoothing.

Apply smoothing to model (and data) to a multi-dimensional array along axis.

Parameters:
nsmoothint

Length of smoothing operator (must be odd, if even it will be increased by 1).

dimstuple or int

Number of samples for each dimension

axisint, optional

Added in version 2.0.0.

Axis along which model (and data) are smoothed.

dtypestr, optional

Type of elements in input array.

Attributes:
nhint

Length of the filter.

hstarnumpy.ndarray

Time-reversed filter used in adjoint.

convfunccallable

Function handler used to perform convolution.

dimstuple

Shape of the array after the adjoint, but before flattening.

For example, x_reshaped = (Op.H * y.ravel()).reshape(Op.dims).

dimsdtuple

Shape of the array after the forward, but before flattening. In this case, same as dims.

shapetuple

Operator shape.

Notes

The Smoothing1D operator is a special type of convolutional operator that convolves the input model (or data) with a constant filter of size \(n_\text{smooth}\):

\[\mathbf{f} = [ 1/n_\text{smooth}, 1/n_\text{smooth}, ..., 1/n_\text{smooth} ]\]

When applied to the first direction:

\[y[i,j,k] = 1/n_\text{smooth} \sum_{l=-(n_\text{smooth}-1)/2}^{(n_\text{smooth}-1)/2} x[l,j,k]\]

Similarly when applied to the second direction:

\[y[i,j,k] = 1/n_\text{smooth} \sum_{l=-(n_\text{smooth}-1)/2}^{(n_\text{smooth}-1)/2} x[i,l,k]\]

and the third direction:

\[y[i,j,k] = 1/n_\text{smooth} \sum_{l=-(n_\text{smooth}-1)/2}^{(n_\text{smooth}-1)/2} x[i,j,l]\]

Note that since the filter is symmetrical, the Smoothing1D operator is self-adjoint.

Methods

__init__(nsmooth, dims[, axis, dtype, name])

adjoint()

apply_columns(cols)

Apply subset of columns of operator

cond([uselobpcg])

Condition number of linear operator.

conj()

Complex conjugate operator

div(y[, niter, densesolver])

Solve the linear problem \(\mathbf{y}=\mathbf{A}\mathbf{x}\).

dot(x)

Matrix-matrix or matrix-vector multiplication.

eigs([neigs, symmetric, niter, uselobpcg])

Most significant eigenvalues of linear operator.

matmat(X)

Matrix-matrix multiplication.

matvec(x)

Matrix-vector multiplication.

reset_count()

Reset counters

rmatmat(X)

Matrix-matrix multiplication.

rmatvec(x)

Adjoint matrix-vector multiplication.

todense([backend])

Return dense matrix.

toimag([forw, adj])

Imag operator

toreal([forw, adj])

Real operator

tosparse()

Return sparse matrix.

trace([neval, method, backend])

Trace of linear operator.

transpose()

Examples using pylops.Smoothing1D

1D Smoothing

1D Smoothing

Causal Integration

Causal Integration

Wavelet estimation

Wavelet estimation

03. Solvers

03. Solvers