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

Home » Public Forums » archive » Re: read/write standard envi
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
Re: read/write standard envi [message #29618] Tue, 05 March 2002 05:37
Klaus Scipal is currently offline  Klaus Scipal
Messages: 45
Registered: November 1997
Member
T'x for your assistemce, indeed it was easier than expected

Klaus


"Vincent Schut" <schut@gissrv.iend.wau.nl> wrote in message
news:3C84ABBA.60202@gissrv.iend.wau.nl...
> Klaus Scipal wrote:
>> Hi
>>
>> I am sure anyone out there has already done this:
>>
>> I need to read/write a standard ENVI file in IDL. Is there any code
>> available or am I the first one with this problem.
>> T'x for any help
>>
>> Klaus
>>
>>
> I suppose you have ENVI?
> You can simply use the envi-routines for this. Check out the ENVI
> programmers guide that came with your ENVI program, or the online help
> (not the online help of idl, but of envi), search for the section for
> programmers. The appropriate function is called envi_open_file. You can
> search your envi online help file for this.
>
> BTW, also without envi it is quite simple to read/write a standard envi
> file. A very short explanation:
> First open the belonging header file, this contains information about
> the # of bands, samples, lines, data format and storage format. Storage
> format can be bsq, bil or bip, which mean data is stored band after band
> (bsq), byte interleaved by line (bil: line1 band1, line1 band2, l1b3,
> l2b1, etc) or bip: byte interleaved by pixel: p1b1, p1b2, p1b3, p2b1,
> etc. The header file is in human readable text format.
> From the data type you can calculate how many bytes each pixel takes,
> e.g. is the data type integer, each pixel is 2 bytes.
> Then you can just open and read the file. It is not compressed, just
> read the values pixel after pixel.
> You can check your calculation by checking if #samples * #lines * #bands
> * #bytesppixel = filesize.
>
> Using the appropriate envi-routine is much easier, though.
>
> For more info, if you have an envi manual, read the programmers section.
> Otherwise, ask more questions if you don't succeed.
>
> good luck!
>
> Vincent.
>
Re: read/write standard envi [message #29620 is a reply to message #29618] Tue, 05 March 2002 03:27 Go to previous message
Vincent Schut is currently offline  Vincent Schut
Messages: 8
Registered: February 2002
Junior Member
Klaus Scipal wrote:
> Hi
>
> I am sure anyone out there has already done this:
>
> I need to read/write a standard ENVI file in IDL. Is there any code
> available or am I the first one with this problem.
> T'x for any help
>
> Klaus
>
>
I suppose you have ENVI?
You can simply use the envi-routines for this. Check out the ENVI
programmers guide that came with your ENVI program, or the online help
(not the online help of idl, but of envi), search for the section for
programmers. The appropriate function is called envi_open_file. You can
search your envi online help file for this.

BTW, also without envi it is quite simple to read/write a standard envi
file. A very short explanation:
First open the belonging header file, this contains information about
the # of bands, samples, lines, data format and storage format. Storage
format can be bsq, bil or bip, which mean data is stored band after band
(bsq), byte interleaved by line (bil: line1 band1, line1 band2, l1b3,
l2b1, etc) or bip: byte interleaved by pixel: p1b1, p1b2, p1b3, p2b1,
etc. The header file is in human readable text format.
From the data type you can calculate how many bytes each pixel takes,
e.g. is the data type integer, each pixel is 2 bytes.
Then you can just open and read the file. It is not compressed, just
read the values pixel after pixel.
You can check your calculation by checking if #samples * #lines * #bands
* #bytesppixel = filesize.

Using the appropriate envi-routine is much easier, though.

For more info, if you have an envi manual, read the programmers section.
Otherwise, ask more questions if you don't succeed.

good luck!

Vincent.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: DOUBLE precision no precise??
Next Topic: smoothing large arrays

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

Current Time: Wed Oct 08 19:27:11 PDT 2025

Total time taken to generate the page: 0.00509 seconds