Re: Astronomys` Sixth Neighbour Needs Help [message #36203 is a reply to message #35884] |
Tue, 12 August 2003 01:40  |
wmconnolley
Messages: 106 Registered: November 2000
|
Senior Member |
|
|
Bitner <google_forums@gyttja.org> wrote:
> The trick is that I need the closest point that satisfies my condition
> (the closest point that has a score -- population or whatnot --
> greater than the test station)....
> wmc@bas.ac.uk wrote in message news:<3f37b61f@news.nwl.ac.uk>...
>> I come across this sometimes. The basis of the solution is usually
>> something like:
>>
>>> lon1=data.longitude & lon1(i)=-999
>>> lat1=data.latitude & lat1(i)=-999
>>
That should have been:
mindist=min(sqrt((lon1-lon(i))^2+(lat1-lat(i)^2),j)
If you need other conditions then:
k=where(score gt whatnot)
mindist=min(sqrt((lon1(k)-lon(i))^2+(lat1(k)-lat(i)^2),jj)
j=k(jj)
-W.
--
William M Connolley | wmc@bas.ac.uk | http://www.antarctica.ac.uk/met/wmc/
Climate Modeller, British Antarctic Survey | Disclaimer: I speak for myself
I'm a .signature virus! copy me into your .signature file & help me spread!
|
|
|