New Script: Cassini: From launch to orbital insertion.

All about writing scripts for Celestia in Lua and the .cel system
Topic author
Jon R

New Script: Cassini: From launch to orbital insertion.

Post #1by Jon R » 31.07.2004, 21:12

Here's a .cel script of the Cassini mission from launch through orbital insertion.
I'm sure it's not perfect...it's my first attempt and I was learning along the way.:)
But I think it's pretty cool. I hope you enjoy.

I made in on Celestia 1.3.2 pre 10 (which has the Cassini spacecraft.) Plus I'm not sure if I used commands that were not supported on other versions.

It lasts about 10 minutes.

JOn

{
#
#------------------------------------------------------------------------
# Cassini Mission.cel V1.00:
#
#------------------------------------------------------------------------
#
renderflags {clear "orbits|constellations|comettails|boundaries"}
renderflags {clear "pointstars|nightmaps|galaxies|markers"}
renderflags {set "cloudmaps|eclipseshadows|atmospheres|nightmaps"}
labels {clear "planets|moons|spacecraft|asteroids|constellations|stars|galaxies"}
set {name "AmbientLightLevel" value 0.40}
set {name "FOV" value 40.0}
time {jd 2450736.89792}
setframe {
ref "#0/Cassini"
target "Sol/Earth"
coordsys "lock"
}
select {object "#0/Cassini"}
center{}
print {text "At any time you can use the space bar to pause or press esc to abort." row -4 column 1 duration 5.0}
wait {duration 5}
goto { time 3.0}
wait {duration 6.0}
print {text "The Cassini Mission to Saturn began from Earth on Oct 15 1997." row -4 column 1 duration 16.0}
wait {duration 5}
orbit {axis [0 1 0] rate 30 duration 9.0}
wait {duration 2}
select {object "Sol/Earth"}
timerate {rate 300}
wait {duration 5}
timerate {rate 1000}
orbit {axis [0 1 0] rate -20 duration 2.5}
timerate {rate 2000}
print {text "Due to payload constraints, only a optimum amount of fuel is loaded\non board the spacecraft." row -5 column 1 duration 12.0}
wait {duration 15}
print {text "So, to travel the outer planets,\nwe utilize the gravity of the planets to gain enough momentum\nto get to our destination." row -5 column 1 duration 12}
wait {duration 14}
print {text "This is called 'gravity assist'." row -3 duration 8}
wait {duration 10}
print {text "Cassini used gravity assist 4 times on it's way to Saturn!" row -5 column 1 duration 10}
timerate {rate 10000}
wait {duration 12}
print {text "Twice it flew by Venus..." row -5 column 1 duration 15.0}
wait {duration 5}
print {text "...then, once past the Earth..." row -5 column 1 duration 10.0}
wait {duration 5}
print {text "...and finally, it would flyby Jupiter on it's approach to Saturn." row -5 column 1 duration 7.0}
wait {duration 9}
print {text "So, let's go to our first destination...Venus!" row -5 column 1 duration 9.0}
wait {duration 9}
timerate {rate 50000}
print {text "Now it took a little over 6 months for Cassini to reach Venus..." row -5 column 1 duration 8.0}
wait {duration 8}
print {text "...so, let's jump forward in time a bit..." row -4 column 1 duration 8.0}
orbit {axis [0 1 0] rate -30 duration 6.0}
select {object "Sol/Venus"}
timerate {rate 100000}
time {jd 2450890.33333}
set {name "FOV" value 40.0}
wait {duration 5}
print {text "In a moment you'll see the planet Venus enter\nour field of view from the top-right portion of the screen." row -4 column 1 duration 12.0}
wait {duration 12}
print {text "Cassini's trajectory established a flyby of Venus at a distance of about 300 kilometers..." row -5 column 1 duration 10.0}
wait {duration 10}
print {text "That's only about 190 miles from the surface...\nthe closest of all Cassini's planned flybys!" row -4 column 1 duration 7.0}
wait {duration 5}
timerate {rate 50000}
wait {duration 3}
timerate {rate 20000}
setframe {
ref "#0/Cassini"
target "Sol/Venus"
coordsys "lock" }
wait {duration 2}
timerate {rate 10000}
wait {duration 3}
timerate {rate 3000}
wait {duration 11}
timerate {rate 10000}
print {text "Cassini was now poised to return to Venus in 14 months for a second flyby \n on June 24, 1999." row -5 column 1 duration 9.0}
wait {duration 10}
timerate {rate 1500000}
print {text "This second flyby of Venus would be at distance of 700km...\nor about 450 miles." row -5 column 1 duration 10}
wait {duration 23}
timerate {rate 500000}
wait {duration 2}
timerate {rate 100000}
wait {duration 6}
timerate {rate 50000}
wait {duration 7}
timerate {rate 10000}
wait {duration 7}
timerate {rate 3000}
wait {duration 10}
timerate {rate 10000}
wait {duration 10}
print {text "And now it's just a two-month trip to flyby the Earth." row -5 column 1 duration 8}
orbit {axis [0 1 0] rate -21 duration 5.5}
orbit {axis [1 0 0] rate 10 duration 2}
wait {duration 2}
select {object "Sol/Earth"}
timerate {rate 150000}
print {text "The flyby of Earth would be at a distance of 1200km...\nor about 750 miles." row -5 column 1 duration 8}
wait {duration 11}
setframe {
ref "#0/Cassini"
target "Sol/Earth"
coordsys "lock" }
print {text "An interesting tidbit...\nThere were some protests at that time warning
of Cassini's plutonium powerplant\nand the fears of an accidental collision with Earth." row -6 column 1 duration 14}
wait {duration 14}
timerate {rate 50000}
wait {duration 11}
timerate {rate 20000}
wait {duration 6}
timerate {rate 10000}
wait {duration 5}
timerate {rate 2000}
wait {duration 12}
print {text "So, it's now been almost two years since the launch of Cassini\nand in essence, we are just leaving Earth...only now with the added momentum gained\nby the three gravity assist flybys." row -5 column 1 duration 20}
wait {duration 15}
timerate {rate 10000}
wait {duration 5}
print {text "And now it's on to Jupiter..." row -5 column 1 duration 8}
wait {duration 3}
orbit {axis [0 1 0] rate -45 duration 5.2}
orbit {axis [1 0 0] rate -10 duration 2.5}
setframe {
ref "#0/Cassini"
target "Sol/Jupiter"
coordsys "lock" }
select {object "Sol/Jupiter"}
wait {duration 3}
labels {set "planets"}
wait {duration 13}
labels {clear "planets"}
timerate {rate 1500000}
wait {duration 5}
print {text "The closest we get to Jupiter is about 10,000,000 km." row -5 column 1 duration 12}
wait {duration 23}
timerate {rate 100000}
select {object "0#/Galileo"}
mark {object "#0/Galileo"}
renderflags {set "markers"}
print {text "The marked object is the Galileo probe which was\nstill on it's mission in orbit around Jupiter!" row -5 column 1 duration 15}
wait {duration 25}
setframe {
ref "#0/Cassini"
target "Sol/Saturn"
coordsys "lock" }
print {text "And now to our final destination...\nthe 'Jewel of the Solar System'...Saturn." row -5 column 1 duration 8}
wait {duration 8}
select {object "#)/Cassini"}
orbit {axis [0 1 0] rate 30 duration 4}
wait {duration 3}
renderflags {clear "markers"}
timerate {rate 150000}
wait {duration 5}
print {text "We'll move forward in time again...to the flyby of Pheobe...\n
one of Saturn's moons." row -5 column 1 duration 10}
wait {duration 8}
# ------------------------Saturn arrival---------------------
timerate {rate 1}
time {jd 2453168.16667}
setframe {
ref "#0/Cassini"
target "Saturn/Pheobe"
coordsys "lock"
}
select {object "#0/Cassini"}
goto {}
# Only used for alignnment when testing Saturn segment alone.
# orbit {axis [0 1 0] rate -10 duration 1.5}
# orbit {axis [1 0 0] rate 10 duration 1}
orbit {axis [0 1 0] rate 10 duration 3}
changedistance {duration 2 rate 0.5 }
select {object "Saturn/Pheobe"}
timerate {rate 200}
print {text "Several weeks before Cassini arrived at Saturn\nit flew by one of Saturn's moons named Pheobe." row -5 column 1 duration 10}
wait {duration 12}
print {text "One interesting fact about Pheobe is that is has a 'retrograde' orbit." row -5 column 1 duration 8}
wait {duration 10}
print {text "This means it orbits Saturn in a clockwise direction...\nmost objects in our Solar System orbit in a counter-clockwise direction." row -5 column 1 duration 10}
wait {duration 12}
print {text "One possible theory to explain this is that Pheobe was an asteroid\nthat was somehow captured by Saturn's gravity." row -5 column 1 duration 10}
wait {duration 12}
print {text "Cassini passed within several thousand kilometers of Pheobe\non June 11, 2004." row -5 column 1 duration 10}
wait {duration 12}
print {text "But there's no stopping us now...\nwe're on schedule to arrive at Saturn on June 29, 2004." row -5 column 1 duration 10}
wait {duration 5}
setframe {
ref "#0/Cassini"
target "Saturn"
coordsys "lock"
}
set {name "FOV" value 50.0}
select {object "#0/Cassini"}
timerate {rate 100000}
wait {duration 10}
timerate {rate 50000}
wait {duration 10}
timerate {rate 20000}
wait {duration 4}
timerate {rate 10000}
wait {duration 4}
timerate {rate 5000}
wait {duration 5}
chase {}
print {text "The point at which time Cassini passes through the ring-plane of Saturn\nis called SOI or Saturn Obital Insertion." row -5 column 1 duration 10}
timerate {rate 1000}
wait {duration 10}
timerate {rate 500}
print {text "It was shortly after SOI that Cassini fired it's thruster for 90 minutes\nin order to slow down so it could be captured by Saturn's gravity." row -5 column 1 duration 10}
wait {duration 20}
timerate {rate 500}
wait {duration 5}
print {text "This is about the where Cassini made it's closest approach\nto Saturn-approximately 19,000km, or about 12,000 miles!" row -5 column 1 duration 10}
wait {duration 18}
orbit {axis [0 1 0] rate -20 duration 8}
wait {duration 10}
timerate {rate 1000}
wait {duration 5}
setframe {
ref "#0/Cassini"
target "Saturn"
coordsys "lock"
}
timerate {rate 5000}
wait {duration 5}
timerate {rate 10000}
wait {duration 5}
print {text "So there you have it...Cassini in orbit!" row -5 column 1 duration 10}
wait {duration 5}
print {text "This script is finished...press esc to abort." row -5 column 1 duration 10}
wait {duration 1}

}

Return to “Scripting”