; ; This example code illustrates how to access and visualize a LaRC ASDC g3bssp ; vertical profile 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 g3b.ssp.2022062949SSv05.21.idl ; ; Tested under: IDL 8.7.2 ; Last updated: 2022-09-09 ; ; NOTE: IDL 8.7.2 can't read attributes from this file. ; ; Open file. FILE_NAME='g3b.ssp.2022062949SSv05.21' FILE_ID=H5F_OPEN(FILE_NAME) ; Read data. DATAFIELD_NAME='/Altitude Based Data/Aerosol Ozone Profiles/Ozone_AO3' data_id=H5D_OPEN(FILE_ID, DATAFIELD_NAME) data=H5D_READ(data_id) ; Read attributes. ; Get long_name. ;long_name_id=H5A_OPEN_NAME(data_id, 'long_name') ;long_name=H5A_READ(long_name_id) ;H5A_Close, long_name_id long_name='AO3 Concentration' ; Get units. ;units_id=H5A_OPEN_NAME(data_id, 'units') ;units=H5A_READ(units_id) ;H5A_Close, units_id units='#/cm$^{-3}$' ; Get fill value ;fillvalue_id=H5A_OPEN_NAME(data_id,'_FillValue') ;fillvalue=H5A_READ(fillvalue_id) ;PRINT, "_FillValue error here" ; H5A_Close, fillvalue_id fillvalue=3.4028235e38 ALT_NAME='/Altitude Based Data/Altitude Information/Altitude' alt_id=H5D_OPEN(FILE_ID, ALT_NAME) alt=H5D_READ(alt_id) ; Get long_name of altitude. ;long_name_id_alt=H5A_OPEN_NAME(alt_id, 'long_name') ;long_name_alt=H5A_READ(long_name_id_alt) ;H5A_Close, long_name_id_alt long_name_alt='Geometric Altitude' ; Get units of altitude. ;units_id_alt=H5A_OPEN_NAME(alt_id, 'units') ;units_alt=H5A_READ(units_id_alt) ;H5A_Close, units_id_alt units_alt = 'km' DATE_NAME='/Event Information/Date' date_id=H5D_OPEN(FILE_ID, DATE_NAME) date=H5D_READ(date_id) TIME_NAME='/Event Information/Time' time_id=H5D_OPEN(FILE_ID, TIME_NAME) time=H5D_READ(time_id) LAT_NAME='/Event Information/Latitude' lat_id=H5D_OPEN(FILE_ID, LAT_NAME) lat=H5D_READ(lat_id) LON_NAME='/Event Information/Longitude' lon_id=H5D_OPEN(FILE_ID, LON_NAME) lon=H5D_READ(lon_id) ; Close handles. H5D_Close, data_id H5D_Close, alt_id H5D_Close, date_id H5D_Close, time_id H5D_Close, lat_id H5D_Close, lon_id ; Process fill value, convert data that are equal to fillvalue to NaN idx=WHERE(data eq fillvalue(0), cnt) if cnt gt 0 then data[idx] = !Values.F_NAN ; Format the date/time. dstr=STRING(date, FORMAT='(I8.8)') y = dstr.SubString(0, 3) m = dstr.SubString(4, 5) d = dstr.SubString(6, 7) tstr=STRING(time, FORMAT='(I6.6)') hh = tstr.SubString(0, 1) mm = tstr.SubString(2, 3) ss = tstr.SubString(4, 5) dtstr= y + '-' + m + '-' + d + 'T' + hh + ':' + mm + ':' + ss + 'Z' ; Create X axis label. x_label = long_name + ' at ' + dtstr + ' ('+ units + ')' ; Create Y axis label. y_label = long_name_alt + ' ('+ units_alt + ')' ; Create title label. t_label = FILE_NAME + '!C' + $ 'Longitude='+STRCOMPRESS(STRING(lon)) + $ ' Latitude='+STRCOMPRESS(STRING(lat)) ; Draw a line plot. p = PLOT(data, alt, YTITLE=y_label, XTITLE=x_label, $ TITLE=t_label, XTICKFONT_SIZE=8, YTICKFONT_SIZE=8, $ /BUFFER) png = file_name + '.idl.png' p.save, png, HEIGHT=600, WIDTH=800 EXIT