Comments (3)
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.
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.
Solved by #41
from pyxtf.
Related Issues (18)
- Channel ordering HOT 8
- Example notebook is missing 'concatenate_channel' function HOT 2
- pyxtf error HOT 2
- xtf can't be read correctly HOT 3
- XTF_HEADER(67) HOT 1
- I met an error when reading a xtf file HOT 5
- Convert .xxx to xtf files HOT 2
- File indexing HOT 3
- More ideas to prevent confusion with another Python XTF implementation? HOT 4
- How convert XTF to Geotiff? HOT 2
- Error while plotting HOT 2
- Run plot_sonar_paythy.py in examples HOT 1
- Ensure that an index is for the file being read
- Write XTF example failing to write packets HOT 1
- Memory Error HOT 3
- Writing over 255 pings causes output xtf file to be unreadable. HOT 3
- Set the SampleFormat enumeration automatically from numpy datatype when writing packets
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyxtf.