I 'm trying to plot a spectrum of a Star given some data. The data set spans about 21,000 points.
import numpy as np
import astropy.units as u
import matplotlib.pyplot as plt
from specutils import Spectrum1D
data = ascii.read("SSD1.csv", data_start=1)
wavelength = data['col1']*u.AA
flux = data['col2']*u.Jy
spec1d = Spectrum1D(spectral_axis=wavelength, flux=flux)
ax = plt.subplots()[1]
ax.plot(spec1d.spectral_axis, spec1d.flux)
ax.set_xlabel("Dispersion")
ax.set_ylabel("Flux")
This is the plot i get: Plot of Flux vs Wavelength
It's too difficult to resolve the spectra, how can i make it smooth like this?