Lab 2: The Cloud Shift

Exploring the Pearl Hill Fire in Google Earth Engine

Author

Dr. Francisco Laso, ESCI 442/542 — Introduction to Remote Sensing

Lab 2 Module II — Transition to Cloud Computing
Readings due before lab: Campbell Ch. 3 — Remote Sensing Platforms (pp. 54–74)  |  Ch. 4 — Digital Mapping Cameras (pp. 77–114)  |  Ch. 5 — Digital Imagery (pp. 115–144)

Background

In Lab 1 you downloaded a Landsat 8 scene from USGS EarthExplorer, stacked the bands in ArcGIS Pro, and built composites by hand — one file, one computer, one location at a time. Every operation depended on data you managed locally.

That workflow taught you what is actually happening inside a satellite image: how digital numbers encode reflected energy across wavelength bands, how placing bands in different color channels reveals different features, and how the same pixel can look completely different depending on which part of the spectrum you choose to display. You learned this by doing it manually, with full awareness of each step.

Now you will do the same things — same fire, same Landsat scene, same composites — in Google Earth Engine. The image stays on Google’s servers. You describe what to do with it in a few lines of JavaScript, and the servers execute that description remotely. Nothing is downloaded.

This shift is not just about convenience. Campbell Ch. 3.5 describes how Landsat’s sun-synchronous orbit and 16-day revisit cycle determine which scenes exist in the archive and when. When you print the Pearl Hill image metadata in GEE today, you will see WRS_PATH: 45 and WRS_ROW: 27 — direct outputs of that orbital design. The reason GEE has exactly one scene from the peak of the fire (October 3, 2020) is the same reason you had only one scene to download from EarthExplorer.

Note

Lab Objectives

By the end of this lab you will be able to:

  1. Navigate the GEE Code Editor and understand the role of its three panels
  2. Load a satellite image from the GEE catalog using ee.Image() and read its metadata from the Console
  3. Explain the difference between select() and the bands display parameter, and why this distinction determines what the Inspector shows
  4. Build true-color, NIR false-color, and SWIR false-color composites using Map.addLayer() with explicit visualization parameters
  5. Use a histogram to choose appropriate display stretch values
  6. Reconstruct a spectral profile from Inspector values and compare it to your Lab 1 spectral signatures
  7. Apply the complete workflow independently to a Sentinel-2 scene, adapting band names and value ranges for a different sensor
Warning

Before You Begin

Make sure you have:

Tip

New to GEE? Start here.

If you have never used Google Earth Engine before, these resources will help you get oriented before the lab begins:


Part 1 — The GEE Code Editor

Open Script L2.0 (Introduction) and L2.1 (JavaScript Basics) in the GEE Code Editor. Your instructor will walk through these during the demo.

The Code Editor has three panels and a map area. Take a moment to orient yourself before running any code.

The Google Earth Engine Code Editor. The left panel contains your Scripts, Assets, and the API Docs reference. The center panel is where you write and run JavaScript — click Run to execute, Save often. The right panel has three tabs: Inspector (click any map location to read pixel values), Console (output from print() appears here), and Tasks (monitor exports). The map panel below displays layers added by Map.addLayer(); use the Layers toggle in the upper right to control visibility.
Note

Script L2.1 covers: JavaScript variables, objects, lists, and the ee.* API. Run each block and confirm Checkpoint L2-CP1 in the Console before continuing.


Part 2 — Loading the Pearl Hill Image

Open Script L2.2 (Loading Images and Metadata).

In Lab 1, opening the Landsat scene meant navigating to a .TIF file on your hard drive and waiting for ArcGIS Pro to read it locally. In GEE, ee.Image() takes the catalog path of the scene and returns a reference to an image stored on Google’s servers. Nothing is transferred to your computer. The variable pearlHill is a pointer to a server-side object, not a local copy of the data.

When you run print(pearlHill), GEE retrieves the image metadata and sends it to the Console. The pixel data stays on the server. Expand the printed output and compare it to what you saw in EarthExplorer before downloading in Lab 1.

Note

Understanding the Landsat catalog path: LANDSAT/LC08/C02/T1_L2

When you search Landsat 8 in the GEE Data Catalog, you will find eight product variants. The path breaks down as:

  • LC08 — Landsat Collection 8 OLI/TIRS sensor
  • C02 — Collection 2, the current reprocessed archive
  • T1 or T2 — Tier 1 or Tier 2, referring to geometric quality only. Tier 1 scenes meet the highest accuracy standard (ground control available, registered to within 12 m) and are required for time-series and change detection work. Tier 2 scenes are used only when a needed scene has no Tier 1 equivalent.
  • L1 or L2 — Level-1 (no atmospheric correction) or Level-2 (surface reflectance). L2 is what you want for all land surface analysis.

