X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 19 Aug 2009 11:17 AM by  anon
MATH_DOIT more than two bands
 3 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
19 Aug 2009 11:17 AM
    I am using MATH_DOIT for processing some indices (see code below). This has worked fine with an equations with only two bands but I cannot get equations with three bands to work. I keep receiving an error: Error: "Attempt to subscript FID with I is out of range" Additionally is there anyway I could process more than one equation at a time and assign them different names?     pro bandmath_CSIT compile_opt idl2 input_path = 'E:\FinalProcessing\GrassValley_Slide\georef_atcoroutput\' cd, 'E:\FinalProcessing\GrassValley_Slide\burn_indices\'     files=FILE_SEARCH(input_path+'*_rotate', count=count)     IF(count EQ 0)THEN BEGIN   PrintF, 'No files were found to process' ENDIF ;open file     for i=0, count-1 do begin       ENVI_OPEN_FILE, files[i], r_fid=fid       if(fid eq -1) then begin         envi_batch_exit         return     endif envi_file_query, fid, dims=dims, ns=ns, nl=nl, fname=filename ;set pos array for calculation t_fid=[fid,fid] pos = [9, 24, 51]-1 exp = '(b9/(b24*b51))' ;set the output filenames by stripping out the base name and appending 'nbr.img' out_name = file_basename(filename, '_rotate')+'_CSIT' ;call the doit envi_doit,'math_doit',$     fid=t_fid, pos=pos, dims=dims,$     exp=exp, out_name=out_name, $     r_fid=r_fid endfor end

    Deleted User



    New Member


    Posts:
    New Member


    --
    19 Aug 2009 11:31 AM
    I'm wondering if the problem is in the area of your t_fid variable. It looks to me like you have 2 fids there but you have 3 bands. What happens if you use the following instead: t_fid = [fid, fid, fid]

    Deleted User



    New Member


    Posts:
    New Member


    --
    19 Aug 2009 11:35 AM
    Perfect, thank you!!

    Deleted User



    New Member


    Posts:
    New Member


    --
    23 Oct 2009 10:44 AM
    In the script above what does the '-1'  in pos = [9, 24, 51]-1 actually do?
    You are not authorized to post a reply.