Re: strange behaviour of bytscl by large arrays [message #80048 is a reply to message #79953] |
Mon, 23 April 2012 13:54  |
Klemen
Messages: 80 Registered: July 2009
|
Member |
|
|
Hmm today I don't have just the usual problems with IDL, but also with thist post... I would assume that everything is online once you press post... Anyway, short version once again.
Lajos, thank you very much. It's nice to know that I am not the only one seeing a miracle. :) Although the sky is not falling. :) And what I find really interesting is that you observed also the correlation to the number of CPU.
David, sorry that I was not clear in the first post. Yes the thing is that using BYTSCL and HIST_EQAL have some difficulties when processing large arrays. Using the above example of Lajos, see the output of the histogram.
pro test
cpu, tpool_nthreads=1
n=10l^8
nn=n-1
a3=fltarr(n)
count=0ll
for j=0l, nn do a3[j]=count++ ; better implementation
h = histogram(a3, binsize=10L^6)
print, h
b = byte(a3)
h = histogram(b)
print, h
end
IDL prints:
1000000 1000000 1000000 1000000 1000000 1000000 1000000
1000000 1000000 1000000 1000000 1000000 1000000 1000000
1000000 1000000 999999 1000000 1000000 1000000 1000000
1000000 1000000 1000000 1000000 1000000 1000000 1000000
1000000 1000000 1000000 1000000 1000000 999999 1000000
1000000 1000000 1000000 1000000 1000000 1000000 1000000
1000000 1000000 1000000 1000000 1000000 1000000 1000000
1000000 1000000 1000000 1000000 1000000 1000000 1000000
1000000 1000000 1000000 1000000 1000000 1000000 1000000
1000000 1000000 1000000 1000000 999998 1000000 1000000
1000000 1000000 1000000 1000000 1000000 1000000 1000000
1000000 1000000 1000000 1000000 1000000 1000000 1000000
1000000 1000000 1000000 1000000 1000000 1000000 1000000
1000000 1000000 1000000 1000000 1000000 1000000 1000000
1000000 1000000 4
2073833 65536 131072 65536 655360 65536 131072
65536 1816871 65536 131072 65536 655360 65536
131072 65536 2073833 65536 131072 65536 655360
65536 131072 65536 1816871 65536 131072 65536
655360 65536 131072 65536 2073833 65536 131072
65536 655360 65536 131072 65536 1816871 65536
131072 65536 655360 65536 131072 65536 2073833
65536 131072 65536 655360 65536 131072 65536
1816871 65536 131072 65536 655360 65536 131072
65536 2073833 65536 131072 65536 655360 65536
131072 65536 1816871 65536 131072 65536 655360
65536 131072 65536 2073833 65536 131072 65536
655360 65536 131072 65536 1816871 65536 131072
65536 655360 65536 131072 65536 2073833 65536
131072 65536 655360 65536 131072 65536 1816871
65536 131072 65536 655360 65536 131072 65536
2073833 65536 131072 65536 655360 65536 131072
65536 1816871 65536 131072 65536 655360 65536
131072 65536 2073833 65536 131072 65536 655360
65536 131072 65536 1816871 65536 131072 65536
655360 65536 131072 65536 2073833 65536 131072
65536 655360 65536 131072 65536 1816871 65536
131072 65536 655360 65536 131072 65536 2073833
65536 131072 65536 655360 65536 131072 65536
1816871 65536 131072 65536 655360 65536 131072
65536 2073833 65536 131072 65536 655360 65536
131072 65536 1816871 65536 131072 65536 655360
65536 131072 65536 2073833 65536 131072 65536
655360 65536 131072 65536 1816871 65536 131072
65536 655360 65536 131072 65536 2073833 65536
131072 65536 655360 65536 131072 65536 1816871
65536 131072 65536 655360 65536 131072 65536
2073833 65536 131072 65536 655360 65536 131072
65536 1816871 65536 131072 65536 655360 65536
131072 65536 2073833 65536 131072 65536 655360
65536 131072 65536 1816871 65536 131072 65536
655360 65536 131072 65536
Isn't that strange - after scaling to BYTE each histogram bin should contain the same number of values, just like the original histogram. This is not a prblem if I set n no 10^7.
Cheers, Klemen
|
|
|