Integration of astropy into spectra

There are many flaws in this change. Please give me your reviews, comments to make this better!