Transcript
Page 1: Exercise 7 – Importing and applying Quality Control ...cliveg.bu.edu/courses/estonia/modis-lab-07-08-analyses.pdfExercise 7 – Importing and applying Quality Control information

Exercise 7 – Importing and applying Quality Control information. In this exercise you will import MODIS Leaf Area Index (LAI) and corresponding Quality Control (QC) for Western Europe. The images will be imported in IDL-ENVI, scaled to physical LAI units and screened using the quality control data. 1.) Import and play around with MODIS data • Start ENVI using the ENVI 3.6 icon on the desktop or through the ‘Start Menu’. • Open the MODIS “LAI_1km” TIFF file of day 2002-225 in ENVI using: File–Open

External File–Generic Formats–TIFF/GeoTIFF • The ‘Available Bands List’ window appears, select ‘Band 1’ and click the ‘Load

Band’ button

Figure 1. Overview of ENVI viewers and the list of available bands

The lower left viewer window (Figure 1) shows the entire MODIS LAI image that we have created using MRT. The other two windows are white because they are zoomed in at the upper left corner of the image (see arrows) which contains no-data values.

Page 2: Exercise 7 – Importing and applying Quality Control ...cliveg.bu.edu/courses/estonia/modis-lab-07-08-analyses.pdfExercise 7 – Importing and applying Quality Control information

• Improve the contrast by moving the red box in the lower left window to Northern-

France (Figure 2) and selecting ‘Enhance–[Image] Equalization’. Additionally a color table can be applied using: ‘Tools–Color Mapping–ENVI Color Tables’ and by selecting a color table from the list (use BLUE/GREEN/RED/YELLOW). The main window will now show more contrast

Figure 2. Improving image contrast using contrast manipulation functions

• Look at the data values in the images (use: Tools–Cursor Location/Value). We know

from looking at the MOD15 file in HDF explorer that the valid range is from 0 – 100. This means that any pixel above 100 is some sort of fill value and not needed for analysis. We can filter these out by performing a map query to find all pixels < =

Page 3: Exercise 7 – Importing and applying Quality Control ...cliveg.bu.edu/courses/estonia/modis-lab-07-08-analyses.pdfExercise 7 – Importing and applying Quality Control information

100, but this can be carried out better using the QC information that is delivered with the MODIS data.

2.) Apply Quality Control • Open the MODIS “FparLai_QC” TIFF file of day 2002-225 in ENVI using: File–

Open External File–Generic Formats–TIFF/GeoTIFF From the Documentation and the HDF file it can be derived that bits {5,6,7} of every pixel contain quality control information that is produced by the MODIS LAI/Fpar algorithm (see MOD15 product guide for the exact interpretation of all QC bits). • In order to extract the QC information we need to compile a small IDL function and

use IDL band-math to apply that function to our data. Select ‘File–Compile IDL Module’ from the main menu and search for a file called ‘mod15_qc.pro’ which is on the CD-ROM.

IDL will now load this module and compile it so we can use it in the band math functionality of ENVI. • Now select ‘Basic Tools–Band Math’ from the main menu and enter the following

expression (Figure 3): mod15_qc(b1)

• Assign the FparLai_QC data layer to the variable b1 (Figure 4). And choose an output file (e.g. ‘mod15_2002225_qc.img’). Press ‘OK’ to start computing.

We now have a file with MOD15 quality control information that contains the following values: [0,1,2,3,4,7]. These values have the following meaning: Value Binary flags Explanation

0 000 LAI derived using RT methods, best possible 1 001 LAI derived using RT methods, with saturation 2 010 LAI derived using empirical methods, RT failed (geometry) 3 011 LAI derived using empirical methods, RT failed (Other) 4 100 No retrieval (oceans, cities, etc) 7 111 Background

Page 4: Exercise 7 – Importing and applying Quality Control ...cliveg.bu.edu/courses/estonia/modis-lab-07-08-analyses.pdfExercise 7 – Importing and applying Quality Control information

Figure 3. The ‘mod15_qc’ module can be called

using Band Math

Figure 4. Assign layer to variable ’b1’

• Now we will use the MOD15 QC info to create a mask that contains all good quality

pixels. Follow the following procedure: Select ‘band 1’ of the previously created file in the ‘Available Bands List’ and

