Added astropy as an optional dependency