X

NV5 Geospatial Blog

Each month, NV5 Geospatial posts new blog content across a variety of categories. Browse our latest posts below to learn about important geospatial information or use the search bar to find a specific topic or author. Stay informed of the latest blog posts, events, and technologies by joining our email list!



Not All Supernovae Are Created Equal: Rethinking the Universe’s Measuring Tools

Not All Supernovae Are Created Equal: Rethinking the Universe’s Measuring Tools

6/3/2025

Rethinking the Reliability of Type 1a Supernovae   How do astronomers measure the universe? It all starts with distance. From gauging the size of a galaxy to calculating how fast the universe is expanding, measuring cosmic distances is essential to understanding everything in the sky. For nearby stars, astronomers use... Read More >

Using LLMs To Research Remote Sensing Software: Helpful, but Incomplete

Using LLMs To Research Remote Sensing Software: Helpful, but Incomplete

5/26/2025

Whether you’re new to remote sensing or a seasoned expert, there is no doubt that large language models (LLMs) like OpenAI’s ChatGPT or Google’s Gemini can be incredibly useful in many aspects of research. From exploring the electromagnetic spectrum to creating object detection models using the latest deep learning... Read More >

From Image to Insight: How GEOINT Automation Is Changing the Speed of Decision-Making

From Image to Insight: How GEOINT Automation Is Changing the Speed of Decision-Making

4/28/2025

When every second counts, the ability to process geospatial data rapidly and accurately isn’t just helpful, it’s critical. Geospatial Intelligence (GEOINT) has always played a pivotal role in defense, security, and disaster response. But in high-tempo operations, traditional workflows are no longer fast enough. Analysts are... Read More >

Thermal Infrared Echoes: Illuminating the Last Gasp of a Dying Star

Thermal Infrared Echoes: Illuminating the Last Gasp of a Dying Star

4/24/2025

This blog was written by Eli Dwek, Emeritus, NASA Goddard Space Flight Center, Greenbelt, MD and Research Fellow, Center for Astrophysics, Harvard & Smithsonian, Cambridge, MA. It is the fifth blog in a series showcasing our IDL® Fellows program which supports passionate retired IDL users who may need support to continue their work... Read More >

A New Era of Hyperspectral Imaging with ENVI® and Wyvern’s Open Data Program

A New Era of Hyperspectral Imaging with ENVI® and Wyvern’s Open Data Program

2/25/2025

This blog was written in collaboration with Adam O’Connor from Wyvern.   As hyperspectral imaging (HSI) continues to grow in importance, access to high-quality satellite data is key to unlocking new insights in environmental monitoring, agriculture, forestry, mining, security, energy infrastructure management, and more.... Read More >

1345678910Last
«July 2025»
SunMonTueWedThuFriSat
293012345
6789101112
13141516171819
20212223242526
272829303112
3456789
15515 Rate this article:
4.2

IDL 8.4 - Sliced bread, step aside

Jim Pendleton

For my money, there have been a handful of IDL releases that have had the greatest impact on my ability to produce efficient and flexible applications in my professional life, both in my 18+ years in the Custom Solutions Group and in my earlier incarnations as a science data analyst for various research projects.

  • Version 1:  "You mean I don't have to spend hours writing Tektronix PLOT-10 FORTRAN programs to see my data?"  My remaining undergrad years flew by after that.
  • Version 3.6: Cross-platform widget support and a GUI-oriented development environment
  • Version 5.0. Object Graphics and object-oriented language syntax
  • Version 6.4. The last of the releases largely shepherded by Ali Bahrami, former IDL product architect, provided much of the infrastructure for TCP/IP client and server applications we rely on.

IDL 8.4 has the potential to have a similar level of positive influence on the way I write code.  In particular the addition of built-in variable attributes and static methods will at the very least reduce the amount of code needed to perform the functionality I use regularly in IDL through functions such as SIZE, STRTRIM, and N_ELEMENTS.

 

Using other programming languages such as Python as a pattern, IDL_Variable types have been extended to have object-like behavior when certain syntax is encountered by the interpreter at run-time.

 

Some static methods and attributes act as more compact means to access existing functionality.  Some of these also offer improved performance relative to their procedural counterparts.

 

Others represent brand-new functionality that in previous releases required multiple IDL statements.  Don't overlook this wide selection of new static methods that expand functionality. For example, there's a very useful new static substitution method on string variables, ".Replace".

 

Though it's not called out explicitly, you can add your own static methods as well.

 

For example, to serialize an IDL variable's contents for transmission via HTTP, for example in an ENVI Services Engine task request parameter, we might compress the data and convert to a Base-64 encoding.


FUNCTION IDL_Variable::jp_Serialize, s
   COMPILE_OPT STATIC
   RETURN, IDL_Base64(ZLib_Compress(s))
END

 

IDL> b = BINDGEN(5,5)
IDL> r = b.jp_Serialize()
IDL> r
eJxiYGRiZmFlY+fg5OLm4eXjFxAUEhYRFROXAAAAAP//AwAKQQEt

 

In order to reconstruct the variable on the receiving end, the client will need the ASCII stream along with the data type code and the dimensions.  The latter two items can be retrieved via the variable attributes ".Typecode" and ".Dim".

 

IDL> b.typecode, b.dim
           1
           5           5

 

The deserialization static method is simply the inverse operation.

 

FUNCTION IDL_Variable::jp_Deserialize, s, TYPE=type, DIMENSIONS=dims
    COMPILE_OPT STATIC
    RETURN, ZLIB_Uncompress(IDL_Base64(s), TYPE=type, DIMENSIONS=dims)
END

 

IDL> r.jp_Deserialize(TYPE=1,DIMENSIONS=[5,5])
   0   1   2   3   4
   5   6   7   8   9
  10  11  12  13  14
  15  16  17  18  19
  20  21  22  23  24

 

For future compatibility it's important to provide a namespace for your IDL_Variable class extensions that have little potential to conflict with possible extensions by the IDL engineering team in the future.  In this example, I'm using a "jp_" prefix.

 

Given that the IDL_Variable class does not extend objects or structures, how would you consider implementing a serialization/deserialization mechanism for those data types?  For named structures and objects, it's entirely possible via proxy static class methods and temporary SAVE files.  This is an exercise left for the reader.  Or a topic for a future blog post!

Please login or register to post comments.