Giter VIP home page Giter VIP logo

Comments (3)

kwinkunks avatar kwinkunks commented on June 16, 2024 1

I have implemented something for this now... it's in the bleeding edge bruges, under filters.convlve(). I tried lots of ways, and found map to be a bit faster than apply_along_axis, so that's what I used. But it's basically the same as what you're doing. With a bit of fiddling with shapes, I made it work for any dimensions -- so you can convolve a 3D reflectivity volume with a 2D wavelet bank, for example.

See https://github.com/agile-geoscience/bruges/blob/develop/bruges/filters/convolve.py#L12-L31

By the way, you don't have to construct the wavelet bank with a list comprehension or anything. You can just do:

w, t = bruges.filters.ricker(0.128, 0.001, f=np.linspace(5, 100, 20), return_t=True)

Then w will have shape (20, 128).

from bruges.

mycarta avatar mycarta commented on June 16, 2024

Hi Diego

Are you working on this? I'd started playing around with it last year, taking off from Matt's post x lines of Python: synthetic wedge model and came up with this: Making many synthetic seismic models in Python.
Perhaps vectorizing the code in cell 17: synth = np.array([np.apply_along_axis(lambda t: np.convolve(t, w, mode='same'), axis=0, arr=r) for r in rc for w in ws ])
What do you think? Then you already have a notebook example that I can clean-up and update for Python 3.

from bruges.

kwinkunks avatar kwinkunks commented on June 16, 2024

Fixed with f4fc0c1

from bruges.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.