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

Home » Public Forums » archive » Re: image statistics without the NaN
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: image statistics without the NaN [message #58723] Sun, 17 February 2008 22:20 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
raghuram writes:

> Here's the problem :
>
> I wrote an IDL script to compute basic statistics of a MODIS image
> that i have processed.
> The areas outside my study area have been set to NaN because i don't
> want them to be considered
> while computing statistics in ENVI.
> But, when i use the Image_statistics procedure in IDL, i'm not able to
> ignore the NaN and hence all the
> basic stats show values of NaN( like max=NaN, min= NaN etc..)
>
> Expected result:
> To calculate the true max,min values of the image without considering
> the pixels which are set to NaN.
>
> Anybody has any idea how to go about fixing this problem ? my initial
> thought was to create a NaN mask, but
> i want to get some ideas flowing.

I should think something like this will work:

IDL> Image_Statistics, image, Mask=Finite(image), MIN=min, MAX=max

Well, except that this program seems strangely written, in that the mask
must be a named variable for some reason. So try this:

IDL> mask = Finite(image)
IDL> Image_Statistics, image, Mask=mask, MIN=min, MAX=max

Cheers,

David


Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming (www.dfanning.com)
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Previous Topic: Use IDL Workbench with other languages?
Next Topic: IDL & reading headers of netCDF files

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

Current Time: Fri Oct 10 08:32:46 PDT 2025

Total time taken to generate the page: 0.08341 seconds