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 #86315 is a reply to message #86313] Fri, 25 October 2013 09:02 Go to previous messageGo to previous message
Phillip Bitzer is currently offline  Phillip Bitzer
Messages: 223
Registered: June 2006
Senior Member
Hi Simon-

Well, you're not getting what you think in the "data" variables. Check out this from the help for READ_ASCII:

The result is an IDL structure array containing the data

And this variable (ultimately) is what you're using in ENVI_WRITE_ENVI_FILE. Only problem is, according to the help, the parameter that you should pass is:

This is a 2D or 3D data array of type byte, integer, unsigned integer, long integer, unsigned long integer, long 64-bit integer, unsigned long 64-bit integer, floating-point, double-precision, complex, or double-precision complex.

You have to extract the pertinent data from the READ_ASCII function, and put it in the format ENVI_WRITE_ENVI_FILE expects. (I'll note there's probably better ways than using READ_ASCII here, but you can certainly get it to work.)

There's a couple of other things going on. Consider these lines:

rnd_data = FLTARR([ns], [nc]) ;float array of ns = 11, nl = 11 for 3 bands
...
red_data = READ_ASCII(redfile, DATA_START = 6, DELIMITER = string(9B))

rnd_data = [red_data]

Basically, the first line isn't doing anything for you, because you change the variable (more formally, dynamically cast the variable) from an array to a structure in the last line.

Hope this helps!
[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 23:20:11 PDT 2025

Total time taken to generate the page: 0.16750 seconds