Algorithm for lat/lon searching [message #49807] |
Fri, 18 August 2006 07:50  |
Paul Van Delst[1]
Messages: 1157 Registered: April 2002
|
Senior Member |
|
|
Hello,
I want to implement a global *land* surface emissivity database (as a LUT) into a
radiative transfer code. Fir simplicity the database is simply gridded by lat/lon (land
and sea). Due to memory limitations, I want to only keep the land gridboxes in my lookup
table. Obviously, doing this complicates searching for the actual lat/lon element since
they're no longer stored on a grid.
What I'm looking for is a simple and/or quick method for searching a somewhat irregularly
spaced database for particular points. In the IDL newsgroup there was recently a
discussion above finding unique number pairs (lat->"high" portion of 64 bit int,
lon->"low" portion) and I was thinking that would provide a searchable database. By
converting the lat/lon pair to a unique number, e.g.
JD Smith wrote:
<IDL code follows>
> epsilon=1.e-7 ; difference in degrees for equality
> lat_lon = ulong64((lat+90.)/epsilon) + ishft(ulong64(lon/epsilon),32)
the resultant lat_lon array being simple to search.
An additional problem is that, since this data will be used for satellite data
assimilation and satellites tend to scan "diagonally" across lat/lon, adjacent/close-by
*geographical* grid elements will be accessed and it's not clear to me that the above
lat/lon orgainisation will put elements separated by a short physical distance anywhere
near each other in the lat_lon array.
I will be playing with and testing this over the coming days, but I wanted to pick the
brains of folks out there in advance.
Thanks for any suggestions/advice,
cheers,
paulv
p.s. Since the final code needs to be Fortran95, I set followups to comp.lang.fortran
--
Paul van Delst Ride lots.
CIMSS @ NOAA/NCEP/EMC Eddy Merckx
Ph: (301)763-8000 x7748
Fax:(301)763-8545
|
|
|