X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 14 May 2010 05:24 PM by  anon
'math_doit' with multiband output images
 1 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
14 May 2010 05:24 PM
    Hi, Basically i have a script that makes a stack of 12 input files (22 layers).  The script transforms them to all be the same interleave and datatype(2=integer).  The problem is that two of the multiband files are byte. When i try to use 'math_doit'  for exp=fix(b1) i can not get it to output a multiband file. After opening the file and checking the datatype i have this chunck of code:  IF (dt eq 1) THEN BEGIN pos = lindgen(nb)       IF (nb GT 1) Then Begin                        fidMath = strarr(nb)                        for z =0, nb-1 Do fidMath[z]=fid                        fid = fidMath       ENDIF  envi_doit,'math_doit', fid=fid, dims=dims, exp=exp, out_name = out_name, pos=pos, r_fid = r_fid_int   But i am only getting a one band output!  fid= [25,25] pos=[0,1], dims = -1           0        7067           0        7198 and out_name has an appropriate value.   Please help me see what is going wrong! thanks, ska1

    MariM



    Veteran Member


    Posts:2396
    Veteran Member


    --
    17 May 2010 12:15 PM
    When using MATH_DOIT on multiple bands for multiple band output, you have to loop through each band.  The result will be several separate bands so then you can put them back together using something like CF_DOIT.  An example might be: for i=0,num_bands-1 do begin     envi_doit, 'math_doit', dims=dims, exp=expression, pos=pos[i], $        fid=input_fid, out_name=out_name, r_fid=r_fid, /in_memory     out_fid[i]=r_fid endfor pos=lonarr(num_bands) envi_doit, 'cf_doit', dims=dims, fid=out_fid, pos=pos, out_dt=2, $     out_name=out_name, /remove, r_fid=result_fid
    You are not authorized to post a reply.