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.")
|