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

Home » Public Forums » archive » Re: matching 2 grids
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: matching 2 grids [message #47849 is a reply to message #47848] Wed, 08 March 2006 17:50 Go to previous messageGo to previous message
Mark Hadfield is currently offline  Mark Hadfield
Messages: 783
Registered: May 1995
Senior Member
Jenny wrote:
> Hi Mark,
>
> Sorry I'm not very clear about my problem. But it seems more complex
> than the one posted yesterday. They are 2-D arrays. I have 2 files for
> grid1: 600*600 array for lat1, and 600*600 array for lon1, one
> lat1/lon1 pair (smae coordinate in the array) represents the true
> location on earth. So generally lat1 increase along a column, and also
> slightly different along a row. Same for lon1, increase along a row,
> slightly different along a column. I think grid1 was produced from
> polar stereographic projection, so that they are not equally spaced
> lat/lon pairs. grid2 is a polygon shaped subset of grid1, they are also
> one 2-d array for lat2 and one for lon2 (say 100*120 with 0 filled in
> some places), but not exactly the same values as those in grid1, grid2
> was defined in a different projection. What I want is to find the
> closest lat1/lon1 for each of the lat2/lon2 based on the geographic
> location the lat/lon represents.

Yes, it's what I called a 2-D location problem in my previous post and
it can be handled by MGH_LOCATE2 or MGH_LOCATE2A (the former is faster
when the number of points in grid2 is large, the latter when it is
small). Examples of how to use these are in MGH_EXAMPLE_LOCATE.

What MGH_LOCATE2 will give you, for each point in grid2, is a 2-element
floating-point vector describing its position in the 2D "index space" of
grid1. If you round this vector to the nearest integer, that will be the
location of the nearest point of grid1.


--
Mark Hadfield "Kei puwaha te tai nei, Hoea tahi tatou"
m.hadfield@niwa.co.nz
National Institute for Water and Atmospheric Research (NIWA)
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: read files with time column
Next Topic: Problems with Restore

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

Current Time: Sun Oct 12 12:08:13 PDT 2025

Total time taken to generate the page: 1.83597 seconds