Re: Problem with ENVI_DOIT, 'CF_DOIT' [message #34537] |
Wed, 26 March 2003 15:23  |
Pete[2]
Messages: 3 Registered: February 2003
|
Junior Member |
|
|
It should be fine to use the ENVI_DOIT, 'CF_DOIT' routine, since this is the
routine used when you use the New File Builder (File>Save File As>ENVI
Standard) which allows you to create a new multiband file from several
single band files (That must be all the same size).
Just remember that you must pass an array of band positions (pos)
corresponding to the bands you want to use, and an array of the
corresponding File ID's (fid). In your case, pos will be an array of zeros
corresponding to the number of single band files.
A simple example would be something like:
; Open the files
envi_open_file, 'Band1.img', r_fid=fid1
envi_open_file, 'Band2.img', r_fid=fid2
envi_open_file, 'Band3.img', r_fid=fid3
; Query one of the files to get the dimensions
; Note ALL the files MUST be the same size
envi_file_query, fid1, ns=ns, nl=nl
dims = [-1, 0, ns-1, 0, nl-1]
; Build the fid and pos arrays
fid=[fid1,fid2,fid3]
pos=[0,0,0]
; Create the new ENVI file
envi_doit, 'cf_doit', fid=fid, pos=pos, dims=dims, $
out_name="New_File.img", r_fid=r_fid
end
Cheers,
Peter
"St�phane SAUX PICART" <stephane.saux-picart@cesbio.cnes.fr> wrote in
message news:d95ff3c7.0303260201.46b3d2bf@posting.google.com...
> I am trying to use the ENVI routine: ENVI_DOIT, 'CF_DOIT'
> I have several files containing only one band and I would like to save
> them in a single file containing several bands.
> Is it possible to use that routine?
> Are there other ways to compute that?
>
> Thank you
>
> St�phane SAUX PICART
|
|
|