AMS writes:
> Ok, here is some code which will reproduce the problem (IDL 7.1.1). This should draw an image in a 5x5 degree box from 47-52 N, 115-110 W. It puts the image in the right place, but the edge columns and rows are chopped in half in size (they should all be the same size). So you can see that this means all the points are offset from where they really should be. Does anyone know what is happening here?
My guess is this is just an artifact of using the Map_Set way of doing
things, which is very, very old and not of professional grade in terms
of map projection software. Using the Map_Proj_*** routines, however,
does result in what I think you expect. I added this code to the end
of yours to give you the same perspective.
mapStruct = Map_Proj_Init(117,Limit=[45,-118,55,-108], $
center_lon=-112.5)
cola1 = Map_Proj_Image(scaled_data, [-115, 47, -110, 52], $
Dimensions=[xsize, ysize], Map_Struct=mapStruct)
window, 1
map_set,latdel=1,londel=1,limit=[45,-118,55,-108],/noborder, $
xmargin=[2,2],ymargin=[2,2]
tv, cola1, startx,starty,xsize=xsize,ysize=ysize
Of course, you have to get your head around the LIMIT being expressed in
a different order in the Map_Proj_Init and Map_Proj_Image routines, but
once you are burned 8-10 times it becomes second nature to you. :-)
I would encourage everyone to use the Map_Proj_**** routines for map
projection work. They are old, but at least professional quality. Of
course, they are hard to work with, which is why I generally work with
the Coyote Library map projection routines instead, which are wrappers
for the Map_Proj_*** routines and make this kind of thing much easier.
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
|