; ; This example code illustrates how to access and visualize GPM L1C 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 1C.F19.SSMIS.XCAL2016-V.20160105-S214106-E232259.009078.V05A.HDF5.idl ; ; Tested under: IDL 8.6.0 ; Last updated: 2018-01-22 ; Open file. file_name='1C.F19.SSMIS.XCAL2016-V.20160105-S214106-E232259.009078.V05A.HDF5' file_id=H5F_OPEN(file_name) ; Retrieve data. datafield_name='/S1/Tc' data_id=H5D_OPEN(file_id, datafield_name) dataf=H5D_READ(data_id) ; Get '_FillValue' attribute. fv_id=H5A_OPEN_NAME(data_id, '_FillValue') fv=H5A_READ(fv_id) H5A_CLOSE, fv_id ; Get 'units' attribute. units_id=H5A_OPEN_NAME(data_id, 'units') units=H5A_READ(units_id) H5A_CLOSE, units_id ; Get 'long_name' attribute. title_id=H5A_OPEN_NAME(data_id, 'LongName') long_name=H5A_READ(title_id) H5A_CLOSE, title_id ; Close dataset. H5D_CLOSE, data_id ; Retrieve lat/lon. lat_name='/S1/Latitude' lat_id=H5D_OPEN(file_id, lat_name) lat=H5D_READ(lat_id) H5D_CLOSE, lat_id lon_name='/S1/Longitude' lon_id=H5D_OPEN(file_id, lon_name) lon=H5D_READ(lon_id) H5D_CLOSE, lon_id ; Close file. H5F_CLOSE, file_id ; Process missing value, convert dataf that are equal to missingvaluef to NaN idx = where(dataf eq fv, cnt) if cnt gt 0 then dataf[idx] = !Values.F_NAN ; Subset at nchan1=0. dataf = dataf[0,*,*] ; Compute data min/max for colorbar. 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) lon1 = lon[*] lat1 = lat[*] dataf1 = dataf[*] dim = SIZE(dataf1, /dim) ; The following will print 289800 data size. PRINT, dim ; Our IDL 8G memory machine cannot handle more than 160000 data ; points. start = 0 subset = 160000 ; IDL may have a bug. It cannot handle the following subsetting. ;start = 160000 ;subset = 289799 c1 = SCATTERPLOT(lon1[start:subset], lat1[start:subset], OVERPLOT=m, $ MAGNITUDE = dataf1[start:subset], $ RGB_TABLE=ct, $ POSITION=[0.1, 0.1, 0.83, 0.9],$ /SYM_FILLED, SYMBOL='o', SYM_SIZE=0.1) mc = MAPCONTINENTS() datamin=MIN(dataf) datamax=MAX(dataf) cb = COLORBAR(RGB_TABLE=ct, RANGE=[datamin, datamax], /BORDER, ORIENTATION=1, $ TEXTPOS=1, POSITION=[0.85,0.2,0.87,0.8], TITLE=units) t1 = TEXT(0.1, 0.2, FONT_SIZE=8, long_name) png = file_name + '.idl.png' c1.save, png, HEIGHT=600, WIDTH=800 EXIT