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

Home » Public Forums » archive » Histogram Too Many Array Elements
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
Histogram Too Many Array Elements [message #67732] Mon, 24 August 2009 15:40 Go to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Folks,

When I am working with large images, and I want to
plot a histogram, there are occasions when Histogram
complains about "too many array elements". On the
current image I am working on, for example, I am
passing an array to Histogram that has 1,727,194
elements.

It is an odd sort of error. And it is not even clear
to me that this is too many elements per se. It almost
seems like the bin size plays a role, too.

In any case, does anyone know what, exactly, causes this
error to occur? It seems to me it occurs most often
when working with MODIS reflectance data where the data
values are between 0 and 1. If it really is "too many"
elements in the array, what would be the "just right"
number?

Cheers,

David
--
David Fanning, Ph.D.
Coyote's Guide to IDL Programming (www.dfanning.com)
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: Histogram Too Many Array Elements [message #67851 is a reply to message #67732] Tue, 25 August 2009 11:13 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Folks,

I wrote yesterday:

> When I am working with large images, and I want to
> plot a histogram, there are occasions when Histogram
> complains about "too many array elements". On the
> current image I am working on, for example, I am
> passing an array to Histogram that has 1,727,194
> elements.
>
> It is an odd sort of error. And it is not even clear
> to me that this is too many elements per se. It almost
> seems like the bin size plays a role, too.

As it happens this was the result of a misplaced NAN
keyword, so that images with NANs caused the histogram
bin size to be a NAN, resulting in the "too many
elements" error message.

I was running into this problem with the Coyote
Library program, XSTRETCH. I have updated this
program (which is used with IMGWIN, among other
programs) to work correctly. You can download an
updated version here:

http://www.dfanning.com/programs/xstretch.pro

Cheers,

David

--
David Fanning, Ph.D.
Coyote's Guide to IDL Programming (www.dfanning.com)
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Digits in IDL
Next Topic: Re: Speed-up of code

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

Current Time: Thu Oct 09 06:03:08 PDT 2025

Total time taken to generate the page: 0.00735 seconds