Introduction to ENVI User Functions - Tutorial of ENVI Software - Completely GIS, GPS, and Remote Sensing Lecture Material - facegis.com
Introduction to ENVI User Functions

Overview of This Tutorial

This tutorial provides basic information on programming in ENVI. It covers the basics for creating user-defined band math functions and User Functions, including creating compound widgets and writing data tiling operations. This tutorial assumes that you are familiar with the "Interactive Data Language (IDL)" and understand how to write functions and procedures in IDL. ENVI RunTime users cannot program in ENVI.

Files Used in This Tutorial

You must have the ENVI CD-ROM mounted on your system to access the files used by this tutorial or copy the files to your disk.

The source codes for both the user-defined Band Math routines and the User Functions are included in the USER_FUN subdirectory in the ENVIDATA directory on the ENVI TUTORIALS & DATA CD-ROM. The image file BLDR_TM.IMG used in the tutorial is contained in the BLDR_REG subdirectory in the ENVIDATA directory on the ENVI TUTORIALS & DATA CD-ROM.

Required Files

BM_DIVZ1.PRO	Simple Band Math Function
BM_DIVZ2.PRO	Revised Band Math Function
TP_DIVZ1.PRO	ENVI User Function
TP_DIVZ2.PRO	Revised ENVI User Function
BLDR_TM.IMG	Boulder Thematic Mapper Data
BLDR_TM.HDR	ENVI Header for Above

Background - Programming in ENVI

ENVI provides a variety of interfaces for executing user written routines. User routines are written in the "Interactive Data Language (IDL)". IDL routines are written as functions or procedures and named with a .pro extension. This tutorial shows examples of two of these techniques - Band Math and User Functions. For descriptions of the ENVI programming functions used in this tutorial, see the ENVI User's Guide or on-line help.

