Created
November 11, 2022 14:50
-
-
Save andycasey/7e6dcbae776ec763dd4606db5374c9a5 to your computer and use it in GitHub Desktop.
APOGEE 2D frames for FROE
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
# /uufs/chpc.utah.edu/common/home/sdss43/dr17/apogee/spectro/redux/dr17/exposures/apogee-n/57282 | |
# or | |
# https://dr17.sdss.org/sas/dr17/apogee/spectro/redux/dr17/exposures/apogee-n/57282/ | |
from glob import glob | |
from astropy.io import fits | |
# Just use the middle chip for now | |
paths = glob("ap2D-b-*.fits") | |
for path in paths: | |
with fits.open(path) as image: | |
print(path, image[0].header["IMAGETYP"]) | |
""" | |
ap2D-b-17200004.fits Dark | |
ap2D-b-17200006.fits ArcLamp | |
ap2D-b-17200005.fits QuartzFlat | |
ap2D-b-17200008.fits ArcLamp | |
ap2D-b-17200007.fits ArcLamp | |
ap2D-b-17200010.fits Dark | |
ap2D-b-17200009.fits ArcLamp | |
ap2D-b-17200012.fits Dark | |
ap2D-b-17200011.fits Dark | |
ap2D-b-17200041.fits Dark | |
ap2D-b-17200043.fits QuartzFlat | |
ap2D-b-17200040.fits Dark | |
ap2D-b-17200045.fits QuartzFlat | |
ap2D-b-17200042.fits Dark | |
ap2D-b-17200047.fits ArcLamp | |
ap2D-b-17200044.fits QuartzFlat | |
ap2D-b-17200052.fits InternalFlat | |
ap2D-b-17200046.fits ArcLamp | |
ap2D-b-17200053.fits InternalFlat | |
ap2D-b-17200048.fits ArcLamp | |
ap2D-b-17200054.fits Dark | |
ap2D-b-17200049.fits ArcLamp | |
ap2D-b-17200050.fits Dark | |
ap2D-b-17200051.fits InternalFlat | |
ap2D-b-17200022.fits Object | |
ap2D-b-17200023.fits Object | |
ap2D-b-17200025.fits Object | |
ap2D-b-17200024.fits Object | |
ap2D-b-17200026.fits Object | |
ap2D-b-17200027.fits Object | |
ap2D-b-17200028.fits Object | |
ap2D-b-17200029.fits Object | |
ap2D-b-17200030.fits Object | |
""" | |
get_paths = [ | |
("Object", "ap2D-b-17200022.fits"), | |
("ArcLamp", "ap2D-b-17200049.fits"), | |
("InternalFlat", "ap2D-b-17200053.fits"), | |
("QuartzFlat", "ap2D-b-17200044.fits"), | |
("Dark", "ap2D-b-17200042.fits") | |
] | |
commands = [] | |
for image_type, basename in get_paths: | |
commands.extend([ | |
f"wget -O {basename} https://dr17.sdss.org/sas/dr17/apogee/spectro/redux/dr17/exposures/apogee-n/57282/{basename}", | |
f"ln -s {basename} {image_type}.fits" | |
]) | |
print(f"Execute these:") | |
print("\n".join(commands)) | |
# After downloading: | |
image = fits.open("QuartzFlat.fits") | |
import matplotlib.pyplot as plt | |
fig, ax = plt.subplots() | |
ax.imshow(image[1].data, vmin=0, vmax=2000) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment