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

Home » Public Forums » archive » locating the closest values?
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
locating the closest values? [message #80682] Tue, 26 June 2012 13:55
anil is currently offline  anil
Messages: 34
Registered: August 2009
Member
Hi,
I have two datasets/files. 1st one contains the values i want to find
(latitudes and longitudes) and the second file contains 3 columns as
longitude latitude and depth.
What i want to do is to read my desired values from file 1 and find
the closest values in file 2 and the corresponding 3rd column(depth)
from file 2. here is what i did:
1st file:
42.25 30.57
41.17 32.58
......
2nd file
42.55 34.42 1000
41.54 33.21 1500
.......
what i did is :

difference1=abs(lon-desiredlon)
a1=min(difference1,index1)

difference2=abs(lat-desiredlat)
a2=min(difference2,index2)

in this case, lon(index1) and lat(index2) become my desired values. no
problem with that. but how do i get the 3rd column. i could not match
index1 and index2 with where function.
what am i missing here?
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: IDLnetURL Object Not Loading
Next Topic: locating the closest values?

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

Current Time: Wed Oct 08 19:05:58 PDT 2025

Total time taken to generate the page: 0.00592 seconds