Stellarium’s Satellites plug-in: Some gain, some lose

I am supposed to be doing anything but programming. Instead, today I spent most of my time writing code for Stellarium. I lose.

When I’m working on Stellarium, I am also supposed to be working on the Device Control plug-in (the descendent of the Telescope Control plug-in), and in particular, on re-writing its INDI client. Instead, today I spent most of my time writing a simple GUI for adding satellites in the Satellite plug-in. Telescope users lose. Satellite lovers gain. Well, after my branch is merged with the trunk. The merge proposal is here:
https://code.launchpad.net/~daggerstab/stellarium/satellites-import-gui/+merge/87865

This morning I though that I can finish the basic part for two hours. It took me more than ten. :( Of course, one of the reasons is that I’m working on a netbook and operations such as compilation, version control and code comparison are slow. I also had to study other people’s code and re-factor some of it. Nevertheless… It’s still ten hours of my life that I’m not getting back.

Anyway, I have some ideas for improving the way the Satellites plug-in handles its updates. Both require adding a checkbox to the configuration window and some code in the update function:

  • An option for automatic removing the satellites that are no longer in the update lists during an update.
  • An option for automatic adding of the new satellites in a given source file (in particular, CelesTrak’s “last month’s launches” file).

The combination of the two will allow the users to have a constantly updated snapshot of the currently active satellites. :) I’m going to leave the implementation to someone else, though. I’ve had enough of Stellarium for now.

Posted in Stellarium | Leave a comment

What I (should) have been working on: new interface for Oculars

Stellarium’s Oculars plug-in have been plagued with interface problems almost since its creation. Originally it was controlled with hard-coded key combinations, but the default ones were not easily accessible on keyboard layouts different from the default US QWERTY one and users complained. Then the plug-in’s author, Timothy Reaves, decided to add an option to change the combinations by entering the new ones by hand. This was somewhat awkward and users complained. Then he decided to use as few key combinations as possible and added a drop-down menu instead. Again, this was not very user-friendly and users have been complaining.

So I decided to look into the ways a plug-in can add controls on the screen – like the button bars in the lower left side of the screen. The result looks like this:

Before, there was a field in the upper right corner of the screen that displayed information about the current telescope/eyepiece. Now in its place is a control panel that allows cycling through the telescopes, eyepieces and sensors by clicking buttons. When the ocular view or sensor frame overlay is not active, the panel retracts, showing only the large buttons at the bottom.

There are several things that need to be done to finish the redesign of the interface, but I haven’t worked on it properly for the last few weeks. Even after the new interface is completed, it won’t help much Stellarium’s problems with the limited options for user interactions available to plug-ins.

The code is here:

https://code.launchpad.net/~daggerstab/stellarium/plugins-gui-improvement

Did I mention that this was supposed to be quick project before I continued my work on other stuff, such as telescope control? I’ve been sitting on some ASCOM and INDI code for long enough to forget what needs to be done with it.

Posted in Plug-ins, Programming, Screenshots, Stellarium | 2 Comments

Stellarium – you’re using it wrong: Comets and asteroids

I occasionally search for Stellarium in Google when I’m bored. It’s a good way to find out what good (or bad) things software reviewers are saying about Stellarium (and sometimes about me). It’s also a good way to catch bugs that haven’t been reported to Stellarium’s bug tracker.

Some of the stuff I come upon during these vanity searches is rather amusing, though. A recent example is a series of videos on YouTube that convinced me that I need to explain how Stellarium handles comets and asteroids and how the Solar System Editor plug-in works. I’m going to discuss the videos themselves after the explanation.

All of this applies to Stellarium 0.11.0, released in July 2011. Some parts of the description may no longer apply to future versions.

First, let’s make something extremely clear. Stellarium is a simulation. It is based on mathematical modelling. It can’t display an object that is not in its databases, and its databases don’t contain all objects that exist or even all that are known. This applies to stars, Solar System objects, nebulae, satellites, etc.

Stellarium’s database of Solar System objects is kept in the ssystem.ini file. It’s a plain text file, so you can open it with something like Notepad++ and look at what data Stellarium is using for a given object. (You may have two copies. The one in your user directory overrides the one in Stellarium’s installation directory.) Indeed, before the introduction of the Solar System Editor plug-in, manually editing that file was the only way to add Solar System objects to Stellarium.

All Solar System objects can be rendered in two ways – as star-like objects with a fuzzy halo and as spheroids wrapped in a texture (an image showing the surface of the body). How a particular body is rendered in any given moment depends on its size and the current FOV/zoom/magnification – when the view is “zoomed out” enough, the object is rendered as a star.

