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

Home » Public Forums » archive » Help with envi_output_to_external_file
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Help with envi_output_to_external_file [message #71056] Mon, 24 May 2010 09:37
lorenzo is currently offline  lorenzo
Messages: 3
Registered: May 2010
Junior Member
Hi all,
I am new to ENVI, and I am trying to write the output of a routine to
an ASCII file, using the above mentioned ENVI routine, but I
consistently get an "error: incorrect number of arguments" message.
The variable to be output to a file (outlib) is a 20x22 array and it
shows good data.
Help is much appreciated!

Lorenzo.

Here is the code:

pro sample_average
compile_opt idl2

envi, /restore_base_save_files
envi_batch_init, log_file='batch.log'


envi_select, fid=fid, dims=dims, pos=pos
if (fid[0] eq -1) then return
;ENVI_OPEN_FILE, /NO_REALIZE , R_FID=fid, dims=dims, pos=pos
;if (fid[0] eq -1) then return

envi_file_query, fid, ns=ns, nl=nl, nb=nb

out_lib=fltarr(nb,
ns)
temp_data=fltarr(nl,
nb)
for i=0, ns-1 do
begin
for j=0, nb-1 do
begin
sub_dims = [-1, i, i, dims[3],
dims[4]]
x=envi_get_data(fid=fid, pos=[j],
dims=sub_dims)
temp_data[*,
j]=x
endfor
for j=0, nb-1 do begin
out_lib[j, i]=mean(temp_data[*, j])
endfor
endfor

array=[5,1]
envi_output_to_external_format, /ascii, out_lib, field=array,
dims=sub_dims, pos=pos, fid=fid, out_name ="spectra.txt"

end
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Fast Marching Algorithm
Next Topic: color plot over greyscale image - postscript

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

Current Time: Wed Oct 08 11:40:28 PDT 2025

Total time taken to generate the page: 0.00466 seconds