jtigor Set the negative value pixels in the wave to zero using: mywave[][] = mywave[p][q] < 0 ? 0 : mywave[p][q] https://www.wavemetrics.com/comment/18230#comment-18230. Log in or register to post comments April 15, 2019 at 01:10 pm - Permalink
In reply to Set the negative value… by jtigor Physicist92 I just wanted to write here that the problem is solved :) Thank you! Log in or register to post comments April 15, 2019 at 01:11 pm - Permalink
s.r.chinn If execution time is important, you might want to consider MatrixOP/O mywave = mywave * replace(sgn(mywave), -1, 0) which takes about 60% of the time for a (512,512) wave. Log in or register to post comments April 16, 2019 at 07:31 am - Permalink
In reply to If execution time is… by s.r.chinn Physicist92 s.r.chinn wrote: If execution time is important, you might want to consider MatrixOP/O mywave = mywave * replace(sgn(mywave), -1, 0) which takes about 60% of the time for a (512,512) wave. Thank you! Log in or register to post comments April 16, 2019 at 08:09 am - Permalink
Set the negative value pixels in the wave to zero using:
https://www.wavemetrics.com/comment/18230#comment-18230.
April 15, 2019 at 01:10 pm - Permalink
In reply to Set the negative value… by jtigor
I just wanted to write here that the problem is solved :) Thank you!
April 15, 2019 at 01:11 pm - Permalink
If execution time is important, you might want to consider
MatrixOP/O mywave = mywave * replace(sgn(mywave), -1, 0)
which takes about 60% of the time for a (512,512) wave.
April 16, 2019 at 07:31 am - Permalink
In reply to If execution time is… by s.r.chinn
Thank you!
April 16, 2019 at 08:09 am - Permalink