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

Home » Public Forums » archive » Re: HISTOGRAM data type bug?
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: HISTOGRAM data type bug? [message #71347 is a reply to message #71345] Mon, 14 June 2010 02:45 Go to previous messageGo to previous message
Foldy Lajos is currently offline  Foldy Lajos
Messages: 268
Registered: October 2001
Senior Member
On Mon, 14 Jun 2010, chris wrote:

> Hi,
> I observed that IDL 6.4 x64 and 7.1 x64 (Windows 7 x64) crashes each
> time I'd like to do the following:
>
> IDL> test_histo_bug
> % Compiled module: TEST_HISTO_BUG.
> L INT = Array[5, 5]
> L DOUBLE = Array[5, 5]
> H LONG = Array[7]
>
> IDL> test_histo_bug,/crashme
> ->IDL crashes completely
>
>
> pro test_histo_bug,crashme=crashme
> l=$
> [[0,0,0,0,0],$
> [0,1,1,1,1],$
> [0,1,1,1,1],$
> [0,1,1,1,1],$
> [0,1,1,1,2]]
> help,l
> l=keyword_set(crashme)? ulong(l) : double(l)
> h=histogram(l,reverse_indices=r,nbins=7,min=1)
> help,l,h
> end
>
> Is it possible that HISTOGRAMM can't *handle* ULONG values? May be
> someone can shed some light on this behaviour?
>
> Thanks in advance
>
> CR
>

From the docs:
----------
BINSIZE
Set this keyword to the size of the bin to use. If this keyword is not
specified, and NBINS is not set, then a bin size of 1 is used. If NBINS is
set, the default is BINSIZE = (MAX - MIN) / (NBINS - 1).

Note
The data type of the value specified for BINSIZE should match the data
type of the Array argument. Since BINSIZE is converted to the data type of
Array, specifying mismatched data types may produce undesired results.
----------

So, your BINSIZE is 0 (calculated as ULONG). This may cause a 'divide by
zero' crash. I think IDL forgets to check BINSIZE.

regards,
lajos
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: symbol font not expoting correctly to EPS from iplot in OSX
Next Topic: Re: Locating sequence of bytes within binary file

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

Current Time: Sun Oct 12 05:21:29 PDT 2025

Total time taken to generate the page: 0.48238 seconds