sssssTrying to figure out if there is an aurora, and if it can be photographed, really requires looking at some different kinds of data. One is the earth’s magnetosphere; how disturbed is it? That’s what causes auroras. That information has to be obtained from the GOES satellites, or magnetometers on the ground (I find the satellites to be a better indicator.) Another is the weather – if it’s cloudy, give up now. Then visibility comes into play – fog will kill the opportunity just as quickly as clouds. You can get that from NOAA (or whoever is your local weather provider if you’re not in the US.) But what if the moon is above the horizon? That’ll kill it too, at least, if the moon is showing any significant crescent. And of course, along those same lines, the sun has to be below the horizon. The moon and sun information can be calculated.

After repeatedly looking all this stuff up, and occasionally forgetting an important issue (like, is it cloudy?) before I drove out to my dark viewing area with my camera gear, I finally decided to pull all the information together into one handy place. And here it is, sized to fit on my iPod’s display, too. Further, since all the data is in one place, I have the underlying engine SMS me if conditions are right for an aurora; also, as long as I keep a browser open to the page, the page auto-refreshes.

The underlying processes keep an eye on things for me, updating their snapshots of satellite data and weather and lunar and solar states every five minutes. So I can be out and about, and if things look hot, I’ll get a text message on my cellphone. How cool is that?

Well, that’s a lot of Python code. I’m going to the source of the satellite data, and retrieving the last two hours of one-minute interval magnetometer data and then generating the graph using the PIL Python package; to NOAA, and grabbing cloud, temperature, relative humidity and visibility; and using the ephem Python package to calculate the moon and sun data, then if it seems reasonable to do so, prodding myself via SMS.

Anyway, it was a fun project, and I thought I’d share both the results, and describe what went into it. The results, unfortunately, are primarily useful to myself and anyone else local to my area; if you’re somewhere else, the sun, moon, and weather data are all wrong. Sorry about that, but that’s the nature of the pursuit.

As far as sharing the code goes… I’d have to clean it up a bit, as it is, it reveals a little more about my server internals than I’m comfortable making public – but if you’re interested, let me know (use the comments) and we’ll see what we can come up with.