works for astropy versions 0.3 and 0.4