Lab II: Environmental Warfare in the Persian Gulf

Last Updated: 1/11/2008

Objective: We will be using a portion of a Landsat TM scene to map the extent of an oil slick in the Persian Gulf during the 1991 Gulf War. The slick resulted from the intentional release of oil by Iraqi forces in Kuwait. A lab report summarizing your results will be required.  We will be using a technique called Density Slicing to create our map.

Preliminaries: An excellent web page that provides background information on this analysis is available. You should review Environmental Warfare: 1991 Persian Gulf Ware by P.R. Baumann. to prepare for this lab. We will be working with the same image that is discussed in this document. This document outlines one approach to analyzing this imagery. We will be using ERDAS for our analysis rather than the PEDAGeOG software described by Dr. Baumann. We will also add a few wrinkles to the analysis.

 

PROCEEDURES:

Step 1: Getting the Imagery. You will find an ERDAS file gulfwar10.img under J:/SALDATA/esci442/Gulf-War/gulfwar10.img. This file contain the seven Landsat TM bands that will be used in this lab.  The file also contains three “empty” bands that we will use to store new data layers that we will create during the course of our analysis. Copy this file to your own subdirectory that you create under C: /temp. Remember that C:/temp is the only subdirectory on the C-drive where you have write permission. 

 

Step 2: Open the file in ERDAS.  Start ERDAS as we did in our first analysis.  In the Viewer window, go to File-Open-Raster layer, then select the file to be opened as you did last week:

fileopen

Do NOT push the ok button yet!  First, we need to go to the Raster Options tab:

truecolor

This dialog box gives us a way to select the bands we want to view right away, before we even open the file.  Let’s start by viewing the image in True color, with bands 3,2,1 in the red, green and blue color guns, respectively.  Now push the ok button.  Take a look at the image.  Refer to the online publication by Bauman as you do to familiarize yourself with the area.  Go ahead and reload the image with different band combinations and different Contrast Adjustments (as explained in last week’s lab) if you would like.

 

Step 3: View single bands.  Reload the image using File-Open-Raster Layer from the Viewer window.  Then go to the Raster Options tab again.  This time, select Display as: Gray scale

grayscale

then select Band 1 and push the ok button.

This enables you to view a single band at a time.  Go to Raster-Band Combinations in the Viewer window to toggle through each of the seven TM bands.  If you’d like, you can go to the Tool Palette tools and select the Contrast Tool contrast to adjust the brightness and contrast for each of these bands.  Note that you can see different things with each band.

 

Step 4: Viewing Frequency Distributions and Sampling Brightness Values.  Let’s take a look at the frequency distribution of brightness values for each band.  To do this, go to Utility-Layer Info… from the Viewer window. 

layerinfosel

Then select the Histogram tab

histotab

This displays the frequency distribution of brightness values for TM Band 1.  Now use the thumbnail to view the histogram for TM Band 5

histoband5

From Bauman’s paper, you will recall that he concluded that this band gives you the best discrimination of water, oil and land.  Put the histogram window off to the side and view TM Band 5 in gray scale.  Play with the contrast a bit until you can see what Bauman was talking about.  Now take another look at the histogram.  In the histogram, notice that there are three distinct “bumps.”  These probably represent different categories of surface feature (Note: you may want to include a copy of this histogram in your lab report.  Using Hypersnap or Snagit, as described in last week’s lab is one way to grab this.).  Our next task is to figure out what each of these features represents.

Let’s sample some of the brightness values in our scene.  Back in the Viewer window, go to Utility-Inquire Cursor.  This will bring up the following:

cursorinquire

Use the slider on the right side to scroll down so that you can see “layer 5.”  This is TM Band 5.  The “File Pixel” column displays the brightness value for the spot under the big white cross in the Viewer window.  You can point to the center of this cross with your cursor and push and hold the left mouse button to drag the cross to a new point on the image.  This will allow us to sample pixel brightness values for TM Band 5 in different parts of the image.  See if you can figure out what the three “bumps” in the frequency distribution represent.

After some fiddling around, you will probably conclude that the left bump represents brightness values for water, the middle bump mostly represents oil (and maybe some land as well) and the far right bump represents land.  You may want to refer to Figure 6 in Bauman’s paper as you sample your image.  You will need to select some potential break points that separate these classes, like this:

Table 1:

Cover Type

Minimum Brightness

Maximum Brightness

Water

 

 

Light Oil

 

 

Heavy Oil

 

 

Land

 

 

 

Step 5: Create a Pseudo-Color Image.  Open a second Viewer window by pushing the big Viewer button on the main ERDAS Imagine Button Bar.  Go to File-Open-Raster Layer in the Viewer #2 window and select our image (Note: It is OK to have the same image open in two separate window.)  Under the Raster Options tab, select Display as Pseudo Color:

psuedocolor

