What's New

# What's New in IDL 8.5

Note: If you are new to IDL or upgrading from an older version, see also:

- What's New in IDL 8.4.1
- What's New in IDL 8.4
- What's New in IDL 8.3
- What's New in IDL 8.2.3
- What's New in IDL 8.2.2
- What's New in IDL 8.2.1
- What's New in IDL 8.2
- What's New in IDL 8.1
- What's New in IDL 8.0

## New Features

### Python Bridge

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:

- Works with Python 2.7+ and Python 3.4+
- Access to all IDL routines and Python modules
- Seamless: looks just like an IDL object or Python module
- All bridge output is redirected to the standard output
- Case sensitivity and row/column major is handled automatically
- Can execute arbitrary command strings in either language
- Automatic data conversion from IDL arrays to numpy arrays
- Data is passed by reference when calling routines/methods
- Can pass main variables back & forth

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.

### IDL IPython Notebook Kernel

Along with the Python Bridge, IDL now has a kernel for running IDL in an IPython notebook. See the Python Bridge documentation for details.

### Color Selection

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.

### Function Pointers

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.

### Dynamic Methods

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.

### IDL_Variable::ToList Method

You can use the new IDL_Variable::ToList method to easily convert IDL variables into lists. See IDL_Variable::ToList for details.

### WGET to Retrieve URL Files

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

## Updates

### BARPLOT, ELLIPSE, and POLYGON now support fill patterns

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.

### HASH: Auto-Instantiation of Nested Hash Elements

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

}

}

}

### IDLgrPalette::NearestColor Now Accepts Arrays

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.

### READ_CSV Can Now Read from URLs

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.

### SOCKET: Create Server-Side Sockets

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.

### Library updates

### Upgrade to CDF Library

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.