When Solar System objects are rendered as star-like objects (fuzzy blobs), they are treated as stars – their apparent size reflects their current brightness (i.e. apparent magnitude), not the size of the body itself. The size of the fuzzy blobs can be manipulated using the “Absolute scale” and “Relative scale” parameters in the “Sky” tab of the “Sky and viewing options” window.

Stellarium doesn’t render comets realistically – it can’t display they tail and coma. Instead, they look just like the other Solar System objects – star-like if you are zoomed out, textured balls when you zoom in enough. Realistic rendering of comets has been on the wishlist for quite some time now, but no willing OpenGL programmer has stepped forward to do something about it.

The situation is the same with asteroids – they are rendered as balls, instead of irregular lumps.

When you import new bodies with the Solar System Editor plug-in, you pull the information from the website of the Minor Planet Center. They maintain both prepared lists of interesting objects and a search engine, hence the two tabs in the “Import data” window – “Lists” and “Online search”. In both cases, the provided information contains only the object name and/or designation, its current orbital elements and data for predicting its brightness.

All comets and asteroids imported via the Solar System Editor plug-in use the same surface texture – nomap.png. (It is also used with some of Stellarium’s default Solar System bodies when there’s no available surface map of the body, for example for some of the gas giants’ satellites.)

All comets imported via the plug-in get the same radius – 5 km (see lines 518 and 969 in SolarSystemEditor.cpp).

All asteroids imported via the plug-in have their approximate size calculated from their absolute magnitude with an assumed albedo of 0.15 (see line 737 in SolarSystemEditor.cpp).

For both asteroids and comets imported with the plug-in, the apparent magnitude (brightness) is calculated using simplistic two-parameter models that provide only a crude approximation. Despite the fact that both use “absolute magnitude” and “slope parameter” as parameters, apparent magnitude is calculated in different ways for comets and asteroids.

There are also a few known bugs:

  • Sometimes, when zooming in on a comet or asteroid, both the 3D textured spheroid and the star-like fuzzy blob are visible at the same time, and the star texture is “dancing around” the “solid” spheroid.
  • There is a bug where the value of the epoch of the mean anomaly is off by 0.5 Julian Days, due to faulty parsing of the Julian date value (see bug #836839 in Launchpad). As a result, the orbital elements of bodies imported with the Solar System Editor plug-in are a bit wrong, leading to a slight error in predicted positions. (Adding to the error already introduced by the low precision of the source data, the fact that it uses a fixed epoch that is often not the desired moment and the general inexactness in Stellarium’s comet orbit model.)

All of this should probably go to the Solar System Editor’s page in the Stellarium Wiki when I finally get around to writing it.

The reason for writing all of this is a rather funny series of videos that I found on YouTube yesterday. All of them have been created by a user called J7409 and concern “Comet Elenin”, a comet that has become the center of some rather daft conspiracy theories. (See the article on Comet Elenin in RationalWiki for examples. Or read the readers’ comments on Leonid Elenin’s blog.)

So, I first came upon the “Pictures of Elenin from Nasa Skyview 9-24-11” video, because it contained “stellarium” in its description. My reactions were something like this:

Oh my, another one that thinks that NASA’s SkyView is real-time… (It’s not, it shows images from various surveys created at various points in the past.) Wait, what? Did he just try to measure the comet’s coma by measuring the halo texture in Stellarium? And its “core” by measuring the fictitious spheroid model? Ouch! :shock: :lol:

Looking through the rest of his videos, it seems that he’s been doing it since August (“Elenin Coma and Nuclie Pics Today Thru Oct 16th On Stelluirum Watch How It Gets BIGGER!”). For the record: the “coma” is actually the star texture. Its size reflects only the current brightness of the object. It’s “growing”, because comets becomes brighter the closer they come to the Sun (at least in the simplistic comet brightness model that Stellarium is using). The “nucleus” is actually the default rendering of a Solar System object, with a fictitious radius of 5 km, because the data pulled from the Minor Planet Center’s website doesn’t contain information about its size or its surface features.

Further digging found more fun videos by the same user. In “Elenin Bringing Friends? Maybe? Might Not Be Elenin We Should Be Looking At.” he shows Stellarium screenshots of the comet surrounded by background stars inside the ocular simulation of the Oculars plug-in, and implies that this is some kind of “cluster” surrounding the comet. (I tried to post a comment to that one and it still hasn’t been approved.) But the record for amusingly wrong statements is held by “Elenin WHY Over 2,000 Observations made and only a Few Used, If Its A Whimpy COMET???”:

  • J7409 notices a bug in Stellarium’s rendering of the comet’s trail. (Kudos for that, I haven’t noticed it.) His assumption? Something is pulling the comet back! *facepalm*
  • According to him, the pixelated orbit line in the orbit visualization applet on the comet’s page in the JPL Small-Body Database browser is evidence for the same. *facepalm* Does he really think that this simple Java applet is some kind of ultra-precise astronomical simulation?
  • He is astonished by the number of observations used to determine the orbit and assumes that they are done by NASA. (This is a common claim in Comet Elenin conspiracy theories.) The observations are actually done by amateur astronomers from all over the world and submitted to the Minor Planet Center. JPL gets them from there, and you can get them too from Comet Elenin’s entry in the MPC Database.
  • After that he misreads the Physical Parameters Table to claim that only 353 of those observations “have been used”. Helloooo? I can haz reading comprehension? First, it’s a separate table from the “Orbit Determination Parameters” box where the 2218 observation is mentioned, and the “353″ figure clearly applies to the row – “comet total magnitude”. (Apparently not all observations contain an estimation of the magnitude, some are just coordinates.) J7409 also ignores that the “from 1786 observations” line two rows below (which applies to “comet nuclear magnitude”).

I am really curious about J7409′s thought process about all of this. Does he realize that Stellarium is a simulation? Where does he think it gets its data? Given the “cluster” and the “orbital pull”, it seems that on some level, there’s the assumption that Stellarium can suck information directly from the fabric of the Universe.

(And I just wrote more than a thousand words mocking some random YouTube teenager. I need to get a life. Though given the amount of crap citing Stellarium in YouTube and elsewhere, I can turn “you are using it wrong” into a regular feature of this blog.)

Posted in Humour, Stellarium | Tagged | 3 Comments

Solar System Editor plug-in: Search inside import lists

Some people mentioned that it is hard to find a specific comet or asteroid in the lists that the Solar System Editor plug-in downloads from the Minor Planet Center website. The lists are indeed long, so today I read up on Qt’s model/view framework and added a search feature that allows filtering the results. It looks like this:

Any other ideas for improvement? (I have some and I’ll be working on them.)

Posted in Plug-ins, Screenshots, Stellarium | Leave a comment

Refraction and extinction support in Stellarium (+ a test build for Windows)

Thanks to Georg Zotti and our Fabien Chéreau, Stellarium now can model atmospheric refraction and extinction. This means that objects in the sky won’t appear where they would appear if the Earth didn’t have an atmosphere and that the Moon will get distorted when it sets. :)

