In [45]: nc = netCDF4.Dataset('GPCP/dat/gpcp_v01r03_monthly_199610-201812.nc','r')
In [46]: nc
Out[46]:
<class 'netCDF4._netCDF4.Dataset'>
root group (NETCDF3_CLASSIC data model, file format NETCDF3):
history: 2019-04-10T10:40:23UTC, Akira Takeshima, The University of Tokyo, Created this file.
dimensions(sizes): time(267), latitude(180), longitude(360)
variables(dimensions): float32 time(time), float64 month(time), float64 year(time), float32 latitude(latitude), float32 longitude(longitude), float64 precip(time,latitude,longitude)
groups:
In [47]: nc.variables
Out[47]:
OrderedDict([('time', <class 'netCDF4._netCDF4.Variable'>
float32 time(time)
units: months since 1996-10-01
unlimited dimensions:
current shape = (267,)
filling on, default _FillValue of 9.969209968386869e+36 used),
('month', <class 'netCDF4._netCDF4.Variable'>
float64 month(time)
units: month
unlimited dimensions:
current shape = (267,)
filling on, default _FillValue of 9.969209968386869e+36 used),
('year', <class 'netCDF4._netCDF4.Variable'>
float64 year(time)
units: year
unlimited dimensions:
current shape = (267,)
filling on, default _FillValue of 9.969209968386869e+36 used),
('latitude', <class 'netCDF4._netCDF4.Variable'>
float32 latitude(latitude)
unlimited dimensions:
current shape = (180,)
filling on, default _FillValue of 9.969209968386869e+36 used),
('longitude', <class 'netCDF4._netCDF4.Variable'>
float32 longitude(longitude)
unlimited dimensions:
current shape = (360,)
filling on, default _FillValue of 9.969209968386869e+36 used),
('precip', <class 'netCDF4._netCDF4.Variable'>
float64 precip(time, latitude, longitude)
units: mm/month
unlimited dimensions:
current shape = (267, 180, 360)
filling on, default _FillValue of 9.969209968386869e+36 used)])
In [48]: nc.variables.keys()
Out[48]: odict_keys(['time', 'month', 'year', 'latitude', 'longitude', 'precip'])