In [2]:
import pyhdf.SD
from pyhdf import SD
from pyhdf.SD import *
from numpy import *

In [3]:
d = SD('ams.hdf',SDC.READ)

In [10]:
d.datasets()


Out[10]:
{'Latitude': (('nscan:L2B Rainfall Products', 'npix:L2B Rainfall Products'),
  (2001, 45),
  5,
  4),
 'Longitude': (('nscan:L2B Rainfall Products', 'npix:L2B Rainfall Products'),
  (2001, 45),
  5,
  5),
 'Rain Rate': (('nscan:L2B Rainfall Products', 'npix:L2B Rainfall Products'),
  (2001, 45),
  22,
  1),
 'Rain Status': (('nscan:L2B Rainfall Products', 'npix:L2B Rainfall Products'),
  (2001, 45),
  22,
  0),
 'Rain Type': (('nscan:L2B Rainfall Products', 'npix:L2B Rainfall Products'),
  (2001, 45),
  20,
  2),
 'Surface Type': (('nscan:L2B Rainfall Products',
   'npix:L2B Rainfall Products'),
  (2001, 45),
  20,
  3)}

In [20]:
a = d.select('Longitude')

In [27]:
len(a.get()[0])


Out[27]:
45

In [ ]: