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

Home » Public Forums » archive » Re: drawing a shaded sphere
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: drawing a shaded sphere [message #11424 is a reply to message #11417] Mon, 06 April 1998 00:00 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
John Boccio (boccio@swarthmore.edu) writes:

> The IDL code at the end of this message when saved as a file cosmic.pro
> will plot the trajectory of a cosmic ray in the earth's magnetic field in
> 3 dimensions. It plots the trajectory as it is happening(not at the end),
> which is the way one should do during a simulation.
>
> I would like to draw a shaded sphere (even better a sphere with earth map
> on its surface) of radius rearth so that the subsequent cosmic ray trajectory
> in the earth's magnetic field appears properly in relation to that sphere.

I couldn't get John's code to run (missing some functions),
but here is an example with simulated data and XInterAnimate
that I coded up in about 5 minutes. Loading the animation
pixmaps takes awhile, but the animation is very fast. You
can, of course, load the pixmaps out of sight if you like.

Cheers,

David
-----------------------------------------------------------

PRO Particle_Track

; Fake latitude and longitude data of simulated particle.

x = Findgen(100)* 2 - 100
y = Findgen(100) * (50/99.)
TVLCT, 255, 255, 0, 1

; Run the animation in XInterAnimate

XInterAnimate, Set=[300,300, 50], /Showload

xx = [x[0]]
yy = [y[0]]
count = 0
FOR j=1, 99, 2 DO BEGIN

; Draw map projection with particle track overlayed.

Map_Set, /Orthographic, /Continents, /Grid, y[j], x[j]
xx = [xx, x[j]]
yy = [yy, y[j]]
PlotS, xx, yy, Color=1
PlotS, xx[count+1], yy[count+1], PSym=4, Color=1

; Copy it into XInterAnimate pixmaps.

XInterAnimate, Frame=count, Window=!D.Window
count = count + 1
ENDFOR

; Run the animation.

XInterAnimate, 20
END

-----------------------------------------------------------
David Fanning, Ph.D.
Fanning Software Consulting
E-Mail: davidf@dfanning.com
Phone: 970-221-0438
Coyote's Guide to IDL Programming: http://www.dfanning.com/
[Message index]
 
Read Message
Read Message
Previous Topic: paradoxon?
Next Topic: New IDL Programming Associate

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

Current Time: Mon Dec 01 08:34:57 PST 2025

Total time taken to generate the page: 1.68481 seconds