from pydap.client import open_url
dataset = open_url("http://127.0.0.1:8001/IDT71003_TAS_MinT_SFC.nc")
mint = dataset['MinT_SFC']
lats = dataset['latitude']
lons = dataset['longitude']
# Just pull out data for the first day
day0 = mint[0]
data = np.squeeze(day0)
from pprint import pprint
print "Keys:", dataset.keys()
print "Lats:", lats.shape, "Lons:", lons.shape, "MinT:", mint.shape
print "MinT attributes:"
pprint(mint.attributes)
Keys: ['latitude', 'time', 'longitude', 'MinT_SFC'] Lats: (277,) Lons: (223,) MinT: (8, 277, 223) MinT attributes: {'_FillValue': -32767.0, 'gridType': 'SCALAR', 'level': 'SFC', 'long_name': 'Minimum Temperature', 'missing_value': -32767.0, 'projectionType': 'LATLONG', 'units': 'C', 'valid_max': 60.0, 'valid_min': -20.0}
_ = plt.imshow(data)
_ = plt.imshow(data, origin='lower')
_ = plt.imshow(data, origin='lower', vmin=0, vmax=20)
extent = [min(lons), max(lons), min(lats), max(lats)]
_ = plt.imshow(data, origin='lower', vmin=0, vmax=20, extent=extent)
# Show a subset of the data around Hobart with latlon (-42.8, 147.31)
# By default this will use bilinear interpolation
_ = plt.imshow(data, origin='lower', vmin=0, vmax=20, extent=extent)
_ = plt.axis([146, 148, -41, -43])
# Setting interpolation to nearest means NO interpolation
# ie. we see the data as blocky because it actually is.
_ = plt.imshow(data, interpolation='nearest', origin='lower', vmin=0, vmax=20, extent=extent)
_ = plt.axis([146, 148, -41, -43])