[ncl-talk] Problem reading hdf5 file
Charles Bardeen
bardeenc at ucar.edu
Mon Jan 23 12:32:15 MST 2017
I am trying to read hdf5 data produced from the Madrigal archive ( http://cedar.openmadrigal.org ). The file format contains groups and compounds. I seem to be able to access the group, but have been unable to access the data that I want from the compound. Can you tell how to make this work? The file format and the commands I have tried are shown below.
Thanks,
Chuck
--------------------------------------------------------------
Charles Bardeen
National Center for Atmospheric Research
P.O. Box 3000, Boulder, CO 80307-3000
Phone: (303) 497-1752, Fax: (303) 497-1400
bardeenc at ucar.edu
Copyright (C) 1995-2015 - All Rights Reserved
University Corporation for Atmospheric Research
NCAR Command Language Version 6.3.0
The use of this software is governed by a License Agreement.
See http://www.ncl.ucar.edu/ for more details.
ncl 0> x = addfile("gps031001g.002.hdf5", "r")
ncl 1> print(x)
Variable: x
Type: file
filename: gps031001g.002
path: gps031001g.002.hdf5
file global attributes:
dimensions:
DIM_000 = 10
DIM_001 = 0
DIM_002 = 0
DIM_003 = 0
variables:
group </Data>
compound <Table_Layout> (year, month, day, hour, min, sec, ut1_unix, ut2_unix, recno, gdlat, glon, tec, dtec) (DIM_000)
group </Metadata>
compound <Data_Parameters> (mnemonic, description, isError, units, category) (DIM_000)
compound <Experiment_Notes> (File Notes) (DIM_000)
compound <Experiment_Parameters> (name, value) (DIM_000)
ncl 5> g = x=>Data
ncl 6> print(g)
Variable: g
Type: file
filename: gps031001g.002
path: gps031001g.002.hdf5
file global attributes:
dimensions:
DIM_000 = 10
DIM_001 = 0
DIM_002 = 0
DIM_003 = 0
variables:
compound <Table_Layout> (year, month, day, hour, min, sec, ut1_unix, ut2_unix, recno, gdlat, glon, tec, dtec) (DIM_000)
ncl 7> tec = g->/Table_Layout.tec
fatal:["Execute.c":6332]:variable (/Table_Layout.tec) is not in file (g)
fatal:["Execute.c":8573]:Execute: Error occurred at or near line 7
ncl 9> tec = x->/Data/Table_Layout.tec
fatal:["Execute.c":6332]:variable (/Data/Table_Layout.tec) is not in file (x)
fatal:["Execute.c":8573]:Execute: Error occurred at or near line 9
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170123/9661d5d8/attachment.html
More information about the ncl-talk
mailing list