; ; This example code illustrates how to access and visualize LaRC TES ; O3 Nadir HDF-EOS5 Swath 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_L2-O3-Nadir_r0000002433_F08_12.he5.idl ; ; Tested under: IDL 8.7.2 ; Last updated: 2021-11-29 ; Open file. file_name='TES-Aura_L2-O3-Nadir_r0000002433_F08_12.he5' file_id=H5F_OPEN(file_name) ; Retrieve data. datafield_name='/HDFEOS/SWATHS/O3NadirSwath/Data Fields/O3' data_id=H5D_OPEN(file_id, datafield_name) data_raw=H5D_READ(data_id) ; Get 'Title' attribute. title_id=H5A_OPEN_NAME(data_id, 'Title') long_name=H5A_READ(title_id) H5A_CLOSE, title_id ; Get 'Units' attribute. units_id=H5A_OPEN_NAME(data_id, 'Units') units=H5A_READ(units_id) H5A_CLOSE, units_id ; Get '_FillValue' attribute. fill_value_id=H5A_OPEN_NAME(data_id, '_FillValue') fill_value=H5A_READ(fill_value_id) H5A_CLOSE, fill_value_id ; Close dataset. H5D_CLOSE, data_id ; Retrieve lat/lon. lat_name='/HDFEOS/SWATHS/O3NadirSwath/Geolocation Fields/Latitude' lat_id=H5D_OPEN(file_id, lat_name) lat=H5D_READ(lat_id) H5D_CLOSE, lat_id lon_name='/HDFEOS/SWATHS/O3NadirSwath/Geolocation Fields/Longitude' lon_id=H5D_OPEN(file_id, lon_name) lon=H5D_READ(lon_id) H5D_CLOSE, lon_id ; Close file. H5F_CLOSE, file_id ; Convert the 2D data to 1D data. nlevels = 5; data1D=data_raw[nlevels, *] data1D=reform(data1D) ; Convert data type. dataf=float(data1D) idx=where(data1D eq fill_value(0), cnt) if cnt gt 0 then dataf[idx] = !Values.F_NAN ; Compute data min/max for colorbar. datamin=MIN(dataf) datamax=MAX(dataf) dim=SIZE(dataf,/dim) ; Get min/max value of lat and lon for zoomed image. latmin=min(lat) latmax=max(lat) lonmin=min(lon) lonmax=max(lon) ; Generate the plot. m = MAP('Geographic', TITLE=file_name, FONT_SIZE=9, /BUFFER) ct = COLORTABLE(72, /reverse) t1 = TEXT(0.35, 0.2, long_name+' at nLevels=5') ; We use SCATTERPLOT because data is 2-d lat/lon swath. ; lon[*]/lat[*]/dataf[*] will make 1-d dataset. c1 = SCATTERPLOT(lon[*], lat[*], OVERPLOT=m, $ MAGNITUDE = dataf[*], $ RGB_TABLE=ct, $ POSITION=[0.1, 0.1, 0.83, 0.9],$ /SYM_FILLED, SYMBOL='o', SYM_SIZE=0.1) mc = MAPCONTINENTS() ; We need custom colorbar because we use SCATTERPLOT(). ; We cannot use TARGET=c1. cb = COLORBAR(RGB_TABLE=ct, RANGE=[datamin, datamax], /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