Note: If you are new to IDL or upgrading from an older version, see also:
IDL now has a bridge from IDL to Python and Python to IDL. From your IDL code, you can now access any Python modules, transfer variables, and call built-in functions. Similarly, from your Python code, you can make IDL calls, transfer variables, and manipulate IDL objects. The bridge has the following features:
For example, within IDL, you could execute the following Python commands to create a matplotlib plot:
IDL> ran = Python.Import('numpy.random')
IDL> arr = ran.rand(100) ; call "rand" method
IDL> plt = Python.Import('matplotlib.pyplot')
IDL> p = plt.plot(arr) ; call "plot", pass an array
IDL> void = plt.show(block=0) ; pass keyword
Within IDL, you can also directly enter Python "command-line mode":
IDL> >>>
>>> import matplotlib.pyplot as plt
>>> import numpy.random as ran
>>> arr = ran.rand(100)
>>> p = plt.plot(arr)
>>> plt.show()
>>>
IDL>
On the Python side, you can easily access all IDL functionality:
>>> from idlpy import IDL
>>> import numpy.random as ran
>>> arr = ran.rand(100)
>>> p = IDL.plot(arr, title='My Plot')
>>> p.color = 'red'
>>> p.save('myplot.pdf')
>>> p.close()
For more information see the Python Bridge documentation.
Along with the Python Bridge, IDL now has a kernel for running IDL in an IPython notebook. See the Python Bridge documentation for details.
The DIALOG_COLORPICKER function allows you to interactively select a color using a selection dialog. The basic dialog grid includes 64 standard colors. You can et custom and preferred colors using keywords.
IDL_Object has a new _overloadFunction method which allows you to create "function pointers" in IDL. By implementing IDL_Object::_overloadFunction for your class, you can have your object behave like an IDL function. See IDL_Object::_overloadFunction for details.
IDL_Object has a new _overloadMethod method which allows you to create "dynamic methods" in IDL. By implementing IDL_Object::_overloadMethod for your class, your users can call arbitrary methods on your object. See IDL_Object::_overloadMethod for details.
You can use the new IDL_Variable::ToList method to easily convert IDL variables into lists. See IDL_Variable::ToList for details.
You can use the new WGET function to quickly and easily retrieve files from URLs:
IDL> WGET('http://www.google.com/index.html',FILENAME='test.html')
C:\test.html
BARPLOT, ELLIPSE, and POLYGON now have four new properties: PATTERN_BITMAP, PATTERN_ORIENTATION, PATTERN_SPACING, and PATTERN_THICK. You can use these properties to create either pattern fills or line fills. For example:
data = (RANDOMU(s,10)+0.1) < 1
bottom = (data/4-0.1) > 0
b = BARPLOT(data, $
BOTTOM_VALUES=bottom, $
FILL_COLOR='red', $
BOTTOM_COLOR='yellow', $
C_RANGE=[0,1], $
/HORIZONTAL, PATTERN_ORIENTATION=45, $
PATTERN_SPACING=6, PATTERN_THICK=3)
For details see BARPLOT, ELLIPSE, and POLYGON.
Previously, to create a nested hash of hashes, you would need to use multiple statements, such as the following:
h = HASH()
h['a'] = HASH()
h['a', 'b'] = HASH()
h['a', 'b', 'c'] = 5
Now, when you use "unknown" subscripts for array indexing, IDL will automatically create the necessary nested hash. For example:
h = HASH()
h['a', 'b', 'c'] = 5
PRINT, h, /IMPLIED
IDL prints:
{
"a": {
"b": {
"c": 5
}
}
}
The IDLgrPalette::NearestColor method now accepts arrays for the red, green, and blue arguments. This significantly increases the speed when computing the nearest color for thousands of input values.
The READ_CSV function can now read CSV files that are on a remote server, simply by specifying a URL for the file name. The QUERY_CSV function can also be used with URLs.
The SOCKET procedure has three new keywords to enable you to create server-side sockets. The ACCEPT keyword specifies a LUN on which to accept communications, the LISTEN keyword specifies a port to listen to, and the PORT keyword specifies the port number. See SOCKET for details.
The CDF library has been upgraded to version 3.6.0.4. In addition, the CDF_LIB_INFO and CDF_CONTROL routines have new keywords for handling leap seconds and sparse records.