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 . It also supports OPeNDAP via netCDF interface.
Depending on computer systems users used, installing GDL may be easy.
For example, there are numerous packaged versions of GDL available for various OSes. For example, you can install GDL for CentOS 6 using yum install gdl
.
If your you want to try map support, you need to build GDL from source code. The packaged GDL doesn't include map support.
However, building from source is very difficult and we don't recommend it. GDL is still in beta (0.9.x) release and map support may not work as documented by the GDL team. In addition, building GDL from source code requires PLplot[1], GNU Scientific Library (GSL)[2], GNU Readline Library[3] and other optional packages. Please note that HDF4 library should be built with --disable-netcdf
option if you want to support OPeNDAP via NetCDF.
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[4] to convert the AMSR-E HDF-EOS2 file
to an HDF5 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.
To read a remote data via OPeNDAP, a different set of functions that resemble NetCDF API should be used. Figure 3 shows code that opens an OPeNDAP AIRS data and reads a 3-D variable.
IDL provides functions for plotting data on a map such as
MAP_SET
but GDL does not support this by default. However, basic plotting functions are supported pretty well.
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 code in Figure 4.
CONTOUR
can accept lat/lon with data as shown in Figure 6.