[SciPy-User] about opening netcdf file

mdekauwe mdekauwe at gmail.com
Wed May 28 10:45:55 EDT 2014


Personally I use the https://code.google.com/p/netcdf4-python/

I think at some point when I tested it was considerably quicker, but no idea
if this is really true. Anyway...

import netCDF4 as nc

f = nc.Dataset(fname, 'r')             

# Extract data from NetCDF file
lats = f.variables['latitude'][:]  # extract/copy the data
lons = f.variables['longitude'][:]
time = nc.num2date(f.variables['time'][:], f.variables['time'].units)

temp = f.variables['Tair']

HTH,

Martin



--
View this message in context: http://scipy-user.10969.n7.nabble.com/SciPy-User-about-opening-netcdf-file-tp19445p19455.html
Sent from the Scipy-User mailing list archive at Nabble.com.



More information about the SciPy-User mailing list