ENVI processes data spatially or spectrally depending on the requirements of the function and on the input file storage format. If a function only operates either spatially or spectrally then the data must be accessed accordingly. However, if a process can be performed either spatially or spectrally, then ENVI operates on the data based on the file storage format. The three file storage formats that ENVI uses are Band Sequential (BSQ), Band Interleave by Line (BIL), or Band Interleave by Pixel (BIP) (See the ENVI User's Guide, on-line help, or ENVI Tutorials).

ENVI allows processing of image data larger than available memory. This is accomplished by breaking the data up into usable pieces or "tiles", processing the tiles separately, then reassembling the tiles into the output image. A tile is a piece of data processed in memory by ENVI. The size of a spatial tile is determined by the ENVI configuration item image tile size and is set by the user to optimize memory usage without exceeding the computer's physical memory size. Spatial tiles always include all the samples being processed and as many lines as possible. Spectral tiles on the other hand, are defined by the number of samples (ns) and the number of bands (nb) being processed. A BIL spectral tile is (ns, nb) and a BIP spectral tile is (nb, ns). Spectral tiles will always be this size and are unrelated to the set image tile size.

The basic process for a tiling operation in ENVI is as follows:

Initialize the ENVI tiles

Loop on the number of tiles

     request the tile

     process the tile

     [write result of the processing to disk or memory]

end loop

[Enter the data into Available Bands List]


User Defined Band Math Routines

This portion of the exercise will familiarize you with editing and compiling a .pro file (an IDL program). The compiled function is executed using ENVI's Band Math routine. Band math uses ENVI's tiling capabilities for handling large images. You will create a simple band math function that performs a mathematical expression using two bands. The optional keyword CHECK will enable divide by zero checking and the keyword DIV_ZERO will be used to set divide by zeros to another value.

Start ENVI

Before attempting to start the program, ensure that ENVI is properly installed as described in the installation guide.

  • To open ENVI in Unix, enter " envi " at the UNIX command line.
  • To open ENVI from a Windows or Macintosh system, d ouble-click on the ENVI icon.

The ENVI Main Menu will appear when the program has successfully loaded and executed.

Open TM Data

To open the Boulder, Colorado Thematic Mapper (TM) data:

Select File->Open Image File from the ENVI Main Menu.

  • On some platforms you must hold the left mouse button down to display the submenus from the Main Menu.
  • Navigate to the BLDR_REG subdirectory of the ENVIDATA directory on the ENVI TUTORIALS & DATA CD-ROM just as you would in any other application and select the file BLDR_TM.IMG from the list and click "OK".

The Available Bands List dialog will appear on your screen with the 6 available TM bands listed. This list allows you to select spectral bands for display and processing.

Edit the Band Math Function

Normally, you would open an editor and type in the following IDL function, however, this function has already been saved in the USER_FUN directory for your use as BM_DIVZ1.PRO. This is the initial part of the function.

  • If you choose to enter the function yourself, use IDL's text editor or your favorite editor, enter the text below, and save the function as BM_DIVZ1.PRO.

function bm_divz1, b1, b2

  ; Just do the ratio and ignore divide by zeros

  result = (float(b1) + b2) / (float(b1) - b2)

  return, result

end

Compile the Band Math Function

To compile the newly created function:

Select System->Compile Module from the ENVI Main Menu.

  1. When the Enter Module Filename dialog appears, navigate to the location of the saved function, BM_DIVZ1.PRO, and select the file.
  2. To make sure that the function compiled without errors, look in the IDL output log window.

On the PC and MAC this is the OUTPUT LOG window and under UNIX it is the shell window ENVI was started from. The following line will appear if the module compiled successfully.

% Compiled module BM_DIVZ1

  1. Edit and fix any errors for modules that did not compile successfully and recompile as above.

Run the Band Math Function

To run the compiled function select Basic Tools->Band Math from the ENVI Main Menu.

  1. When the Band Math dialog appears, enter the following in the "Enter an expression:" input text box:

bm_divz1(b1,b2)

  1. Click "OK".
  2. When the Variable/Band Pairings dialog appears, click on "B1" in the "Variables used in expression" list widget.
  3. From the "Available Bands List:" list widget, click on "Band 2".

Repeat the same process to pair B2 with TM Band 3.

  1. Select "B2" from the "Variables used in expression" list widget.
  2. From the "Available Bands List:" list widget, select "Band 3".

Now the "Variables used in expression:" should show the following.

B1- Band 2:bldr_tm.img

B2 - Band 3:bldr_tm.img

  1. Click "OK".
  2. When the Band Math Parameters dialog appears, select the "Output Result to File" toggle button, enter an output filename, and click "OK".

Since we are not checking for divide by zero errors, the IDL command log window should indicate that the program caused an arithmetic error;

% Program caused arithmetic error: Floating divide by 0.

Display the Result

Click on the "grayscale" toggle button in the Available Bands List dialog.

  1. Select the band math result we just created "Band Math (bm_divz1(b1,b2)):filename" and select "Load Band".
  2. Click the right mouse button in the Main Image display and select Functions->Interactive Analysis->Cursor Location/Value.
  3. Try to locate the divide by zero values in the image, which will have a data value of #INF. These pixels are black.

We will compare this result to the result of the next section.

Update the Band Math Function

To add a divide by zero check to the band math function:

  • Select the following code from the pre-saved file BM_DIVZ2.PRO , or type in the code using your favorite editor.

The following code is now the complete band math function.

function bm_divz2, b1, b2, check=check, div_zero=div_zero

if (keyword_set(check)) then begin

; If div_zero is set then use it otherwise use zero

if (n_elements(div_zero) gt 0) then $

temp_value = div_zero $

else $

temp_value = 0.0

; Find all the locations where the band is zero

temp = float(b1) - b2

ptr = where(temp eq 0, count)

; Temporarly set the divide by zero cases to divide by 1

if (count gt 0) then $

temp(ptr) = 1

; Perform the ratio

result = (float(b1) + b2) / temp

; If any divide by zeros then set the output

if (count gt 0) then $

result(ptr) = temp_value

endif else begin

; Just do the ratio and ignore divide by zeros

result = (float(b1) + b2) / (float(b1) - b2)

endelse

return, result

end

Compile the Band Math Function

To compile the updated function:

Select System->Compile Module from the ENVI Main Menu.

  1. When the Enter Module Filename appears, navigate to the location of the saved function, BM_DIVZ2.PRO, and select the file.
  2. To make sure that the function compiled, look in the IDL output log window.

On the PC and MAC this is the OUTPUT LOG window and under UNIX it is shell window ENVI was started from. The following line will appear if the module compiled successfully.

% Compiled module BM_DIVZ2

  1. Edit and fix any errors for modules that did not compile successfully.

Run the Band Math Function

The new function can now check for divide by zeros and can set them to an error value. To run the compiled function:

Select Basic Tools->Band Math.

  1. When the Band Math dialog appears, enter the following in the "Enter an expression:" input text box:

bm_divz2(b1,b2, /check, div_zero=1.0)

  1. Click "OK".
  2. When the Variable/Band Pairings dialog appears, click on "B1" in the "Variables used in expression" list widget.
  3. From the "Available Bands List:" list widget, click on "Band 2".

Repeat the same process to pair B2 with TM Band 3.

  1. Select "B2" from the "Variables used in expression" list widget.
  2. From the "Available Bands List:" list widget, select "Band 3".

Now the "Variables used in expression:" should show the following.

B1- Band 2:bldr_tm.img

B2 - Band 3:bldr_tm.img

  1. Select the "Output Result to File" toggle button, enter an output filename, and click "OK".

Display the Result

Start a new ENVI display window by selecting "New" next to "Active Display" on the Available Bands List.

  1. Select the band math result we just created, "Band Math (bm_divz2(b1,b2, /check, div_zero=1.0)):filename", and select "Load Band".

All the pixels that caused a divide be zero before and had a value of #INF are now white and have the value 1.0.

  1. To compare two pixels first, link the two displays by selecting Functions->Link Displays in the Main Display window.
  2. Select Functions->Interactive Analysis->Cursor Location/Value in the Main display.
  3. Roam around the image with the cursor until you find a 1.0 data value in Display #2 and the corresponding #INF data value in Display #1.

Creating a User Function

An ENVI User Function consists of adding a menu item, creating an event handler that defines the widget interface, using data tiling for accessing the data, and adding the output bands to the Available Bands list. The User Function you will create performs the same mathematical expression as the band math example above. The code has been pre-saved in the file TP_DIVZ1.PRO , or you can type in the code listed below using your favorite editor.

Editing envi.men

User functions can be added to the envi.men file and run from the menu like the rest of the ENVI routines.

Copy the envi.men file from the ENVI installation MENU subdirectory to another directory and filename.

  1. Enter the new filename (including the directory path) in the "default envi menu file" parameter in the envi.cfg file.

Exit ENVI so that you can update the envi.men file to include your new routine.

  1. To quit your ENVI session, click "Quit" or "Exit" on the ENVI Main Menu, then type " exit " at the IDL command prompt.
  2. Edit your new envi menu file and locate the line:

1 {User Functions}

  1. Directly below this line enter the following two lines for the new menu items:

2 {User Band Ratio1} {user ratio} {tp_divz1}

2 {User Band Ratio2} {user ratio} {tp_divz2}

where 2 indicates the menu level, {User Band Ratio} is the menu item name, {user ratio} is the name of the uvalue, and {tp_divz1} or {tp_divz2} is the name of the event handler.

  1. Close and save the new envi menu file.

Creating an Event Handler

This portion of the exercise will familiarize you with creating ENVI event handlers for user defined functions. You will use the ENVI file selection function and ENVI's compound widgets.

Edit the event handler

Enter the following code using your text editor or use the file included in the USER_FUN directory under the filename TP_DIVZ1.PRO.

The first thing to do in the routine is to extract the uvalue and compare it the uvalue in the envi menu file.

After receiving the uvalue the event handler selects the input file. ENVI_SELECT is used for file selection and spatial and spectral subsetting. Returned from ENVI_SELECT are the input file id (FID), the band dimensions (DIMS), and the selected bands (POS). If the returned FID equals -1 then the "Cancel" button was selected and the event handler must exit.

Since the processing routine is performing the same mathematical expression as the band math example, we need to make sure that at lease two bands are selected. If the improper number of bands are selected then ENVI_ERROR is used to give a warning message and the event handler exits.

Input parameters entered on the command line in the Band Math exercise are now entered using ENVI compound widgets.

  • Use WIDGET_AUTO_BASE to create a widget base which allows auto-management of widget events.
  • Use row and column bases for positioning the compound widgets WIDGET_MENU and WIDGET_PARAM to replace the keywords in the Band Math example.
  • WIDGET_MENU creates the "Check for divide by 0?" using an exclusive list to make a "Yes/No" toggle button.
  • WIDGET_PARAM accepts an input value that is used as the replacement for the divide by zero.
  • WIDGET_PARAM accepts a floating point number (DT=4) with three digits past the decimal points (FIELDS=3) with a default value of zero (DEFAULT=0.0).
  • Finally, WIDGET_OUTFM is used to prompt for the output filename or memory option.
  • Each of the compound widgets set the keyword /auto giving AUTO_WID_MNG the responsibility of managing the compound widgets.
  • AUTO_WID_MNG returns a structure with the tag names defined by the uvalue of each compound widget.
  • In addition, the structure contains the tag accept, which is set to one if the you select "OK" and zero if the "Cancel" button is selected.

In this example, we print the selections for "Check for divide by 0?" and the "Divide by zero value". The next exercise will use the same event handler but pass the arguments to the tile processing routine.

pro tp_divz1, ev

widget_control, ev.id, get_uvalue=uvalue

if (uvalue eq 'user ratio') then begin

envi_select, title='Ratio Input File', fid=fid, dims=dims, $

pos=pos

if (fid eq -1) then return

    ; We will just do a ratio of the first two band

; from the pos array so make sure there are at

; least two bands are selected

if (n_elements(pos) lt 2) then begin

mstr = 'You must select two bands to ratio.'

envi_error, mstr, /warning

return

endif

; Create a compound widget for the input parameters

    base = widget_auto_base(title='Ratio Parameters')

sb = widget_base(base, /column, /frame)

sb1 = widget_base(sb, /row)

mw = widget_menu(sb1, prompt='Check for divide by 0 ? ', $

list=['Yes','No'], /excl, default_ptr=0, rows=0, $

uvalue='check', /auto)

sb1 = widget_base(sb, /row)

wp = widget_param(sb1, prompt='Divide by zero value', $

dt=4, field=3, xs=6, uvalue='div_zero', default=0.0, /auto)

sb = widget_base(base, /column, /frame)

ofw = widget_outfm(sb, func='envi_out_check', $

      uvalue='outf', /auto)

; Automanage the widget

result = auto_wid_mng(base)

if (result.accept eq 0) then return

check = (result.check eq 0)

div_zero = result.div_zero

    help, result.outf, /st

print, check

print, div_zero

endif

end

 

  • If you are creating your own file, save this routine as TP_DIVZ1.PRO in the same directory as the new envi menu file or use the TP_DIVZ1.PRO in the USER_FUN directory.

Running the User Function

Follow the procedures below to compile and run the User Function from within ENVI.

Start ENVI

  • To open ENVI in Unix, enter " envi " at the UNIX command line.
  • To open ENVI from a Windows or Macintosh system, d ouble-click on the ENVI icon.

The ENVI Main Menu will appear when the program has successfully loaded and executed.

Open TM Data

To open the TM data:

Select File->Open Image File.

  • On some platforms you must hold the left mouse button down to display the submenus from the Main Menu.
  • When the Enter Input Data File dialog appears, navigate to the BLDR_REG subdirectory of the ENVI tutorial data directory and select the file BLDR_TM.IMG from the list.
  • Click "OK"

The Available Bands List dialog will appear.

Compile the Event Handler

To compile the newly created event handler:

Select System->Compile Module from the ENVI Main Menu.

  1. When the Enter Module Filename dialog appears, navigate to the location of the saved function, TP_DIVZ1.PRO, and select the file.
  2. To make sure that the function compiled, look in the IDL command window.

On the PC and MAC this is the COMMAND LOG window and under UNIX it is shell window you started ENVI from. The following line will appear if the module compiled successfully.

% Compiled module TP_DIVZ1

  1. Edit and fix any errors for modules that did not compile successfully.

Run the Event Handler

Select Utilities->User Functions->User Band Ratio1.

  1. When the Ratio Input File selection dialog appears, select BLDR_TM.IMG from the "Select Input File" list widget.
  2. Click "OK".

The Ratio Exercise Parameters dialog will appear and allow the selection of divide by zero checking, the divide by zero value, and an output filename.

  1. Select the "No" toggle button for the "Check for divide by 0".
  2. Enter 1.0 for the "Divide by zero value".
  3. Enter TP_DIVZ1.IMG as the output filename.
  4. Click "OK".
  5. Look in the IDL command log window to see the values printed at the bottom of the event handler.

Write the Tiling Routines

Follow the procedures below to create the tiling routines that allow ENVI to process large image files.

Creating the Tiling Routine

This portion of the exercise will familiarize you with creating ENVI tile processing routines. You will use the band math example and convert it to a tiling routine which uses the newly created event handler.

Updating the Event Handler

The first thing to do in the processing routine sets up the IO error handling. Next, ENVI_FILE_QUERY is used to get the filename (FNAME) and X and Y starting pixel (XSTART and YSTART). The filename is used for the processing status report and XSTART and YSTART are just used in the output image header.

The tile processing routine allows both output to file and memory, file operations open the output file for writing and memory output allocates a float array. Next, the ENVI tiles are initialized using ENVI_INIT_TILE. Since the processing routine uses two bands simultaneously the MATCH_ID is used on the second ENVI_INIT_TILE forcing processing tiles from the two bands to be the same size. ENVI_REPORT_INIT and ENVI_REPORT_INC set up a processing status widget and the report increment respectively.

Now that everything is initialized the processing routine can just loop over the number of tiles. At the start of each loop the processing status is updated and a check is made to see if the "Cancel" button was selected. The calls to ENVI_GET_TILE with the TILE_IDs return the data to process. Each tile is processed with the mathematical expression from the Band Math exercise. After processing the data memory items are written to the variable mem_res otherwise the result is written to a file.

Now that the processing is completed ENVI_ENTER_DATA or ENVI_SETUP_HEAD enter the new image into ENVI. Memory items use ENVI_ENTER_DATA while output to disk uses ENVI_SETUP_HEAD to open the file and write the ENVI header file (.HDR). Finally, the tile pointers and report are cleaned up using ENVI_TILE_DONE and ENVI_REPORT_INIT.

In the event handler replace the print statements with the call to the processing routine show below.

tp_divz_doit, fid=fid, pos=pos, dims=dims, check=check, $

  out_name=result.outf.name, div_zero=div_zero, $

  in_memory=result.outf.in_memory

 

Here is the new code for TP_DIVZ2.PRO. You can enter this using your favorite editor or use the file TP_DIVZ2.PRO saved in the USER_FUN directory.

pro tp_divz_doit, fid=fid, pos=pos, dims=dims,check=check,$

out_name=out_name, in_memory=in_memory, $

  div_zero=div_zero, r_fid=r_fid

; Set up the error catching and initialize optional keywords

!error = 0

on_ioerror, trouble

in_memory = keyword_set(in_memory)

; Get the file xstart and ystart and calculate ns and nl

envi_file_query, fid, fname=fname, xstart=xstart, $

    ystart=ystart

ns = dims(2) - dims(1) + 1

nl = dims(4) - dims(3) + 1

 

; Either alloate a memory array or open the output file

get_lun, unit

if (in_memory) then $

mem_res = fltarr(ns, nl) $

else $

openw, unit, out_name

 

; Initialize the data tiles

tile_id1 = envi_init_tile(fid, pos(0), $

    num_tiles=num_tiles, xs=dims(1), xe=dims(2), $

    ys=dims(3), ye=dims(4), interleave=0)

tile_id2 = envi_init_tile(fid, pos(1), match_id=tile_id1)

 

; Setup the processing status report

  if (in_memory) then tstr = `Output to Memory' $

  else tstr = `Output File: ` + out_name

  envi_report_init, [`Input File: ` + fname, tstr], $

    title='Ratio Processing', base=rbase, /interupt

 

  envi_report_inc, rbase, num_tiles

 

; Loop over each processing tile

for i=0, num_tiles-1 do begin

envi_report_stat, rbase, i, num_tiles, cancel=cancel

if (cancel) then begin

!error = envi_cancel_val()

goto, trouble

endif

 

; Retrieve the tile data

data1 = envi_get_tile(tile_id1, i, ys=ys, ye=ye)

data2 = envi_get_tile(tile_id2, i)

 

; Perform the ratio

if (keyword_set(check)) then begin

; Find all the locations where the band is zero

temp = float(data1) - data2

ptr = where(temp eq 0.0, count)

 

; Temporarly set the divide by zero cases to divide

; by 1, do the ratio, and then set the divide by zero

; to div_zero

if (count gt 0) then $

temp(ptr) = 1

 

result = (float(data1) + data2) / temp

 

if (count gt 0) then $

result(ptr) = div_zero

 

endif else begin

 

; Just do the ratio and ignore divide by zeros

result = (float(data1) + data2) / $

(float(data1) - data2)

endelse

 

if (in_memory) then $

mem_res(0,ys-dims(3)) = result $

else $

writeu, unit, result

 

endfor

 

; Process error messages

!error = 0

trouble: if (!error ne 0) then $

envi_io_error, 'Ratio Processing', unit=unit

free_lun, unit

 

if (!error eq 0) then begin

descrip = 'Ratio Processing'

if (in_memory) then $

envi_enter_data, mem_res, descrip=descrip, $

xstart=xstart+dims(1), ystart=ystart+dims(3), $

r_fid=r_fid $

else $

envi_setup_head, fname=out_name, ns=ns, nl=nl, nb=1, $

        data_type=4,interleave=0, xstart=xstart+dims(1), $

ystart=ystart+dims(3), /write, /open, r_fid=r_fid, $

descrip=descrip

endif

; Clean up the tile pointer and the status report

envi_tile_done, tile_id1

envi_tile_done, tile_id2

envi_report_init, base=rbase, /finish

end

 

pro tp_divz2, ev

widget_control, ev.id, get_uvalue=uvalue

if (uvalue eq 'user ratio') then begin

envi_select, title='Ratio Input File', fid=fid, dims=dims, $

pos=pos

if (fid eq -1) then return

 

; We will just do a ratio of the first two band

; from the pos array so make sure there are at

; least two bands are selected

if (n_elements(pos) lt 2) then begin

mstr = 'You must select two bands to ratio.'

envi_error, mstr, /warning

return

endif

 

; Create a compound widget for the input parameters

    base = widget_auto_base(title='Ratio Parameters')

sb = widget_base(base, /column, /frame)

sb1 = widget_base(sb, /row)

mw = widget_menu(sb1, prompt='Check for divide by 0 ? ', $

list=['Yes','No'], /excl, default_ptr=0, rows=0, $

uvalue='check', /auto)

sb1 = widget_base(sb, /row)

wp = widget_param(sb1, prompt='Divide by zero value', $

dt=4, field=3, xs=6, uvalue='div_zero', default=0.0, /auto)

 

sb = widget_base(base, /column, /frame)

ofw = widget_outfm(sb, func='envi_out_check', $

uvalue='outf', /auto)

; Automanage the widget

result = auto_wid_mng(base)

if (result.accept eq 0) then return

check = (result.check eq 0)

div_zero = result.div_zero

tp_divz_doit, fid=fid, pos=pos, dims=dims, check=check, $

out_name=result.outf.name, div_zero=div_zero, $

in_memory=result.outf.in_memory

endif

end

Compile the Tile Processing Routine

To compile the updated tile processing routine:

Select System->Compile Module from the ENVI Main Menu.

  1. When the Enter Module Filename dialog appears, navigate to the location of the saved function, TP_DIVZ2.PRO, and select the file.
  2. To make sure that the function compiled, look in the IDL command window.

On the PC and MAC this is the COMMAND LOG window and under UNIX it is shell window you started ENVI from. The following line will appear if the module compiled successfully.

% Compiled module TP_DIVZ2

  1. Edit and fix any errors for modules that did not compile successfully.

Run the Tile Processing Routine

Select Utilities->User Functions->User Band Ratio2.

  1. When the Ratio Input File selection dialog appears, select BLDR_TM.IMG from the "Select Input File" list widget.
  2. Be sure to select "Spectral Subset" and select only bands 2 and 3.
  3. In the Spectral Subset dialog, click "OK".
  4. Click "OK" in the "Ratio Input File" selection dialog.

The Ratio Exercise Parameters dialog will appear and allow the selection of divide by zero checking, replacement value, and output to memory or file.

  1. Select the "Yes" toggle button for the "Check for divide by 0".
  2. Enter 1.0 for the "Divide by zero value".
  3. Select the output to "File" toggle button, enter a file name and click "OK".

The resulting image will be placed into the Available Bands List.

Display the Result

  • Select the newly created band in the Available Bands list and select "Load Band" to display the image.

This image should be the same as the Band Math example for the case that checked for divide by zero values.

End the ENVI Session

This concludes the User Function Tutorial.

  • Click "Quit" or "Exit" on the ENVI Main Menu, then type exit at the IDL command prompt.

Notes on Autocompiling

The two routines created in this tutorial can be set up to autocompile for future ENVI sessions.

  • To autocompile, place the two .PRO files in the save_add directory of the ENVI installation and restart ENVI. They will be compiled whenever ENVI is started.

Source: http://www.ltid.inpe.br