This failed for me when the data was not a masked array (no attibute: getmask)