Setting negative values in wave to zero
Physicist92
Hi all,
I have wave with (512,512) points. It consists of positive and negative values. How can I set all negative values in the wave to zero and preserve all positive values?
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