7811
How to use personalized ENVI files and save_add directories on UNIX.
Note: This Help Article applies to the classic ENVI interface, and not to the more modern default interface used in ENVI 5 and later versions.
ENVI allows the user to customize several files which control different aspects of ENVI functionality, including envi.cfg (the system configuration file), envi.men (the file which controls the layout of the main menu), display.men (the file which controls the layout of the display window menu), map_proj.txt (a file containing parameters for map projections), colors.txt (a file defining the ENVI graphics colors in RGB terms), and others (see "ENVI File Formats" in the online help). Unfortunately, most ENVI users on UNIX systems do not have permission to change these files, or to add their own procedures to the ENVI save_add directory. This is because installation of ENVI on UNIX machines must be performed by the system administrator logged in as root. Moreover, it may be inappropriate to customize the installed versions of these files, because on many UNIX systems multiple users work with the same installation of ENVI. This article provides instructions for UNIX users interested in establishing and customizing their own ENVI files and directories.
To customize ENVI files for yourself on a UNIX system, without affecting other users who may run the same installation of ENVI, follow these steps:
1.) Copy the ENVI files you are interested in customizing to your home directory from the installation directories. The files envi.men, display.men, colors.txt, and envi.cfg are located in the ENVI menu directory. The map_proj.txt file is located in the ENVI map_proj directory.
2.) Copy the file called ‘e_locate.pro’, which can be found in the ENVI menu directory, into your home directory. The presence of a .pro file in your home directory will cause IDL to add your home directory to the search path when it starts up, allowing ENVI to find your copy of the envi.cfg file.
3.) Next add lines to your .cshrc (or .tcshrc for tcsh on some systems) file in your home directory which will a.) execute the ENVI setup file when you start a new csh (or tcsh) shell and b.) add your home directory tree into the IDL file search path. This will ensure that ENVI will find the files in your home directory before it finds the copies of them which are in the default installation location, where you don't have write permission. The lines to your .cshrc (or .tcshrc) file that run the ENVI setup file and sets the IDL search path should look something like this:
# Set up environment for ENVI 4.0 and modify IDL search path variable (IDL_PATH).
# (Expecting previously defined IDL search path variable definition.)
source /usr/local/rsi/idl_6.0/products/envi_4.0/bin/envi_setup
setenv IDL_PATH '+/home/myusername:'$IDL_PATH
You will need to change the home directory path, shown here as +/home/myusername, to your own home directory path. You may also need to change the directory path to the envi_setup file if your ENVI installation is a later version or in a location other than /usr/local/rsi.
NOTE: If you anticipate that $IDL_PATH will be undefined (no prior IDL search path customizations) then be sure to use the string "<IDL_DEFAULT>" in place of "$IDL_PATH" at the end the second command. Notice in the following example "<IDL_DEFAULT>" is inside of the right single quote character (2 lines):
# Set up environment for ENVI 4.0 and modify IDL search path variable (IDL_PATH).
# (Not using previously defined custom IDL search path definition.)
source /usr/local/rsi/idl_6.0/products/envi_4.0/bin/envi_setup.bash
unsetenv IDL_PATH
setenv IDL_PATH '+/home/myusername:<IDL_DEFAULT>'
Using ENVI 4.0 from Bash:
For ENVI 4.0 and higher, the installation contains an ENVI setup file for Bash shell. In that case, the something like the following equivalent commands can be placed in the .bashrc file in your home directory.
Previously defined IDL search path definition:
# Set up environment for ENVI 4.0 and modify IDL search path variable (IDL_PATH).
# (Expecting previously defined IDL search path variable definition.)
. /usr/local/rsi/idl_6.0/products/envi_4.0/bin/envi_setup
IDL_PATH='+/home/myusername:'$IDL_PATH
export IDL_PATH
Not using previously defined custom IDL search path definition
# Set up environment for ENVI 4.0 and modify IDL search path variable (IDL_PATH).
# (Not using previously defined custom IDL search path definition.)
. /usr/local/rsi/idl_6.0/products/envi_4.0/bin/envi_setup.bash
unset IDL_PATH
IDL_PATH='+/home/myusername:<IDL_DEFAULT>'
export IDL_PATH
4.) Edit the envi.cfg file to point to the new menu, map projection, or colors file(s) in your home directory. The easiest way to edit the envi.cfg file is in interactive ENVI by choosing [
File -> Preferences] from the main ENVI menu.
5.) You can now edit the ENVI files in your home directory, and the changes will be implemented when you start ENVI.
Establish A Personal Save_Add Directory
To establish a personalized save_add directory, first establish a personal ENVI configuration file (envi.cfg) as described above. Then follow these steps:
1.) Make a directory named save_add in your home directory, or in any directory for which you have write permission.
2.) Edit your personal ENVI configuration file (envi.cfg) to specify the new default save_add directory.
Now when you call ENVI from the UNIX prompt, ENVI starts looking in the IDL_PATH for the envi.cfg file, finds one in the first place it looks (your home directory), and then reads the ENVI configuration file to determine where to find the rest of the setup files and the save_add directory.