X
4206

Complex data and Z-profile values in ENVI

When displaying complex data in ENVI, you may notice that the Cursor Location / Value tool will show the correct pixel values, but that the Z-profile window gives different results.

Why is this? What are those values?


If you have ENVI and IDL, and in IDL create some double complex data:


   arr = dcomplexarr(3, 50, 50)

   arr[*,0:20, *] = -2.e14
   arr[*,21:49, *] = 3.e14

And read that array into ENVI and write it out as an ENVI file :


   envi_write_envi_file, arr, data_type=9, func_complex=0, $
      interleave=2, $
      nb=nb, $
      nl=nl, $
      ns=ns, $
      r_fid=fid, $
      out_name='test.img'


You may notice that the Cursor Location / Value tool will show the correct pixel values (approximately +-2.e-5),

but that the Z-profile window gives different results.

This is because complex data contain both real and imaginary numbers, and the spectral profile window

cannot plot both of these.

Using the above code, which writes out power, will result in spectral profile values that range from 32-34.

These values are actually the log of the absolute data value. We can see this by entering:   

   ENVI> print, alog(2e14)
    32.9293

The returned value (in the 30's) is what is seen in the y-axis of the spectral plot.

   
If you want ENVI to just show the real part of the data without taking the log, you will need to write
the real portion of the image out as a separate dataset.