Proper use of the “inferno” palette: animating a temperature time series in Earth Engine

Google Earth
Jan 13 · 5 min read

By Justin Braaten, Technical Writer for Earth Engine

Data visualization is as much an art as it is a science. On the Earth Engine team, we feel exceptionally fortunate to work with one of the most inherently beautiful subjects: Earth. Several months ago we announced an exciting new function for Earth Engine that makes quick and easy work of image time series visualization. In this follow-up post, we describe the process of transforming data into stunning animations of Earth, illustrating the beauty and drama in change.

A snapshot of global surface temperature July 2018

The ee.ImageCollection.getVideoThumbURL() function is a bit of Earth Engine magic that generates an animated GIF image from a collection of images on the fly. Since image collections can be composed of lots of different data types, it was designed to be flexible, having few assumptions about input collections. This flexibility provides the perfect opportunity to pick up a digital paint brush and exercise the right hemisphere of your brain. Let’s walk through some simple steps for turning numbers into a ballet of colors.

Southern Ocean hourly modeled surface temperature over five days in July 2018.

Identify a dataset

The first step is to identify a subject. Maybe forest change, deglaciation, or coastal erosion is of interest to you? Ultimately, your decision defines what dataset to work with. Here, we’ll use modeled global surface temperature as it requires no pre-processing, which will allow us to focus on the basic elements of animation composition and styling.

Render default animation

After identifying a dataset, it’s helpful to render a handful of images to see what you’re working with, and determine what changes need to be made. The animation below is the result of simply rendering the first 10 images in our collection, which happens to represent 27 hours of surface temperature starting July 1, 2015. As you can see, the default settings make this data hard to interpret. The biggest issue is that the assignment of colors to numbers is limited to a very small range of the data; inclusive range of 0 to 1, because the input data type is floating point.

Stretch color over a data range

Since temperature has a much greater range than 0°C to 1°C, we need to set the “min” and “max” color stretch parameters to a more realistic range, such as -40°C and 40°C. After rendering the collection with a more appropriate color stretch, we can now distinguish land from water and describe patterns in daily temperature. For instance, it appears that temperatures are generally warmer at latitudes closer to the equator, and that temperature increases over the continents in an east to west fashion as Earth progressively presents new longitudes to the sun on its daily rotation.

Identify your subject

There are many patterns and phenomena that can be described in the animation above. Perhaps the most striking is the intense heat experienced by northern Africa. Let’s focus on relating this story by specifying a bounding box around Africa, and filtering the image collection to the 72 hours surrounding some of the hottest days in July 2018.

Ensure a proper color stretch

In our initial stretch of global temperature, limits were set broadly to accommodate the large range. However, now that we are focusing on Africa, we need to refine the color stretch to better represent its temperature range during the selected dates. After increasing the “min” parameter to 7°C and “max” to 47°C, the contrast is much improved.

Add some color

The best data visualizations offer self-evident interpretation. Without a description, the above animation does not evoke the notion of temperature. One way to do this is to map a color palette to the data that is more representative of temperature. Given the conditions, perhaps the most fitting choice is the “inferno” palette from matplotlib.

Draw attention to your subject

Finally, it is important to highlight your subject by reducing background noise and distractions. In the above animation, it’s hard to distinguish land from ocean. We’re not concerned with ocean temperatures, so let’s clip the image data by Africa’s border.

With a proper stretch, intuitive color palette, and a focus on the subject, this animation pretty well conveys Africa’s temperature dynamics for some of the hottest days in 2018. Notice how temperature increases and decreases throughout each day, watch mesmerizing circulation patterns, and see how the moderating ocean temperatures progressively converge on the country’s interior before the emergence of the sun on the horizon of each new day.

Find more details and code snippets on how to create time series animations in the Earth Engine Developer Guide. We hope you’ll look forward to the next installment in this series, when we’ll demonstrate image overlays and blending, including vector overlay, hillshade, and foreground emphasis.

If you’re interested in exploring other datasets available in Earth Engine, check out the Earth Engine Data Catalog and read about some of its newest additions.

Google Earth and Earth Engine

Google Earth

Written by

The whole world in your browser.

Google Earth and Earth Engine

For developers, scientists, explorers and storytellers

More From Medium

More from Google Earth and Earth Engine

More from Google Earth and Earth Engine

More on Earth Engine from Google Earth and Earth Engine

More on Earth Engine from Google Earth and Earth Engine

How small acts became big movements towards inclusivity

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade