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