My Google Health Profile

Last week someone sent me word about a new service from Google called Google Health. I'm sure a lot of folks are rightfully a bit dubious about this service, but luckily their privacy policy is pretty clear about how they share your data (it appears they won't, basically). So hopefully they'll follow that policy and folks will find it to be a valuable service.

One has to wonder, of course, what is their angle? Google is first and foremost an advertising company. Search and data analytics is just a means to this end. So are they planning on flashing ads about Paxil to folks who suffer from depression? Probably.

In any case, check it out and see what interesting things you can do with your medical history. The Internet is a great place to reinvent yourself - for example, according to Google, I'm now officially a 30-year old dwarf with a severe allergy to cabbage juice.

SambaXP 2008

This last April I had the opportunity to attend SambaXP in Göttingen Germany. This was my first time in Germany, and I have to say I like the place a lot. Unfortunately, I didn't have a whole lot of time to explore. I spent most of the time in Göttingen where the conference was. But that, too, was a nice place to visit. I just wish I spoke any German at all.

I flew into Copenhagen, Denmark (btw, business class RULES), and then hopped over to Hamburg. From there it was about a two-hour train ride down to Göttingen. Pretty easy overall, even for a sleep deprived traveler like me.

SambaXP was just great. Microsoft was there in force, with engineers and architects to meet and exchange information with the Samba team. I felt I was watching a bit of history as Andrew Tridgell of the Samba team asked the Microsoft employees in the audience to stand up, and be recognized. That was nice. Microsoft has gone beyond what any regulatory agency has asked. The Samba Team (and the world) now has open access to 30,000+ pages of documentation and new friends in Microsoft with which to collaborate.

Anyway, enough preaching. Here are a couple photographs I took at Germany. I actually didn't take all that many, unfortunately.

Train station in Hamburg, Germany

Germany at ~120MPH

I've Arrived!

My Job

I find it's sometimes difficult to explain my job to my friends and family. For the past three years I've worked at the Open Source Software Lab (OSSL) at Microsoft. Most of my family members don't really know what open source is, and even fewer know why Microsoft has such a lab. I'm afraid it would take quite some time to explain all the details. But for those who are curious about where I work and what I do, I wrote a short article on about the OSSL called Inside the OSS Lab.

Port25 also has many other articles that might shed a bit more light on the OSSL.

Space Weather Archive

Many folks may not know that I'm a bit of a fan of space weather. I've spent a considerable amount of my nerdy free time digging through the archives at the Space Weather Prediction Center (formerly the Space Environment Center) website. The SWPC is a division of NOAA, and is responsible for collecting data and monitoring events related to space weather. This includes monitoring changes in the Earth's geomagnetic field, and collecting data about particle and electromagnetic radiation (such as x-rays) that are constantly being hurled at us by the Sun.

The SWPC utilizes data from ground stations, as well as a number of satellites, particularly the GOES satellites, to collect and archive space weather data. This information is then used to assist in predicting space weather, and alerting the world to significant space weather events such geomagnetic or solar radiation storms. The SWPC website includes an education section for those interested in learning all about space weather.

Well, enough about that. In this blog I wanted to write about a web-based application called the Space Weather Archive that I built to assist myself and others in easily accessing historical space weather information. The application is available here, and is free for anyone to use. The archive goes as far back as 1996, primarily because that's when the archive on the SWPC FTP archive begins :)

