In [1]:
%matplotlib inline
In [2]:
import csv
import matplotlib.pyplot as plt
import astropy.io.fits as fits
import spectraldl.lamost as lamost
import spectraldl.preprocessing as preprocessing
In [3]:
fig, axs = plt.subplots(3, 1)
for ax, path in zip(axs, [
'/lamost/GAC_100N13_V1/spec-55961-GAC_100N13_V1_sp06-088.fits',
'/lamost/GAC_071N52_V2/spec-55940-GAC_071N52_V2_sp01-070.fits',
'/lamost/GAC065N50V1/spec-56316-GAC065N50V1_sp07-048.fits'
]):
with fits.open(path) as hdulist:
fluxes = lamost.get_fluxes(hdulist)
waves = lamost.get_waves(hdulist)
idx = (waves > preprocessing.START) & (waves < preprocessing.END)
ax.plot(waves[idx], fluxes[idx])
ax.axvline(x=6564.6, color='black', linestyle='dashed', label='H-alpha')
ax.grid()
ax.legend()
ax.set_xlabel('wavelength (Angstrom)')
ax.set_ylabel('flux')
ax.set_title(hdulist[0].header['FILENAME'])
fig.tight_layout()
In [4]:
fig, axs = plt.subplots(3, 1)
for ax, path in zip(axs, [
'/lamost/HD081044N520834M01/spec-56301-HD081044N520834M01_sp06-213.fits',
'/lamost/GAC088N20V2/spec-56309-GAC088N20V2_sp06-189.fits',
'/lamost/GAC078N51V2/spec-56310-GAC078N51V2_sp07-169.fits'
]):
with fits.open(path) as hdulist:
fluxes = lamost.get_fluxes(hdulist)
waves = lamost.get_waves(hdulist)
idx = (waves > preprocessing.START) & (waves < preprocessing.END)
ax.plot(waves[idx], fluxes[idx])
ax.axvline(x=6564.6, color='black', linestyle='dashed', label='H-alpha')
ax.grid()
ax.legend()
ax.set_xlabel('wavelength (Angstrom)')
ax.set_ylabel('flux')
ax.set_title(hdulist[0].header['FILENAME'])
fig.tight_layout()