What’s New in IDL 8.5

Wednesday, September 09, 2015

IDL 8.5 includes new features and functionality such as a new bi-directional IDL-Python bridge, new time series routines, a new color picker, new functional programming enhancements, and more. Learn how IDL 8.5 can help you interpret your data, expedite discoveries, and deliver powerful applications to market.



Note: If you are new to IDL or upgrading from an older version, refer to the What's New topics for previous releases.

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 in IDL Help.

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 in IDL Help 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 set 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.

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.

IDL_Variable::ToList Method

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

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 the BARPLOT, ELLIPSE, and POLYGON topics in IDL Help.

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.

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.


© 2015 Exelis Visual Information Solutions, Inc., a subsidiary of Harris Corporation. All Rights Reserved. This information is not subject to the controls of the International Traffic in Arms Regulations (ITAR) or the Export Administration Regulations (EAR). However, this information may be restricted from transfer to various embargoed countries under U.S. laws and regulations.

Rate this article:
No rating
Tags:

Number of views (4845)/Comments (0)

Please login or register to post comments.

Name:
Email:
Subject:
Message:
x

FEATURED CASE STUDY

MOST POPULAR



© 2017 Exelis Visual Information Solutions, Inc., a subsidiary of Harris Corporation