comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Reprojecting an image file derived from Level 1B MODIS HDF
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Reprojecting an image file derived from Level 1B MODIS HDF [message #74200] Sun, 02 January 2011 15:23 Go to next message
Kasia is currently offline  Kasia
Messages: 2
Registered: January 2011
Junior Member
Hi,

I have an image file that I created using IDL from a Level 1B MODIS
HDF file. I now need to reproject this image file to display in Google
Earth, but I'm having a hard time figuring out how to do this. The
code that generated the image file also outputs a lat/lon for each
value so I thought that would help since there is geographic
information contained in the image file. But, that hasn't helped me.

I've tried applying the header information from the original HDF file
to the new image file using ENVI because I know it can read these
MODIS files, but that hasn't worked too well. ENVI can reproject the
MODIS HDF file beautifully but I also need it to do the same for the
new image file.

All of the projection and lat/lon information in the new image file is
identical to that of the original MODIS HDF file that I can easily
reproject in ENVI. I just can't figure out how to add that information
to the image file so ENVI can do the same sort of magic on the new
file.

Any help would be greatly appreciated!
Kasia
Re: Reprojecting an image file derived from Level 1B MODIS HDF [message #74228 is a reply to message #74200] Wed, 05 January 2011 16:22 Go to previous messageGo to next message
Kasia is currently offline  Kasia
Messages: 2
Registered: January 2011
Junior Member
Wow! Thanks for all these replies. I have the tools to reproject the
original file now but that would then require modifying the code that
generates the jpeg, which I don't have, unfortunately.

Devin, I discovered the ENVI Build GLT command after I posted this and
it has been working great in reprojecting the jpeg. BUT the images
don't line up with the landscape after displaying in Google Earth.
I've triple checked the lat/lon box coordinates that I wrote into the
kml and they seem to be correct so the only thing I can think of is
I'm using the wrong projection.

So the next question is...What projection does GE want? I've heard the
following:
Mercator
Equirectangular
World Equidistant Cylindrical (Sphere)

Which one is it? I did this over a year ago successfully with
different datasets using GDAL and the World Equidistant Cylindrical
(Sphere) projection, but I also remember reprojecting another MODIS
dataset using ENVI and Equidistant Cylindrical is not an option in
ENVI.

There are plenty of other options, so any suggestions?

Thanks again!
Kasia
Re: Reprojecting an image file derived from Level 1B MODIS HDF [message #74234 is a reply to message #74200] Wed, 05 January 2011 09:37 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Michael Galloy writes:

> I have updated the IDLdoc submission with new releases on the ITT VIS
> code library site (as one of several places to get it), but I'm
> considering dropping it for the next release and making
> idldoc.idldev.com the one and only place to get it.
>
> But, it certainly would be nice to have some kind of place to share code
> that was not a full fledged project with a svn/git/hg repo and website,
> i.e., "here's a useful routine or two."

Probably if more people hit that Make a Contribution!
button at the bottom of a web page there would be
more volunteers. :-)

Maybe we should start charging dues on the newsgroup.
Or make people pay $1 for good answers and $5 for
bad ones. I don't know. I do know it is a LOT of
uncompensated work to run a web page. :-)

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: Reprojecting an image file derived from Level 1B MODIS HDF [message #74235 is a reply to message #74200] Wed, 05 January 2011 09:25 Go to previous messageGo to next message
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
On 1/5/11 7:03 AM, David Fanning wrote:
> devin.white@gmail.com writes:
>
>> With the new interface, I think a lot of
>> submissions have seen a drop in the number of new downloads since you
>> have to go hunting for exactly what you want.
>
> Even when you know *exactly* what you want,
> it seems to be a crap shoot. I always figured
> this is the strategy ITT devised to confuse our
> enemies. :-)

I have updated the IDLdoc submission with new releases on the ITT VIS
code library site (as one of several places to get it), but I'm
considering dropping it for the next release and making
idldoc.idldev.com the one and only place to get it.

But, it certainly would be nice to have some kind of place to share code
that was not a full fledged project with a svn/git/hg repo and website,
i.e., "here's a useful routine or two."

Mike
--
www.michaelgalloy.com
Research Mathematician
Tech-X Corporation
Re: Reprojecting an image file derived from Level 1B MODIS HDF [message #74245 is a reply to message #74200] Wed, 05 January 2011 06:03 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
devin.white@gmail.com writes:

> With the new interface, I think a lot of
> submissions have seen a drop in the number of new downloads since you
> have to go hunting for exactly what you want.

Even when you know *exactly* what you want,
it seems to be a crap shoot. I always figured
this is the strategy ITT devised to confuse our
enemies. :-)

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: Reprojecting an image file derived from Level 1B MODIS HDF [message #74249 is a reply to message #74200] Wed, 05 January 2011 05:27 Go to previous messageGo to next message
devin.white is currently offline  devin.white
Messages: 50
Registered: March 2007
Member
I was trying to be a somewhat diplomatic, but you're absolutely right,
David. The ITT VIS Code Library is not very easy to navigate. I
prefer the old interface, which included static links for submissions
and a fairly intuitive browsing interface. The static link option
meant that submissions were actually discoverable by search engines
(what a novel idea). With the new interface, I think a lot of
submissions have seen a drop in the number of new downloads since you
have to go hunting for exactly what you want.

On Jan 4, 11:10 pm, David Fanning <n...@dfanning.com> wrote:
> devin.wh...@gmail.com writes:
>>  Both MCTK and GEST can be downloaded from
>> the ITT VIS website under User Community->Code Library.  Because of
>> how their site is set up, I can't post links to them here--you'll have
>> to search for them.  Luckily, they're not too hard to find.
>
> I guess we could disagree about what "not too hard"
> means, but yes, I've used the MCTK and its worth
> the time it takes (probably!) to find it. Very slick
> and works nicely. :-)
>
> 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: Reprojecting an image file derived from Level 1B MODIS HDF [message #74255 is a reply to message #74200] Tue, 04 January 2011 20:10 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
devin.white@gmail.com writes:

> Both MCTK and GEST can be downloaded from
> the ITT VIS website under User Community->Code Library. Because of
> how their site is set up, I can't post links to them here--you'll have
> to search for them. Luckily, they're not too hard to find.

I guess we could disagree about what "not too hard"
means, but yes, I've used the MCTK and its worth
the time it takes (probably!) to find it. Very slick
and works nicely. :-)

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: Reprojecting an image file derived from Level 1B MODIS HDF [message #74256 is a reply to message #74200] Tue, 04 January 2011 19:47 Go to previous messageGo to next message
devin.white is currently offline  devin.white
Messages: 50
Registered: March 2007
Member
In addition to the excellent recommendations made already, I can add
at least one more that is fairly easy to try:

Use the Latitude and Longitude bands stored in the L1B file to
reproject the image in ENVI by taking advantage of the "Georeference
from IGM" tool (Map->Georeference From Input Geometry). To get at
these bands in ENVI, you'll either have to save them to ENVI files
using IDL or open the L1B HDF using the generic HDF option (File->Open
External File->HDF), which allows you to select which datasets from
the file you want to load. The bands will probably be smaller than
the swath image, so you'll have to resize them to match (Basic Tools-
> Resize Data). This is by no means the most accurate way to resize
them, but it is easy. Besides some accuracy issues, the IGM approach
is also very slow, so be prepared to wait for the output.

As other folks have pointed out, the most reliable option is to first
reproject the original L1B image using MRTSwath or the MODIS
Conversion Toolkit (MCTK is an ENVI plugin). Either software package
will generate a georeferenced file that can then be processed further
to create the image you need, which can then be displayed in Google
Earth. How you get the image into Google Earth is another matter.
One option is the Google Earth Super-Overlay Tool (GEST, also an ENVI
plugin), which can generate full resolution image overlays that look
exactly like what you see in an ENVI display window (it even honors
stretching and filters). Both MCTK and GEST can be downloaded from
the ITT VIS website under User Community->Code Library. Because of
how their site is set up, I can't post links to them here--you'll have
to search for them. Luckily, they're not too hard to find.


On Jan 2, 6:23 pm, Kasia <sia...@gmail.com> wrote:
> Hi,
>
> I have an image file that I created using IDL from a Level 1B MODIS
> HDF file. I now need to reproject this image file to display in Google
> Earth, but I'm having a hard time figuring out how to do this. The
> code that generated the image file also outputs a lat/lon for each
> value so I thought that would help since there is geographic
> information contained in the image file. But, that hasn't helped me.
>
> I've tried applying the header information from the original HDF file
> to the new image file using ENVI because I know it can read these
> MODIS files, but that hasn't worked too well. ENVI can reproject the
> MODIS HDF file beautifully but I also need it to do the same for the
> new image file.
>
> All of the projection and lat/lon information in the new image file is
> identical to that of the original MODIS HDF file that I can easily
> reproject in ENVI. I just can't figure out how to add that information
> to the image file so ENVI can do the same sort of magic on the new
> file.
>
> Any help would be greatly appreciated!
> Kasia
Re: Reprojecting an image file derived from Level 1B MODIS HDF [message #74292 is a reply to message #74228] Thu, 06 January 2011 17:51 Go to previous message
devin.white is currently offline  devin.white
Messages: 50
Registered: March 2007
Member
The reason for the misalignment could be geopositioning errors in the
Longitude and Latitude bands, but an equally likely situation is that
the native imagery in Google Earth is not in the right place. That
happens a lot. You should by no means treat the imagery in Google
Earth as truth. It's generally good to about 30m, but not always.
Google Earth's native projection space is Geodetic (longitude and
latitude with respect to the WGS-84 ellipsoid). I think it supports
UTM and a few other projections, but Geodetic is the safest to use.


On Jan 5, 7:22 pm, Kasia <sia...@gmail.com> wrote:
> Wow! Thanks for all these replies. I have the tools to reproject the
> original file now but that would then require modifying the code that
> generates the jpeg, which I don't have, unfortunately.
>
> Devin, I discovered the ENVI Build GLT command after I posted this and
> it has been working great in reprojecting the jpeg. BUT the images
> don't line up with the landscape after displaying in Google Earth.
> I've triple checked the lat/lon box coordinates that I wrote into the
> kml and they seem to be correct so the only thing I can think of is
> I'm using the wrong projection.
>
> So the next question is...What projection does GE want? I've heard the
> following:
> Mercator
> Equirectangular
> World Equidistant Cylindrical (Sphere)
>
> Which one is it? I did this over a year ago successfully with
> different datasets using GDAL and the World Equidistant Cylindrical
> (Sphere) projection, but I also remember reprojecting another MODIS
> dataset using ENVI and Equidistant Cylindrical is not an option in
> ENVI.
>
> There are plenty of other options, so any suggestions?
>
> Thanks again!
> Kasia
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Read large ascii file quickly
Next Topic: IDL 8, EPS vs. PS graphics

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 13:48:54 PDT 2025

Total time taken to generate the page: 0.00431 seconds