Re: reading envi file in IDL [message #55514 is a reply to message #55513] |
Thu, 23 August 2007 13:09   |
robinson.inj
Messages: 32 Registered: August 2007
|
Member |
|
|
On Aug 23, 12:29 pm, "Jeff N." <jnett...@utk.edu> wrote:
> On Aug 23, 2:14 pm, robinson....@gmail.com wrote:
>
>
>
>> Hi Jean, thanks for your assistance. I got this error:
>> Error occurred at: READ_BINARY 132 C:\RSI\IDL63\lib
>> \read_binary.pro
>> Robinson
>
>> On Aug 23, 10:49 am, "Jean H." <jghas...@DELTHIS.ucalgary.ANDTHIS.ca>
>> wrote:
>
>>> Robin,
>
>>> if you just have this one file, you can do:
>
>>> data = read_binary('c:\test\yourFile',data_Start = 0,data_Type=4,
>>> data_Dims=[400,400,5])
>
>>> From the top of my head, I can't remember where/how to specify the band
>>> interleave.... though in your case you have the default option, so it
>>> would work!
>
>>> If you have other files, I can send you/here a function that, with the
>>> help of ENVI, opens the file and return the header info in a structure...
>
>>> Jean
>
>>>> 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)}
>>>> ============================================================ ======
>
> I really think you need to figure out what's going on with the file
> compression issue. The code I posted for you will work for normal
> (uncompressed) envi images - i've used code like this many, many, many
> times myself.
>
> Jeff
Jeff, you were right. The "file compression =1" was the issue. The /
Compress keyword in the opening procedure solved the problem.
Robinson
|
|
|