Fanning Software Consulting

Bright MODIS Images

QUESTION: I've downloaded a number of MODIS reflectance images, and I am certain I have calibrated and gridded the reflectance values correctly. But when I go to make a true-color image, using channels 1, 4, and 3 as the RGB values, my images appear dark and dingy compared to what I see on the MODIS Rapid Response System web page. What are they doing that I'm not doing to produce such bright, good looking images?

ANSWER: Ah, well, they know secrets they aren't telling you!

One of the secrets they know is how to scale the data differentiallly, instead of byte scaling the data using the IDL BytScl command, the way you are. Rather, they scale portions of the image differently than they scale other portions of the image to enhance the visual effects of the image.

I learned about this by poking around on some MODIS web pages (I forget which ones) until I found some IDL software that I believe might have been written by Liam Gumley that appears to use the secret formula used by the MODIS Rapid Response Team to process their images.

The secret (I suppose I can reveal it) is comprised of two vectors, which for normal MODIS images are defined like this.

   input  = [0,  30,  60, 120, 190, 255]
   output = [0, 110, 160, 210, 240, 255] 

The procedure is simple enough. First byte scale the MODIS reflectance data into the range of 0 to 255, as normal. The MODIS Rapid Response Team uses a default range of -0.01 to 1.10 to perform the scaling.

   preScaledImage = BytScl(reflectanceData, MIN=-0.01, MAX=1.10)

Then use the input vector to select pixels in the pre-scaled image. Scale the selected pixels into the corresponding range as indicated by the output vector. For example, first take the pixels in the pre-scaled image that lie between 0 and 30, and scale those pixels into the range of 0 to 110. Then find the pixels with values between 30 and 60, and scale those pixels into the range of 110 to 160, and so on. This is what provides the differential scaling.

So you don't have to write the code to do this, I have done it for you in a program named ScaleModis. You can use it to brighten up a single MODIS reflectance channel, like this:

    cgImage, ScaleModis(chan_01_ref, RANGE=[0.0, 0.75])

Or, you can supply three different MODIS reflectance image channels to create true-color or false-color 24-bit images for display. True-color images typically use channels 1, 4, and 3 as the RGB channels. Whereas if you are interested in clouds, a 3-6-7 channel combination is sometimes used. Here, for example, is how you can produce a true-color image:

   cgImage, ScaleModis(chan_01_ref, chan_04_ref, chan_03_ref)

You can see how this brightens the MODIS image up in the figure below. The image on the left is a true-color image produced by simply byte scaling channels 1, 4, and 3. The image on the right was produced with the same three channels, but scaled using ScaleModis.

Dull and dingy color imageBright and shiny color image
The image on the left was produced by simply byte scaling MODIS channels 1, 4, and 3. While the image on the
right was produced using the same three channels, but scaled with ScaleModis. The image shows dramatic ice
melting from July 26th, 2009 in the Arctic Ocean. Alaska in on the upper left, and Sibera on the upper right. The
North Pole is in the center bottom of the image.

Version of IDL used to prepare this article: IDL 7.0.3.

Web Coyote's Guide to IDL Programming