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

Home » Public Forums » archive » Re: Maximum value array resampling
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: Maximum value array resampling [message #45026 is a reply to message #45025] Fri, 05 August 2005 12:18 Go to previous messageGo to previous message
b_efremova@yahoo.com is currently offline  b_efremova@yahoo.com
Messages: 18
Registered: July 2005
Junior Member
Hi,
I'm not able to do it without loops, but I can do it with less loops.
Here's a program that makes it in two ways. The first is what I think
you probably are doing, and the second is twice faster for an array
2048x2048 ...you probably figured that much yourself, but since I did
it... here it is:

PRO test,im,y1,y2
x=im
ss=size(im,/dimensions)
n1=ss[0]/2.
n2=ss[1]/2.

y1=fltarr(n1,n2)
y2=y1
;--------- first way-----------
t10=systime(1)
for i=0,n1-1 do for j=0,n2-1 do begin
y1[i,j]=x[2*i,2*j] > x[2*i+1,2*j] > x[2*i,2*j+1]>x[2*i+1,2*j+1]
end
print,'time1=',systime(1)-t10

;--------- secon way-------------
t20=systime(1)
for i=0,n1-1 do x[i,*]=x[2*i,*] > x[2*i+1,*]
for i=0,n2-1 do y2[*,i]=x[0:n1-1,2*i] > x[0:n1-1,2*i+1]
print,'time2=',systime(1)-t20

;------
END
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Dynamic array of an Object as class member variable.
Next Topic: New Tabbing Functionality in IDL 6.2

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

Current Time: Fri Oct 10 14:48:29 PDT 2025

Total time taken to generate the page: 1.60051 seconds