Skip to content

Commit

Permalink
create_petalnz_pdf(): additional check requiring tileid to be in tile…
Browse files Browse the repository at this point in the history
…s-survey.ecsv
  • Loading branch information
araichoor committed Sep 6, 2024
1 parent 48e477d commit 81e76e0
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions py/desispec/night_qa.py
Original file line number Diff line number Diff line change
Expand Up @@ -1679,6 +1679,21 @@ def create_petalnz_pdf(
)
)
tileids, surveys = tileids[sel], surveys[sel]
# AR additional check if the tile is in tiles-{survey}.ecsv, as get_tilecov() needs that
# AR https://github.com/desihub/desispec/issues/2357
sel = np.ones(len(tileids), dtype=bool)
for survey in np.unique(surveys):
fn = os.path.join(os.getenv("DESI_SURVEYOPS"), "ops", "tiles-{}.ecsv".format(survey))
t = Table.read(fn)
reject = (surveys == survey) & (~np.in1d(tileids, t["TILEID"]))
if reject.sum() > 0:
log.warning(
"ignoring tiles={} which have survey={} but are not present in {}".format(
",".join(tileids[reject].astype(str)), survey, fn,
)
)
sel[reject] = False
tileids, surveys = tileids[sel], surveys[sel]
# AR for main tiles, restrict to tiles with EFFTIME > MINTFRAC * GOALTIME
# AR we also read the tile-qa*fits header below in the loop,
# AR but it is simpler/safer to do separate this first loop
Expand Down

0 comments on commit 81e76e0

Please sign in to comment.