Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado
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/
In article <MPG.f92a4527ce8dc2b989776@news.frii.com>, davidf@dfanning.com (David Fanning) wrote: > > 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 > ----------------------------------------------------------- > I tried both codes, John Boccio's works on my machine (SGI). (Don't forget the function definitions at the beginning). I just had trouble getting it to stop. David's is pretty interesting, except watching the loading is a bit hard on the eyes. It might be useful for a satellite orbit simulation. Good Luck, John. Rose -----== Posted via Deja News, The Leader in Internet Discussion ==----- http://www.dejanews.com/ Now offering spam-free web-based newsreading