We use T1_L2: highest geometric quality, fully atmospherically corrected. The 19 bands in the product are standard for all Landsat C2 L2 scenes — 7 optical SR bands, 1 thermal band, and 11 QA and atmospheric ancillary bands. You will use only SR_B2–SR_B7 in this lab.

Note

Script L2.2 covers: ee.Image(), print(), metadata reading, and the Landsat product tier/level system. Confirm Checkpoint L2-CP2 before continuing.


Part 3 — Single-Band Display and Histograms

Open Script L2.3 (Single-Band Display and Histograms).

Map.addLayer() takes three arguments: the image, a visualization parameters object {bands, min, max}, and a layer name. With a single band, the result is grayscale — values at or below min appear black, values at or above max appear white.

The min and max parameters are a display stretch — exactly the contrast enhancement Campbell describes in Section 5.7. They control what you see on screen but do not alter the pixel values the sensor recorded. In GEE, you make this choice explicitly rather than letting the software decide automatically.

A histogram of pixel values helps you set those bounds deliberately. The script generates one for Band 4 (Red) — locate it in the Console before you continue.

Band 4 (Red) pixel value distribution. Study the shape of this histogram before moving on. Where is the main peak? Is the distribution symmetric or skewed? What might the left-side bars represent versus the right-side tail? The answers will help you understand what you are seeing in the grayscale display and why certain surfaces appear darker or lighter.

Landsat 8 Band 4 (Red) displayed in grayscale. This is the same Pearl Hill scene you worked with in Lab 1, retrieved from the GEE catalog in seconds without downloading any files. Notice which areas appear darkest and which appear brightest. Do these patterns match your expectations from the electromagnetic properties of these surfaces discussed in Campbell Ch. 2?
Note

Script L2.3 covers: Map.setOptions(), Map.setCenter(), Map.addLayer() with single-band grayscale, and ui.Chart.image.histogram(). Confirm Checkpoint L2-CP3 before continuing.


Part 4 — Multi-Band Composites

Open Script L2.4 (Multi-Band Composites).

When you assign three bands to the R, G, B display channels, the color of each pixel reflects the relative brightness of its values in those three bands. This is the additive color system that Campbell explains in Sections 4.7 and 5.6 — the same principle behind every composite you built by hand in Lab 1. In GEE, the band assignment is one line of code.

The script builds three composites in sequence: true-color (B4/B3/B2), NIR false-color (B5/B4/B3), and SWIR false-color (B7/B5/B3). The SWIR composite is the same one you built manually in ArcGIS Pro. Use the Layers toggle to compare all three composites and think carefully about what each one reveals and why — you will need to explain this in your SOP.

Tip

Connecting to your reading

When you change the bands array from ['SR_B4','SR_B3','SR_B2'] to ['SR_B5','SR_B4','SR_B3'], the burn scar changes dramatically in appearance. The pixel values did not change — only the assignment of bands to color channels changed. This is the additive color system Campbell describes in Section 5.6 (Figure 5.14 and surrounding text). Before moving on, make sure you can explain in your own words why the burn scar appears in a different color in each composite.

Note

Script L2.4 covers: True-color, NIR false-color, and SWIR false-color composites; the additive color system. Confirm Checkpoint L2-CP4 before continuing.


Part 5 — select() vs. bands, and the Spectral Profile

Open Script L2.5 (select() vs. bands — and the Spectral Profile).

This section addresses something you may have already noticed: when you clicked a pixel with the Inspector on a layer from Part 3 or 4, you saw all 19 bands listed — not just the ones you chose to display. Script L2.5 explains why, and introduces select() as the tool that changes what an image actually contains rather than just what is rendered on screen.

Operation What it affects Inspector shows
bands in Map.addLayer() Display only All bands the image contains
select() on the image The image object Only the selected bands

Understanding this distinction is essential for the spectral profile work in Part 6. Read the script annotations carefully before proceeding.

Note

Script L2.5 covers: select(), the bands display parameter, and building a 6-band spectral profile layer for the Inspector. Confirm Checkpoint L2-CP5 before continuing.


Part 6 — Spectral Profiles and Lab 1 Comparison

