One more thing. I just used iplt.contourf by mistake, and had to halt the code. The traceback was exactly the same as last time, so I'm guessing this is where the code gets stuck. Might give an indication of the source of the slowdown? Full traceback below in case it's useful (sorry it's a bit long!)
/home/users/lgarciacarreras/python_scripts/gl_general/irisutils.pyc in mapcontour(varplot, levels, title, cbar, cmap, fout, verbose, extend, cbtitle, min0, boxplot)
208 pl = iplt.pcolormesh(varplot, cmap=colmap, norm=norm)
209 else:
--> 210 pl = iplt.contourf(varplot, levels=levels, cmap=cmap, extend=extend)
211
212 #title
/usr/lib/python2.7/site-packages/iris/plot.pyc in contourf(cube, *args, **kwargs)
575 coords = kwargs.get('coords')
576 kwargs.setdefault('antialiased', True)
--> 577 result = _draw_2d_from_points('contourf', None, cube, *args, **kwargs)
578
579 # Matplotlib produces visible seams between anti-aliased polygons.
/usr/lib/python2.7/site-packages/iris/plot.pyc in _draw_2d_from_points(draw_method_name, arg_func, cube, *args, **kwargs)
281 result = _map_common(draw_method_name, arg_func,
282 iris.coords.POINT_MODE, cube, plot_defn,
--> 283 *args, **kwargs)
284 else:
285 # Obtain data array.
/usr/lib/python2.7/site-packages/iris/plot.pyc in _map_common(draw_method_name, arg_func, mode, cube, plot_defn, *args, **kwargs)
534
535 # Draw the contour lines/filled contours.
--> 536 return draw_method(*new_args, **kwargs)
537
538
/usr/lib/python2.7/site-packages/cartopy/mpl/geoaxes.pyc in contourf(self, *args, **kwargs)
968 sub_trans.force_path_ccw = True
969
--> 970 result = matplotlib.axes.Axes.contourf(self, *args, **kwargs)
971 self.autoscale_view()
972 return result
/usr/lib/python2.7/site-packages/matplotlib/axes.pyc in contourf(self, *args, **kwargs)
7724 if not self._hold: self.cla()
7725 kwargs['filled'] = True
-> 7726 return mcontour.QuadContourSet(self, *args, **kwargs)
7727 contourf.__doc__ = mcontour.QuadContourSet.contour_doc
7728
/usr/lib/python2.7/site-packages/matplotlib/contour.pyc in __init__(self, ax, *args, **kwargs)
1292 are described in QuadContourSet.contour_doc.
1293 """
-> 1294 ContourSet.__init__(self, ax, *args, **kwargs)
1295
1296 def _process_args(self, *args, **kwargs):
/usr/lib/python2.7/site-packages/matplotlib/contour.pyc in __init__(self, ax, *args, **kwargs)
828 transform=self.get_transform(),
829 zorder=zorder)
--> 830 self.ax.add_collection(col)
831 self.collections.append(col)
832 else:
/usr/lib/python2.7/site-packages/matplotlib/axes.pyc in add_collection(self, collection, autolim)
1489 if autolim:
1490 if collection._paths and len(collection._paths):
-> 1491 self.update_datalim(collection.get_datalim(self.transData))
1492
1493 collection._remove_method = lambda h: self.collections.remove(h)
/usr/lib/python2.7/site-packages/matplotlib/collections.pyc in get_datalim(self, transData)
172
173 if not transform.is_affine:
--> 174 paths = [transform.transform_path_non_affine(p) for p in paths]
175 transform = transform.get_affine()
176 if not transOffset.is_affine:
/usr/lib/python2.7/site-packages/matplotlib/transforms.pyc in transform_path_non_affine(self, path)
2190 return path
2191 elif not self._a.is_affine and self._b.is_affine:
-> 2192 return self._a.transform_path_non_affine(path)
2193 else:
2194 return self._b.transform_path_non_affine(
/usr/lib/python2.7/site-packages/cartopy/mpl/geoaxes.pyc in transform_path_non_affine(self, src_path)
163 # in matplotlib, but is in Cartopy).
164 geoms = cpatch.path_to_geos(src_path,
--> 165 getattr(self, 'force_path_ccw', False))
166
167 for geom in geoms:
/usr/lib/python2.7/site-packages/cartopy/mpl/patch.pyc in path_to_geos(path, force_ccw)
201 isinstance(collection[-1][0], Polygon) and
202 isinstance(geom, Polygon) and
--> 203 collection[-1][0].contains(geom.exterior)):
204 collection[-1][1].append(geom.exterior)
205 else:
/usr/lib/python2.7/site-packages/shapely/geometry/base.pyc in contains(self, other)
384 def contains(self, other):
385 """Returns True if the geometry contains the other, else False"""
--> 386 return bool(self.impl['contains'](self, other))
387
388 def crosses(self, other):
/usr/lib/python2.7/site-packages/shapely/predicates.pyc in __call__(self, this, other, *args)
9 self._validate(this)
10 self._validate(other, stop_prepared=True)
---> 11 return self.fn(this._geom, other._geom, *args)
12
13 class RelateOp(Delegating):
/usr/lib/python2.7/site-packages/shapely/geos.pyc in errcheck_predicate(result, func, argtuple)
183 return retval
184
--> 185 def errcheck_predicate(result, func, argtuple):
186 if result == 2:
187 raise PredicateError("Failed to evaluate %s" % repr(func))
KeyboardInterrupt: