; ; This example code illustrates how to access and visualize LaRC ASDC MOPITT ; version 9 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 MOP03T-20131129-L3V5.9.1.he5.idl ; ; Tested under: IDL 8.7.2 ; Last updated: 2021-11-11 ; Open file. file_name = 'MOP03T-20131129-L3V5.9.1.he5' file_id = H5F_OPEN(file_name) ; Read latitude. datafield_name = '/HDFEOS/GRIDS/MOP03/Data Fields/Latitude' data_id = H5D_OPEN(file_id,datafield_name) lat = H5D_READ(data_id) ; Read longitude. datafield_name = '/HDFEOS/GRIDS/MOP03/Data Fields/Longitude' data_id = H5D_OPEN(file_id,datafield_name) lon = H5D_READ(data_id) ; Read variable. datafield_name = '/HDFEOS/GRIDS/MOP03/Data Fields/RetrievedSurfaceTemperatureDay' data_id = H5D_OPEN(file_id,datafield_name) dataspace_id = H5D_GET_SPACE(data_id) dims = H5S_GET_SIMPLE_EXTENT_DIMS(dataspace_id) dims = float(dims) data = H5D_READ(data_id) ; Get units. units_id = H5A_OPEN_NAME(data_id, 'units') units = H5A_READ(units_id) ; Get fill value. fillvalue_id = H5A_OPEN_NAME(data_id,'_FillValue') fillvalue = H5A_READ(fillvalue_id) ; Get long name attribute. long_name_id = H5A_OPEN_NAME(data_id,'long_name') long_name = H5A_READ(long_name_id) ; Convert data type. dataf = float(data) fillvaluef = float(fillvalue(0)) H5A_Close, fillvalue_id H5D_Close, data_id ; Process fill value. idx = where(dataf eq fillvaluef(0), cnt) if cnt gt 0 then dataf[idx] = !Values.F_NAN ; Tranpose data. dataf = TRANSPOSE(dataf) ; 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) 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