X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 24 Apr 2009 01:19 PM by  anon
Calling envi routines without opening the environment
 2 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
24 Apr 2009 01:19 PM
    Hello all, I would like to use ENVI/IDL to work as a server for image analysis. We already have quite a large code in ENVI/IDL, and it would be difficult to maitain a parallel code in fortan or whatever. Our server is windows based,so as it is not possible to open the GUI from a CGI, and as the command line version of IDL is only available on linux, I am willing to switch to this OS. But, the fact is that I have been reading the Envi Help, and I don't find a way for IDL to load the Envi libraries, without lauchning the ENVI GUI... Do anybody knows if there is a way to load the envi libraries into IDL without the GUI? As this step is crucial for our application, I will thank you very much for any kind of help!!!!   Best Regards,   Michel Le Page  

    MariM



    Veteran Member


    Posts:2396
    Veteran Member


    --
    28 Apr 2009 08:47 AM
    When you run ENVI in true batch mode, you run in IDL only.  To do this, at the beginning of your code, you restore the ENVI files and initiate batch.  For example: ENVI, /RESTORE_BASE_SAVE_FILES  ;(which restores the same .sav files as when ENVI launches) ENVI_BATCH_INIT  ;(initializes batch mode) There are many examples in the ENVI help on how to launch an ENVI batch program from IDL only.  Are you asking if you can run a batch routine without launching the IDL Workbench?

    Deleted User



    New Member


    Posts:
    New Member


    --
    28 Apr 2009 10:32 AM
    Sounds like you want to start up a batch session of ENVI.  Here's how (from the ENVI docs under ENVI Programmer's Guide > Working in Batch Mode > Initiating Batch Mode): Initiating ENVI batch mode requires you to restore several ENVI save files (.sav) and call the ENVI routine ENVI_BATCH_INIT. The combined process is referred to as initiating batch mode. The save files are binary format files that contain the ENVI library routines and internal variables required to run ENVI. Do not attempt to initialize ENVI in batch mode from an IDL session that is currently running an interactive ENVI session. Instead, start a new IDL session to initialize ENVI in batch mode. Start ENVI. From the ENVI main menu bar, select File ? Preferences. Click Miscellaneous and ensure that the Exit IDL on Exit from ENVI option is set to No. Exit ENVI and, if required, exit IDL. Start a new IDL session and enter the following command at the IDL command line: ENVI, /RESTORE_BASE_SAVE_FILES If you forget to use the keyword RESTORE_BASE_SAVE_FILES, you will start a normal ENVI session. If you have multiple versions of IDL installed on your computer, be sure that the IDL executable you are using to start a new IDL session is the same one associated with your ENVI installation (where the main ENVI directory is installed). In a standard UNIX installation, the ENVI executable file is in the following location:/usr/local/itt/idlxx/products/envixx/bin/envi.run The path to the IDL executable in the same installation is in the following location:/usr/local/itt/idlxx/bin This IDL installation includes an extra file (envi.sav) in the idlxx/lib/hook directory. If you try initiating batch mode from a separate installation of IDL (if you are not using ENVI + IDL), you will receive the error "Attempt to call undefined procedure/function: ENVI." Next, call the ENVI__BATCH_INIT procedure from the IDL command line: ENVI_BATCH_INIT Calling ENVI_BATCH_INIT is nearly identical to starting a new ENVI session, except there is no GUI. After batch mode has been established, all subsequent calls to ENVI_BATCH_INIT are ignored. The following is example code for initiating batch mode: ; ******************************************************* ; This batch example shows how to initialize ENVI ; in batch mode. ; ; For more information see the ENVI Programmer's Guide. ; ******************************************************* ; Copyright (c) 2000-2001, ITT Visual Information Solutions. ; ******************************************************* pro bt_init envi, /restore_base_save_files envi_batch_init, log_file='batch.log' ; Batch processing would go here envi_batch_exit end  
    You are not authorized to post a reply.