; ; This example code illustrates how to access and visualize ; LaRC TES L3 CH4 HDF-EOS5 Grid file in IDL. ; ; If you have any questions, suggestions, comments on this example, ; please use the HDF-EOS Forum (http://hdfeos.org/forums). ; ; If you would like to see an example of any other NASA HDF/HDF-EOS ; data product that is not listed in the HDF-EOS Comprehensive Examples page ; (http://hdfeos.org/zoo), feel free to contact us at eoshelp@hdfgroup.org ; or post it at the HDF-EOS Forum (http://hdfeos.org/forums). ; ; Usage: ; ; $idl TES-Aura_L3-CH4_r0000033028_C01_F01_12.he5.idl ; ; Tested under: IDL 8.7.2 ; Last updated: 2021-12-02 file_name='TES-Aura_L3-CH4_r0000033028_C01_F01_12.he5' datafield_name='/HDFEOS/GRIDS/NadirGrid/Data Fields/SurfacePressure' ; Open file. file_id=H5F_OPEN(file_name) ; Open dataset. data_id=H5D_OPEN(file_id,datafield_name) data=H5D_READ(data_id) ; Retrieve lat and lon. Lat_NAME='/HDFEOS/GRIDS/NadirGrid/Data Fields/Latitude' lat_id=H5D_OPEN(file_id,Lat_NAME) lat=H5D_READ(lat_id) Lon_NAME='/HDFEOS/GRIDS/NadirGrid/Data Fields/Longitude' lon_id=H5D_OPEN(file_id,Lon_NAME) lon=H5D_READ(lon_id) ; Get units. units_id=H5A_OPEN_NAME(data_id, 'Units') units=H5A_READ(units_id) ; Get missing value. missingvalue_id=H5A_OPEN_NAME(data_id,'_FillValue') missingvalue=H5A_READ(missingvalue_id) H5A_CLOSE, missingvalue_id ; Get title. title_id=H5A_OPEN_NAME(data_id,'Title') title=H5A_READ(title_id) H5A_CLOSE, title_id ; Convert data type. dataf=FLOAT(data) ; Close data set and file id. H5D_CLOSE, data_id H5F_CLOSE, file_id ; Process fill value. idx=WHERE(data EQ missingvalue(0), cnt) if cnt gt 0 then dataf[idx]=!Values.F_NAN ; Get min and max value of data. datamin=min(dataf, /NAN) datamax=max(dataf, /NAN) ; Generate the plot. m = MAP('Geographic', TITLE=file_name, FONT_SIZE=9, /BUFFER) ct = COLORTABLE(72, /reverse) t1 = TEXT(0.35, 0.01, Title) c1 = CONTOUR(dataf, lon, lat, /FILL, OVERPLOT=m, $ RGB_TABLE=ct, $ GRID_UNITS='degrees', POSITION=[0.1, 0.1, 0.83, 0.9]) mc = MAPCONTINENTS() cb = COLORBAR(TARGET=c1, /BORDER, ORIENTATION=1, TEXTPOS=1, POSITION=[0.85,0.2,0.87,0.8], TITLE=units) png = file_name + '.idl.png' c1.save, png, HEIGHT=600, WIDTH=800 EXIT