Mars Global Surveyor: MEGDR Viewer // ver B

My Mars topography mine Their Mars topography theirs
download the sketch folder—view the code

How do you use it?
You have to tinker directly with the code to make this do anything.
This one doesn’t run in continuous mode and it isn’t interactive so there is no link to run it in the browser. Also, it processes a 2MB data file so it would be ridiculously slow to download an run it as an applet.

What is it?
As I mentioned yesterday, I’m geeking-out about Mars right now. I was surfing around some NASA and JPL web sites looking for more digital elevation maps and found a lot of data from the Mars Orbiter Laser Altimeter. This is an instrument on the Mars Global Surveyor craft that mapped the Red Planet from 1999 to 2006. Unlike the false-color topographic map I used in yesterday’s sketch, these new files I found are NOT images. They are data files that need to be rendered into images with special visualization software. Unfortunately—or perhaps, fortunately—I couldn’t find an OS X version of any of these software packages. So I thought (encouraged by Ben Fry’s Visualizing Data book), “I bet I can write something in Processing that could view these files.” Well, it’s been a long night, I’m not sure exactly how it works, and it sure ain’t perfect, but I’ve got something. The sketch reads the altitude data from the .img files, parses that into the pixel array and displays the resulting image.

If you run this yourself, be prepared, the image size is 1440 x 720 pixels.

Why is it cool?
There are so many reasons… but one thing that really shocked me is that it’s only 9 lines of code.

One Response to “Mars Global Surveyor: MEGDR Viewer // ver B”

  1. P{three-sixty}5 » Blog Archive » Mars Global Surveyor: MEGDR Viewer // ver C Says:

    [...] What is it? This is an interactive version of Monday’s sketch. It’s another attempt at rendering an image from a Mars Orbiter Laser Altimetry data file. It’s also confounding, infuriating, and not working. I can’t quite get my head wrapped around the bitwise operations and the bitmasking. It’s getting a wider range of colors, and it’s revealing more detail in the image, but I don’t understand why the colors aren’t smooth. [...]