Open Script L2.6 (Pixel Values, Scale Factors, and Lab 1 Comparison).

Why GEE Values Differ from Campbell’s Digital Numbers

The pixel values you see in the Inspector are not the raw digital numbers that Campbell introduces in Section 5.4. Landsat C2 L2 stores scaled surface reflectance integers — a physically meaningful quantity that requires a scale factor to convert to true reflectance. Script L2.6 explains the conversion and why this is a feature of the data product, not a limitation of GEE.

Read the scale factor explanation in the script carefully, then run the print statement that demonstrates the conversion. This concept is the basis for Limitation L1 in your SOP.

Reconstructing the Spectral Profile

Use the L8 Spectral Profile Layer and the Inspector to collect pixel values for each land cover class. When you click this layer with the Inspector and expand the Pixels section, you will see the six band values listed (SR_B2 through SR_B7) in dictionary view.

Tip

Building the spectral profile chart in Excel

The Inspector gives you the raw values. To reconstruct the spectral profile graph you made in Lab 1:

Step 1 — Collect values from the Inspector

  1. Click the Inspector tab, then click on a pixel clearly representing one land cover class
  2. Expand Pixels, find the L8 Spectral Profile Layer entry, and switch to dictionary view (the list icon ≡)
  3. Read off the six values listed: SR_B2, SR_B3, SR_B4, SR_B5, SR_B6, SR_B7
  4. Paste them into a column in Excel and label the column with the land cover class name
  5. Repeat for each land cover class — each class becomes a separate column

Your table should look something like this (values will differ based on where you clicked):

Band Burnt Veg. Forest Fallow/Barren Irrigated Snow Water
SR_B2 9000 8500 10500 9200 21500 7500
SR_B3 9500 9000 12000 9800 20000 7800
… … … … … … …

Step 2 — Build the line chart

  1. Select your entire data table (band labels + all class columns)
  2. Insert a Line Chart (Insert → Charts → Line → Line with Markers)
  3. The chart may not look right immediately — right-click anywhere on the chart area and select “Select Data…” (Windows) or “Select Data Source…” (Mac)
  4. In the dialog:
    • Each land cover class should appear as a Series (one line per class)
    • Under Horizontal (Category) Axis Labels, click Edit and select your band name column (SR_B2 through SR_B7) — this puts the bands on the X-axis in wavelength order rather than as numbered categories
  5. Add a descriptive title, label both axes (X: Band; Y: Pixel Value — Scaled SR Integer), and add a legend

Your finished chart should look similar to the example below.

Example spectral profile chart built from GEE Inspector values. Each line represents one land cover class; the X-axis shows bands in wavelength order from blue (SR_B2) to SWIR2 (SR_B7). Notice how the shape of each profile reflects the surface properties you read about in Campbell Ch. 2 — water absorbs across all bands and stays low; snow is high in the visible and drops sharply in SWIR; vegetation peaks strongly at SR_B5 (NIR). Your values will differ from this example depending on which pixels you clicked, but the overall shapes should be similar.

Complete the spectral profile table in Script L2.6 for all six land cover classes, build the Excel chart, and answer Interpretation Questions Q1–Q3.

Note

Script L2.6 covers: Scale factors, surface reflectance vs. raw DNs, spectral profile comparison with Lab 1. Confirm Checkpoint L2-CP6 before continuing.


Part 7 — Independent Exercise: Sentinel-2

Open Script L2.7 (Independent Exercise — Sentinel-2, October 4, 2020).

You have completed the instructor-led demonstration. Now apply the same workflow independently to a Sentinel-2 scene acquired one day later over the same fire area. Sentinel-2 measures similar wavelengths to Landsat 8 but uses different band names, a different value scaling convention, and different spatial resolution for some bands. You must adapt — not copy — the Landsat workflow.

Before writing any code, print the image to the Console and read its full 23-band structure. Script L2.7 explains which bands belong to which category and which ones to use for each composite. Consult the GEE Data Catalog entry for COPERNICUS/S2_SR for the authoritative band specifications.

Once you have built all three composites and the spectral profile layer, use the Inspector to collect spectral profiles for the same six land cover classes you sampled in Part 6.

Sensor Comparison: Building a Second Spectral Profile

The goal of the sensor comparison is to examine how two different sensors measure the same surfaces — and to begin understanding why the numbers differ even when the wavelengths are similar.

Step 1 — Identify which bands are comparable

Before collecting any values, you need to know which Sentinel-2 bands correspond to which Landsat 8 bands. The figure below shows the spectral ranges of both sensors plotted against atmospheric transmission windows. Study it carefully.

