sunset accross Europe, 4PM

I don’t remember what sparked the idea, but for some time I have been thinking about having a desktop background that showed the changing view of Earth from space; a geostationary position showing the approaching sunrise/sunset. I have seen a ‘Desktop DreamScene‘? that was something akin to what I was after, but I wanted to do this myself and slightly differently. In the end I think I ended up using the same or very similar software to achieve my effect.

Google Earth was my first port of call to source these images, but this was limited by the limited ability to take clean screenshots and inability to position the view off-centre. After more stumbling around the web I came accross NASA’s World Wind Java application. This is fantastic, the Blue Marble Next Generation images look fantastic, it is open source and can be developed in a multitude of ways and it can be scripted. The drawback is that the applet is supplied as a demo, my Java skills are virtually non-existant and after some time playing around and looking at other peoples work I had made very little progress. Then whilst watching some of the BBC Wonders of the Solar System series I began wondering what software they used to create the models. The BBC site pointed me towards Celestia. Another free offering, it has its own scripting language and lets the user explore the solar system in its known entirety.

Celestia has its own scripting language and an active user base who have generated many higher resolution image maps and other objects. I downloaded a night view and higher res day views, then created my own cloud cover png.

I adapted the scattering effect after reading a discussion about adapting night time views, I don’t know about realism, but I prefer the look offered by the following:

Height 60
Lower [ 0.43 0.52 0.65 ]
Upper [ 0.26 0.47 0.84 ]
Sky [ 0.40 0.6 1.0 ]
Sunset [ 1.0 0.6 0.2 ]
CloudHeight 7
CloudSpeed 65
CloudMap "earth-clouds.*"
# Mie 0.001
# MieAsymmetry -0.25
# Rayleigh [ 0.001 0.0025 0.006 ]
# MieScaleHeight 12
# my old values
## Mie 0.0005
## MieAsymmetry -0.15
## Rayleigh [ 0.00025 0.0009 0.0015 ]
## Absorption [ 0.00018 0.00005 0.0 ]
## MieScaleHeight 18
Mie 0.0050
MieAsymmetry -0.35
Rayleigh [ 0.0008121 0.0020775 0.00375 ]
Absorption [ 0.00057 0.0004 0.0 ]
MieScaleHeight 15

There is more work to do on the night lights, I can improve on what I currently have, but I have not had any luck using the Radiance Calibrated Lights: 1996-1997 from This post and this one discuss creating texture maps, but I have not managed to do it. I will stick with what I have for now.

Version 1.6.1 of Celestia will allow the user to use a url directly in a script, but for now I set the view I would like to record then run a little script. The script increments the date and time and takes a series of screenshots. In this way I captured 288 images; images from midnight to midnight for the 15th Jan, 15th Feb etc. So I get a rougly accurate seasonal variation in sunlight. If I were really keen I would work out how to use the NASA Blue Marble monthly images so the snowline moves according to the season along with the sunlight, but then since all the snow seems to be melting anyway…

I use the images on my desktop background along with a little program wot I wrote to keep the images in sync with the local time. Below is the celx script i use in celestia.
To Use the Script:

  • Screenshots are written to the directory set by the config option “ScriptScreenshotDirectory” in the celestia.cfg file, defaulting to the main celestia directory (typically something like C:\Program Files\Celestia\), depending on your system. Celestia may not be allowed to write files there, so you may need to edit the cfg file.
  • To use the same view use the cel url at the top of the script. Otherwise set up your view to whatever you want,
  • open the script from Celestia; File, Open Script…
  • type Alt-Enter to go to full screen, sit back and wait a couple of minutes while the images are captured.

hours = {}
months = {"01","02","03","04","05","06","07","08","09","10","11","12"}
hours = {"00","01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24"}
celestia:print("In a moment this script will capture a series of screenshots\n Type Alt-Enter to go to Full Screen view now.\n To quit press the Escape key, then Alt-Enter again.", 15.0, 0, 0, -18, -2)
while countdown>0 do
celestia:print("Starting in: "..countdown.."...", 0.8, 0,0,-4,-1)
wait (1)
--loop months
for m = 1, 12 do
--loop through hours
for h = 1, 24 do
tdb_dt = celestia:utctotdb(2010, m, 15, h-1, 00, 00)
celestia:takescreenshot("jpg", months[m].."_"..hours[h])