Cross-Matched Spectra


In [1]:
%matplotlib inline

In [2]:
import csv
import astropy.io.fits as fits
import spectraldl.lamost as lamost
import spectraldl.ondrejov as ondrejov
import matplotlib.pyplot as plt

In [3]:
with open('data/cross-matched.csv', newline='') as f:
    reader = csv.reader(f)
    for ond_path, lam_path in reader:
        fig, ax = plt.subplots()
        with fits.open(ond_path) as ond_hdulist:
            ondrejov.plot_spectrum(ond_hdulist, ax)
            ax.set_title(ondrejov.get_object_name(ond_hdulist))
        with fits.open(lam_path) as lam_hdulist:
            lamost.plot_spectrum(lam_hdulist, ax)


/usr/local/lib/python3.5/dist-packages/matplotlib/pyplot.py:524: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`).
  max_open_warning, RuntimeWarning)