html5-img
1 / 26

A Matlab tutorial in working with HDF files

A Matlab tutorial in working with HDF files. Overview. Description of HDF data format Programs available for visualizing and manipulating data Features of HDF view and how/where to download Introduction to case study and tasks for this lab Ordering data Reading HDF files into Matlab

yaphet
Télécharger la présentation

A Matlab tutorial in working with HDF files

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. A Matlab tutorial in working with HDF files

  2. Overview • Description of HDF data format • Programs available for visualizing and manipulating data • Features of HDF view and how/where to download • Introduction to case study and tasks for this lab • Ordering data • Reading HDF files into Matlab • Matlab coding exercises • Getting familiar with Giovanni (time permitting)

  3. HDF (Hierarchical Data Format) is a library and multi-object file format for storing and managing data between machines. Two versions: HDF4 and HDF5. HDF-EOS specifically for EOS satellites (Terra, Aqua and Aura) Important features: Self-describing; Can store swaths, grids, in-situ data, instrument metadata, and browse image in a single file; No limits on size or number of data objects; Support parallel I/O, multiple platforms and API with C/C++/Fortran/Java/Matlab interfaces Basics of HDF data format

  4. Free* HDF View* IDL Matlab Pomegranate* Igor Pro GrADS* Panpoly* Programs for HDF files:http://www.hdfgroup.org/tools.html

  5. HDF View :Screenshot of main window Menu and tool bar Data panel Tree panel Info panel

  6. Free download link for WIN/MAC/LINUX: http://www.hdfgroup.org/hdf-java-html/hdfview/index.html User guide: http://www.hdfgroup.org/hdf-java-html/hdfview/UsersGuide/index.html Getting HDF View

  7. Case study for lab: 2009 Eruption of Mt. Redoubt

  8. Tasks Working with HDF files from MODIS: a. Retrieve Terra MODIS Level 2 AOD’s at 550 nm for April 4, 2009 at 2220 UTC. http://ladsweb.nascom.nasa.gov/data/search.html http://modis.gsfc.nasa.gov/ b. Use Matlab to make a contour plot of AOD, with latitude on the Y-axis and longitude on the X-axis. Be sure to add the coastline to your plot. c. What are the ranges of AOD in your plot? What is the mean AOD? Based on this information, was the event observed in the satellite data a strong volcanic event? Working with HDF files from OMI (time permitting): a. Retrieve Aura OMI Level 3 AI (UV aerosol index) for April 4, 2009 from Giovanni http://disc.sci.gsfc.nasa.gov/giovanni/overview/giovanni-parameters b. Using Matlab, make a contour plot of AI, with latitude on the Y-axis and longitude on the X-axis. Load the coast. c. From the plot, which regions of the plume would you expect to be most rich in ash?

  9. Task 1a: Retrieving Terra MODIS Level 2 AOD

  10. Task 1b: Reading MODIS HDF files into Matlab clear % reading in file MODIS_ID = hdfsd ('start','filename.hdf', 'read'); % extract info about file description [numdata, numdescr] = hdfsd ('fileinfo', MODIS_ID); % assigning dataset ID(s) AODid = hdfsd ('select', MODIS_ID, 9); longid = hdfsd ('select', MODIS_ID, 0); latid = hdfsd ('select', MODIS_ID, 1); % extracting info from dataset [name,numdim,dimvector,type,numdescr] = hdfsd('getinfo', AODid) [name,numdim,dimvector,type,numdescr] = hdfsd('getinfo', longid) [name,numdim,dimvector,type,numdescr] = hdfsd('getinfo', latid) % Reading HDF datasets and importing into Matlab startvector = [0 0]; endvector = dimvector; stride = []; AODvar = hdfsd('readdata', AODid, startvector, stride, endvector); longvar = hdfsd('readdata', longid, startvector, stride, endvector); latvar = hdfsd('readdata', latid, startvector, stride, endvector);

  11. Tasks 1b & c: On your own or in groups • Steps and hints to problems: • 1c. The plot: • Change AOD fill values (-9999) to not a number (NaN) • Don’t forget to multiply AOD by a scale factor of 0.001 • You will need to subtract 360 degrees from all values of longitude that are greater than 0 to remap on a linear scale. • Use Matlab help. For example, type: help contourf to gather more information on contourf. • 1d. Based on the max/min and mean values of AOD for this event, what might this mean about the strength of the eruption? Hint: Fresh plumes from strong eruptions can have AOD’s as high as those for meteorological clouds, which can be in the 100’s.

  12. April 4 AOD

  13. Task 2a: Getting OMI AI data from Giovanni

  14. Task 2b: Reading OMI data into Matlab clear % reading in file OMI_ID = hdfsd ('start','filename.hdf, 'read'); % extract info about file description [numdata, numdescr] = hdfsd ('fileinfo', OMI_ID); % assigning dataset ID(s) AIid = hdfsd ('select', OMI_ID, 0) % extracting info from dataset [name,numdim,dimvector,type,numdescr] = hdfsd('getinfo', AIid) % Reading HDF datasets and importing into Matlab startvector = [0 0]; endvector = dimvector; stride = []; AIvar = hdfsd('readdata', AIid, startvector, stride, endvector);

  15. Task 2b & c: On your own • Steps and hints to problems: • 1c. The plot: • Longitude and latitude are not included in this hdf file. You will need to calculate your own based on the dimensions of the AI matrix and the long/lat ranges • (-180 to -136 longitude; 67 to 47 latitude) • Remember to remove AI fill values (for this dataset, fill value < -1 X 1030) • You may notice when you plot this data that it needs to be flipped about the x and/or y-axis to get the correct orientation. • 1d. Where would you expect to find the areas most rich in ash? Hint:OMI AI serves as a qualitative indicator of the presence of UV absorbing aerosols, such as ash.

  16. April 4 OMI AI

More Related