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

Home » Public Forums » archive » Re: map_image and latmin/latmax, lonmin/lonmax - edges or centres?
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: map_image and latmin/latmax, lonmin/lonmax - edges or centres? [message #86046 is a reply to message #86045] Thu, 26 September 2013 07:39 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
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.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: how to read string data from excel file
Next Topic: combination of two integration methods in a specified time interval

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

Current Time: Wed Oct 08 16:07:33 PDT 2025

Total time taken to generate the page: 0.00292 seconds