; ; This example code illustrates how to access and visualize GESDISC MEaSUREs ; Ozone Zonal Average 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 BUV-Nimbus04_L3zm_v01-02-2013m0422t101810.h5.idl ; ; Tested under: IDL 8.7.2 ; Last updated: 2019-01-17 ; Open file. file_name='BUV-Nimbus04_L3zm_v01-02-2013m0422t101810.h5' file_id=H5F_OPEN(file_name) ; Read data. datafield_name='/Data_Fields/ProfileOzone' data_id=H5D_OPEN(file_id,datafield_name) data=H5D_READ(data_id) ; Get title. title_id=H5A_OPEN_NAME(data_id, 'long_name') title=H5A_READ(title_id) H5A_CLOSE, title_id ; Get units. units_id=H5A_OPEN_NAME(data_id, 'units') units=H5A_READ(units_id) H5A_CLOSE, units_id ; Get fill value. fillvalue_id=H5A_OPEN_NAME(data_id,'_FillValue') fillvalue=H5A_READ(fillvalue_id) H5A_CLOSE, fillvalue_id ; Close dataset. H5D_CLOSE, data_id ; Read latitude. latitude_name='/Data_Fields/Latitude' latitude_id=H5D_OPEN(file_id, latitude_name) lat=H5D_READ(latitude_id) ; Get title. title_id=H5A_OPEN_NAME(latitude_id, 'long_name') title_lat=H5A_READ(title_id) H5A_CLOSE, title_id ; Get units. units_id=H5A_OPEN_NAME(latitude_id, 'units') units_lat=H5A_READ(units_id) H5A_CLOSE, units_id ; Close dataset. H5D_CLOSE, latitude_id ; Read Pressure. pressure_name='/Data_Fields/ProfilePressureLevels' pressure_id=H5D_OPEN(file_id, pressure_name) pressure=H5D_READ(pressure_id) ; Get title. title_id=H5A_OPEN_NAME(pressure_id, 'long_name') title_pressure=H5A_READ(title_id) H5A_CLOSE, title_id ; Get units. units_id=H5A_OPEN_NAME(pressure_id, 'units') units_pressure=H5A_READ(units_id) H5A_CLOSE, units_id ; Close dataset. H5D_CLOSE, pressure_id ; Read Date. date_name='/Data_Fields/Date' date_id=H5D_OPEN(file_id, date_name) date=H5D_READ(date_id) H5D_CLOSE, date_id ; Close file. H5F_CLOSE, file_id ; Convert type to double. dataf = FLOAT(data) ; Process fill value. idx=WHERE(data EQ fillvalue(0), cnt) IF cnt GT 0 THEN dataf[idx] = !Values.F_NAN ; Subset at index 0. index_s = 0 ; Transpose data to plot pressure (Y-axis) vs latitude (X-axis). dataf = TRANSPOSE(dataf(*,*,index_s)) ; This product's time is not in TAI 1993 format. ; It uses a 4+2 digit number that indicates year and month. tstring = STRING(date(index_s), FORMAT='(I6)') d_max=MAX(pressure) d_min=MIN(pressure) ; Generate the plot. ct = COLORTABLE(13) c1 = CONTOUR(dataf, lat, pressure, /FILL, /BUFFER, $ /YLOG, $ YRANGE=[d_max, d_min], $ RGB_TABLE=ct, $ TITLE=file_name, $ XTITLE=title_lat +' (' + units_lat + ')', $ YTITLE=title_pressure + ' (' + units_pressure + ')', $ POSITION=[0.1, 0.1, 0.82, 0.8]) cb = COLORBAR(TARGET=c1, /BORDER, ORIENTATION=1, TEXTPOS=1, $ POSITION=[0.85,0.2,0.87,0.8], TITLE=units) t1 = TEXT(0.25, 0.8, title + ' on ' + tstring) ; Write PNG image file. png = file_name + '.idl.png' c1.save, png, HEIGHT=600, WIDTH=800 EXIT