Comprehensive Examples

This page provides comprehensive examples on how to access and visualize various NASA HDF/HDF-EOS files using IDL ®, MATLAB® and NCL. Other tools and programming languages examples can be found here.

Please read this special note first before you proceed further.

For a list of examples for the different data centers, click on the examples in the table below.

NASA Data Centers Product Examples using different tools
GESDISC [Examples]
LAADS [Examples]
LP DAAC [Examples]
LaRC
LaRC Product Type File Codes Plots Note
CERES
more examples
Grid CERES_EBAF_TOA_Terra_Edition1A_200003-200510.nc.hdf NCL MATLAB
MATLAB(nc)
IDL NCL MATLAB MATLAB(nc) IDL nc:MATLAB NetCDF interface is used.
CER_ES4_TRMM-PFM_Edition1_009001.199808.hdf NCL MATLAB IDL NCL MATLAB IDL
CER_AVG_Aqua-FM3-MODIS_Edition2B_007005.200510.hdf NCL MATLAB IDL NCL MATLAB IDL
CER_ES4_Aqua-FM3_Edition1-CV_024032.200908.hdf NCL MATLAB IDL NCL MATLAB IDL Reference number is used in IDL and MATLAB to define field since multiple fields share same name.
CER_ISCCP-D2like-Day_Aqua-FM3-MODIS_Beta1_023030.200612.hdf NCL MATLAB IDL NCL MATLAB IDL Values for lat/lon are obtained using the formular from NASA website; IDL and MATLAB generate plots in Geographic, Hammer and Sinusoidal projections, but NCL cannot generate plots in Sinusoidal projection.
NCL MATLAB IDL NCL MATLAB IDL
NCL MATLAB IDL NCL MATLAB IDL
CER_ISCCP-D2like-GEO_Composite_Beta1_023031.200510.hdf NCL MATLAB IDL NCL MATLAB IDL
CER_SRBAVG3_Aqua-FM3-MODIS_Edition2A_016031.200510.hdf NCL MATLAB IDL NCL MATLAB IDL Value for latitude and longitude are followed the formular from NASA website
CER_SYN_Aqua-FM3-MODIS_Edition2B_007005.20051031.hdf NCL MATLAB IDL NCL MATLAB IDL
CER_ZAVG_Aqua-FM4-MODIS_Edition2B_007005.200503.hdf NCL MATLAB IDL NCL MATLAB IDL
NCL MATLAB IDL NCL MATLAB IDL line graphic
MISR
more examples
Grid MISR_AM1_CGAL_2005_F06_0012.hdf NCL MATLAB IDL NCL MATLAB IDL
MISR_AM1_TC_ALBEDO_P223_O056884_F05_0011.hdf
lat_MISR_TC_ALBEDO_P223_F05_lvl50.output
lon_MISR_TC_ALBEDO_P223_F05_lvl50.output
NCL MATLAB
MATLAB(z)
IDL
IDL(z)
NCL MATLAB
MATLAB(z)
IDL
IDL(z)
Latitude and longitude are generated by HDF-EOS2 Dumper
MISR_AM1_GRP_ELLIPSOID_GM_P117_O058421_BA_F03_0024.hdf
MISR_AM1_AGP_P117_F01_24.hdf
lat_MISR_ELLIPSOID_P117_F03.output for all blocks*
lon_MISR_ELLIPSOID_P117_F03.output for all blocks* lat_MISR_ELLIPSOID_P117_F03_lvl50.output for 1 block
lon_MISR_ELLIPSOID_P117_F03_lvl50.output for 1 block
NCL*
NCL
MATLAB*
MATLAB
MATLAB(z)
IDL*
IDL
IDL(z)
NCL*
NCL
MATLAB*
MATLAB
MATLAB(z)
IDL*
IDL
IDL(z)
Latitude and longitude are generated by HDF-EOS2 Dumper.
NCL*
NCL
MATLAB*
MATLAB
MATLAB(z)
IDL*
IDL
IDL(z)
NCL*
NCL
MATLAB*
MATLAB
MATLAB(z)
IDL*
IDL
IDL(z)
Latitude and longitude are retrieved from MISR_AGP file.
MOPITT
more examples
Grid MOP02-20000303-L2V5.7.1.val.hdf NCL MATLAB IDL NCL MATLAB IDL IDL and MATLAB cannot retrieve the latitude and longitude because the values are stored as 1-D array for swath.
MOP03-20000303-L3V1.0.1.hdf NCL MATLAB IDL NCL MATLAB IDL Vertical cross section of longitude pressure
NCL MATLAB IDL NCL MATLAB IDL Horizontal plot
NCL MATLAB IDL NCL MATLAB IDL Vertical cross section of latitude pressure
TES Swath TES-Aura_L2-O3-Nadir_r0000011015_F05_07.he5 NCL MATLAB IDL NCL MATLAB IDL
NCL MATLAB IDL NCL MATLAB IDL line graphic
Grid TES-Aura_L3-CH4_r0000010410_F01_07.he5 NCL MATLAB IDL NCL MATLAB IDL  
NSIDC [Examples]
PO.DAAC [Examples]
Ocean Biology Processing Group [Examples]
GHRC [Examples]
ICESat-2 [Examples]
Table 1: Sample Data Files and Code Examples

We also provide examples for other data centers that produce HDF4 files.

Other Data Centers Product Examples using different tools
CloudSAT Data Processing Center [Examples]
Ocean Productivity [Examples]
Table 2: Sample Data Files and Code Examples from Other Data Centers

We also extracted and documented information for sample HDF-EOS2/HDF4 and HDF-EOS5 files that are useful to determine the EOS contents stored in the sample files. Please click here for HDF-EOS2/HDF4 and here for HDF-EOS5 to read comprehensive description and retrieve sample files.


Last modified: 05/14/2012
About Us | Contact Info | Archive Info | Disclaimer
Sponsored by NASA Cooperative Agreement Grant Number NNX08AO77A / Maintained by The HDF Group