Spectral bands of Sentinel-2 MSI and Landsat 8 OLI plotted against atmospheric transmission. Band numbers are labeled on each bar. Use this diagram and the GEE Data Catalog entries for both sensors to complete the band correspondence table below before you start collecting values.

Using the diagram above and the GEE Data Catalog, fill in the center wavelength and bandwidth for each band pair in your SOP before you begin sampling. The table headers are provided — the wavelength values are yours to look up:

Landsat 8 band L8 center wavelength (nm) Sentinel-2 equivalent S2 center wavelength (nm)
SR_B2 B2
SR_B3 B3
SR_B4 B4
SR_B5 B8 or B8A?
SR_B6 B11
SR_B7 B12
Tip

On SR_B5 vs. B8 / B8A: Sentinel-2 has two NIR bands. Look at their center wavelengths and compare them to Landsat SR_B5. Which one is the closer spectral match? Does spatial resolution change your choice? There is no single right answer — explain which you chose and why.

Step 2 — Collect Sentinel-2 spectral profiles

Use the S2 Spectral Profile Layer and the Inspector dictionary view to collect values for each land cover class visible in the Sentinel-2 scene. Note that the Sentinel-2 tile does not cover exactly the same area as the Landsat scene — use whatever land cover classes are clearly present in both images. Snow visible in the Landsat scene may not be present in the Sentinel-2 tile; skip any class you cannot find a clean, representative pixel for.

For each class, choose pixels that are spectrally pure — clearly within one land cover type, not at a boundary or in a transition zone between two cover types. A pixel at the edge of the burn scar, for example, may mix burned and unburned surface reflectance and will not represent either cleanly. Being precise about pixel selection is part of good remote sensing practice and will affect how interpretable your comparison is.

Step 3 — Build the Sentinel-2 spectral profile chart

Use the same Excel workflow as Part 6 to build a second spectral profile chart for Sentinel-2, with the equivalent bands on the X-axis in wavelength order. Place the two charts side by side and examine the shapes across land cover classes.

When you compare the two charts you will notice that the absolute values differ substantially between sensors. Before drawing conclusions about which sensor detected more energy, consider what determines the scale of the values stored in each product — this is the basis for Interpretation Question Q7.

Warning

Common error: Sentinel-2 band names have no SR_ prefix. The correct name for the red band is 'B4', not 'SR_B4'. Using the Landsat naming convention in a Sentinel-2 script will produce an error or an empty layer.

Spatial Resolution at the Burn Scar Boundary

The two sensors you are working with have different spatial resolutions for their SWIR bands. Before answering Question Q6, zoom in to the burn scar boundary on both SWIR composites until you can see individual pixels clearly. Look at the same feature on both sensors and examine what you see.

The SWIR composites of both sensors at a burn scar boundary. What do you notice?
Note

Script L2.7 covers: Full Sentinel-2 workflow — load, print, three composites, spectral profile layer, sensor comparison table, and Questions Q4–Q7. Confirm Checkpoints L2-CP7 and L2-CP8 before completing your SOP.


Interpretation Questions

Answer all seven questions in the Results and Visual Evidence section of your SOP. Questions Q1–Q3 draw from the Landsat demo (Scripts L2.5–L2.6); Q4–Q7 draw from the independent exercise (Script L2.7).

Q1 (Script L2.6) Describe the spectral profile shape for the burned land cover class. Which bands have the highest values? Which have the lowest? How does this explain why the burn scar appears the color it does in the SWIR false-color composite?

Q2 (Script L2.6) Compare your GEE spectral profile shapes to those from your Lab 1 ArcGIS Pro spectral profile tool. Do the shapes match even though the absolute values differ? What does this tell you about the relationship between scaled surface reflectance integers and raw digital numbers?

Q3 (Script L2.6) Which two land cover classes have the most similar spectral profiles? What does this similarity tell you about their surface properties?

Q4 (Script L2.7) The burn scar appears in the same color family in both the Landsat and Sentinel-2 SWIR false-color composites. Using the additive color system, explain why this color appears and what it tells you about the spectral behavior of burned land.

Q5 (Script L2.7) Campbell Ch. 5.7 states that image enhancement changes what you see but not the underlying values. Change S2_MAX from 3000 to 5000 in the CONFIGURATION section of Script L2.7, rerun the script, and click the same burn scar pixel with the Inspector. Do the pixel values change? What does this confirm about the role of visualization parameters?

