; ; This example code illustrates how to access and visualize LaRC CATS ; Level 2 Swath Version 2.01 HDF5 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 CATS-ISS_L2O_D-M7.2-V2-01_05kmLay.2017-05-01T00-47-40T01-28-41UTC.hdf5.idl ; ; Tested under: IDL 8.6.0 ; Last updated: 2018-06-14 ; Open file. file_name='CATS-ISS_L2O_D-M7.2-V2-01_05kmLay.2017-05-01T00-47-40T01-28-41UTC.hdf5' file_id = H5F_OPEN(file_name) ; Read data. datafield_name='/layer_descriptor/Aerosol_Type_Fore_FOV' data_id=H5D_OPEN(file_id,datafield_name) data=H5D_READ(data_id) ; Close dataset. H5D_CLOSE, data_id ; Read latitude. latitude_name='/geolocation/CATS_Fore_FOV_Latitude' latitude_id=H5D_OPEN(file_id, latitude_name) lat=H5D_READ(latitude_id) ; Close dataset. H5D_CLOSE, latitude_id ; Read longitude. lon_name='/geolocation/CATS_Fore_FOV_Longitude' lon_id=H5D_OPEN(file_id, lon_name) lon=H5D_READ(lon_id) ; Close dataset. H5D_CLOSE, lon_id ; Change 0 to other value to visualize other layer. data = data(0,*) ; Change 3 to 0 or 1 to check other location. lat = lat(2,*) lon = lon(2,*) ; lat/lon are 2-D, Nx1 array. lat = reform(lat) lon = reform(lon) data = reform(data) dim=size(data,/dim) longname = datafield_name ; Define the color table. levels = 9 ct = COLORTABLE([[0, 150, 0, 255, 0, 255, 200, 100, 50, 200], $ [0, 150, 0, 255, 255, 0, 100, 50, 25, 128], $ [0, 150, 255, 0, 0, 0, 255, 255, 125, 200]], $ NCOLORS = levels, /TRANSPOSE) ; Generate the plot. m = MAP('Geographic', TITLE=file_name, FONT_SIZE=9, /BUFFER) t1 = TEXT(0.35, 0.2, longname) ; We use SCATTERPLOT because data is 2-d lat/lon swath. c1 = SCATTERPLOT(lon, lat, OVERPLOT=m, $ MAGNITUDE = data, $ RGB_TABLE=ct, $ POSITION=[0.1, 0.1, 0.83, 0.9],$ /SYM_FILLED, SYMBOL='o', SYM_SIZE=0.1) mc = MAPCONTINENTS() ; We need a custom colorbar because we use SCATTERPLOT(). cb = COLORBAR(RGB_TABLE=ct, RANGE=[0,9], ORIENTATION=1, BORDER=1,$ TICKVALUES=[0.5,1.5,2.5,3.5,4.5,5.5,6.5,7.5,8.5], $ TICKNAME=['invalid', 'marine', 'p. marine ', 'dust', $ 'dust mixture', 'clean/bg', 'p. continental', $ 'smoke', 'volcanic'], $ 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