- The world is more than what Tclworld
shows (which is planet Earth in a dual-hemisphere view). Kevin Kenny
brought me to the idea of downloading a star catalogue from ftp://adc.gsfc.nasa.gov/pub/adc/archives/catalogs/5/5050/catalog.dat.gz
which contains a wealth of data on 9100-something celestial bodies, and he challenged me to what he called "TclUniverse", but this time I was more modest and just made it TclStars
. I filtered out the 3147 ones that have names, and for each of them the catalog number, name, DE (declination) and RA (rectascension) position, magnitude and spectrality. (Additional info for the stars is at ftp://adc.gsfc.nasa.gov/pub/adc/archives/catalogs/5/5050/notes.dat.gz
, but I haven't looked at that yet.)
The stars are then rendered on a canvas
, with coordinates computed from DE and RA taken as polar coordinates, and the color derived from magnitude (sort of the inverse brightness - the smaller the mag., the brighter the star - I use colors on a white-yellow-orange-red-brown scale to express ascending magnitude, or descending brightness). The blue circle is the "celestial equator", stars beyond of that are in fact in the opposite hemisphere. Equinoctial
and solstitial colur
(hope I get those terms right - sort of meridians) are the blue lines. The compass directions are displayed, because they differ from the down earth view.
You can zoom in or out with buttons and mouseclicks, change the threshold from which magnitude stars are displayed, or change your hemisphere totally (sort of look up from South Pole instead of from North Pole). When you move the mouse pointer over a star, its data are displayed in the top bar. That's about all - but it took me 6 hours to get the details sort of right. What this demo really shows is again the power of the canvas, that can handle over 3000 objects (mostly ovals) and graciously zoom in and out.
Get TclStars 0.2 as a Starkit
;-) at http://tcl.tk/starkits/stars.kit
. No warranty, but enjoy! What's missing is moving objects like planets or satellites - for this you'd have to calculate trajectories for a given point in time. The present TclStars just shows the fixed stars as of (I suppose) Jan 1, 2000. See TclPlanets
for fast animation ;-)
Thanks to Kevin for supplying me (in the Tcl chatroom
) with the initial knowledge on how to deal with astronomic data (which I had never done before that evening ;-), and of course to Tcl and Tk - I could think of no other language that I would have done this in! Tcl gives you wings to fly!
See also http://starchart.sourceforge.net/
- Arts and crafts of Tcl-Tk programming