7212
How to create an ENVI *.sav file for ENVI Runtime Use
This article outlines the steps that are required to create an ENVI *.sav file. In order to do so you must have ENVI+IDL installed.
Complete the following steps to create an ENVI save file from within an IDL session. If you are currently running an ENVI session, be sure to exit ENVI before saving and compiling your user function procedure in IDL. Otherwise, your ENVI save file (*.sav) will include all of the compiled ENVI routines.
1. Reset your session
To ensure that no unwanted session information is saved along with the program enter the following at the IDL command prompt(not case sensitive):
IDL>.FULL_RESET_SESSION or
IDL>.F
2. Open the ENVI procedure (*.pro)
Suppose your code is called 'my_envi_function.pro'. Open and then compile it by entering the following at the IDL command prompt:
IDL> .COMPILE my_envi_function.pro
3. Call RESOLVE_ALL
From the IDL command line call 'resolve_all' to compile all dependent routines in the code. Since the program is using any ENVI library routines, use the SKIP_ROUTINES keyword to not resolve those routines. This is necessary because IDL doesn't 'understand' ENVI routines.
IDL> Resolve_All, /continue_on_error, skip_routines='envi'
This is an example of what may be seen at the output window:
% Attempt to call undefined procedure/function: 'ENVI_GET_PROJECTION'.
% Execution halted at: RESOLVE_ALL_BODY
% Attempt to call undefined procedure/function: 'ENVI_PROJ_CREATE'.
% Execution halted at: RESOLVE_ALL_BODY
4. Create the ENVI save file (*.sav)
Finally, to create the ENVI *.sav file use the SAVE procedure at the IDL command line, and set the ROUTINES keyword:
IDL> SAVE, file='my_envi_function.sav', /routines