rebin vs congrid [message #89069] |
Tue, 22 July 2014 07:12  |
greg.addr
Messages: 160 Registered: May 2007
|
Senior Member |
|
|
The documentation says rebin is somewhat faster than congrid, but it doesn't seem to be true (at least, not for upsizing)...
pro tmp_rebin_vs_congrid
sz=[5000L,5000L]
f=8
a=findgen(sz)
t=tic("rebin")
b=rebin(a,sz[0]*f,sz[1]*f,/sample)
toc,t
t=tic("congrid")
c=congrid(a,sz[0]*f,sz[1]*f)
toc,t
end
IDL> tmp_rebin_vs_congrid
% Time elapsed rebin: 4.6150000 seconds.
% Time elapsed congrid: 1.9849999 seconds.
IDL>
cheers,
Greg
|
|
|
rebin vs congrid [message #89102 is a reply to message #89069] |
Thu, 24 July 2014 09:58  |
Chip Helms
Messages: 24 Registered: November 2012
|
Junior Member |
|
|
My guess is that the variables are being stored to memory during the rebin call and so are already available in memory during the congrid call. If you run the test again without resetting after the first run I would guess the times will likely end up closer. That said, I'm perfectly prepared to be wrong. Heh
Cheers,
Chip
|
|
|