230 likes | 444 Views
Visualizing and Analyzing of HDF-EOS and HDF data with NCL. Wei Huang, Dave Brown, Mary Haley, Rick Brownrigg CISL/NCAR Dennis Shea, Adam Philips CGD/NCAR huangwei@ucar.edu. What is NCL. NCL stands for NCAR Command Language http://www.ncl.ucar.edu for more information
E N D
Visualizing and Analyzing ofHDF-EOS and HDF data with NCL Wei Huang, Dave Brown, Mary Haley, Rick Brownrigg CISL/NCAR Dennis Shea, Adam Philips CGD/NCAR huangwei@ucar.edu
What is NCL • NCL stands for NCAR Command Language • http://www.ncl.ucar.edu for more information • NCL is developed at CISL/NCAR, for scientific data analysis and visualization • Free available as binaries, open source • Supports NetCDF (3 and 4), GRIB (1 and 2), HDF, HDF-EOS 2 and 5 (as Spring of 2010) • Newly added HDF5 and OpenDap (in 2010) • High quality graphics • Lots of example scripts CISL/NCAR
HDF-EOS5 Released April, 2010 • HDF-EOS5 included NCL • 5.2.0 released in April, 2010 • 5.2.1 released in July, 2010 • HDF, and HDF-EOS2/5 Examples • http://www.ncl.ucar.edu/Applications/HDF.shtml • Use “ncl_filedump” to check variables in HDF, and HDF-EOS2/5 files • Use “ncl_convert2nc” to convert HDF-EOS2/5 and HDF files to NetCDF files CISL/NCAR
HDF-EOS5 Sample CISL/NCAR
HDF-EOS5 Sample (continue) CISL/NCAR
HDF-EOS5 Sample (continue) Reflectivity of the ground pixel CISL/NCAR
HDF5 in Beta Release CISL/NCAR
Sample Script to Read HDF5 • f = addfile(”./data/MOD13A2A.h5", "r”) • printVarSummary(f) • grps = getfilegroups(f, "/", 0) • print(grps) • grps2 = getfilegroups(f, "/MODIS_Grid_16DAY_1km_VI", 0) • print(grps2) • v1 = f->1_km_16_days_red_reflectance • printVarSummary(v1) • vn = grps2(0)+"/1 km 16 days blue reflectance” • v2 = f->$vn$ • printVarSummary(v2) CISL/NCAR
Group in HDF5 and Sample Script • f = addfile(”./data/NISESSMI.h5", "r") • print(f) • gn = "/Northern Hemisphere” • g1 = f=>$gn$ • print(g1) • g2n = "/Northern Hemisphere/Data Fields” • g2 = g1=>$g2n$ • print(g2) • vn = "/Northern Hemisphere/Data Fields/Age" • v1 = g1->$vn$ • printVarSummary(v1) • v2 = g2->$vn$ • printVarSummary(v2) CISL/NCAR
HDF5 Sample Plot CISL/NCAR
HDF5 Sample Plot (continue) CISL/NCAR
HDF5 Sample Plot (continue) CISL/NCAR
HDF5 Sample Plot (continue) CISL/NCAR
Read Compound data from HDF5 • fn = "K1VHR_23SEP2008_2330_L02_SST.h5” • f = addfile(fn, "r”) • print(f) • lon1d = f->/SST/SST_Composite.Longitude • lat1d = f->/SST/SST_Composite.Latitude • sst1d = f->/SST/SST_Dataset.SST CISL/NCAR
Print-out • filename: K1VHR_23SEP2008_2330_L02_SST • file global attributes: • dimensions: • DIM_000 = 36381 • variables: • group </PRODUCT_INFORMATION> • group </PRODUCT_METADATA> • group </PRODUCT_METADATA/PRODUCT_DETAILS> • group </PRODUCT_METADATA/PROJECTION_PARAMETERS> • group </SST> • compound <SST_Composite> (Latitude, Longitude, SST) (DIM_000) • compound <SST_Dataset> (Latitude, Longitude, SST) (DIM_000) • group </SST/GP_PARAM_INFO> CISL/NCAR
HDF-EOS5 OpenDap • Using liboc-dap-0.0.2 • In Alpha Version CISL/NCAR
HDF-EOS5 OpenDap -- a sample script • url = "http://acdisc.gsfc.nasa.gov/opendap/HDF-EOS5/Aura_OMI_Level3/OMAEROe.003/2010/" • filename = url + "OMI-Aura_L3-OMAEROe_2010m0712_v003-2010m0714t203639.he5” • f = addfile(filename,"r”) • print(f) • vis_aerosol = f->SingleScatteringAlbedoPassedThresholdMean • printVarSummary(vis_aerosol) • lat = f->Latitude • printVarSummary(lat) • lon = f->Longitude • printVarSummary(lon) CISL/NCAR
HDF-EOS5 OpenDap –sample plot CISL/NCAR
Conclusion • HDF-EOS5 is already released • 5.2.0 in April, 2010 • 5.2.1 in July, 2010 • HDF5 will be released soon • Being tested with lots of data • In Beta Version • HDF-EOS5 OpenDap is on the way • With limited test • In Alpha Version CISL/NCAR
Questions? Thank You! CISL/NCAR
Write HDF5 with NCL • Write HDF5 with Options: • Compression • At File Level • At Variable Level • Chunking • At File Level • At Variable Level CISL/NCAR
Sample Script to Write HDF5 fin = addfile(“uvt.nc", "r") fout = addfile("simple.h5", "c”) T = fin->T time = fin->time lev = fin->lev lat = fin->lat lon = fin->lon ntim = dimsizes(time) nlev = dimsizes(lev) nlat = dimsizes(lat) nlon = dimsizes(lon) setfileoption(fout,"CompressionLevel", 2) mtim = 1 mlat = nlat/2 mlon = nlon/2 mlev = nlev/2 chunkSizes = (/ mtim, mlev, mlat, mlon /) dimUnlim(0) = False filechunkdimdef(fout,dNames,chunkSizes,dimUnlim) ... filevardef(fout, "T", typeof(T), getvardims(T)) filevarchunkdef(fout, "T", chunkSizes) ... filevarcompressleveldef(fout, "T", 6) filevarattdef(fout,"T", T) ... fout->T = (/T/) ... CISL/NCAR