GNU Data Language (GDL) is a free clone of Interactive Data Language
(
IDL
), which is an interpreted language used to manipulate scientific
data and draw plots. GDL partially supports both
HDF4
and
HDF5
.
Additionally, it supports
netCDF
.
Depending on computer systems users used, installing GDL may be easy. For example, Linux Ubuntu provides the GDL package. Other popular Linux systems may also provide the GDL package.
If your system does not have GDL installed, you need to build GDL from source code.
Building GDL from source code requires PLplot[1] and
GNU Scientific Library (GSL)[2].
In particular, building PLplot was not easy, and
it generated two errors that required manual fixes. First, it could
not detect correct paths for Python executables, libraries and
include files. We had to manually specify them. Second, when
installing PLplot, a missing .mod files error occurred. We had to
manually copy three .mod files from the bindings/f95 directory.
Installing the current version of GDL requires special attention if HDF4 or HDF5 is built
with
SZIP
. In this case, the
configure script will fail. Users have
to patch the configure script to link the HDF4 or HDF5 library with SZIP.
Based on personal email communications with a GDL developer,
the next release of GDL may fix the configuration problem (release date should be after Sep. 8th, 2009).
If
netCDF-4
built with HDF5 is used, the
configure script should be
fixed further because GDL assumes that netCDF does not depend on
HDF5, which is no longer true if netCDF-4 is built with HDF5. In the
configure.in file, netCDF-4 rule should be located after HDF5 rule.
Also, the user should add -lhdf5_hl to LIBS for HDF5 rule because
netCDF-4 uses them. Since GDL uses HDF5 1.6 API, H5_USE_16_API should be defined for the preprocessor if it is linked with HDF5 1.8 or later.
Please note that a GDL developer notified us in email that the above netCDF-4/HDF5 configure script problem is resolved in GDL 0.9rc4.
Since GDL has only a thin abstraction layer, it exposes format-specific differences to users. For example, all HDF4-related function names start with HDF while all HDF5-related function names start with H5. Both HDF4 and HDF5 are partially supported.
Figure 1 is an example of code that reads data from an HDF4 SDS
and stores all values in the tbocean variable. These statements
can be typed under the GDL environment. We will use one
AMSR-E AE_RnGd
file from NSIDC.
You can download the file explained in this page from
here.
One GDL function is mapped to one HDF4 C API as the above example
shows. For example, HDF_SD_START() is equivalent to SDstart().
For more detailed information, refer to the HDF4 reference manual.
To read an HDF5 file, a different set of functions that resemble
HDF5 C API should be used.
We used the HDF4-to-HDF5 Conversion tool[3] to convert the AMSR-E HDF-EOS2 file
to anHDF5 file. The converted file was renamed to
AMSR_E_L3_RainGrid_B05_200707.h5.
Users can download this HDF5 file from
here.
Figure 2 shows code that opens an
HDF5 file and reads all values in a dataset. Although this is
equivalent to Figure 1, the code is very different because the
file formats are different.
Similar to the HDF4 interface, one GDL function is mapped to one HDF5 C API, which means that users need to know how to use HDF5 C API.
IDL
provides functions such as
MAP_SET for mapping
points on the earth's surface, but GDL does not implement this,
as of June 2008. GDL can draw contours and surfaces, but it lacks
the ability to shade surfaces.
After reading data from a file by using the code shown in either Figure 1 or Figure 2, a contour can be drawn by the following command: