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 #86337 is a reply to message #86335] Mon, 28 October 2013 09:34 Go to previous messageGo to previous message
Phillip Bitzer is currently offline  Phillip Bitzer
Messages: 223
Registered: June 2006
Senior Member
Hi Simon-

First, some terminology. You can have an "array of structures". You can also have a "structure with tags that are arrays".

Before we jump into it, the use of help is much more, well, helpful, than print. You'll see this in action below.

Consider this variable:

IDL> str = {data:FLTARR(3, 3)}

Notice "str" is a structure, and "data" is a tag (or field) of "str". Try this:

IDL> help, str

So, "str" is in fact a structure. In order to access the tag data, we use:

IDL> help, str.data

So, str.data (again, the tag "data" in the structure "str") is a 3x3 float array.

Print it if you'd like:
IDL> print, str.data

This is how you deal with a "structure that has tags that are arrays".

-------

We can take this further. Consider:
arrOfStr = REPLICATE(str, 2)

Now, 'arrofStr' is an "array of structures". See for yourself:
IDL> help, arrOfStr

You can print this too:
IDL> print, arrOfStr

What you *really* want is the data tag from each structure:
IDL> help, arrOfStr.data
IDL> print, arrOfStr.data

-------
[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: Sat Oct 11 04:52:35 PDT 2025

Total time taken to generate the page: 0.16029 seconds