import iris
import numpy as np
iris.FUTURE.netcdf_promote = True
cube = iris.load_cube('/Users/scott/DATA/StationData/GHCN-D/NetCDFs/UKM00003772_HEATHROW_TMAX.nc')
print cube
TMAX / (degrees_c) (time: 11874) Dimension coordinates: time x Scalar coordinates: elevation: 25.3 m latitude: 51.478 degrees longitude: -0.461 degrees Attributes: Conventions: CF-1.5 StationID: UKM00003772 StationName: HEATHROW
print cube.coord('time')
DimCoord([1973-01-01 00:00:00, 1973-01-02 00:00:00, 1973-01-03 00:00:00, ..., 2016-01-10 00:00:00, 2016-01-11 00:00:00, 2016-07-13 00:00:00], standard_name=u'time', calendar=u'gregorian', var_name='time')
ntimes = len(cube.coord('time').points)
ts1 = cube.data[0:3650]
ts2 = cube.data[ntimes-3650 : -1]
11874 8224
n1, bins, patches = plt.hist(ts1, 8, normed=1, histtype='step', lw=1, color='blue', label='first half')
n2, bins, patches = plt.hist(ts2, 8, normed=1, histtype='step', lw=1, color='red', label='second half')
np.mean(ts1), np.mean(ts2)
(14.908547945205479, 16.52044395724856)