Re: True-Color Modis Image [message #67475] |
Thu, 30 July 2009 21:22  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
James Kuyper writes:
> I'm the person responsible for maintenance of the code that creates
> those files. I didn't write the original code, and it has required very
> little maintenance in the five years I've been responsible for it. I am,
> by training, a physicist, not a remote sensing expert, but of necessity
> I've learned a few things about this subject.
Thanks for the help, James.
I do think I have scaled and gridded the data correctly.
The secret to getting "bright" images, compared to what
I was getting most of the day, appears to be knowing
the esoteric numbers necessary to do a piecewise-scaling
of the image into byte values, rather than doing a simple
BYTSCL. I have an article in the works that I think will
help people produce better results. Perhaps you will have
more suggestions when you read the article. I would
certainly welcome them. :-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
Re: True-Color Modis Image [message #67480 is a reply to message #67475] |
Thu, 30 July 2009 20:46   |
jameskuyper
Messages: 79 Registered: October 2007
|
Member |
|
|
David Fanning wrote:
> Folks,
>
> I am trying to create a true-color MODIS image of
> the sort shown on this page:
>
> http://rapidfire.sci.gsfc.nasa.gov/subsets/?mosaic=Arctic
>
> I have been using MODIS bands 1, 4, and 3 to represent
> the R, G, and B components of a 24-bit image. But my
> images don't look like those. In fact, they look almost
> like a gray-scale image. :-(
>
> Am I missing some "mixing" algorithm that combines
> these three channels in some other way? Anyone have
> any insight into this? I am using MOD02 files and
> just scaling each band with BytScl after I regrid
I'm the person responsible for maintenance of the code that creates
those files. I didn't write the original code, and it has required very
little maintenance in the five years I've been responsible for it. I am,
by training, a physicist, not a remote sensing expert, but of necessity
I've learned a few things about this subject.
Simply using BytScl won't work. You have to get each band correctly
scaled relative to the other two bands to make it come out right.
The MOD02 files have HDF Scientific Data Sets (SDSs) with names that end
in "_RefSB" for the reflective bands or "_Emissive" for the emissive
bands, which contain what we call scaled integer values. For each band
there's a scaling factor and an offset that must be applied to those
numbers to get the radiances in Watts/meter^2/micrometer/steradian. The
scaling factors and offsets are stored in SDS attributes named
radiance_scales and radiance_offsets. the formula is:
radiance[frame,scanline,band] = radiance_scales[band]*
(scaled_integer[frame,scanline,band] - radiance_offsets[band])
For the reflective bands, you can also calculate the reflectance product
rho*cos(theta), where rho is the Bidirectional Reflectance Factor, and
theta is the solar incidence angle. For this purpose, you use the
reflectance_scales and reflectance_offsets SDS attributes. The formula is:
reflectance[frame,scanline,band] = reflectance_scales[band]*
(scaled_integer[frame,scanline,band] - reflectance_offsets[band])
Note that these are top-of-atmosphere radiances and reflectances; if you
want surface radiances or reflectances you'll need to apply atmospheric
corrections to these values
Getting the scaling right is just the beginning, it isn't the whole
issue - but it does help. People who are experts in remote sensing have
produced much better pictures than I do from the same data; I'm not sure
how they do it.
For information about this and many other matters of importance for
understanding the MODIS L1B products, see
<http://www.mcst.ssai.biz/mcstweb/L1B/product.html>. In particular,
please look the "MODIS Level 1B Product User's Guide". If you have any
questions about this or any other MODIS Level 1 issues, feel free to
contact me in my official capacity at James.R.Kuyper@nasa.gov.
|
|
|
Re: True-Color Modis Image [message #67490 is a reply to message #67480] |
Thu, 30 July 2009 15:14   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
David Fanning writes:
> OK, I'm using the same 1-4-3 channel combination
> the MODIS guys are using, but my images don't look
> as bright and snappy as theirs do. Does anyone
> know what kinds of tricks they are using? Or, is
> this a government secret?
One of those days when I feel like I'm talking to
myself all day. :-(
OK, I found the secret on the Internet with some
IDL code that looks like it might have been written
by Liam Gumley. The secret is piecewise scaling
of values in the MODIS images. Sort of like local
scaling. I'll probably write an article about this
sometime soon, as it is something I would like to
remember, and it seems to have some general applications.
Very nifty, and my images now have a bright, sexy look,
rather than the drab, nerdy look they had before.
Cheers,
David
--
David Fanning, Ph.D.
Coyote's Guide to IDL Programming (www.dfanning.com)
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
|
Re: True-Color Modis Image [message #67495 is a reply to message #67491] |
Thu, 30 July 2009 12:12   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
David Fanning writes:
> I have been using MODIS bands 1, 4, and 3 to represent
> the R, G, and B components of a 24-bit image. But my
> images don't look like those. In fact, they look almost
> like a gray-scale image. :-(
Humm. Hang on. When I got up to take a leak,
I changed my angle to the monitor, and I guess
maybe I am looking at true-color images. With
ice and cloud, it is a bit hard to tell. I can
just stand up and tilt my head to the side to
get the effect I want. ;-0
Cheers,
David
--
David Fanning, Ph.D.
Coyote's Guide to IDL Programming (www.dfanning.com)
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
Re: True-Color Modis Image [message #67549 is a reply to message #67475] |
Fri, 31 July 2009 13:31  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
David Fanning writes:
> The secret to getting "bright" images, compared to what
> I was getting most of the day, appears to be knowing
> the esoteric numbers necessary to do a piecewise-scaling
> of the image into byte values, rather than doing a simple
> BYTSCL. I have an article in the works that I think will
> help people produce better results
Here is the aforementioned article:
http://www.dfanning.com/ip_tips/brightmodis.html
There is a new Coyote program, ScaleModis, to go
along with it. I have to say, I *really* cleaned this
algorithm up from what I found on the MODIS web pages.
Yep, that's right HISTOGRAM and VALUE_LOCATE. My God,
those two programs together are amazing! Probably
another article or two just in that part of the code
itself, since I got confused by my own web pages. :-(
Anyway, you can find a superfast MODIS scaler here:
http://www.dfanning.com/programs/scalemodis.pro
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
Re: True-Color Modis Image [message #67566 is a reply to message #67475] |
Fri, 31 July 2009 01:08  |
d.poreh
Messages: 406 Registered: October 2007
|
Senior Member |
|
|
On 30 Jul., 21:22, David Fanning <n...@dfanning.com> wrote:
> James Kuyper writes:
>> I'm the person responsible for maintenance of the code that creates
>> those files. I didn't write the original code, and it has required very
>> little maintenance in the five years I've been responsible for it. I am,
>> by training, a physicist, not a remote sensing expert, but of necessity
>> I've learned a few things about this subject.
>
> Thanks for the help, James.
>
> I do think I have scaled and gridded the data correctly.
> The secret to getting "bright" images, compared to what
> I was getting most of the day, appears to be knowing
> the esoteric numbers necessary to do a piecewise-scaling
> of the image into byte values, rather than doing a simple
> BYTSCL. I have an article in the works that I think will
> help people produce better results. Perhaps you will have
> more suggestions when you read the article. I would
> certainly welcome them. :-)
>
> Cheers,
>
> David
>
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.dfanning.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Hi David
There is a very nice free software (Hydra) from university of
Wisconsin that does all this very fast (It has been written in JAVA
not IDL!!!). it is free and you can download it.
Cheers
|
|
|