IDL CEFLIB API for Windows
==========================

This delivery contains the IDL CEFLIB API for Windows.


[CAUTION]
====
This delivery contains binaries for x86_64 architecture (64 bits) 

They have to be used with x86_64 IDL version.
====

== Download

* link:documents/IDL_CEFLIB_Windows.zip[]

== Installation

=== Uncompress CEFLIB_Windows.zip

Unzip the IDL_CEFLIB_Windows.zip file in any directory of your choice.

We will find the following files:

* idl_cef.dlm
* idl_cef.dll
* CEFLIB.dll
* zlib1.dll

=== Identify the installation directory

The CEFLIB is delivered as a IDL DLM (Dynamically Loadable Module),
that has to be installed in a given directory in order to be used by IDL.

This directory is identified by an external system variable called IDL_DLM_PATH,
corresponding to an internal DLM_PATH IDL variable.

You can display the default value, using:

----
$ IDL
IDL> print, !DLM_PATH
c:\Program Files\ITT\IDL\IDL80\bin\bin.x86_64
IDL> exit
----

=== Install binaries

You can copy manually the 4 previous files in the DLM_PATH directory, and relaunch IDL.

Another possibility should be to update Windows environment variable IDL_DLM_PATH, setting to:

----
IDL_DLM_PATH="c:\your\installation\directory;<IDL_DEFAULT>"
----

=== Handling separate header files

If your CEF files are using separate CEH header files, you have to specifiy
the directories were to find such .ceh files

This is done using the CEFPATH environment variable.

The CEFPATH should contain a list of directories, separated by ;

.Example
----
CEFPATH="c:\data\cluster\cef\includes;c:\data\mission\cef\includes"
----


.Problem with IDL SETENV command on Windows !
[CAUTION]
====

If you are setting the CEFPATH variable in an IDL script file, using:

----
SETENV, "CEFPATH=C:\users\dupond\documents\CEF\includes"
----

The CEFPATH variable with be available from your IDL scripts, using : 

----
print, GETENV ("CEFPATH")
----

But, when you call the IDL CEFLIB library, using :

----
IDL> nbrecords = cef_read ("/path/to/myfile.cef")
----

The CEFPATH variable will not transmitted to the CEFLIB C library.

So, you have to set the CEFPATH before running IDL:

* by setting a Windows environment variable

* or in a script file, that set the variable and launch IDL.

====

=== Testing

Quit and relaunch IDL, as the DLM are read once during IDL startup.

----
$ IDL
IDL> filename = "C1_CP_WHI_ELECTRON_DENSITY__20020105_000000_20020106_000000_V071001.cef"
IDL> nbrec = cef_read (filename)
IDL> print, cef_varnames()
IDL> t = cef_var("time_tags")
IDL> d = cef_var ("electron_density")
IDL> plot, t, d
IDL> exit
----

[CAUTION]
====
The CEF file given in this example is not part of the delivery. 

You can use every .cef or .cef.gz file available on your computer, or downloaded from CAA/CSA.
====