update to use newest astropy API and remove invalid import