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

Home » Public Forums » archive » ENVI File Question
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
ENVI File Question [message #55796] Wed, 12 September 2007 13:43 Go to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Folks,

I have an ENVI file question. I just want to open a Geotiff
file, do some small amount of processing on it, and save
it as an image file ENVI can read. This seems about as
straightforward as it can be.

I found an ENVI procedure named ENVI_SETUP_HEAD that looks
like what I need to create the ENVI header for this very
simple file. My program runs, my ENVI_SETUP_HEAD command
gets called. All appears well, but the header file never gets
created. (Or at least it doesn't get created in the same
place as my image file!)

Here is the output from my program:

Image Filename: /home/fanning/b2.img
ENVI Header Filename: /home/fanning/b2.img.hdr

The image file is there. The header file is not.

Do I have to do something else to write the header?

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Re: ENVI File Question [message #55916 is a reply to message #55796] Thu, 13 September 2007 12:00 Go to previous message
Jean H. is currently offline  Jean H.
Messages: 472
Registered: July 2006
Senior Member
> *Normally*, envi_write_envi_file, will create a header file which has
> the same stem filename as the .img file, but substitutes the .img
> extension for .hdr, so that your header file would be b2.hdr not
> b2.img.hdr. Perhaps this is enough to confuse ENVI, and result in you
> not seeing the map info displayed, because it is looking for a file it
> can't find.

it shouldn't be a problem...

indeed, in my code, with no change (I guess I must have changed
something, otherwise it would be VERY disturbing), it started to write
"data.dat.hdr", while it wasn't before... anyways, I can still open and
properly display the map info in envi!

Jean
Re: ENVI File Question [message #55919 is a reply to message #55796] Thu, 13 September 2007 10:17 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Paul.Bowyer@gmail.com writes:

> 3. Do you really need to be writing ENVI images, ENVI can perfectly
> well handle GeoTIFFs?

I'm mostly fooling around, trying to understand how all
this works. But I wrote a much better Landsat destriping
algorithm than the one that is in ENVI, and I wanted to
see if I could add it to ENVI via a menu selection. I just
got it to work!

Really quite simple once I had a feel for how things
are done. I'm becoming a big fan of ENVI, especially
now that I can add my own code to it. I see my career
taking off again! :-)

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Re: ENVI File Question [message #55920 is a reply to message #55796] Thu, 13 September 2007 09:57 Go to previous message
Paul.Bowyer@gmail.com is currently offline  Paul.Bowyer@gmail.com
Messages: 7
Registered: September 2007
Junior Member
On Sep 13, 5:15 pm, David Fanning <da...@dfanning.com> wrote:
> David Fanning writes:
>> Sorry for all the ENVI questions, but the documentation is
>> wonderful in that it leaves so much for the imagination to
>> fill out. :-)
>
> Oh, forget it. I'm not asking anymore ENVI questions.
>
> (Well, that's not true, since asking the questions reveals
> the answer--usually something dumb I've done--in the shortest
> amount of time. But it would serve my purpose just as much
> to send these questions to alt.sex.fetish instead of bothering
> you good people.)
>
> Cheers,
>
> David
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.dfanning.com/

Hi David,

Couple of suggestions. Do you hard code the header filename into your
program?
1.You list the header file as
ENVI Header Filename: /home/fanning/b2.img.hdr

*Normally*, envi_write_envi_file, will create a header file which has
the same stem filename as the .img file, but substitutes the .img
extension for .hdr, so that your header file would be b2.hdr not
b2.img.hdr. Perhaps this is enough to confuse ENVI, and result in you
not seeing the map info displayed, because it is looking for a file it
can't find.
2. The difference between ENVI_SELECT and ENVI_PICKFILE, not updating
the available bands list, I can't explain exactly, but just for info,
there is a /NO_OPEN keyword that may be set in ENVI_WRITE_ENVI_FILE,
so I would guess that this was why you get the different results, one
uses it the other doesn't?
3. Do you really need to be writing ENVI images, ENVI can perfectly
well handle GeoTIFFs?
Re: ENVI File Question [message #55921 is a reply to message #55796] Thu, 13 September 2007 09:15 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
David Fanning writes:

> Sorry for all the ENVI questions, but the documentation is
> wonderful in that it leaves so much for the imagination to
> fill out. :-)

Oh, forget it. I'm not asking anymore ENVI questions.

(Well, that's not true, since asking the questions reveals
the answer--usually something dumb I've done--in the shortest
amount of time. But it would serve my purpose just as much
to send these questions to alt.sex.fetish instead of bothering
you good people.)

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Running IDL .pro script from another app, using the IDL API
Next Topic: error in a simple pro

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

Current Time: Thu Oct 09 06:55:39 PDT 2025

Total time taken to generate the page: 1.68673 seconds