Time Series
Welcome to the time series visualization module!
In this module, we'll dive into the world of time-series visualizations, where we can create stunning and informative graphics that demonstrate how our Earth is changing over time. By learning how to create these visualizations, we can better understand trends, but it's not just about snazzy pictures. We'll also explore how to interpret the results and make sense of the images we've created. Critical thinking ensures that our analyses are both accurate and meaningful.
“Time is a waste of money.”
Time series analysis with nighttime lights (NTL)
Nighttime lighting data is often used as a proxy for GDP calculations and determining a community's access to telecommunications, electricity, and other infrastructure. Nighttime lights can even be used to detect squid fishing and oil extraction (see the example)! Think: how can you use nighttime lights in your project?
The global nighttime lights image represents the average brightness of nighttime lights at each pixel for a calendar year. Night blankets the entire planet in darkness. There are no clouds. In the “stable lights” band, there are no ephemeral sources of light. Lightning strikes, wildfires, and other transient lights have been removed. It is a layer that aims to answer one question about our planet at one point in time: In 1993, how bright were Earth’s stable, artificial sources of light?
Please look at the metadata that we printed to the Console panel. You should see that the image consists of four bands. The code selects the “stable_lights” band to display as a layer to the map. The range of values for display (0–63) represent the minimum and maximum pixel values in this image. As mentioned earlier, you can find this range in the Earth Engine Data Datalog or with other Earth Engine methods.
Abstract RGB composites
Remember composites? Now we will use an additive color system to make an RGB composite that compares stable nighttime lights at three different slices of time.
var lights93 = ee.Image('NOAA/DMSP-OLS/NIGHTTIME_LIGHTS/F101993'); print('Nighttime lights',lights93); Map.addLayer( lights93, { bands: ['stable_lights'], min: 0, max: 63 }, 'Lights 1993');
NTL time series code exercise
For this exercise, we’ll use data from DMSP-OLS Nighttime Lights dataset
var lights03 = ee.Image('NOAA/DMSP-OLS/NIGHTTIME_LIGHTS/F152003') .select('stable_lights').rename('2003'); var lights13 = ee.Image('NOAA/DMSP-OLS/NIGHTTIME_LIGHTS/F182013') .select('stable_lights').rename('2013'); var changeImage = lights13.addBands(lights03).addBands(lights93.select('stable_lights').rename('1993')); print('change image', changeImage); Map.addLayer( changeImage, { min: 0, max: 63 }, 'Change composite'); Map.setCenter(-43.197, -22.908,7);
This code creates two new images, each representing a different slice of time (2003 and 2013). For both, we use the select method to select a band (“stable_lights”) and the rename method to change the band name to indicate the year it represents.
Next, the code uses the addBands method to create a new, three-band image that we name “changeImage”. It does this by taking one image (lights13) as the first band, using another image (lights03) as the second band, and the lights93 image (which we created earlier) as the third band. The third band is given the name “1993” as it is placed into the image.
Finally, the code prints metadata to the Console and adds the layer to the map as an RGB composite using Map.addLayer. If you look at the printed metadata, you should see under the label “change image” that our image is composed of three bands, with each band named after a year. You should also notice the order of the bands in the image: 2013 (red), 2003 (green), 1993 (blue).
The Map.setCenter is also a useful way to automatically pan and zoom your map to a specified point. (Inputs: longitude, latitude, zoom). Here, we are centering on Rio de Janeiro, Brazil.
Interpreting results
We can now read the colors displayed on the layer to interpret different kinds of changes in nighttime lights across the planet over two decades. Pixels that appear white have high brightness in all three years. You can use the Inspector panel to confirm this. Click on the Inspector panel to change the cursor to a crosshair and then click on a pixel that appears white. Look under the Pixel category of the Inspector panel for the “Change composite” layer. The pixel value for each band should be high (at or near 63, which is our max value. The max value is specified in the information box of the dataset which we can simply find using the search bar).
Many clumps of white pixels represent urban cores. If you zoom into Rio de Janeiro, you will notice that the periphery of the white-colored core appears yellowish and the terminal edges appear reddish. Based on the code you wrote, how do you interpret this? Remember, we created a composite to display newer light presence as red.
In order to explore the change composite layer more efficiently, use the Layer manager panel to uncheck all of the layers except for “Change composite.” Now the map will respond faster when you zoom and pan because it will only refresh the single displayed shown layer.
In addition to urban change, the layer also shows changes in resource extraction activities that produce bright lights. Often, these activities produce lights that are stable over the span of a year, but are not sustained over the span of a decade or more.
For example, off the coast of Rio, you can see geographic shifts in oil rigs that generate bright lights in the empty ocean. Notice that blue pixels are closer to the shore, while green and red are further and further to sea. What does this say about oil resource extraction/depletion over time?
Additionally, pan to over to the Korea Strait (between South Korea and Japan), you can see geographic shifts of fishing fleets that use bright halogen lights to attract squid and other sea creatures towards the water surface and into their nets. Bluish pixels were likely fished more heavily in 1993 and became used less frequently by 2003, while greenish pixels were likely fished more heavily in 2003 and less frequently by 2013
Similarly, fossil fuel extraction produces nighttime lights through gas flaring. If you pan to North America, red blobs in Alberta and North Dakota and a red swath in southeastern Texas all represent places where oil and gas extraction were absent in 1993 and 2003 but booming by 2013.
Pan over to the Persian Gulf and you will see changes that look like holiday lights with dots of white, red, green, and blue appearing near each other; these distinguish stable and shifting locations of oil production
The images below show what you should see in the Korea Strait (left), North America (middle), and the Persian Gulf (right)
Recap
Here’s what we learned in this training:
We created a time-series visualization, using an RGB composite
We learned the importance of interpreting results and to critically think about what our code is outputting visually
New code elements:
In the EE.Image function, we can use .select to choose the specific band we want and .rename to choose an intuitive name for our satellite image
We can create a composite variable using .addBands
We can use Map.setCenter to conveniently center our map on a geographical point of interest