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

Home » Public Forums » archive » Re: reading envi file in IDL
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: reading envi file in IDL [message #55526 is a reply to message #55525] Thu, 23 August 2007 10:48 Go to previous message
Jeff N. is currently offline  Jeff N.
Messages: 120
Registered: April 2005
Senior Member
On Aug 23, 12:09 pm, robinson....@gmail.com wrote:
> Dear All,
> I created a file using ENVI and its header file is below. Does
> somebody could show me how to read that file in IDL?
> In advance thank you very much
> Robinson Juarez
>
> =======================================
> ENVI
> description = {
> File Resize Result, x resize factor: 1.000000, y resize factor:
> 1.000000.
> [Wed Aug 22 10:02:17 2007]}
> samples = 400
> lines = 400
> bands = 5
> header offset = 0
> file compression = 1
> file type = ENVI Standard
> data type = 4
> interleave = bsq
> sensor type = Unknown
> byte order = 0
> x start = 1323
> y start = 714
> map info = {UTM, 1.000, 1.000, 694231.500, 9759973.000, 2.8500000000e
> +001, 2.8500000000e+001, 20, South, WGS-84, units=Meters}
> wavelength units = Unknown
> band names = {
> Resize (Unmix (amazonas_p231r062_etm_071001_a5) EM:GV (X:4278 Y:
> 1152):MAO20071001_test1.em),
> Resize (Unmix (amazonas_p231r062_etm_071001_a5) EM:NPV (X:6152 Y:
> 928):MAO20071001_test1.em),
> Resize (Unmix (amazonas_p231r062_etm_071001_a5) EM:SOIL (X:5959 Y:
> 4199):MAO20071001_test1.em),
> Resize (Unmix (amazonas_p231r062_etm_071001_a5) EM:SHADE (X:2359 Y:
> 2415):MAO20071001_test1.em),
> Resize (RMS Error:MAO20071001_test1.em)}
> ============================================================ ======

Well, if you look at the ENVI help files you'll see what all these
header values mean. The dimensions of the image are the samples,
lines, and bands. The bsq interleave tells you that the dimensions
are (400,400,5). The data type of 4 means float data (i'm pretty
sure, double check this). Header offset = 0 means the binary file is
all data, no header bytes.

So, in this case it would normally boil down to a simple readu:

img = fltarr(400,400,5)
openr, lun, image_file_name, /get_lun
readu, lun, img
free_lun, lun

I say it *would* boil down to the code above b/c i've never seen the
"file compression = 1" line in an envi header. If the file is
compressed you're going to have to deal with the compression, however
that was done.

Also check to make sure the byte order matches your machine (if you
created the image file on the same machine you're reading it with, it
shouldn't be an issue).

Hope that helps,
Jeff
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: mosaic_doit - is it just me?
Next Topic: Renaming a variable in IDL?

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

Current Time: Wed Oct 08 19:35:32 PDT 2025

Total time taken to generate the page: 0.00404 seconds