I’ve uploaded a Windows installer of a test build to the usual place:
https://launchpad.net/stellarium/+download
Look for stellarium-bzr4896-win32.exe (or any package with a greater version number).

Now in the “Sky and viewing options window” there’s a small sub-window for setting the temperature, the atmospheric pressure and the extinction coefficient. The information field in the upper right corner has been updated to show two values for some of the coordinates: one for the “geometric”, unaffected by refraction value, and the other for the apparent value. The refraction effect is automatically turned off when the atmosphere is turned off.

Other things that happened meanwhile:

  • A slight re-design of the Search window. Now it has two tabs, one for object search and one for entering coordinates directly. There’s also a “keyboard” for entering Greek letters for Bayer designations. (The old way of doing it by entering the letters’ names still works.) The end result looks awkward to me, but it was even worse before I did some improvements. :)
  • Thanks to Alexander Wolf, now the markers used for the “nebulae” (that is, all the “deep-sky” objects) reflect their type, so it can be determined at a glance, without clicking on the object.
  • Again thanks to Alexander Wolf, there are a few more planetary satellites buzzing around. :) As they use a simple elliptical orbital model, I guess that the data is going to age quickly. There are some new textures, “stolen” from Celestia, but have in mind that some of them contain terrain that has been made up to fill the gaps.

(And if you find this text incoherent, you should have seen the first draft…)

Posted in Stellarium, Test builds | Leave a comment

Coding postponed…

I was going to spend some time writing code (including some dealing with claims about Comet Elenin), but it’s sunny outside for the first time in weeks. So: instead of lowering the blinds to get the sun out, I’ll get out to get some sun.

Posted in Uncategorized | Leave a comment

(Lack of) Progress Report

