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 #71345 is a reply to message #71344] Mon, 14 June 2010 05:29 Go to previous messageGo to previous message
rogass is currently offline  rogass
Messages: 200
Registered: April 2008
Senior Member
On 14 Jun., 11:45, FÖLDY Lajos <fo...@rmki.kfki.hu> wrote:
> 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

Uh, thank you.
I forgot the influence of the data type.
So, anyway, this means also that if you don't determine the binsize
exactly
the histogram might be erroneous due to the rounding of nbins and
binsize....

I used the histogram together with a label_region(/ulong).

However, the missing check is now a *feature* for me :)
[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: Wed Oct 08 18:47:00 PDT 2025

Total time taken to generate the page: 0.00205 seconds