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

Home » Public Forums » archive » Re: Assigning NaN to arrays
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Assigning NaN to arrays [message #39279 is a reply to message #39278] Sat, 08 May 2004 05:24 Go to previous message
Chris Lee is currently offline  Chris Lee
Messages: 101
Registered: August 2003
Senior Member
In article <49b2657.0405080139.3a293765@posting.google.com>, "Eric
Volquardsen" <elv@irtf.ifa.hawaii.edu> 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.
> Instead of doing so, IDL assigned 2.14748e9. Everything I have seen in
> the IDL documentation seems to indicate that this would work.?.

> 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])

Hi,

If the code is a direct copy-paste, you need some array indices on the
x and y arrays.

Otherwise, it works for me. You didn't say what your typical values are.
Is 2.14e9 not a possible value? Can you provide a sample 5 x 5 grid ?

..
a=findgen(5,5)
a[2,2]=!values.f_nan
print, median(a)
13.0000
..

Chris.
[Message index]
 
Read Message
Read Message
Previous Topic: Re: WIDGET_COMBOBOX
Next Topic: What is this error message about?

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

Current Time: Tue Jul 07 12:31:00 PDT 2026

Total time taken to generate the page: 2.32148 seconds