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
14971 Rate this article:
5.0

Native OPeNDAP support in IDL

Anonym

OPeNDAP is an acronym for "Open-source Project for a Network Data Access Protocol." From the OPeNDAP website: “OPeNDAP provides software which makes local data accessible to remote locations regardless of local storage format.” Through Unidata’s netCDF-4 library, IDL 8.2 includes native support for OPeNDAP, though currently only on Mac OS X and Linux. Joe Lee of The HDF Group has created an example of using OPeNDAP with a community-generated IDL client. I’d like to modify (and slightly expand) his example to instead use the native OPeNDAP support in IDL 8.2. Start with the URL to an AIRS level 3 standard daily product file (HDF-EOS format) hosted on The HDF Group’s OPeNDAP-enabled server:

 IDL> url = 'http://eosdap.hdfgroup.uiuc.edu:8080/opendap/data/NASAFILES/hdf4/AIRS.2008.10.27.L3.RetStd001.v5.2.2.0.G08303124144.hdf' 

Access the file at this URL using netCDF library calls. Open the file with NCDF_OPEN, which returns an identifier (a long integer) for the file:

 IDL> file_id = ncdf_open(url)

What’s in this file? Use NCDF_INQUIRE to find the number of variables, dimensions and attributes:

 IDL> info = ncdf_inquire(file_id) IDL> help, info ** Structure <85778ac>, 4 tags, length=16, data length=16, refs=1: NDIMS           LONG                26 NVARS           LONG               274 NGATTS          LONG                 0 RECDIM          LONG                -1

There are 274 variables in this file. Use NCDF_VARIDSINQ to get identifiers for all the variables:

 IDL> var_ids = ncdf_varidsinq(file_id) IDL> help, var_ids VAR_IDS         LONG      = Array[274]

Use NCDF_VARINQ to get information about the last variable in the file:

 IDL> help, ncdf_varinq(file_id, var_ids[-1]) ** Structure <85779ec>, 5 tags, length=40, data length=40, refs=1: NAME            STRING    'TopographyU274' DATATYPE        STRING    'FLOAT' NDIMS           LONG                 2 NATTS           LONG                 3 DIM             LONG      Array[2]

Extract data from this last variable in the remote file to your IDL session. Use NCDF_VARID to get an identifier for the variable, by name (note that this string is case-sensitive), and NCDF_VARGET to actually get the data, which will be stored locally in the variable topo.

 IDL> topo_id = ncdf_varid(file_id, 'TopographyU274') IDL> ncdf_varget, file_id, topo_id, topo IDL> help, topo TOPO            FLOAT     = Array[360, 180]

We’ve successfully pulled data from the remote file into IDL! To properly visualize these data, also get their geographic coordinates:

 IDL> latitude_id = ncdf_varid(file_id, 'LatitudeU271') IDL> longitude_id = ncdf_varid(file_id, 'LongitudeU272') IDL> ncdf_varget, file_id, latitude_id, latitude IDL> ncdf_varget, file_id, longitude_id, longitude IDL> help, longitude, latitude LONGITUDE       FLOAT     = Array[360] LATITUDE        FLOAT     = Array[180]

Then close the file:

 IDL> ncdf_close, file_id

Visualize these topography data as a contour plot in a map projection:

 IDL> m = map('Miller Cylindrical', $ > color='gray', $ > label_color='black', $ > label_position=0, $ ; move labels to edges > title='AIRS.2008.10.27.L3 Topography') IDL> nlevels = 11 IDL> levels = findgen(nlevels)*500 + 250 ; meters IDL> g = contour(topo, longitude, latitude, $ > overplot=m, $ >   c_value=levels, $ >   rgb_table=33, $ >   background_color='dark blue', $ >   /fill, $ >   grid_units='degrees') IDL> c = mapcontinents(color='white') IDL> cb = colorbar(target=g, $ >   position=[0.2, 0.13, 0.85, 0.15], $ >   title='Elevation (m)')

and save the visualization to a PNG file:

 IDL> p.save, 'idl_opendap_ex.png', resolution=150 

The result (click to embiggen): AIRS topography retrieved via OPeNDAP with IDL Grab the source code for this example from here.

Please login or register to post comments.