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

Home » Public Forums » archive » Error when calling ENVI_WRITE_ENVI_FILE
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: Error when calling ENVI_WRITE_ENVI_FILE [message #86343 is a reply to message #86337] Mon, 28 October 2013 18:07 Go to previous messageGo to previous message
Josh Sixsmith is currently offline  Josh Sixsmith
Messages: 13
Registered: December 2012
Junior Member
> What you *really* want is the data tag from each structure:
>
> IDL> help, arrOfStr.data
>
> IDL> print, arrOfStr.data
>
>
>
> -------

Exactly what Phillip has mentioned. Use the tag names to get at the actual data array contained within the structure. The "data" argument to "ENVI_WRITE_ENVI_FILE" is the array itself, not a structure that contains the arrays.

You could pre-allocate an array that will contain all the bands.
eg

red_data = READ_ASCII(redfile, DATA_START = 6, DELIMITER = string(9B))
columns = 4000 ; or whatever it may be
rows = 4000
bands = 7
all_bands = FLTARR(columns, rows, bands)
all_bands[*,*,0] = red_data.data_tag_name ;data_tag_name could be data as in the example provided by Phillip.

and so on for all the necessary bands.

bnames=['1','2','3','4','5','6','7']

Then
ENVI_WRITE_ENVI_FILE, all_bands, bnames=bnames, nb=bands, nl=rows, ns=columns, out_name='my_envi_file'

Hope that helps.

Cheers
Josh
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Airy function implementation?
Next Topic: New Coyote Store Up and Running

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

Current Time: Thu Oct 09 22:59:31 PDT 2025

Total time taken to generate the page: 0.72057 seconds