IDL Lab #9: Create Spectral Response Curves and Extract the Red Edge Inflection Point from Spectral Data The objectives of this laboratory exercise are to introduce the student to: - Learn basic commands to create line plots in IDL - Use IDL to extract the red edge inflection point For further reading in this lab exercise, please refer to pages 53-68 in Introduction to IDL, by Mark Piper and Michael D. Galloy, Research Systems, Inc., 2004 Create Simple Line Plots in IDL: Introduction: The spectral response of two plants, called plant A and B, was measured. One plant was severely water stressed and the other plant was well watered. Provided with the background that water stress results in increasing reflectance over the entire wavelength range between 350 to 2500 nm, your first task is to take a look at the spectral response curves of plant A and B to determine which plant is water stressed. To be able to look at the spectral response curves of both plants, you will learn how to create simple line plots with IDL. Example Program to plot spectral response curve of plant A and B: ;; 11-12-2005 ;; by Jan Eitel ;; IDL Program to create line plot of the spectral response measured ;; for two plants pro line_plot ;; open input spectra_1 openr, 1, '/plant_a.txt' spectra_1 = fltarr(1,2151) readf,1, spectra_1 ;; open input spectra_2 openr, 1, '/plant_b.txt' spectra_2 = fltarr(1,2151) readf,1, spectra_2
;; Specifiy sensor wavelengths ;; Wavelengths are specified in the sensor_wavelength.txt file ;; Set indexed color mode and load a predefined color table into IDL device, decomposed = 0 loadct, 5 ;; Plot spectra ;; Define title, x and y axis of plot plot, sensor_wavelength[0, 0:2150], spectra_2 [0, 0:2150], title = 'Plant A (Blue) and Plant B (Red)', xtitle = 'Wavelength (nm)', ytitle = 'Reflectance (%)', linestyle=1, color=100 ;; Oplot procedure is used to display vector data over a previously drawn plot ;; Oplot can be only called after plot has been called! oplot, sensor_wavelength[0, 0:2150], spectra_1 [0, 0:2150], color = 50 end The spectral response curve of plant A is plotted in blue and of B in red. Task #1: Circle below which plant is water stressed Plant A Plant B Task #2: Create another line plot. To do this, open Excel and type in column A: 400, 500, 600, 700
Those values present your wavelengths. Open another Excel spreadsheet and type in column A: 20, 35, 18, 42. Those are the reflectance values associated with each wavelength. Give both spreadsheets a name you can remember and save them as a tab delimited (.txt file) in a folder of your choice. Next, read these values into IDL, and create a line plot. Give the line plot the title: My First Line Plot and label the x- and y- axis of the plot appropriately. Red Edge Inflection Point Introduction: The red edge inflection point refers to the maximum slope of the prominent increase in reflectance between the red and the near infrared range for green vegetation. It has been shown that structural and chemical changes of leaves may result in a shift of the red edge inflection point. Due to the fact that biotic and abiotic stress can cause structural and chemical changes within leaves, shifts of the red edge inflection point could be used to remotely detect plant stress. In the following, we write a program that allows us to extract the red edge inflection point from plant A and B. ;; Jan Eitel ;; 10-18 - 2005 ;; Program to extract red edge inflection point Pro red_edge_final ;; open input spectra_1 openr, 1, '/plant_a.txt' spectra_1 = fltarr(1,2151) readf,1, spectra_1 ;; create output arrays red_edge_1 = make_array(1, 2151, value = 0,/float) red_edge_2 = make_array(1, 1, value = 0,/float) red_edge_3 = make_array(1, 1, value = 0,/float) ;; Sensor wavelengths ;; Define sampling interval
sint = 5 ;; Take first derivative y_in = y + sint red_edge_1[0, y] = ((spectra_1[0, y_in]-spectra_1[0, y])/sint) ;; Extract maximum Slope red_edge_2 [0, 0] = max(red_edge_1[0, 330:400]) ;; Find wavelength associated with maximum slope if (red_edge_1[0, y] EQ red_edge_2[0, 0]) then begin red_edge_3[0, 0] = sensor_wavelength[y + sint] endif print, 'The red edge inflection point for plant A is:', red_edge_3[0, 0] ;; Repeat same procedure for spectrum 2 ;; open input spectra_2 openr, 1, '/plant_b.txt' spectra_2 = fltarr(1,2151) readf,1, spectra_2 ;; create output arrays red_edge_1 = make_array(1, 2151, value = 0,/float) red_edge_2 = make_array(1, 1, value = 0,/float) red_edge_3 = make_array(1, 1, value = 0,/float) ;; Sensor wavelengths ;; Define sampling interval sint = 5 ;; Take first derivative y_in = y + sint
red_edge_1[0, y] = ((spectra_2[0, y_in]-spectra_2[0, y])/sint) ;; Extract maximum Slope red_edge_2 [0, 0] = max(red_edge_1[0, 330:400]) ;; Find wavelength associated with maximum slope if (red_edge_1[0, y] EQ red_edge_2[0, 0]) then begin red_edge_3[0, 0] = sensor_wavelength[y + sint] endif print, 'The red edge inflection point for plant B is:', red_edge_3[0, 0] end Task #3: Does water stress result in a shift of the red edge inflection point (circle the right answer) Yes No Task #4: If water stress results in a shift of the red edge inflection point does the inflection point shift towards (circle the right answer): Shorter Wavelengths Longer Wavelengths