Q6 (Script L2.7) Zoom in to the burn scar boundary until individual pixels are visible in both composites. Which sensor shows a sharper boundary? What sensor property described in Campbell Ch. 3 explains this difference?

Q7 (Script L2.7) Landsat SWIR2 values (e.g., ~12000) are much larger than Sentinel-2 SWIR2 values (e.g., ~2000) for the same burn scar area. Does this mean Landsat detected more SWIR energy? Explain why the numbers differ even though both sensors measure similar wavelengths.


Standard Operating Procedure (SOP)

Complete this section in your own words as you work through the lab. Your SOP documents your workflow so that a technically competent colleague could replicate your exact analysis. Write it after completing both the Landsat demo and the Sentinel-2 independent exercise. Use the five section headings below — these are the same headings used in the course SOP template and in the grading rubric.


1. Objective

State the environmental or scientific question this lab addresses and why it matters. What does working with Landsat and Sentinel-2 in GEE allow you to observe or measure that the Lab 1 workflow could not? Briefly identify the study area (Pearl Hill fire, Okanogan County, WA) and the two GEE asset IDs used.


2. Data Inventory

List both datasets and justify why each is appropriate for this analysis. For each dataset, include: full GEE catalog path, scene ID, acquisition date, processing level, spatial resolution, path/row or MGRS tile, cloud cover percentage (from metadata), and bands used. Then briefly explain why this dataset’s spatial, temporal, and spectral resolution is appropriate for mapping fire disturbance at this location and scale.

Landsat 8 OLI — LANDSAT/LC08/C02/T1_L2

Sentinel-2 MSI — COPERNICUS/S2_SR


3. SOP — The Workflow

Document the key operations in your Lab 2 workflow. For each operation below, paste the relevant code block and explain in plain English what it does and why. Your explanation should be specific enough that someone unfamiliar with GEE could understand and replicate your steps.

  1. ee.Image() — how does this differ from opening a file in ArcGIS Pro?
  2. print() — what does it retrieve, and from where?
  3. select() — what does it do to the image object, and how does this differ from the bands parameter in Map.addLayer()?
  4. The visualization parameters for one composite: explain what bands, min, and max each control, and what happens if you change them
  5. The histogram — what information did it provide, and how did you use it to choose your display range?

4. Results and Visual Evidence

Your Results and Visual Evidence section should include:

  • Screenshots of all six composites (three Landsat + three Sentinel-2) with descriptive captions. Each caption should identify the sensor, band combination, and at least one key feature visible in the image and why it appears that way
  • Your Landsat spectral profile table and chart (six land cover classes × six bands; see Part 6)
  • Your completed band correspondence table with wavelengths for both sensors (see Part 7), including a note on which NIR band you chose for Sentinel-2 and why
  • Your Sentinel-2 spectral profile table and chart (available land cover classes × six comparable bands; see Part 7)
  • A brief written comparison of the two charts — do the profile shapes match across sensors for the same land cover classes? Where do they differ, and why?
  • Written answers to Interpretation Questions Q1–Q7 (answer each question directly and include it here, in your Results and Visual Evidence section)

5. Analyst’s Note

Identify at least three limitations or sources of uncertainty in this analysis. These should be methodological or data-related — not personal difficulties with the software. Write each limitation in your own words; explain what it is and why it matters for interpreting your results.

Examples of the kinds of limitations to consider (do not simply copy these; write your own):

  • How the pixel values stored in GEE relate to — or differ from — the raw sensor measurements described in Campbell Ch. 5
  • What a single-date acquisition can and cannot tell you about the landscape
  • What cloud cover or atmospheric conditions might affect in either scene
  • Properties of these sensors that could affect how the same surface appears differently between Landsat and Sentinel-2
  • What features on the ground this analysis cannot detect, and why

Submission Checklist

Compile the following into a single Word document and submit to Canvas:

Note

Grading Note

This lab is graded as a Weekly Methods Log (SOP). The five SOP sections (Objective, Data Inventory, SOP/Workflow, Results and Visual Evidence, and Analyst’s Note) carry the most weight. Question answers are assessed on demonstrated connection to Campbell Ch. 3–5 — vague answers that do not reference specific concepts will receive partial credit. Screenshots are checked for completeness and correct captioning. The Excel spectral profile chart is graded on correct axis labeling, one series per land cover class, and values that match what the Inspector returns for that surface type.


ESCI 442/542 — Introduction to Remote Sensing | Western Washington University