Lab 3 : Calibration of Mars Pathfinder IMP Images

    In this lab, you are going to calibrate two sets of images obtained with the Imager for Mars Pathfinder (IMP).  The picture on the left shows the IMP on its extendible mast.  Click on the link for detailed information on how it works.  [Actually, the data you will be using were altered in several ways for pedagogical reasons.]

    Starting with the raw images in DN units, we are going to apply corrections/calibrations until we end up with the radiance units (W m-2 µm-1 sr-1).  This involves, among other things, bad pixel correction, flat fielding, and absolute responsivity calculation, as we outlined in Lecture 5.  The two sets of data are made up of red, green, and blue images, so you will be able to produce two truecolor images at the end.

   All the data you will need can be found in the Lab 3 Data Package, specifically the ".mat" file lab3_variables_2015.mat file stored in the DATA directory of the expanded archive.  The Matlab variables saved in this file are all double precision floating array of size 256 x 248 and are described in the Table 1 below.

Table 1.  The contents of lab3_variables_2015.mat from the Lab 3 Data Package DATA directory
Matlab variables
Contents
rover_red
Raw image of the rover on Martian surface using the red filter in the right eye of the IMP
rover_grn
 Raw image of the rover on Martian surface using the green filter in the right eye of the IMP
rover_blu
 Raw image of the rover on Martian surface using the blue filter in the right eye of the IMP
sky_red
Raw image of the Martian sky above a distant peak using the red filter in the right eye of the IMP 
sky_grn
 Raw image of the Martian sky above a distant peak using the green filter in the right eye of the IMP
sky_blu
 Raw image of the Martian sky above a distant peak using the blue filter in the right eye of the IMP
dark_lab = D(x, y)
 Normalized laboratory-measured dark pattern in units of DN/sec
shutter_lab = S(x, y)
 Normalized laboratory-measured dark shutter pattern in units of DN
ff_red
 Normalized flat field for the red filter (already corrected for the bad pixels, dark current, and shutter effect)
ff_grn
 Normalized flat field for the green filter (already corrected for the bad pixels, dark current, and shutter effect)
ff_blu
 Normalized flat field for the blue filter (already corrected for the bad pixels, dark current, and shutter effect)

Please examine all these arrays carefully.  Are you annoyed with the upside-down images?  If so, go back and look at the MATLAB Image Tutorial for help.

        The bias/dark frame is generated by using the laboratory-derived dark model [Reid et al., 1998].  This frame includes signal from thermally generated electrons and the hardware offset that is included in the raw data.  The dark model has the form

DN = Ad t eBdTD(x, y) + 4000.00 As eBsTS(x, y) + An eBnT + Hoff

where Ad = 3.016, Bd = 0.105, As = 2.845, Bs = 0.105, An = 4.05, Bn = 0.144, Hoff = 8.27, and T is temperature in oC.  [Note: we have introduced the extra factor of 4000 here in order to amplify this otherwise subtle effect in the raw data]

    The first term models the dark current generated in the active region of the CCD during an exposure of t seconds, with the term D(x, y) representing the normalized laboratory-measured dark pattern (DN/sec).  The second term models the dark current generated during readout of the image from the storage region of the CCD, with the term S(x, y) representing the normalized laboratory-measured dark shutter pattern (DN).  The third term models the temperature-dependent null pixel offset, and the fourth term represents the constant hardware offset (bias).

    The absolute responsivity in units of (DN/sec) / (W m-2 µm-1 sr-1) has the following quadratic form

R = A1 + A2T + A3T2

where T is temperature in oC.  The Table 2 shows the coefficients for the quadratic equation.
 

Table 2.  Exposure times, Temperatures, and IMP Responsivity Parameters
Data
Exposure time, t (msec)
Temperature, T (oC)
Wavelength (nm)
Responsivity
parameter, A1
Responsivity
parameter, A2
Responsivity
parameter, A3
rover_red
 108.0000
-17.6433
671.2
557.3
-0.575
-0.0014
rover_grn
 198.5000
 -17.6433
530.8
578.6
-0.893
-0.0020
rover_blu
 1527.0000
 -17.6433
443.2
117.9
-0.392
-0.0006
sky_red
 91.0000
 -15.7921
671.2
557.3
-0.575
-0.0014
sky_grn
118.5000 
-15.7921
530.8
578.6
-0.893
-0.0020
sky_blu
 810.5000
 -15.7921
443.2
117.9
-0.392
-0.0006

    Please download the LAB3_2015.docx file (also included in the REPORT sub-directory of the Data Package) and use it as a template like you did for LAB 1.  Also, remember to use the Matlab workbook file "lab3_workbook.m" also stored in the REPORT sub-directory. After you are finished, create an archive of your REPORT sub-directory and upload it to the LAB4 sub-directory of your home directory on datafarm.astro.cornell.edu (just like you have done for the previous labs).Remember that you get credit only for the files that you upload to datafarm.  Each question listed in LAB3_2015.docx is explained in more detail below.

1.  Remove bad pixels from all the images.  Why is simply just median filtering the whole image not a good idea in this case?
(a).  As applied to these images, define/describe a "bad" pixel.  Elaborate on your criteria.  It is a good idea to write a program if you want the flexibility of adjusting some threshold values of your criteria.
(b).  How many "bad" pixels did you find in each of the six raw images?
(c).  Describe how you repaired those "bad" pixels.

2.  Do you detect any evidence of frame transfer smear (i.e., "electronic shutter effect") in the raw images?  If so, please describe in detail (for example, quantifying percent increase in DN across the image).  Create the dark model frames described above1 and use them to correct the bad pixel removed raw images.  Did the model correct this effect?  How can you tell?  Describe any residual patterns or artifacts that remain in the images after this step in the processing (experiment with stretching2), and hypothesize on their cause. Look back at MATLAB Image Tutorial for help.

3.  Apply the flat-field correction to all the images.  Discuss the result.  Describe some of the improvements.  Was anything made worse?  If so, please elaborate.

4.  Calculate the absolute responsivity as described above for all the images.1  Then, produce the images in radiance units and save all six resulting images to a file called "netid_lab4_images.mat", where "netid" refers to your own "netid". Place this file in the REPORT sub-directory of your Lab 3 Data Package.

5.  Using appropriate scaling ranges, create two truecolor images and save to files named "rover.tiff" and "mars_sky.tiff".  What color is the Martian sky? What color are the rover wheels (and why)? To generate true color images, create a 256x248x3 array where the three 256x248 layers contaed the calibration red, green, and blue frames. Note, in order to display an m x n x 3 array using "imagesc" in Matlab you need to scale the array such that the pixel avlues range from 0 to 1. However, when you use "imwrite" to save the tiff files, the data need to be converted to integer arrays (most likely uint8 arrays that vary from 0-255). Take a look at the Barnacle Bill example near the end of the MATLAB Image Tutorial if you need a refresher. Note also that you should only scale the data after calibrating the individual frames and combining them into the full array (i.e., use the same scaling relation on each layer to preserve the relative intensities of the colors).

1 Make sure that the constants/parameters you use in calculations are double precision floating point datatypes.
2 Remember that we went through different ways to "stretch" images in the MATLAB Image Tutorial.