Friday, March 16, 2007

The Random Walk

Like a photon in the Sun, sometimes my programming follows a random path toward completion. My work becomes parenthetical, where I start one thing, which leads to a change to something else, which then leads to some inspiration to fix it for the better, which reminds me of something I always wanted to do, which in turn leads me further away from the task I began, and so on. My great fear is that I'll get caught up so far away from where I started that I won't be able to find my way back, or even if I do, I'll have lost the inspiration that was driving the original project. Yet somehow I always find my way back and I always rediscover the inspiration, although is some cases it was years later! But most importantly, I have learned to trust these detours, because I have never followed one that I would later regret; in every instance they have made SkyTools better.

Recently I started on the last major piece of SkyTools 3 that had yet to be written. It's what I call a Context Viewer. This is a chart window that is attached to the Interactive Atlas, as a sort of pop up. This window will display an eyepiece view for the selected telescope and eyepiece combination. An indicator appears on the Atlas that you can drag around to position the eyepiece view. It will also support cameras. Building this window might seem like a big project, but in fact I can borrow code from elsewhere (primarily the new Thumbnail viewer--but I'll save that one for another time). It's really just a matter of copying and pasting code and then making some modifications, something I find simple, yet tedious.

One morning I got to work and simply couldn't bring myself to continue on it. This happens from time to time, and I know I'll spend the rest of the day staring out the Window or posting to Usenet if I don't give in and find something more appealing to do.

I'd been copying a code snippet from the Chart Controls dialog when I had one of those crazy ideas. Could we just get rid of that dialog entirely? I had a look: sure enough, the only controls that were not already on the charts were the coordinate system and map projection used by the Interactive Atlas. I realized they could be moved to the tool bar. The scenario selection is also stored there, and I briefly considered removing it, but decided to move it to the tool bar as well.

Moving these little-used controls to the tool bar was one of those small changes that was at the same time rather dramatic, and I was pleased by the result. Now more prominent, I think they will get much more use. It seemed like this would also be a good opportunity to add the galactic coordinate system as planned. Of course, once I had the selection labeled "Galactic Coordinates" in the Combo Box, I needed to actually add this coordinate transform to the mapping code! While doing that I realized that I should also have galactic coordinates as a grid selection. While adding them to the grid I remembered a question someone asked on a forum about software that could display what was below the horizon. I had the sudden realization that I should split the horizon coordinate mode into two modes; one that displays simple horizon coordinates (and extends below the horizon) and one that simulates the sky with extinction, refraction, etc. So I did that. But I also needed to make changes in the horizon line... and of course I promised to add a meridian and ecliptic, and I should probably plot more "cardinal points" such as the Galactic Poles and Galactic center.

Somewhere in there I discovered that in the simulation horizon mode my new shaded sky no longer matched up with the horizon as drawn. So off I went to my new sky shading module. It took a full day to straighten that out!

And what was I supposed to be working on again?

Next time: how all this led to a breakthrough in object trail labels!

3 comments:

Unknown said...

Welcome to the blog-o-sphere Greg.

Let's just hope ST3 doesn't take as long as the aforementioned photon migration.. :D

Skyhound said...

Hi John. I think it already has!

murison said...

> Hi John. I think it already has!

Egads, a million years!? I certainly hope not!