Lab 1 - Intro To Remote Sensing and EE
Lab 1 - Intro To Remote Sensing and EE
Prerequisites: If you are new to JavaScript or programming, go through this guide. Review the
Earth Engine Code Editor doc and the Get Started guide.
a. Search for 'San Francisco' in the playground search bar and click the result to pan and
zoom the map to San Francisco.
b. Use the geometry tools to make a point in San Francisco (Exit the drawing tool when
you're finished). Name the resultant import 'point' by clicking on the import name
('geometry' by default).
c. Search for 'landsat 8 raw' and import the 'USGS Landsat 8 Collection 1 Tier 1 Raw
Scenes' ImageCollection. Name the import 'landsat'.
d. Filter the ImageCollection by date and location, sort by a metadata property called
'CLOUD_COVER' and get the first image out of this sorted collection:
e. The variable image now stores a reference to an object of type ee.Image. Display a
human-readable representation of the image by printing it to the console:
f. Activate the Console and observe that after the descriptive text, an object is displayed.
Expand and explore the object by clicking the little triangle (►) next to the image name to
see more information stored in that object. Specifically, expand properties and inspect
the long list of metadata items stored as properties of the image. This is where that
CLOUD_COVER property you just used is stored.
g. Note that there are band specific coefficients (RADIANCE_ADD_*, RADIANCE_MULT_* where
* is a band name) in the metadata for converting from the digital number (DN) stored by
the image into physical units of radiance. These coefficients will be useful in later
exercises.
a. Add the image found in exercise 1 to the map display with the following code:
b. Observe that this Image is displayed according to the visualization instructions in the
trueColor dictionary object. Specifically, bands is a list of three bands to display as red,
green and blue, respectively (first band is red, second is green, third is blue). To
understand where these band names come from, inspect the bands property of the image
in the Console. To understand how to match bands to colors, see this helpful page and
this one.
c. There is more than one way to discover the appropriate min and max values to display.
Try going to the Inspector tab and clicking somewhere on the map. Note that value in
each band, in the pixel where you clicked, is displayed as a list in the Inspector. Try
clicking on dark and bright objects to get a sense of the range of pixel values. Also note
that the layer manager in the upper right of the map display lets you automatically
compute a linear stretch based on the pixels in the map display.
d. Define a new set of visualization parameters and use them to add the image to the map
0as a false-color composite. This particular set of bands results in a color-IR composite
because the near infra-red (NIR) band is set to red:
e. Try playing with band combinations, min and max DNs to achieve different visualizations.
Note that you can compare the displays by toggling layers on and off with the layer
manager.
L𝝀 = a𝝀*DN𝝀 + b𝝀 (1)
Note that every term is indexed by lamda (𝝀, the symbol for wavelength) because the coefficients
are different in each band. See Chander et al. (2009) for details on this linear transformation
between DN and radiance. In this exercise, you will generate a radiance image and examine the
differences in radiance from different targets.
a. Perform the transformation in equation 1 using the Earth Engine function for converting
Landsat imagery to radiance in Watts/m2/sr/𝝁m. It will automatically look up the right
metadata values for each band and apply the equation for you:
Note that this code applies the transformation to a subset of bands (specified by a list of band
names) obtained from the image using select(). That is to facilitate interpretation of the
radiance spectrum by removing the panchromatic band ('B8'), an atmospheric absorption band
('B9') and the QA band ('BQA'). Also note that the visualization parameters are different to
account for the radiance units.
b. Inspect the radiance image by activating the Inspector and clicking locations on the map.
(It may be easier if you turn off the other images you're displaying by commenting
Map.addLayer() lines from previous exercises. Comment a line with the Ctrl-/ shortcut or
two forward slashes at the start of the line). Click on different land cover types and in the
Inspector, and click the chart icon ( ) to get a chart of the pixel values. If the shape of
the chart resembles Figure 1, that's because the radiance (in bands 1-7) is mostly
reflected solar irradiance. The radiance detected in bands 10-11 is thermal, and is
emitted (not reflected) from the surface.
Figure 1. Solar irradiance. Data sources: 6000 K blackbody spectrum from
http://astrogeology.usgs.gov/tools/thermal-radiance-calculator, adjusted according to the solid angle
subtended by the solar disk. TOA and sea level irradiance from http://rredc.nrel.gov/solar/spectra/am1.5/.
b. Since reflectance is a unitless ratio in [0, 1], change the visualization parameters to
correctly display the TOA data:
c. Using the Inspector, click several locations on the map and examine the resultant
spectra. It should be apparent, especially if you chart the spectra, that the scale of pixel
values in different bands is drastically different. Specifically, bands 10-11 are not in [0, 1].
The reason is that these are thermal bands, and are converted to brightness temperature,
in Kelvin, as part of the TOA conversion. Very little radiance is reflected in this wavelength
range; most is emitted from the Earth's surface. That emitted radiance can be used to
estimate brightness temperature, using the inverted Planck equation. Examine the
temperature of various locations. Now add this command to the TOA image before adding
it to the map to get only bands 1-9: .select('B([0-9])').
d. To make plots of reflectance, select the reflective bands from the TOA image and use the
Earth Engine charting API. To see a customized chart of reflectance at a point in Golden
Gate Park, use:
// Define reflective bands as bands B1-B7. See the docs for slice().
var reflectiveBands = bands.slice(0, 7);
// See http://landsat.usgs.gov/band_designations_landsat_satellites.php
var wavelengths = [0.44, 0.48, 0.56, 0.65, 0.86, 1.61, 2.2];
There are several new methods in this code. The Point constructor takes a list of coordinates as
input, as an alternative to a "hand-made" point from the geometry drawing tools that is imported to
the script. The slice() method gets entries in a list based on starting and ending indices.
Search the docs (on the Docs tab) for 'slice' to find other places this method can be used.
Construction of the chart is handled by an object of customization parameters (learn more about
customizing charts) passed to Chart.image.regions().
a. To explore Landsat surface reflectance data, search 'Landsat 8 surface reflectance' and
import the 'USGS Landsat 8 Surface Reflectance Tier 1' ImageCollection. Name the
import sr. Filter to the same date, location and cloudiness as with the raw and TOA
collections and get the first image.
b. When you add this to the map, you will need to scale the imagery or change the
visualization parameters. Why? Read the dataset description to find out. What is the
scale factor for bands 1-9?
7. Assignment
1. In your code, set the value of a variable called azimuth to the solar azimuth of the image from
1d. Do not hardcode the number. Use get(). Print the result.
2. Add a layer to the map in which the image from 1d is displayed with band 7 set to red, band 5
set to green and band 3 set to blue. Name the layer falsecolor.
3. What is the brightness temperature of the golden gate park point? Make a variable in your
code called temperature and set it to the band 10 brightness temperature. Hint:
4. What is the surface reflectance (in [0,1], meaning you will need to apply the scale factor) in
band 5 (NIR) at the golden gate park point? Make a variable in your code called reflectance
that stores this value.
This work is licensed under a Creative Commons Attribution 4.0 International License.