[ncl-talk] How to read variables in hdf5 group
Laura Fowler
laura at ucar.edu
Thu Sep 14 14:30:07 MDT 2017
Hello:
I would like to read a hdf5 file using ncl. After using ncdump, I see
that besides 4 global attributes the file also contains 2 groups. So,
after using addfile, I read and print the group "flashes":
flashes = f=>flashes
print(flashes)
The beginning of the output from print is:
Number of Attributes:3
CLASS : GROUP
TITLE : Sorted LMA flash data
VERSION : 1.0
variables:
Variable: LMA_170510_210000_600
Type: compound
Total Size: 2590 values
10360 bytes
Number of Dimensions: 1
Dimensions and sizes: [ 2590 <(null)> ]
Coordinates:
Number of Attributes: 35
component_names : ( area, ctr_alt, ctr_lat, ctr_lon,
duration, flash_id, init_alt, init_lat, init_lon, init_pts, ... [Total
of 15 values] )
CLASS : TABLE
FIELD_0_FILL : 0
FIELD_0_NAME : area
FIELD_10_FILL :
FIELD_10_NAME : n_points
FIELD_11_FILL : 0
FIELD_11_NAME : specific_energy
Now I would like to read the variables (area, ctr_alt, ...) in the
group "flashes" but cannot figure out how to access them. I looked
around the documentation but did not see an obvious example to do so.
Is there some more detailed documentation somewhere, or can someone
write me back on how to do this?
Thanks,
Laura
--
!-------------------------------------------------------------------------------------------------------------
Laura D. Fowler
Mesoscale and Microscale Meteorology Division (MMM)
National Center for Atmospheric Research
P.O. Box 3000, Boulder CO 80307-3000
e-mail: laura at ucar.edu
phone: 303-497-1628
!-------------------------------------------------------------------------------------------------------------
More information about the ncl-talk
mailing list