Pre-stack modeling operator for multiple wavelets

Abierto
#648 3 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 2 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
30/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
python
Área
backend

Línea de trabajo

Start at the pre-stack inversion operator’s explicit=False path and read how it constructs Convolve1D operators and combines them with BlockDiag; compare this with the dense multi-wavelet path shown in the issue. First focus on the stated 1D case, leaving 2D and 3D extension for later. Done means sparse results for multiple wavelets are consistent with the dense implementation.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

enhancement

🛠 Multi-Wavelet Support in Pre-Stack Inversion Operator (explicit=False)

📖 Description

The convolution operator used by pylops for pre-stack inversion (explicit=False) is implemented using the Conv1D class. Currently, pylops supports only a single wavelet for all angles, meaning the inversion assumes the same wavelet for each angle.

I attempted to modify the code to allow a different wavelet for each angle (mid-angle in my case, as I’m using partial stacks). However, my current results are only consistent when using dense operators (explicit=True), whereas I would expect them to also work in the sparse case.


🔍 Observations

  • ✅ The dense implementation (explicit=True) behaves as expected.
  • ❌ The sparse implementation (explicit=False) does not produce comparable results.
  • ⚠️ The issue seems related to how the Conv1D operator is built when handling multiple wavelets.

The code using Conv1D for multiple wavelets is only working for spatdims=1 at the moment, the idea is to extend for 2D or 3D cases when i adress this issue.


💡 Code Snippet

✅ Dense Implementation (Working)
# Handling multiple wavelets
if isinstance(wav, list):
    print("Dense multi-wavelet operator")
    n = len(wav)
    C = np.zeros((n * nt0, n * nt0))

    wsub_list = []
    for w in wav:
        wsub = np.asarray(convmtx(w, nt0, len(w) // 2)[:nt0])
        wsub_list.append(wsub)

    C = get_block_diag(theta)(*wsub_list)

else:
    # Create wavelet operator
    C = ncp.asarray(convmtx(wav, nt0, len(wav) // 2)[:nt0])
    C = [C] * ntheta
    C = get_block_diag(theta)(*C)

# Combine operators
M = ncp.dot(C, ncp.dot(G, D))
Preop = MatrixMult(M, otherdims=spatdims, dtype=dtype)

❌ Sparse implementation (Not-working)
    else:
        if isinstance(wav, list):
            print("Dense multi-wavelet operator")
            # Criar uma lista de operadores de convolução
            Cop_list = []

            for w in wav:
                Cop = Convolve1D(
                    (nt0),
                    h=w,
                    offset=len(w) // 2,  # Define o centro da wavelet
                    axis=0,
                    dtype='float32',
                    method='fft'
                )
                Cop_list.append(Cop.tosparse())  # Adiciona à lista de operadores'
            

            Cop = BlockDiag(Cop_list)

        else:
            print("Sparse single wavelet operator")
            # Create wavelet operator
            Cop = Convolve1D(
                dims,
                h=wav,
                offset=len(wav) // 2,
                axis=0,
                dtype=dtype,
            )
Lenguaje dominante
Python
Estrellas
539
Forks
126
Merge medio
2 d 17 h
PR fusionados (30 d)
21

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de PyLops/pylops

Todos los issues de PyLops/pylops

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.