load it into a window using the ‘Load Band’ button. Now select ‘Basic Tools–Masking–Build Mask’ from the main ENVI menu‘s. Select the display that contains the image of the file that you just loaded (probably

Display #1). Select the option ‘Import Band Data Range’ and use the values 0 and 1 for

minimum and maximum (Figure 5). Specify an output file (e.g. ‘mod15_2002225_qc_mask.img’) and click ‘OK’. Note that the mask file is added to the ‘Available Bands List’ (Figure 6).

Page 5: Exercise 7 – Importing and applying Quality Control ...cliveg.bu.edu/courses/estonia/modis-lab-07-08-analyses.pdfExercise 7 – Importing and applying Quality Control information

Figure 5. Use the ‘Import Band Data Range’ to

define the mask

Figure 6. The mask is added to the

‘Available Bands List’

• We can now apply our newly created mask in order to derive only valid LAI pixels

from the image. Use: ‘Basic Tools–Masking–Apply Mask’. Select the MOD15 2002 LAI_1km image as input file and select the mask band (Figure 7).

• Now press ‘OK’, choose an output file and press ‘OK’ again.

Page 6: Exercise 7 – Importing and applying Quality Control ...cliveg.bu.edu/courses/estonia/modis-lab-07-08-analyses.pdfExercise 7 – Importing and applying Quality Control information

Figure 7. Applying the QC mask to the MOD15 LAI product

3.) Converting to physical LAI Units We know from using HDF Explorer that the conversion factor for converting DN values into physical LAI values is 0.1. Therefore we will apply ENVI’s Band Math function to apply this conversion factor. • Select ‘Basic Tools–Band Math’ from ENVI’s main menu’s and enter the expression:

b1*0.1 • Now assign the masked LAI_1km 2002 to the variable ‘b1’ and set the output file to

‘mod15_2002_LAI_final.img’ and press ‘OK’. 4.) Repeat steps 1-3 for the MOD15 product of 2003-225 (Close all 2002 files first to avoid any confusion)

End of Exercise 7

Choose input first

Then select Mask

Page 7: Exercise 7 – Importing and applying Quality Control ...cliveg.bu.edu/courses/estonia/modis-lab-07-08-analyses.pdfExercise 7 – Importing and applying Quality Control information

Exercise 8. Visualizing and analyzing MODIS data.

We will focus at trying to determine the effects of the 2003 drought in Europe on the distribution of LAI values over Europe by comparing the 2002 season (relatively wet) and the 2003 season (extremely dry and warm). In this exercise you will use some of the advanced visualization capabilities of ENVI. 1.) Computing LAI statistics over Europe In this step we will first compare the overall distribution of LAI values over Europe by generating and comparing the histograms of the LAI values in 2002 and 2003. Carry out the following steps: • Load the two files with the final LAI values (mod15_2002_LAI_final.img &

mod15_2003_LAI_final.img) as well as the masks that we created for both datasets. We need these masks for statistics calculation in order to avoid that the no-data values influence the statistics.

• Choose from the main ENVI menu: ‘Basic Tools–Statistics–Compute Statistics’. • Choose ‘mod15_2002_LAI_final.img’ as input and choose the appropriate mask band

using the ‘Select Mask Band’ button. Now press ‘OK’. • Set the ‘Calculate Statistics Parameters’ as in the screenshot below and press ‘OK’.

Figure 8. Setting options for statistics calculation.

Page 8: Exercise 7 – Importing and applying Quality Control ...cliveg.bu.edu/courses/estonia/modis-lab-07-08-analyses.pdfExercise 7 – Importing and applying Quality Control information

• ENVI will now present you with a text window showing the basic statistics of the LAI in 2002 as well as a plot window with a histogram. Do not close these windows, we need them for comparison!

• Now calculate the statistics for the LAI of 2003 in the same way. 2.) Compare and visualize the LAI statistics. • Look at the text window with the statistical parameters of the LAI in 2002 & 2003.

What do you conclude from the mean LAI value? • Now look at the distributions, this can be done more easily by having the two

distribution in the same plot window. Luckily, there is a neat trick in ENVI to combine the data in the two plot windows. To do this, activate the ‘Plot Key’ by selecting ‘Options–Plot Key’ (Figure 9).

• Now select the plot key label with the left mouse button and simply drag & drop the label onto the other plot window (Figure 9). Now the two distributions are plotted in the same window and can be easily compared.

Figure 9. Drag & drop the plot key from one window to the other

• You can control various aspects of the plot (line color, line thickness, plot symbols) using ‘Edit-Data Parameters’.

