X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 05 Aug 2009 01:40 AM by  anon
ENVI_PICKFILE, /MULTIPLE_FILES
 1 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
05 Aug 2009 01:40 AM
    hi all, its may be a simple question again, but i cann't get a solution. in the envi help there is no example for this. ok....i want to filter multiple files with adapt_filt_doit but it doesn'n work and i am sure, that anybody of you can help me very quickly. here the example code: pro filter3 compile_opt STRICTARR   ;   ; First restore all the base save files.   ; envi, /restore_base_save_files ENVI_INIT, /batch_mode   ;   ; Open the input file   ; ; open file image = ENVI_PICKFILE($    TITLE='Pick a calibrated image', $    FILTER='*cali.img', /MULTIPLE_FILES) ENVI_OPEN_FILE, image , r_fid=fid   if (fid eq -1) then begin     envi_batch_exit     return   endif ENVI_FILE_QUERY, fid, dims=dims, nb=nb, geo_points=geo_points, nl=nl, ns=ns   pos  = lindgen(nb)   out_name = image+'_lee.img' ;Filter parameters kx = 5    method = 6 noise_type = 0 cmax=1.2909 cu = 0.3019 damp = 1 ;nlook = 3 print, 'Filtering...' ENVI_DOIT, 'adapt_filt_doit', fid=fid, pos=pos, dims=dims, out_name=out_name, kx=kx, noise_type=noise_type, method=method, $                               CMAX=cmax, CU=cu, DAMP=damp ENVI_SETUP_HEAD, fname=out_name, ns=ns, nl=nl, nb=1, interleave=0, geo_points=geo_points, data_type=4, /WRITE   ;   ; Exit ENVI   ;   envi_batch_exit end   if i click on all files in the directory the script stops with the error massage: " expression must be a scalar or 1 element array in this context: Array[19]   if i am right, that means, that there are two much files selected...if i select only one file, the script works very well. so...my question...which sense makes the /multiple_files in this case or the other way around...how can i solve this with using /multiple_files? is there a need for using " for" statement and how does it look like. thanks in advance... cheers, christine  

    Deleted User



    New Member


    Posts:
    New Member


    --
    05 Aug 2009 05:55 AM
    ok...sorry...i found the mistake in the script it now works very well. i just add:   ; open file image = ENVI_PICKFILE($    TITLE='Pick a calibrated image', $    FILTER='*cali.img', /MULTIPLE_FILE) num_image = n_elements(image) for f=0, num_image-1 do begin ENVI_OPEN_FILE, image[f] , r_fid=fid   if (fid eq -1) then begin     envi_batch_exit     return   endif   ;   ; Set the POS keyword to process all   ; spectral data. Output the result   ; to disk.   ; ENVI_FILE_QUERY, fid, dims=dims, nb=nb, geo_points=geo_points, nl=nl, ns=ns   pos  = lindgen(nb) out_name = image[f]+'_lee.img'   bye
    You are not authorized to post a reply.