Usage of the tool is fairly straight forward. Simply input a date and click "Submit". The result will include both geomagnetic and x-ray data, as well as links to the actual data and plots from the SWPC archive. Once caveat is that the data for a particular day will not be available until the following day. This is because the SWPC compiles the data and generates a summary file once per day (for the previous day's data), which we use to retrieve some of our information.

There are also other methods we can use to query the Space Weather Archive using a GET request, and passing arguments so that it returns plain text data. This would be possibly be useful to those interested in querying the archive from within their own applications. But before I get into that, I want to write a bit more about the data from which this data is mined.

The SWPC archive is available via FTP, but probably more conveniently over the web at If you explore the archive you can see that there is A LOT of data there. I myself spent many hours in here looking for the correct data I wanted to study. The archive includes both text files with columns of data, as well as plots in .gif format. Older data is stored in what they call the warehouse. Folks wanting to access data more than a year or so old will need to look in here.

Much of the data from previous years is compressed as .tar.gz files, which makes it a bit more difficult to immediately access. They tend to do this around the first week of January. For this reason the Space Weather Archive I built actually pulls data from my own mirror that contains the uncompressed archives. This just makes sense anyway. It's faster and easier on the SWPC website.

So I mentioned earlier that we can also query the Space Weather Archive using just a standard GET request. To do this one must simply pass the year, month and day to the application in the URL:

The format=0 portion tells the Space Weather Archive to output the data in text format, rather than the default HTML. The output of the above URL looks like the following:

Date: 2008-05-04

Geomagnetic Kp: 1:2:3:3:1:2:2:2
Geomagnetic Ap: 8
Geomagnetic Summary: Semi-Quiet
Geomagnetic List:
Geomagnetic Plot:

Xray (1.0-8.0 Ang): 3.7300e-09 W/m^2
Xray (0.5-3.0 Ang): 5.3916e-09 W/m^2
Xray High: 9.5000e-09 W/m^2
Xray Low: 3.7300e-09 W/m^2
Xray Peak: Normal
Xray Summary: <B Class (Normal)
Xray List:
Xray Plot:

Thats it! The information includes x-ray and geomagnetic data for that particular day, including links to the actual data files and plots. The output format should make important and parsing into another application relatively easy.

I hope you find this data as interesting as I do. If you do end up using the Space Weather Archive for your own application, please feel free to drop me an email and let me know :)

Calculate Moon Phase Data with PHP

While developing ParaDB, I wanted to be able to calculate the phase of the moon given an arbitrary date and time. The only PHP software I found for this was the moon-phase class available from In my tests, however, I found it to be a bit less accurate than an equivalent Perl module I had used in the past called Astro::MoonPhase. So, I went ahead and just translated the Perl module to PHP.

The PHP version can be downloaded here. Feel free to expand on it, or rewrite it as a PHP class. If you use it in anything interesting, please let me know :)


The PHP moonphase functions work much like their Perl counterparts. Below is sample code returning a number of variables. This should be pretty familiar to those who have used the Astro::MoonPhase module:

require( '/2008/05/' );

$date = '2008-05-05';
$time = '20:36:00';
$tzone = 'PST';

// Usage: $data = phase( seconds_since_1970 );
$moondata = phase(strtotime($date . ' ' . $time . ' ' . $tzone));

$MoonPhase = $moondata[0];
$MoonIllum = $moondata[1];
$MoonAge = $moondata[2];
$MoonDist = $moondata[3];
$MoonAng = $moondata[4];
$SunDist = $moondata[5];
$SunAng = $moondata[6];

To add to this example, you could then translate the phase into an easy-to-read format:

$phase = 'Waxing';
if ( $MoonAge > SYNMONTH/2 ) {
$phase = 'Waning';
print "$phase\n";

You could even make this a bit more useful by using $MoonIllum:

// Convert $MoonIllum to percent and round to whole percent.
$MoonIllum = round( $MoonIllum, 2 );
$MoonIllum *= 100;
if ( $MoonIllum == 0 ) {
$phase = "New Moon";
if ( $MoonIllum == 100 ) {
$phase = "Full Moon";

print "Moon Phase: $phase\n";
print "Percent Illuminated: $MoonIllum%\n";

More information can also be found with the Astro::MoonPhase documentation. -- Moonphase Functions
moonphase.php -- Sample Code

That's it, enjoy :)

Update: This script is now available as a PHP class.