X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 12 Jun 2014 11:54 AM by  anon
Newbie Question
 1 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
12 Jun 2014 11:54 AM
    Hello, I am literally just getting started with IDL so forgive me for making any seriously obvious mistakes. I am just running a few batch examples from the ENVI Reference Guide. I've just copied and pasted the CROSS_TRACK_CORRECTION_DOIT example into the IDL DE, save it, compile it, and run it. It seems to compile successfully and run through the couple of print statements I threw in for understanding. But it doesn't create a logfile or an output image. I know this is probably something extremely fundamental, but I am not seeing the solution. Any thoughts? script below: pro example_cross_track_correction_doit ; ; First restore all the base save files. ; envi, /restore_base_save_files ; ; Initialize ENVI and send all errors ; and warnings to the file batch.txt ; envi_batch_init, log_file='C:\Program Files\Exelis\ENVI50\classic\data\batch.txt' ; ; Open the input file ; envi_open_file, 'C:\Program Files\Exelis\ENVI50\classic\data\bhtmref.img', r_fid=fid if (fid eq -1) then begin ; envi_batch_exit return endif ; Set the keywords. We will perform the ; cross track correction on all samples ; and bands in the file. The correction will ; be in the samples direction, multiplicative, ; and with a 2nd order polynomial. ; envi_file_query, fid, ns=ns, nl=nl, nb=nb dims = [-1L, 0, ns-1, 0, nl-1] pos = lindgen(nb) out_name = 'C:\Program Files\Exelis\ENVI50\classic\data\bhtmref_xtrk.img' range_dir = 0 method = 1 order = 2 ; ; Perform the cross track correction ; envi_doit, 'cross_track_correction_doit', fid=fid, pos=pos, dims=dims, range_dir=range_dir, out_name=out_name, method=method, order=order print, 'out_name =', out_name print, 'range_dir =', range_dir print, 'dims =', dims ; Exit ENVI ; ; envi_batch_exit end

    Deleted User



    New Member


    Posts:
    New Member


    --
    13 Jun 2014 08:42 AM
    Just in case anyone else runs into this issue, I can at least explain how I fixed my issue...and that was to switch over to starting the ENVI API and not ENVI Classic. So: pro example_cross_track_correction_doit e = envi(/HEADLESS) ; Open the input file envi_open_file, 'C:\Program Files\Exelis\ENVI50\classic\data\bhtmref.img', r_fid=fid if (fid eq -1) then begin ; envi_batch_exit return endif ; Set the keywords. We will perform the ; cross track correction on all samples ; and bands in the file. The correction will ; be in the samples direction, multiplicative, ; and with a 2nd order polynomial. envi_file_query, fid, ns=ns, nl=nl, nb=nb dims = [-1L, 0, ns-1, 0, nl-1] pos = lindgen(nb) out_name = 'C:\Program Files\Exelis\ENVI50\classic\data\bhtmref_xtrk.img' range_dir = 0 method = 1 order = 2 ; Perform the cross track correction envi_doit, 'cross_track_correction_doit', fid=fid, pos=pos, dims=dims, range_dir=range_dir, out_name=out_name, method=method, order=order ; Exit ENVI e.close end I'm not sure if IDL was trying to run both ENVI and ENVI Classic at the same time (which apparently is a nono), but this seems to fix the issue of not outputting anything.
    You are not authorized to post a reply.