-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #86 from karllark/stis_lsfs
STIS LSFs used in mocking of spectra
- Loading branch information
Showing
14 changed files
with
4,213 additions
and
33 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
This file contains 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
556 changes: 556 additions & 0 deletions
556
measure_extinction/utils/STIS_LSF/data/LSF_G140L_1200.txt
Large diffs are not rendered by default.
Oops, something went wrong.
553 changes: 553 additions & 0 deletions
553
measure_extinction/utils/STIS_LSF/data/LSF_G140L_1500.txt
Large diffs are not rendered by default.
Oops, something went wrong.
556 changes: 556 additions & 0 deletions
556
measure_extinction/utils/STIS_LSF/data/LSF_G230L_1700.txt
Large diffs are not rendered by default.
Oops, something went wrong.
553 changes: 553 additions & 0 deletions
553
measure_extinction/utils/STIS_LSF/data/LSF_G230L_2400.txt
Large diffs are not rendered by default.
Oops, something went wrong.
555 changes: 555 additions & 0 deletions
555
measure_extinction/utils/STIS_LSF/data/LSF_G430L_3200.txt
Large diffs are not rendered by default.
Oops, something went wrong.
553 changes: 553 additions & 0 deletions
553
measure_extinction/utils/STIS_LSF/data/LSF_G430L_5500.txt
Large diffs are not rendered by default.
Oops, something went wrong.
549 changes: 549 additions & 0 deletions
549
measure_extinction/utils/STIS_LSF/data/LSF_G750L_7000.txt
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
import argparse | ||
|
||
import matplotlib.pyplot as plt | ||
from astropy.table import Table | ||
|
||
|
||
if __name__ == "__main__": | ||
|
||
# commandline parser | ||
parser = argparse.ArgumentParser() | ||
parser.add_argument("--png", help="save figure as a png file", action="store_true") | ||
parser.add_argument("--pdf", help="save figure as a pdf file", action="store_true") | ||
args = parser.parse_args() | ||
|
||
fig, ax = plt.subplots(ncols=4, figsize=(16, 8)) | ||
|
||
# setup the plots | ||
fontsize = 12 | ||
font = {"size": fontsize} | ||
plt.rc("font", **font) | ||
plt.rc("lines", linewidth=2) | ||
plt.rc("axes", linewidth=2) | ||
plt.rc("xtick.major", width=2) | ||
plt.rc("ytick.major", width=2) | ||
|
||
# resolutions in A/pixel | ||
g140l_res = 0.5831004076162168 | ||
g230l_res = 1.548239955089159 | ||
g430l_res = 2.7463714795193273 | ||
g750l_res = 4.879600079462369 | ||
|
||
tags = ["G140L_1200", "G140L_1500"] | ||
for i, ctag in enumerate(tags): | ||
a = Table.read( | ||
f"data/LSF_{ctag}.txt", format="ascii.commented_header", header_start=-1 | ||
) | ||
|
||
# slits = ["52x0.1", "52x0.2", "52x0.5", "52x2.0"] | ||
slits = ["52x2.0"] | ||
for cslit in slits: | ||
ax[0].plot(g140l_res * a["Rel_pixel"], a[cslit], label=ctag) | ||
ax[0].legend() | ||
ax[0].set_xlabel(r"$\Delta\lambda$ [$\AA$]") | ||
ax[0].set_xlim(-20 * g140l_res, 20 * g140l_res) | ||
|
||
tags = ["G230L_1700", "G230L_2400"] | ||
for i, ctag in enumerate(tags): | ||
a = Table.read( | ||
f"data/LSF_{ctag}.txt", format="ascii.commented_header", header_start=-1 | ||
) | ||
|
||
# slits = ["52x0.1", "52x0.2", "52x0.5", "52x2.0"] | ||
slits = ["52x2.0"] | ||
for cslit in slits: | ||
ax[1].plot(g230l_res * a["Rel_pixel"], a[cslit], label=ctag) | ||
ax[1].legend() | ||
ax[1].set_xlabel(r"$\Delta\lambda$ [$\AA$]") | ||
ax[1].set_xlim(-20 * g230l_res, 20 * g230l_res) | ||
|
||
tags = ["G430L_3200", "G430L_5500"] | ||
for i, ctag in enumerate(tags): | ||
a = Table.read( | ||
f"data/LSF_{ctag}.txt", format="ascii.commented_header", header_start=-1 | ||
) | ||
|
||
# slits = ["52x0.1", "52x0.2", "52x0.5", "52x2.0"] | ||
slits = ["52x2.0"] | ||
for cslit in slits: | ||
ax[2].plot(g430l_res * a["Rel_pixel"], a[cslit], label=ctag) | ||
ax[2].legend() | ||
ax[2].set_xlabel(r"$\Delta\lambda$ [$\AA$]") | ||
ax[2].set_xlim(-20 * g430l_res, 20 * g430l_res) | ||
|
||
tags = ["G750L_7000"] | ||
for i, ctag in enumerate(tags): | ||
a = Table.read( | ||
f"data/LSF_{ctag}.txt", format="ascii.commented_header", header_start=-1 | ||
) | ||
|
||
# slits = ["52x0.1", "52x0.2", "52x0.5", "52x2.0"] | ||
slits = ["52x2.0"] | ||
for cslit in slits: | ||
ax[3].plot(g750l_res * a["Rel_pixel"], a[cslit], label=ctag) | ||
ax[3].legend() | ||
ax[3].set_xlabel(r"$\Delta\lambda$ [$\AA$]") | ||
ax[3].set_xlim(-20 * g750l_res, 20 * g750l_res) | ||
|
||
fig.tight_layout() | ||
|
||
if args.png: | ||
fig.savefig("stis_lsfs.png") | ||
else: | ||
plt.show() |
This file contains 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
Oops, something went wrong.