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

Home » Public Forums » archive » Re: Euclidean distance (2D array)
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Euclidean distance (2D array) [message #11807] Mon, 25 May 1998 00:00
Martin Schultz is currently offline  Martin Schultz
Messages: 515
Registered: August 1997
Senior Member
mirko_vukovic@notes.mrc.sony.com wrote:
>
[...]
> One example on how to do this is the following routine that I find invaluable.
>
> ;+ NAME:
> ; TWO_D_ARR
> ;
[...]

Mirko,

how about this one:
; header identical to yours ;-)

pro twodarray,vx,vy,ax,ay

tvy = transpose(vy)
vx_size=size(vx)
vy_size=size(vy)
nx = vx_size(vx_size(0)+2)
ny = vy_size(vy_size(0)+2)

ax = rebin(vx,nx,ny)
ay = transpose(rebin(vy,ny,nx))

end


I did a little timing test, and it performed 3 times faster.


Regards,
Martin.


------------------------------------------------------------ -------
Dr. Martin Schultz
Department for Earth&Planetary Sciences, Harvard University
109 Pierce Hall, 29 Oxford St., Cambridge, MA-02138, USA

phone: (617)-496-8318
fax : (617)-495-4551

e-mail: mgs@io.harvard.edu
Internet-homepage: http://www-as.harvard.edu/people/staff/mgs/
------------------------------------------------------------ -------
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: tvrd() output to HDF file?
Next Topic: Problems with scalar structures

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

Current Time: Sat Oct 11 06:25:53 PDT 2025

Total time taken to generate the page: 0.16319 seconds