What I’ve been (not) working on recently:

  • It turns out that Stellarium’s Time Zone plug-in doesn’t work as advertised – the user-defined time zones are not saved to the configuration file. When I looked at the source code, it turned out that the function that should do it is not broken, but missing. I vaguely recall that this feature was not ready and the interface was supposed to be hidden, but it seems that in the rush around making the release I had forgotten to do it. I’ve opened a bug report and I’ll probably work on it this evening.
  • The Telescope Control plug-in is hanging as Damocles’ sword over my head. I tried to implement a Qt-based client for the INDI wire protocol instead of using the one included in the INDI library. It turned out to be harder than expected. One of the main reasons is that INDI is not “pure” (well-formed) XML, so Qt’s XML handling mechanisms have to be convinced to handle it. After it turned out that my initial approach doesn’t handle well partial messages, I started a rewrite of the client. I feel bad about the whole mess, which doesn’t affect well my productivity.
  • I still need to finish the Solar System editor plug-in. It’s supposed to allow editing all the data about a Solar System object from the GUI.
  • Somewhat more pressing issue is the fact that the Minor Planet Center changed the server that provides the online search feature in that plug-in. As a result, everyone trying to search for objects with Stellarium 0.10.6 gets a “page not found” message. There is a workaround, but I need to write how to do it. There’s also a test build for Windows with the correct server address in the usual place (stellarium-bzr4875-win32.exe or later version). A long term solution is necessary and someone (Timothy Reaves?) suggested using some kind of redirect from the website. So far I’ve only drafted a Blueprint.

There’s also a ton of stuff I am doing or should be doing besides writing code for Stellarium. :(

Posted in Stellarium | 2 Comments

ASCOM

What I was doing before holidays and relatives claimed my time in front of the computer:

Selecting a device with the ASCOM chooser

Second ASCOM experiment in Stellarium - using the telescope simulator

Using the telescope simulator

Posted in Screenshots, Stellarium | Tagged | 2 Comments

Stellarium 0.10.6 has been released

The latest stable version of Stellarium, 0.10.6, has been released.
Quote from stellarium.org:

The Stellarium development team is proud to announce
the release of version 0.10.6 of Stellarium.

This release brings some interesting new features:
- New feature for installing landscapes from
ZIP archives.
- New plugin: Solar System editor.
- New plugin: Time Zone manual override.
- Oculars plugin: customizable keyboard
shortcuts.
- Satellites plugin: added new orbit prediction
engine w/ orbits.
- Satellites plugin: can now update TLEs from
a local file.
- Telescope control plugin: added manual equinox
/ epoch override.

There have also been a large number of bug fixes
and some performance improvements.

New users will find that some plugins have been
enabled by default. Computers where an older
version of Stellarium has been run will continue
with the old settings unless defaults are reset.

An installer for Windows can be downloaded from the usual place on the website.

The build for Mac OS X will be a little late. For now, a pre-release build can be downloaded from the usual place on the website.

Packages for Ubuntu Lucid Lynx (10.04) and Maverick Meerkat (10.10) are available from Stellarium’s Launchpad PPA (Personal Package Archive):
https://launchpad.net/~stellarium/+archive/stellarium-releases

Actually, it is not necessary to visit the website. The PPA can be added to Ubuntu’s software sources in the Software Center or the Synaptic package manager:

ppa:stellarium/stellarium-releases

It also can be added by running these two commands in a terminal:

sudo add-apt-repository ppa:stellarium/stellarium-releases
sudo apt-get update

After that, Stellarium can be installed from the Software Center, Synaptic or the command line.

Posted in Stellarium | Leave a comment

Pre-release test build of Stellarium 0.10.6

After unpleasant past experiences, the team decided to stop new developments in the code* two weeks before the release and make a test build, so that the translators and testers can have a go at it.

(* We are supposed to be committing only bug fixes after that, but, as someone noticed, “One man’s bug fix is another man’s new feature.”)

Matthew Gates has written a description (with many screenshots) of what is new in Stellarium 0.10.6. So, the only thing left for me is to post links to the test packages I made.

Windows

A test package for Windows can be downloaded from here:
https://launchpad.net/stellarium/+download
(look for stellarium-0.10.6-beta-1-win32.exe)

Ubuntu

There is also a PPA (Personal Package Archive) at Launchpad with .deb packages for Ubuntu Lucid Lynx (10.04) and Maverick Meerkat (10.10):
https://launchpad.net/~stellarium/+archive/stellarium-testing/
Visiting that page is actually not necessary: all you have to do is to add this to your software sources:

ppa:stellarium/stellarium-testing

You can do it in the Software Center, the Synaptic package manager, or by opening a terminal and running these commands:

sudo add-apt-repository ppa:stellarium/stellarium-testing
sudo apt-get update
Posted in Stellarium, Test builds | 1 Comment