Tag Archives: arrays

A column sort routine

In spreadsheet programs like Excel or LibreOffice, you can apply a sort on a column to every other column in the spreadsheet. IDL’s SORT function doesn’t provide this functionality, but with a little code, we can make it so. The … Continue reading

Posted in language, programming | Tagged , , | 2 Comments

Dynamically creating variables in a program

There are situations where it may be useful to create variables at runtime in an IDL program, taking the variable names from a string array. Though there are a couple ways of doing this, I’d like to use SCOPE_VARFETCH here, … Continue reading

Posted in data access, language | Tagged , , , , | 1 Comment

The minimum and maximum operators

Have you used the minimum (<) and maximum (>) operators in IDL? They’re among my favorites; they’re binary operators that return the smaller (minimum) or larger (maximum) of their operands. For example, 5 is larger than 2, so the minimum … Continue reading

Posted in language | Tagged , , , , , | 3 Comments

An LSD radix sort algorithm in IDL

(Note: I’m at the HDF and HDF-EOS Workshop XV this week, so today I have a guest post by Atle Borsholm, a Senior Consultant in the Exelis VIS Professional Services Group. Atle is an IDL master. I’m trying to persuade … Continue reading

Posted in data analysis, language, programming | Tagged , , , , | 6 Comments

Converting an indexed image into an RGB image

Here’s an example of how to convert an indexed image into an RGB image. Though they require more memory, I often find RGB images easier to work with because I don’t have to deal with color tables: I invariably forget … Continue reading

Posted in data access, language | Tagged , , , , | 2 Comments

Order of operations in an expression

Given a floating-point array x, which of these two statements: IDL> y1 = 2.0 * x / 3.0 IDL> y2 = x * (2.0 / 3.0) executes faster, the first or the second? Note that both statements produce the same … Continue reading

Posted in language, programming | Tagged , | 3 Comments