image display question

I have a 2D complex wave ('mask') that I want to display in an image graph. The default (magnitude) mode works fine, but when I try to display the phase, using
modifyimage mask imcmplxmode=3

there are artifacts even when the magnitude of the wave is strictly zero. The strictly-zero part of most of the wave content has been verified by using the (magnitude) image cursor, by editing the wave, and by printing to the command line. I am attaching the .ibw wave file. Should I not expect that uniform zero regions show flat (if not 0) phase? I'm using IP 6.23, Windows 7.
mask.ibw (1.83 MB)
Hi Steve,

I think the answer is here:
matrixop/o aa=phase(mask)
newimage aa


The image display mode is not doing anything that MatrixOP is not computing. So take it one more step and execute:

matrixop/o bb=mag(mask)
newimage bb
MatrixOP/O aa=greater(mag(mask),0.1)*phase(mask)


A.G.
WaveMetrics, Inc.
AG,

Thanks for your suggestions.

It turns out that the culprit lay in the way that the complex zero values were set in my 2D wave definition, using a logical multiplier factor whose value was 0 in certain regions. The resulting complex numbers had signed zeros, whose real and imaginary values could be either positive or negative. The phase display algorithm apparently uses atan2, which can give a pi phase shift for some of those cases.

I solved the display problem by using a conditional operator  ? : assignment method for the complex wave that did not transfer the sign of the non-zero part of the argument to the assigned zero. Remember, when it comes to zeros, sign matters.
s.r.chinn wrote:
... Remember, when it comes to zeros, sign matters.


Were the values zero or extremely small floating point numbers?