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 #84680] Tue, 26 June 2012 14:07
anil is currently offline  anil
Messages: 34
Registered: August 2009
Member
Hi,
I have 2 ascii files/datasets. 1st file contains latitude and
longitude pairs(2 columns) in each line. 2nd file contains also
latitude longitude and also a 3rd column, depth. What i want to do ,
is to read each line from file 1(desiredlon and lat), and then find
the closest latitude and longitudes and the corresponding depth in
file 2.
I did something like this:

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

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

when i check, lon(index1) and lat(index2) gives correct results. but
i could not read the 3rd column/depth using these indexes. Is there
any other way to do this?
My 2nd file is ~35000 lines. For each longitude there are many
matching longitudes in the 2nd file, it is the same for latitude. But
there is only one single point for each pair of coordinates. How can i
match them and find the depth in that row?
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: locating the closest values?
Next Topic: Again an FFT question

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

Current Time: Fri Oct 10 14:05:10 PDT 2025

Total time taken to generate the page: 1.20543 seconds