[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

A new object to play with: horizontal (rectangular) grids




Dear all,

    while I was trying to fix a bug in a regridding program that I once wrote ;-( I decided enough is enough, and I finally sat down to create an object to deal with "georeferencing" as I hope I may call it. Those of you who have developped visualisation routines for geophysical data may have run into the following problems (if not, you are either much smarter than me or just lucky):

1. longitude vectors can wrap around the globe, and they sometimes start at or near 0. degrees, sometimes at or near -180. This can cause a lot of headache when you try to get an index vector for longitudes from -60. to 60. degrees or from 120. to -150. degrees, for example.

2. latitude vectors can be sorted in ascending or descending order, depending on the model or data set in question. As a user, I would always expect a vector in descending order if I extract latitudes from 80. to -80. degrees, for example.

3. sometimes you want to look at grid box "center" coordinates, at other times you need the edge values.

4. you can never remember the exact starting point of a grid (did it have an edge or a center value at 0. degree?)

5. what do you do if the point (or range endpoint) you want to extract lies exactly on the grid box boundary? Sometimes you want to include it in your selection, other times you don't.

The solution to all of these problems (and possible others) is now almost ready, and you can download a first test version from ftp://ftp.dkrz.de/pub/Outgoing/martin_schultz/idl/ . So far, not all the features are fully implemented, and it works only for longitudes (i.e. I haven't implemented the ordering of latitude vectors yet). It is really work in progress, but I decided to post this article anyway, because now is the time where you can still influence the design process if you have serious objections to how certain things work or how they are called. As always the program (mgs_hgrid__define.pro) has a lot of documentation embedded, and there is an example program at the end to show you how to work with this object.

Try it out and let me know if this may be useful to you, this always encourages me to spend more effort on something like this ;-)

Cheers,
Martin



-- 
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[ 
[[ Dr. Martin Schultz Max-Planck-Institut fuer Meteorologie      [[ 
[[ Bundesstr. 55, 20146 Hamburg [[    [[ phone: +49 40 41173-308 [[ 
[[ fax: +49 40 41173-298 [[            [[ martin.schultz@dkrz.de [[
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[