Question What do you conclude about the LAI in 2002 & 2003 from the main distribution on the left side of the plot window? What about the small peak on the right side? 3.) Regional inspection of drought influence on LAI By looking at the image statistics and the distribution of the LAI values we get a feel for the overall situation in Europe. However, it does not give spatial information in order to locate the areas have suffered badly from drought. Therefore, we have to take a look at the image data itself. • Open the final LAI datasets for 2002 and 2003 and load them into two separate

windows.

Page 9: Exercise 7 – Importing and applying Quality Control ...cliveg.bu.edu/courses/estonia/modis-lab-07-08-analyses.pdfExercise 7 – Importing and applying Quality Control information

• Link the two windows (Figure 10), so the both windows display the same area and scroll into the same direction when one of the displays is changed. Use ‘Tools–Link–Link Displays’ and press ‘OK’.

• You can apply a contrast stretch or a color table like in exercise 4.1

Figure 10. Synchronize scrolling behavior using ‘Link Displays’.

• We can visualize the differences in ENVI by creating a 2D-scatterplot of the LAI in

2002 and 2003. • Create a 2D-scatter plot (Figure 11) by selecting ‘Tools–2D Scatter Plots’. Set the

LAI data from 2002 to Band X and the LAI data from 2003 to Band Y, press ‘OK’. • The scatter plot will now be calculated. Set the density function ‘on’ and choose a

suitable color table (use: EOS A) from the list (Figure 12). The scatter plot now shows the pixel density in different colors.

• The scatter plot is only calculated over the current Window because of performance reasons. We can thus easily interpret the scatter plot for different areas by shifting the red box to other areas. Move the red box in the lower left window to the following regions: Massif Central–France, Po Valley–Italy, Benelux, Ireland, Central Germany and Sweden.

Page 10: Exercise 7 – Importing and applying Quality Control ...cliveg.bu.edu/courses/estonia/modis-lab-07-08-analyses.pdfExercise 7 – Importing and applying Quality Control information

Figure 11. Define the scatterplot. Set Band X to the

LAI of 2002. Set Band Y to the LAI of 2003.

Figure 12. Show pixel density by using ‘Density

Slice’. Question: Which areas have been most affected by drought? 4). Showing drought and heat affected pixels For the current tutorial we assume that all areas that are seriously affected by the 2003 drought and heat, are characterized by a 25% smaller LAI in 2003 compared to 2002. The boundary of 25% deviation can be visualized as a line in the LAI scatter plot starting at the origin and crossing the point [6.80, 5.10]. In fact this line can be defined as:

LAI2003 = 0.75 * LAI2002 All pixels that lie below this line are affected by drought, according to our definition.

Turn density slice on!

Then select a color table (use: EOS A)

Page 11: Exercise 7 – Importing and applying Quality Control ...cliveg.bu.edu/courses/estonia/modis-lab-07-08-analyses.pdfExercise 7 – Importing and applying Quality Control information

Figure 13. Defining the line of 25% deviation in the scatter plot.

Drought affected pixels can be marked easily on the image by drawing a ‘region of interest’ in the scatter plot window: • Set the zoom box (red square) to the Po Valley in Northern-Italy • Draw a region of interest in the scatter plot to select all pixels with an LAI that is 25%

smaller in 2003 compared to 2002. Follow the guidelines in Figure 14 (LMB=Left Mouse Button, RMB=Right Mouse Button).

Origin [0,0]

Point [6.8, 5.1]

Drought affected pixels are on this side of the line

Line of 25% deviation

Page 12: Exercise 7 – Importing and applying Quality Control ...cliveg.bu.edu/courses/estonia/modis-lab-07-08-analyses.pdfExercise 7 – Importing and applying Quality Control information

Figure 14. Define area of 25% deviation by creating a Region of Interest in the scatter plot window.

• All pixels that fall within the triangle are marked red on the image. • Draw your own conclusions

1. Click LMB on the plot origin

2. Click LMB to define axis of 25% deviation

3. Click LMB on the X-axis end. 4. Click RMB to close the polygon.

Page 13: Exercise 7 – Importing and applying Quality Control ...cliveg.bu.edu/courses/estonia/modis-lab-07-08-analyses.pdfExercise 7 – Importing and applying Quality Control information

Figure 15. Effect of the 2003 drought on the LAI over Northern Italy. All pixels marked red, have 25%

reduction in LAI in 2003 compared to 2002.

Page 14: Exercise 7 – Importing and applying Quality Control ...cliveg.bu.edu/courses/estonia/modis-lab-07-08-analyses.pdfExercise 7 – Importing and applying Quality Control information

End of Exercise 8


Top Related