Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get group attributes #42

Open
daxinnan opened this issue Apr 28, 2020 · 2 comments
Open

How to get group attributes #42

daxinnan opened this issue Apr 28, 2020 · 2 comments

Comments

@daxinnan
Copy link

What version of pyhdf, HDF4, and Python are you using?

pyhdf version: 0.10.2
HDF4 C library version: 4.2.13
Python version: 3.7.6

What operating system are you using?

Ubuntu 20.04

What did you do?

I use pyhdf to read CloudSat data, I just get some 2D datasets by SD and 1D data by HDF, How can I get the group attributes shown as following, I can't find the suitable usage or documents.

from pyhdf.SD import SD, SDC
from pyhdf import HDF, VS, V
import numpy as np
FILE_NAME = "2014068005444_41824_CS_2B-GEOPROF_GRANULE_P1_R05_E06_F00.hdf"
hdf = SD(FILE_NAME, SDC.READ)

# Read datasets.
DATAFIELD_NAME = 'Radar_Reflectivity'
dset = hdf.select(DATAFIELD_NAME)
data = dset[:, :]
h = HDF.HDF(FILE_NAME)
vs = h.vstart()

xid = vs.find('Latitude')
latid = vs.attach(xid)
latid.setfields('Latitude')
nrecs, _, _, _, _ = latid.inquire()
latitude = latid.read(nRec=nrecs)
latid.detach()

image

What did you expect to see?

What did you see instead?

@gopikrishnangs44
Copy link

@daxinnan Did you find a solution for the same

@ste-goldstein
Copy link

Same problem. I can access it as raw text

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants