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

Home » Public Forums » archive » Re: Problem with ENVI_DOIT, 'CF_DOIT'
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: Problem with ENVI_DOIT, 'CF_DOIT' [message #89755 is a reply to message #34537] Sun, 30 November 2014 22:04 Go to previous message
AliSoomro is currently offline  AliSoomro
Messages: 3
Registered: June 2014
Junior Member
The answer you replied is quite helpful, likewise, dear Pete, I also need your help in this same question, basically i don't want to pick files when it asks (using 'ENVI_PICKFILE'), because i have to process several images, and it seems tedious to me, therefore i made an attempt to do this all automatically, but the error occurs, and to tell you the truth the program i have made is also kind of tedious, do you know how to run it in loop? i want to save first four files as envi standard, then next four, then next four, and so on


pro Layer_Stack

compile_opt idl2
;
; First restore all the base save files.
;
envi, /restore_base_save_files

ENVI_INIT, /batch_mode
;
; Open the input file
;

CD, 'D:\test2\Layer stack\LT51510372009253KHC00\'

file = FILE_SEARCH('*.TIF')

ENVI_OPEN_FILE, file(0), r_fid=fid
ENVI_FILE_QUERY, fid, dims=dims, nb=nb, geo_points=geo_points, nl=nl, ns=ns
ENVI_OPEN_FILE, file(1), r_fid=fid
ENVI_FILE_QUERY, fid, dims=dims, nb=nb, geo_points=geo_points, nl=nl, ns=ns
ENVI_OPEN_FILE, file(2), r_fid=fid
ENVI_FILE_QUERY, fid, dims=dims, nb=nb, geo_points=geo_points, nl=nl, ns=ns
ENVI_OPEN_FILE, file(3), r_fid=fid
ENVI_FILE_QUERY, fid, dims=dims, nb=nb, geo_points=geo_points, nl=nl, ns=ns


fid=[fid1,fid2,fid3,fid4]
pos=[0,0,0,0]

; Create the new ENVI file
envi_doit, 'cf_doit', fid=fid, pos=pos, dims=dims, $
out_name='layer_stack1.tif', r_fid=r_fid

CD, 'D:\test2\Layer stack\LT51510372009253KHC00\'

file = FILE_SEARCH('*.TIF')

ENVI_OPEN_FILE, file(4), r_fid=fid
ENVI_FILE_QUERY, fid, dims=dims, nb=nb, geo_points=geo_points, nl=nl, ns=ns
ENVI_OPEN_FILE, file(5), r_fid=fid
ENVI_FILE_QUERY, fid, dims=dims, nb=nb, geo_points=geo_points, nl=nl, ns=ns
ENVI_OPEN_FILE, file(6), r_fid=fid
ENVI_FILE_QUERY, fid, dims=dims, nb=nb, geo_points=geo_points, nl=nl, ns=ns
ENVI_OPEN_FILE, file(7), r_fid=fid
ENVI_FILE_QUERY, fid, dims=dims, nb=nb, geo_points=geo_points, nl=nl, ns=ns


fid=[fid1,fid2,fid3,fid4]
pos=[0,0,0,0]

; Create the new ENVI file
envi_doit, 'cf_doit', fid=fid, pos=pos, dims=dims, $
out_name='layer_stack1.tif', r_fid=r_fid




; Exit ENVI
;
envi_batch_exit

end
[Message index]
 
Read Message
Read Message
Previous Topic: How to check if the widget_table is empty?
Next Topic: disable keyword "short forms"

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

Current Time: Wed Oct 08 17:53:23 PDT 2025

Total time taken to generate the page: 0.00382 seconds