Then select Layer 5 and push the ok button.  This image should look pretty similar to the gray scale version of this image that you have displayed in Viewer #1.  Now we are going to assign different ranges of brightness values to a unique color.  We call these “Pseudo-colors” because these are not the “True colors” we would see on the ground.  To do this, go to Raster-Attribute in the Viewer #2 window:

rasteratt

Each row in this table represents a brightness value in TM Band 5.  Click on Row 0 and drag down to Row 10.  This will highlight the rows 0 to 10.  Then click on the Color cells for these highlighted  rows and select a color from the palette that pops up.  All pixels in the image with a brightness value ranging from 0 to 10 will now be “painted” with the color you have selected.  Pretty cool isn’t it? 

OK, now play around with this Raster Attribute Editor Dialog box to assign colors to each of the cover types in Table 1 above.  This may take some fiddling to get an image that you are happy with.  VERY VERY IMPORTANT!!!  WHEN YOU HAVE AN IMAGE YOU ARE HAPPY WITH, YOU WILL NEED TO SAVE THIS COLOR SCHEME OR ALL OF YOUR WORK TO THIS POINT WILL BE LOST!  To do this, go to File-Save from the Raster Attributes Editor, like this:

rastersave

This will save your color scheme as part of your *img file.  When you reopen this image at a later time, if you display Band 5 as a Pseudo color image, this color scheme will come up.

What are the results of your density slicing? Did you run into the same problem of misclassification of inland areas as P.R. Baumann did? Why did that happen?

 

Step 6: Creating a Land/Water Mask. Next step is to improve our mapping technique by using other bands in the analysis. Band 4 is the best band for differentiating between land and water surfaces. This feature will help us to eliminate the misclassified inland areas. Just as P.R. Baumann did, we will base our analysis on bands 4 and 5. However, instead of using a simple addition of the two bands, we will first manipulate the pixel values in band 4 and then multiply it with band 5.

Let’s start by closing down all of our assorted windows, except Viewer #1.  Now go to Raster-Band Combinations in the Viewer #1 window and display TM Band 4.  View the histogram for this band and use the Utility-Inquire Cursor feature to sample the image.  Note that the oil slicks do not show up in TM Band 4.  Sample reflectance values for land and water in band 4. Determine, as best as you can, the threshold value that separates the two categories. We want to change all the values below this threshold (representing water) to 1 and all the values above the threshold (representing land) to 0. Why were these specific values chosen?

We will create our Land/Water mask in a new .img file. We will create a simple model that uses logical operations to create this mask based on the image values in band 4.  Push the Modeler modeler button from the ERDAS Imagine main button bar, then select Model Maker from the Spatial Modeler box that pops up.  This will bring up the New Model window.  In this window, we will create a “box and arrow” diagram that represents our model.  What we want to do is start with TM Band 4.  This will be the input for our model.  In ERDAS modeling lingo, this will be the Raster Object in the model.  In ERDAS modeling lingo, we will then perform a Function on this Raster Object and put the result into another Raster Object, which, in this case will a new .img file.  To do all of this, we start by placing a new Raster Object into our New Model window by pushing the Raster Object button on the modeling palette

rasterobject

then move your cursor into the New Model window and left-click to place the Raster Object in the window.

newmodel

Now go back to the modeling palette and select a Place a Function in the model

modelfunction

Then go back to the modeling palette to select Place a Raster Object in the model again

model2

Now we need to connect these boxes.  To do this, go back to the modeling palette and select Connect inputs to functions or functions to onputs.  You then point to the input Raster Object and left-drag to make an arrow that connects the input Raster Object to the function.  Then make a second connection from the function to the output Raster Object.  You should end up with something that looks like:

model3

Double click on the input Raster Object to bring up the Raster dialog box.  Locate your input file, gulfwar10.img, then click ok.  Now double click on the circular function in your New Model window.  This brings up the Function definition dialog box.  This is where we will define our model.  The syntax here is a bit tricky.  Select Functions-Conditional

conditional

