IDL


I’m not sure if I have mentioned this before, but I have a method of exporting simple object graphics scenes to a web page using x3dom. Check out this example of sending a graphics hierarchy containing a polygon (the cow data set from the IDL distribution) to an interactive display on a web page.

This is currently a proof of concept and works for views, models, and polygons with simple properties only, but expanding to more classes and properties should be straightforward. I have done similar things for various other new destination classes for outputs such as POV-Ray and anaglyphs.

Sometimes it is useful to evaluate a mathematical expression that is defined by the user at runtime. This is pretty easy to do using the EXECUTE routine, but EXECUTE is not allowed in applications running in the Virtual Machine. What to do?

This issue has been a problem for me before so I wrote a simple arithmetic parser (docs).

Evaluates a mathematical expression using the basic arithmetic operators +, -, *, /, and ^ along with parentheses for grouping and simple function calls of a single variable.

This routine is implemented with a recursive descent parser and does not use EXECUTE, so it is safe to use in the Virtual Machine.

For example, simple arithmetic expressions can be evaluated:

IDL> print, mg_evalexpr('1 + 2 + 3', error=error), error
                     6       0

Note that the ERROR keyword returns whether there was an error in evaluating the expression. Expressions can also take variables, if their values are provided via a structure or hash-like object:

IDL> print, mg_evalexpr('exp(i * pi)', { pi: !dpi, i: complex(0, 1) })
(      -1.0000000,   1.2246468e-16)

“Hash-like” here means that the object implements a hasKey method and subscripting via brackets like the IDL 8.0 Hash class.

IDLdoc 3.4.3 fixes the bug that prevented search results from being displayed.

The new IDLdoc 3.4.2 release changes one small aspect of the .sav file in the distribution (the source distribution is example the same as the 3.4.1 release): it removes the IDL library routines from the .sav file, i.e., it doesn’t do a RESOLVE_ALL when constructing the .sav file.

Currently, IDLdoc is built with IDL 6.4 to maximize who can use it, but this means any included IDL library routines could conflict with the routines provided by the user’s IDL distribution. IDLdoc is intended to be run from the command line, i.e., a full version of IDL, not a runtime or VM environment, so the IDL library routines should be provided by the user’s IDL distribution.

Get the new version here.

David Fanning recently used IDLdoc to generate documentation for his Coyote Graphics library:

On-line documentation is now available for all 41 of the Coyote Graphics programs. (These are a subset of the programs in the Coyote Library.) This will make it much easier to use these Coyote Graphics programs.

There was a bug in IDLdoc 3.4 which caused crashes with certain content in the Requires tag. The fix is in IDLdoc 3.4.1, get it here.

Also, I have confirmation that IDLdoc will run on big libraries, i.e., over 4000 files, 7700 routines, and 850,000 lines of code!

I will be AGU next week (Tuesday through Thursday morning). I’ll be hanging out at the Tech-X booth (circled at right, just up from the NASA booth) most of the time, but will also be patrolling the posters and hitting a few talks as well.

Here’s our press release:

Tech-X Corporation invites you to visit our booth (Booth #1748) at the American Geophysical Union Fall Meeting 2011, December 5 – 9, at the Moscone Center in San Francisco.

We will be featuring GPU Computing, including GPULib, our library of mathematical kernels for GPU computing.

We will also be demonstrating the Remote Data Toolkit, which allows seamless access to remote data with IDL.

Personnel from Tech-X and/or their collaborators will be participating in the following activities:

Session A53C: Multisensor and Model Aerosol Data Inter-comparison and Synergy III Posters Friday, December 09 1:40PM – 6:00PM, Halls A – C

A53C-0382 Aerosol type estimations for the ERBE period (1985 – 1989) Jose R. Fernandez, SSAI, Hampton, VA; Seiji Kato, NASA Langley Research Center, Hampton, VA; Fred G. Rose, SSAI, Hampton, VA; David W. Fillmore, Tech-X Corporation, Boulder, CO

Exelis VIS will be at booth #1431; I haven’t heard about if there will be an IDL user group meeting.

UPDATE: Also, if you have an iPhone, I recommend the AGU app. It has been very useful already for me.

Full disclosure: I work for Tech-X Corporation.

IDLdoc 3.4 was released today. This is mostly a bug fix version, but there is on big feature: LaTeX equation formatting. To use LaTeX equations in your docs, just use standard LaTeX syntax anywhere plain text is allowed. For example, here is an example of using an equation in the main description:

;+
; Inverse hyperbolic cosine. Uses the formula:
;
; $$\text{acosh}(z) = \ln(z + \sqrt{z + 1} \sqrt{z - 1})$$
;
; :Returns:
;    float, double, complex, or double complex depending on the input
;
; :Params:
;    z : in, required, type=numeric
;       input
;-

The equation should be typeset like (results depend on browser):

$$\text{acosh}(z) = \ln(z + \sqrt{z + 1} \sqrt{z – 1})$$

Inline equations are also allowed. Both can appear in the main description and inside most tags (anywhere comments are just copied over to the output).

Here are the full release notes:

  1. Allow LaTeX equation formatting.
  2. Fix for bug where links to routines, files, etc. in directory overview comments on the overview page were not correct.
  3. Adding links to parent items in index entries.
  4. Changes to HTML output styling including larger type size.
  5. Fixed bug where DLM contents could not be references using backtick notation in rst markup syntax.
  6. Added private and hidden attributes to directory names in overview file.
  7. Not showing warnings page when USER keyword is set.
  8. Fixed bug where parsing rst Requires tag would cause IDLdoc to crash.
  9. Fixed bug where Warnings page showed items from private or hidden items.
  10. UPDATED 11/22: New color scheme.

[Download]

When writing applications or even just longer programs, I used to sprinkle in PRINT statements regularly, telling me of the progress of the program. At some point, I would think the program is working correctly and I would then have to search through the code to find all the PRINT statements to either comment them out (smart, but leaves ugly code behind) or delete them (dumb, I would eventually need them again when I discovered some problem). This approach has some definite drawbacks:

  1. there is no easy way to turn the complete output on and off, much less on a more granular level
  2. output goes to the output log, but sometimes it would be nicer to send the output to a log file
  3. PRINT provides little help for things that I commonly need to print like the time/date, the routine that the message is originating from, etc.

I’ve created the MG_LOG routine to help with these problems.

Continue reading “Logging.”

I’ve updated Modern IDL for some of the IDL 8.1 features, notably GRIB, function graphics enhancements1, and the IDLffVideoWrite class. PDF purchasers from this point on should get the new version and I will send out the update to the purchasers of the old PDF shortly. The first run of the print book is all sold; the second run is still at the printers. So if you order the print version right now, expect the book to ship sometime next week.

As always, see the Modern IDL website for purchasing, new code examples, table of contents, sample chapter (object graphics with the new function graphics updates!), and errata.


  1. Also, I switch back to the term “function graphics”, which was my original favorite term for the new graphics system, but I had gone away from it because there seemed to be consensus on the newsgroup to call it “new graphics.” I think “function graphics” is a better term that is less likely to not make sense when the next graphics system comes out. 

older posts »