comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Assigning NaN to arrays
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Assigning NaN to arrays [message #39280] Sat, 08 May 2004 02:39 Go to next message
elv is currently offline  elv
Messages: 2
Registered: May 2004
Junior Member
I was assigning NaN to the locations of bad pixels in an image. I
then replace the bad pixels with the median of the surrounding good
pixels. Instead of doing so, IDL assigned 2.14748e9. Everything I
have seen in the IDL documentation seems to indicate that this would
work.?.

w = WHERE(mask EQ 1)
size_img = SIZE(image, /dimensions)
size_img = size_img[0]
image[w] = !values.f_nan
x = w MOD size_img
y = w / size_img
FOR i = 0, (n_elements(w)-1) DO image[w[i]] = MEDIAN(image[x-2:x+2,
y-2:y+2])

Thanks,

Eric




Eric Volquardsen
Research Associate
NASA Infrared Telescope Facility
Re: Assigning NaN to arrays [message #39338 is a reply to message #39280] Fri, 14 May 2004 07:08 Go to previous message
George N. White III is currently offline  George N. White III
Messages: 56
Registered: September 2000
Member
On Sat, 8 May 2004, Eric Volquardsen wrote:

> I was assigning NaN to the locations of bad pixels in an image. I
> then replace the bad pixels with the median of the surrounding good
> pixels.

Using NaN this way can have severe performance consequences on some
platforms. If you can't assign a numeric "code" for bad pixels you
might consider using a mask array for portability.

--
George N. White III <aa056@chebucto.ns.ca>
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Help with creating array and plotting
Next Topic: Re: Fuzzy classification

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sun Mar 22 07:04:19 PDT 2026

Total time taken to generate the page: 0.79779 seconds