Giter Club home page Giter Club logo

Comments (3)

oysstu avatar oysstu commented on July 20, 2024

I believe this worked back in the day because numpy was more willing to do automatic type coercion. Negative powers are only permitted for floating point numbers. Try to change the type of the exponent to float32, that might work. Not sure if the output array needs to be float as well.

from pyxtf.

joakimsk avatar joakimsk commented on July 20, 2024

Thanks @oysstu, I used np.multiply instead of *= and also used np.power with 2.0 instead of 2; this seems to work ok. I also cast it to dtype of out_array, as original. I think it is as you suggest, the output does not need to be float. I hope this works with other xtf input as-well, do you have some to test it out on?

if weighted:
    weight_factors = [ping.ping_chan_headers[channel].Weight for ping in pings[::-1]]
    out_array = np.multiply(out_array, np.power(2.0, -np.array(weight_factors))[:, np.newaxis]).astype(out_array.dtype)

from pyxtf.

oysstu avatar oysstu commented on July 20, 2024

Solved by #41

from pyxtf.

Related Issues (18)

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.