27 Mar 2015 01:30 PM |
|
Hi all,
I'm trying to call ENVI in an IDL procedure. When I type "e = ENVI()" as is reccomended on this tutorial on a newly started IDL session, ENVI start up. However, if I open a session where I've tested some scripts I'm trying to run, I usually get the following error:
^
% Syntax error.
If I call ENVI as a function as I've seen in other examples, the same script will say ENVI is not a defined function. What could I be doing wrong?
Thanks!
|
|
|
|
MariM Veteran Member
Posts:2396  
27 Mar 2015 02:07 PM |
|
Do your scripts define any paths in IDL? If the is undefined, then IDL will not find ENVI and you could get errors.
|
|
|
|
Deleted User New Member
Posts:29  
29 Mar 2015 03:10 PM |
|
No they don't. How do I define it?
|
|
|
|
MariM Veteran Member
Posts:2396  
30 Mar 2015 08:37 AM |
|
It should be defined in the IDLDE preferences under IDL->Paths.
In your pro code, do you have the following line?
compile_opt IDL2
|
|
|
|
Deleted User New Member
Posts:29  
03 Apr 2015 12:32 PM |
|
With the "COMPILE_OPT IDL2, I still get an error, although now it looks like:
IDL> TimeSeriesExample
% Compiled module: TIMESERIESEXAMPLE.
% Attempt to call undefined procedure/function: 'ENVI'.
% Execution halted at: TIMESERIESEXAMPLE 9 D:\Projects\bcal-import\TimeSeriesExample.pro
% $MAIN$
IDL>
What path do I need to call in the script to make sure it uses the right directory, and what path should I set in the IDL preferences after IDL_ENVI?
|
|
|
|
MariM Veteran Member
Posts:2396  
06 Apr 2015 06:40 AM |
|
Do you launch ENVI in batch mode? If you launch IDL only, you need to start batch mode or ENVI. To start batch:
Using the new environment:
e=envi(/headless)
or in classic mode:
envi_batch_init
|
|
|
|