> I'm having a hard time wrapping my head around whether both approaches
> are "right", or are they both "wrong." Or, maybe there is some other
> combination. It would be easier (and maybe the right approach) to draw a
> "stream line" instead of a vector. Then, at least you could visually see
> the distortion.
>
> In any case, I can't quite see where I would introduce the actions of
> the proposed keyword. And, then, adding a real map projection is just...
> Whew! I need another bottle of Tylenol. :-(
OK, I've finally convinced myself Wayne was right all along. I can hear
the big sigh from NASA astronomy programmers from here in Colorado! :-)
With the help of the Arrow command to give me a better idea of which
direction I should be pointed in, I have revamped cgDrawVectors to
essentially point in the "data" direction. Now this is more or less
compatible with PartVelVec. I haven't tested this thoroughly with map
projections yet, but it appears it might even be slightly better than
PartVelVec with map projections. Or, maybe it's just my glazed eye
outlook on the subject.
In any case, I recommend everyone who cares about this kind of thing get
a new version of the cgDrawVectors program. You can find it here:
http://www.idlcoyote.com/programs/cgdrawvectors.pro
Here is my test program so you can see what the two programs are doing.
Be sure to download the new program before running it.
;*********************************************************** ***
Pro Vector_Bug
cgdisplay, wid=1, aspect=1.0, Title='Scale Same in XY'
cgplot, [-180, 180], [-180, 180], /NoData
partvelvec, [10,10], [10,10], [-45, -45], [50,-50], $
/over, veccolor='red', length=.5
cgdrawvectors, [10,10], [10,10], [-45, -45], [50,-50], $
/over, veccolor='blue', length=0.1
cgArrow, -45, 50, -25, 70, /Data, Color='Grn6', Thick=3
cgArrow, -45, -50, -25, -30, /Data, Color='Gold', Thick=3
cgdisplay, wid=0, aspect=1.0, Title='Scale Different in XY'
cgplot, [-180, 180], [-400, 400], /NoData
partvelvec, [10,10], [10,10], [-45, -45], [50,-50], $
/over, veccolor='red', length=.5
cgdrawvectors, [10,10], [10,10], [-45, -45], [50,-50], $
/over, veccolor='blue', length=0.2
cgArrow, -45, 50, -25, 70, /Data, Color='Grn6', Thick=3
cgArrow, -45, -50, -25, -30, /Data, Color='Gold', Thick=3
cgdisplay, wid=2, aspect=1.0, Title='Scale Different in XY on Map'
cgMap_Set, /Miller_Cylindrical, $
Position=[0.1, 0.1, 0.9, 0.9], LIMIT=[-70, -180, 70, 180]
;cgMap_Grid, /label
partvelvec, [10,10], [10,10], [-45, -45], [50,-50], $
/over, veccolor='red', length=.5
; cgArrow, -45, 50, -25, 70, /Data, Color='Grn6', Thick=3
; cgArrow, -45, -50, -25, -30, /Data, Color='Gold', Thick=3
mapCoord = Obj_New('cgMap', 118, xrange=[-180, 180], $
yrange=[-70, 70], $
Position=[0.1, 0.1, 0.9, 0.9], /LatLon_Ranges)
mapCoord -> Draw
cgMap_Continents, Map=mapCoord, Color='grn5'
cgdrawvectors, [10,10], [10,10], [-45, -45], [50,-50], $
/over, veccolor='blue', length=0.2, Map=mapCoord
xy = mapCoord -> Forward([-45, -25], [50,70])
cgArrow, xy[0,0], xy[1,0], xy[0,1], xy[1,1], /Data, $
Color='grn6, Thick=3
xy = mapCoord -> Forward([-45, -25], [-50,-30])
cgArrow, xy[0,0], xy[1,0], xy[0,1], xy[1,1], /Data, $
Color='grn6, Thick=3
END
;*********************************************************
Cheers,
David
P.S. See you next year! ;-)
--
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.")
|