IDL is a solution for data visualization and it can visualize a remote HDF-EOS file through OPeNDAP .
IDL version 8.4 and later includes support for OPeNDAP using netCDF4 library.
Call the NCDF_OPEN
function. You can inquire the contents of the
data using NCDF_LIST
.
You can retrieve a variable (e.g., Temperature_MW_A
) data and geolocation data from OPeNDAP resource using NCDF_VARGET
. In addtion, you can retrieve attribute value of a variable using NCDF_ATTGET
.
You can see the complete IDL OPeNDAP code from here. You need to change username and password in the complete code.
OPeNDAP IDL Client method is not going to work with NASA server that requires Earthdata login.
OPeNDAP used to provide the OPeNDAP IDL Client that is no longer supported. In this example, we assume that you have both IDL software and the OPeNDAP IDL Client installed on your system. The IDL is a commercial software that requires a purchase of license. You can download the OPeNDAP IDL Client from here for free.
OPeNDAP IDL Client (idl-client 3.6.1) requires OCAPI (ocapi 1.4.3) and cURL library. If you use IDL 8.0 or above, the latest cURL library will not work with ocapi 1.4.3 and idl-client 3.6.1. It will cause OPENDAP_CONNECT() failure. Please use curl version 7.14.0 if you see such failure. In addition, the make install may fail during idl-client 3.6.1 installation. If it fails, you should copy manually the newly-built libraries under the .libs/ directory to your install directory (e.g., /path/to/install/prefix/lib). You can use ls -a UNIX command to list the hidden .libs/ directory under the unpacked idl-client source directory.
The first step is to create a URL variable. Define an OPeNDAP URL variable that serves an HDF-EOS file. You can download the file in this example here.
Call the OPENDAP_GET
function. This function is provided by the
OPeNDAP IDL client library. If IDL failed to retrieve the data specified in
URL, you'll see an error message
failed to retrieve OPeNDAP data. Also, the return value of
stat will be 0. You can view the contents of the
data by typing help, /str, data
.
From the contents, you'll see that OPeNDAP Array is represented as an IDL
STRUCT
variable.
Grid
as follows.
levels
will be used later to generate a contour map.
Now we're ready to draw the dataset defined above. The following code prepares a window with 12 colors and grid map. The CONTOUR
command fills the grid map with HDF-EOS data(e.g., data.TOPOGRAPHY.TOPOGRAPHY.TOPOGRAPHY).
As you can see from the Figure 10, the color filled contour can hide the original map grid and continents because the dataset covers the world. Thus, we want to draw the outlines of the continent again. The following codes will add the grid lines and world maps on top of the color-filled contour map.