In the choices below functions, double –click on the Conditional {(<test1>)<arg1>,….  In the bottom box, this function should appear.  You will need to edit it to appear as follows:

CONDITIONAL { ($n1_gulfwar10(4)<=??)1, ($n1_gulfwar10(4)>??)0}

You will need to replace the ?? with an appropriate threshold value that you have determined best separates water from everything else in TM Band 4.  What this conditional does is to take all pixels in TM Band 4 that have a value <=?? And assign a value of 1 and take all pixels with a value >?? And assign a value of 0.

We now need to name the output Raster Object.  This is a new file that will contain the zeros and ones defined by our conditional statement.  This output file will contain only a single layer.  Double-click on the output Raster Object and give the output file a name.  Something like “landmask.img” might be appropriate. 

Before you do anything else, SAVE YOUR MODEL!  Do this by going to File-Save as in the New Model window.  You should save it as a graphical model and save it in the same subdirectory as your image files.  I used a name of landmask.gmd. 

Now Execute the model by pushing the executemodel button.  When it is finished executing, open a second Viewer and take a look at your result.  Your output image should contain only two data values, 1’s for the water and 0’s for the land.  If it contains anything else, you goofed.  You can go to Utility-Layer Info to confirm that the minimum and maximum values in the image are 0 and 1, respectively.  What does this image actually look like?  Does it do a pretty good job of separating land and water?  If not, you might want to go back and edit your model and select a new threshold value and rerun the model.  You should be sure to select a new name for the output file (maybe landmask2.img).

 

Step 7: Using Image Arithmetic to Mask out Land.  After to come up with a land/water mask that you are happy with, we are ready to multiply band 5 and by the land/water mask. What will happen to reflectance values on band 5 when they are multiplied by the values in your land/water mask?  How will it help the analysis?

The multiplication is done by creating a new model.  Create a new model, like we did in step 6, that looks like the following graphic:

        Image1

In the first Raster Input graphic, add the file “gulfwar10.img”.  In the second Raster Input Graphic, add the file that contains your land/water mask.  In the Function Graphic, multiply your land/water mask by band 5 in gulfwar10.img.  It will look something like this:

imagemultiply

Now click on the output Raster Graphic and assign a filename to it. 

Important: For reasons that are not clear to me, we need to specify one important thing when we select a file name for our output Raster Graphic.

rastergraph_thematic

The default File type for all Raster Graphics is Continuous.  For reasons that I don’t yet understand, we need to specify a file type of Thematic.  I’m not clear on the difference between these two file types but if you don’t specify Thematic, you will not be able to accurately calculate the area in each cover type. 

Be sure to SAVE YOUR MODEL, then Execute the model by pushing the executemodel button.

 

Step 8: View the output image and create a Pseudo-color Table for it.  Make sure that you still have two Viewer windows open.  In the first, open up your new image.  As you open it, be sure to go to the Raster options tab and select Display as: Pseudocolor.  In the second Viewer, open gulfwar10.img and display TM band 5 in pseudocolor.  Then go to Raster-Attributes in the Viewer #1 window and density slice it using the same color scheme that you used for TM Band 5 in your original gulfwar10.img.  You might want to open the Raster-Attribute Editor for Viewer #2 so you can be sure to use the same ranges and colors.  You will need to make one important change in the Raster-Attribute Editor for Viewer #1.  For this image, pixels with a value of 0 represent land.  Make sure you understand why this is the case!  You will need to assign either a “land” color to the pixels with a value of 0 or perhaps another color (maybe black). 

Compare your TM Band 5 image in pseudocolor to your new “masked” version of TM Band 5 in pseudocolor.  Does this new image provide a better represenation of the extent of the oil slick?  Hopefully it will.  You should no longer have the problem of parts of the land being misclassified as an oil slick!  Your new should give you a much cleaner map of the oil slick. You will probably still have some areas mapped as oil slick that are adjacent to the land. Do you think these areas really represent an oil slick or does this represent an error? What is the direction of the prevailing current? Do you think this is relevant in addressing this question?

BE SURE TO SAVE YOUR PSEUDOCOLOR SCHEME FOR THIS IMAGE!  To do this, go to File-Save from the Raster Attributes Editor.

 

Step 9: Histograms.  We would like to come up with an estimate of the area covered by water, light oil, heavy oil and land for both our unmasked and masked versions of TM Band 5.  Based on Step 8, you should have the unmasked version of TM Band 5 open in Viewer #2 and your masked version of TM Band 5 open in Viewer #1.  To do obtain your area estimates, we will need to export data from the Raster Attribute Editor from each viewer.  First, point to Row 0 in this window, then right-click and go to Select all.  This should highlight all rows and columns of this window.  Then go to Edit-Export and select a filename for these data.  You will need to do this for both of the viewers that you have open.  You will then need to import these data into Excel and you can use various spreadsheet functions to calculate the same summary statistics that are included in Baumann's Tables 2 & 3. Why are your values different from his? . You can also use Excel with your data to create a histogram or two.

NOTE: In order to calculate the area in each cover type, you need to know the pixel size.  For this image, the pixel size is 30 meters by 30 meters.  In the Raster Attributes Editor, the Histogram column indicates the number of pixels with a given value.  After you have imported the data into Excel, you can calculate the area in each cover type by multiplying the number of pixels by the area of each pixel.  I’d suggest that you present the area in hectares.

Calculating areas in ERDAS: Here is another trick.  You can get ERDAS to calculate the areas, in hectares, for each row in your Raster Attribute Table.  This will take some fiddling.  In the Viewer, go to Utility-Layer Info.  Under the General tab, you will note that the pixel size is given as N/A.  This stands for “Not Available.”  I neglected to input this information when I created the file.  This is one of the pieces of information that are normally stored as part of the header information in an ERDAS .img file.  Go to Edit-Change Map Model.  This will bring up the following:

changemapinfo

Change the units to meters and change the pixel size in both the X and Y direction to 30.  Then hit the OK button to close the window.  You will receive a warning message:

attention

This is warning you that you are about to change some of the header information for the image and you should think hard before you do this.  In our case, this is OK, so go ahead and select Yes.  Now close the Layer Info window.  From the Viewer select File-Save-all layers.   This will save your change.

Now go back to the Raster Attribute Editor.  Select Edit-Add Area Column.  Select units of hectares.  You should now have a Area new column in your Raster Attribute table.  You will still need to export this table to Excel to collapse the table into four categories (water, light oil, heavy oil, land).

 

  

Step 10: Hard copy maps. You will want some color images to include in your lab report.  The easiest way to do this is to use Paintshop Pro or Snagit as you did in the previous lab.  The .bmp or .jpg file you create in Paintshop Pro or Snagit can then be inserted into your MS Word file as you write your lab report. 

You can also use MS Word to create a color legend for your images.  This is a particularly nice touch.  To do this, first insert the .bmp or .jpg file from Hypersnap or Snagit into your MS Word file.  You can then use the drawing tools to insert a series of small boxes directly below the image.  You can then manipulate the fill color to match the colors in your map.  We will show you how to do this in lab.

It is important to keep in mind that color printouts are VERY VERY EXPENSIVE! Don't produce these printouts unless you really need to. We are able to monitor use of the color printer by individual accounts. If you overuse the color printer, your access to it will be restricted.

The MS Word file that you create for your lab report will probably only have one or two pages of color.  You should print out the black and white pages on the B&W printer AND ONLY PRINT OUT THE COLOR PAGES ON THE COLOR PRINTER!  You can then collate the B&W and color pages, staple them together and turn in your lab report. 

 

BE SURE TO SAVE A COPY OF ALL OF YOUR FILES TO YOUR U;/ DRIVE AND TO YOUR USB DRIVE.  YOU WILL UNDOUBTEDLY NEED TO REFER TO THESE FILES AS YOU PREPARE YOUR LAB REPORT (discussed below). 

 

FINALLY, Prepare a Lab Report Summarizing your Analysis. Your report should be no more than five double-spaced pages of text.  Three pages will probably be sufficient.  Your lab report must include all the sections described in my “Guidelines….” Document (see link below).  Your lab report will not need to include an Introduction section.  This webpage, and Bauman’s paper should provide sufficient background and there is no need for you to rehash this material.  Your lab report should provide a brief Methods section.  You don’t need to rehash the methods that I have presented in this webpage but you might find the need to provide a brief section that explains anything you did that was a bit different than the methods described above.  The bulk of your lab report should focus on the presentation of your RESULTS and on a DISCUSSION of the significance of these results. Use tables, figures and images to support your writing. As a bare minimum, I expect to see the following figures and tables:

1. A figure showing the results of applying your Pseudocolor scheme to TM5
2. A figure showing the results of applying your Pseudocolor scheme to the product of TM5 and your Land/Water mask
3. A table showing the number of pixels, hectares and % of study area in land, water, light oil and heavy oil for the two figures listed above. Note that you will need to do some conversions to calculate area in hectares from the number of pixels in each cover type. The pixel size in your image is 30 meters by 30 meters.  You can confirm this by going to Utility-Layer Info in the Viewer window.  Look under the General-Map Info section of this box.

Note: In your report, it is OK to refer to the various Thematic Mapper bands numbers (TM4, TM5, etc.) but it is not OK to refer to  "filename_for the land/water mask.img" or "finalimagename.img." These filenames will be meaningless to your reader and the reader really doesn't need to know these filenames anyway. It is OK to refer to your “land/water mask."  You will need to come up with another way to refer to the product of TM Band 5 and your Land/water mask.

Feel free to include additional figures and tables as you see fit. You should also be sure to include a Literature Cited Section. You might find it useful to refer to the book: Day, R.A. 1998. How to Write and Publish a Scientific Paper. ISI Press. An online version of this book might be available by clicking here. This is an "e-book" that can be "checked out." I'm a bit unclear on what this means. If this link does not work, try accessing the book by looking it up your self in the library's online catalog. This book provides an excellent discussion of each section of scientific papers and it also provides some good advice about editing and style.

You should also my Guidelines for the Preparation of Lab Reports web page. This provides more details about what I expect to see in a lab report.

 

Created by: N. Antonova, D. Wallin; 10/6/98; Modified by D. Wallin and M. Tyler 10/4/02



Return to ESCI 442 Lab Page

Return to ESCI 442 Syllabus

Return to David Wallin's Home Page