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

Home » Public Forums » archive » More Map Projection Madness
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: More Map Projection Madness [message #78294 is a reply to message #78253] Fri, 04 November 2011 14:23 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
David Fanning writes:

> window, 2, Title='Screwed Up GCTP Map Grid'
> m = Map_Proj_Init('Cylindrical')
> plot, [0,1], xrange=m.uv_box[[0,2]], yrange=m.uv_box[[1,3]], $
> xstyle=5, ystyle=5, /noerase, /nodata, $
> Position=[0.1, 0.1, 0.9, 0.9]
> map_grid, lats=lats, lons=lons, map_structure=m

The problem here appears to be a bug I first reported
to ITTVIS back in December of 2009.

Map_Proj_Forward has a POLYLINES keyword that returns correct
values itself, but causes the projected XY latitude values to
be incorrect. Thus, they get drawn in the wrong locations.
The only work-around is to call Map_Proj_Forward *without*
using this keyword. For example, in Map_Grid, you can call
Map_Proj_Forward twice, like this:

uv = MAP_PROJ_FORWARD(REPLICATE(lon, N_ELEMENTS(lati)), lati, $
MAP_STRUCTURE=mapStruct, POLYLINES=polylines)
uv = MAP_PROJ_FORWARD(REPLICATE(lon, N_ELEMENTS(lati)), lati, $
MAP_STRUCTURE=mapStruct)

And this problem goes away.

Here is an example of what I mean:

IDL> lons = [-180, -90, 0, 90, 180]
IDL> lats = Replicate(90, 5)
IDL> m = Map_Proj_Init('Cylindrical')
IDL> uv = Map_Proj_Forward(lons, lats, map_structure=m, polylines=p)
IDL> print, uv[1,*]
10007523.
10007523.
10007539.
10007539.
10007539.
10007539.
10007523.
IDL> uv = Map_Proj_Forward(lons, lats, map_structure=m)
IDL> print, uv[1,*]
10007539.
10007539.
10007539.
10007539.
10007539.

You can see there are incorrect values (10007523.) in the
first Map_Proj_Forward call that are not in the second call.
Plus there are fewer values!!

Very strange!

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: More Map Projection Madness
Next Topic: Re: IDL 8.1, X11 and Crashes

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

Current Time: Sun Oct 12 04:46:50 PDT 2025

Total time taken to generate the page: 1.27788 seconds