Created
February 5, 2026 01:05
-
-
Save andycasey/3d765376be4f911be7d089ba197b28f9 to your computer and use it in GitHub Desktop.
Get all APOGEE UNe lamp exposures for Karlo de Leon and David Hogg
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 h5py as h5 | |
| import numpy as np | |
| from tqdm import tqdm | |
| from astropy.table import Table | |
| rows = [] | |
| path = "/mnt/ceph/users/sdssv/work/asaydjari/2025_11_22/outdir/almanac/allobs_57600_61000.h5" | |
| with h5.File(path, "r") as almanac: | |
| for obs in ("apo", "lco"): | |
| for mjd in tqdm(almanac[obs].keys()): | |
| gp = almanac[obs][mjd]["exposures"] | |
| match = (gp["lamp_une"][:] == 1) | |
| indices = np.where(match) | |
| for index in indices[0]: | |
| row = {k: gp[k][index] for k in gp.keys()} | |
| rows.append(row) | |
| t = Table(data=rows, names=list(rows[0].keys())) | |
| t.write("~/20260205-UNe-exposures.csv") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment