Cookies and Capacitors

Tracking countries' energy consumption via nocturnal satellite imagery

Sat, Jan 4, 2014 at 6:34PM

It’s a Saturday night, and I’m sitting here looking at the new OS X Maps application. Suddenly, I zoom out – whoa, they show real-time daylight on the Earth! Oh, look how bright America is. They must consume a lot more energy than all the African countries combined.

What if…we could measure the brightness of each country, and compare that with their actual energy consumption?

We totally can. (inhale)

First, we need to find a night-time picture of the Earth. A quick Google search, and we find this:


Shown below is a famous NASA image that is often called a “satellite photo of earth at night”. It isn’t really a “photo”. Instead it is an image that was compiled using data from a sensor aboard the NASA-NOAA Suomi National Polar-orbiting Partnership satellite launched in 2011. This sensor allows researchers to observe Earth’s atmosphere and surface during nighttime hours. It is a map of the location of lights on Earth’s surface. Each white dot on the map represents the light of a city, fire, ship at sea, oil well flare or other light source. The full-earth image is shown below along with detail images of especially interesting locations.

Satellite view of Earth at night

If you look closely, you can see there is terrain that is illuminated by ambient light. Also, the darkest spots are actually dark blue, so we’ll need to normalize it. Lucky for us, it’s super easy. Just open the picture in Pixelmator, and apply a threshold filter. You’ll get something like the picture below.

Normalized map

Let’s start measuring how bright each country is. I’m using the polygonal lasso tool to roughly cut them out. Here’s America, Mexico, and Austrailia.




The brightness can be measured by counting the percentage of white pixels to black pixels.