Make Every Week: Selfies from Space

This is a snapshot of my town — taken yesterday.

It is crazy-amazing that I can get an image from space on my computer in damn-near real time.

The camera is Landsat 8, a U.S. Geological Survey satellite with a dozen sensors on it. I got an introduction to using satellite imagery at the NICAR 2015 Conference in Atlanta last week, so I thought I’d give it a whirl for this week’s #MakeEveryWeek.

I wondered if I could see from space the lovely thaw we had the past couple of days, with highs hitting near 60.

It was fortunate timing that on the day I went looking for shots of NYC, Landsat 8 had just passed overhead, which it does every 16 days.

The images below are of Jamaica Bay, near JFK Airport. The one on the left was taken yesterday after some serious warmth. The one on the right is the same spot taken Feb. 24, a day the weather service says a foot of snow was on the ground in Central Park. I haven’t color-balanced the two images, but the February ice on the water is clear (click it to enlarge).

The resolution is pretty amazing. Below is New York Harbor, where you can see wakes of boats and even the Statue of Liberty, on Liberty Island in the lower left.

Getting the data down was easy. Assembling it into images was a little harder.

Step 1: Get the Raw Data

The data is available for free via the Earth Explorer tool, but take a second to register and log in — you need to be logged in to download the big TIFF files you'll need later.

First I entered my zip code and a date range for the last six weeks or so. In the “Data Sets” section, I picked “Landsat Archive” and then “L8 OLI/TIRS.” Then clicked “Results.”

There were the several resulting images, and in this very cool feature you can click on the little “footprint” icon to see the coverage area for the image on the map.

I clicked on the download icon next to the image, and chose to download the “Level 1 GeoTIFF Data Product (721.7 MB),” which is actually a zipped package of about a dozen TIFF files, one for each sensor on the satellite.

Step 2: Installing Some Software

To make this go, I needed to install a couple of software utilities from the command line (using Mac’s Terminal program). This, actually, was the trickiest part — mainly because I ended up in a kind of Russian doll set of nested requirements.

My goal was to install landsat-util, which requires the installer called pip. Landsat-util also requires “GDAL” which needs to be installed with Homebrew. Soooo … the whole shebang works out to be something like this (tho I, alas, didn’t do it in this order initially):

sudo easy_install pip

ruby -e "$(curl -fsSL"

brew install gdal

pip install landsat-util

For what it’s worth, I tried to do this in a python virtual environment and failed miserably. So if you know what that is, you might want to avoid it here.

Step 3: Moving the Files Around

Landsat-util is super cool, but seems to need the TIFF files in particular places — namely a directory called ~/landsat/processed/SUPERLONGLANSATNUMBER. So I first unzipped my downloaded package from Earth Explorer:

tar xvzf LC80130322015071LGN00.tar.gz

Then I moved all of those files from my download directory into the directory where landsat-util works:

mkdir ~/landsat
mkdir ~/landsat/processed
mkdir ~/landsat/processed/LC80130322015071LGN00
cp  LC80130322015071LGN00_*.* ~/landsat/processed/LC80130322015071LGN00

Now I was set.

Step 4: Processing the Image

I actually had to build the image based on three of the 11 sensor files. The most basic, it seems, is using the red, green and blue visible-light sensors (which are sensors 4, 3 and 2) and assign them to the red, green and blue pixels of an image. This makes a “natural color” picture.

There are lots more images you can make, using wavelengths in other bandwidths. A beautiful writeup about that is here. In the end, I used the “natural color” recipe of 4-3-2 and sharpened it with the “panchromatic” option:

landsat process LC80130322015071LGN00 --bands 432 --pansharpen

The entire result is a TIFF image of almost a gigabyte is zipped down to 265MB here.

More to Try

I definitely want to play with more recipe combinations, and I also want to see what I can do with ProPublica’s new utility for making the pictures even prettier.

But this was a fun start!

UPDATE! After talking about this post at WNYC, where I work, Metro Editor David Lewis mentioned it to Matthew Schuerman, who was writing about NYC's Jamaica Bay. A detail I took from the satellite image above ended up running atop the article and was on the WNYC home page the morning it was published.

UPDATE #2! Colleague Jenny Ye discovered a typo, where I had landsat-util as landsat-utils. It's been corrected above. She also notes that you need to register on the USGS site in order to download the TIFF files, which I've now noted, too. Thanks, Jenny!

#MakeEveryWeek is a challenge to myself to do just that for all of 2015. The original post on the idea is here, and the running list of projects so far is here.

4 responses
Very cool! Any idea how far back this information is archived?
Pretty sure there's data going back to the 1970s! Check out the wiki page here: -- John
Hi John, Awesome tutorial, really useful! Just have one question: When you run the "landsat process LC80130322015071LGN00 --bands 432 --pansharpen" command in the terminal, do you then get the final 'natural look' file? As I've given it a go with a different landsat scene and even after the processing it's still v.dark and needs some colour adjusting on photoshop.
The images definitely benefit from some additional Photoshop work. I'm not sure, for example, why two images of the same spot (above) would come out with such different "exposures."