Created
November 22, 2019 19:40
-
-
Save iancze/d8862ca23b4a035852ff87b2a0565b37 to your computer and use it in GitHub Desktop.
Read and plot the APF spectra
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from scipy.io import readsav | |
from matplotlib import pyplot as plt | |
w_idl = readsav("w_rl23.2142") | |
w = w_idl["w"] # wavelengths in AA | |
fl_idl = readsav("rl23.2127") | |
f = fl_idl["sp"] # fluxes in arbitrary units | |
print(w.shape) | |
print(f.shape) | |
# each array is 65 orders, 4608 pixels | |
# which echelle order we want to plot | |
order = 40 | |
fig, ax = plt.subplots(nrows=1) | |
ax.plot(w[order], f[order]) | |
ax.set_xlabel(r"$\lambda$ [$\AA$]") | |
ax.set_ylabel("counts") | |
plt.show() | |
# fig.savefig("spectrum.png") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment