On Sun, Mar 01, 2015 at 11:58:27PM +0000, volto natacha wrote: > Hello, > With Python, I would like to recover 2 elements (cf. attach file) but I > can't find the code. > I know that this information is on the member : "GEOMETRY". > I tried to enter, I have 4 members in the group : [u'SAA', u'SWIR', > u'SZA', u'VNIR']
f['LEVEL3/GEOMETRY'].attrs.keys() '.attrs' is a dictionary with the attributes. f['LEVEL3/GEOMETRY'].attrs['TOP_LEFT_LONGITUDE'] should give you one of your examples. > But I can't recover the information about latitude and longitude > Thank you for help > Natacha > Le Samedi 28 février 2015 10h00, volto natacha <[email protected]> a > écrit : > Hi John, > Thank you for your answer. > I have found : > #Import h5py library > Import h5py > #Open HDF5 file with h5py, read-write mode > f=h5py.File ('PROBAV_S1_TOA_X11Y07_20140607_300 m_V001.hdf5','r+') > #Use Python dictionary syntax to explore the HDF5 structure > f.keys() > #Get dimensions > f[‘/LEVEL3/RADIOMETRY/BLUE/TOA’].shape > #Get data type > f[‘/LEVEL3/RADIOMETRY/BLUE/TOA’].dtype > #Get value array > f[‘/LEVEL3/RADIOMETRY/BLUE/TOA’].value > Natacha > Le Vendredi 27 février 2015 20h11, John Readey <[email protected]> a > écrit : > Hi Natacha, > Are you using h5py? It should be as simple as: > f = h5py.File(“myfile.h5”, “r”) > mygroup = f[“group_name”] > John > From: volto natacha <[email protected]> > Reply-To: volto natacha <[email protected]>, > "[email protected]" <[email protected]> > Date: Thursday, February 26, 2015 at 11:43 AM > To: "[email protected]" <[email protected]> > Subject: [Hdf-forum] Read the data in a group in a HDF5 file > > Hi, > I have a PROBA-V imagery (HDF5) > <HDF5 group "/LEVEL3" (5 members)> > I know that I have 5 members in a group in my file HDF5 but I can't > open them. > Could you please help me to read this 5 members ? > Thank you, > Natacha > _______________________________________________ > Hdf-forum is for HDF software users discussion. > [email protected] > http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org > Twitter: https://twitter.com/hdf5 -- ----------------------------------------------------------- Pierre de Buyl KU Leuven - Institute for Theoretical Physics T +32 16 3 27355 W http://pdebuyl.be/ ----------------------------------------------------------- _______________________________________________ Hdf-forum is for HDF software users discussion. [email protected] http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org Twitter: https://twitter.com/hdf5
