desihub / desispec

DESI spectral pipeline
BSD 3-Clause "New" or "Revised" License
36 stars 24 forks source link

Define camword for linkcal #2257

Closed akremin closed 4 months ago

akremin commented 4 months ago

Previously the camword for the linkcal jobs were given the default ('a0123456789') camword, but on at least one night we don't need all cameras and the night we were linking to didn't have all cameras. This updates the code to look at the current night under consideration and identify all good cameras available for at least one exposure. It then requests that union of good cameras as the camword. This does not check if the reference night has those cameras to link to, that is up to the person creating the override file to verify. The linkcal job will crash in that instance, at which time they'll have to find a different night to reference.

I've tested the code on the night that currently crashes in main and we now submit the correct camword: INFO:processing.py:499:create_batch_script: Command to be run: ['desi_link_calibnight', '--refnight=20221119', '--newnight=20221120', '--cameras=a069b7r7', '--include=ctecorrnight,fiberflatnight']

I've also tested on another night with an override file and find that it correctly identifies that we need all cameras: INFO:processing.py:499:create_batch_script: Command to be run: ['desi_link_calibnight', '--refnight=20231017', '--newnight=20231018', '--cameras=a0123456789', '--include=fiberflatnight,ctecorrnight']

I've also created a unit test that verifies that if nothing is specified we get the union in good exposures from the exposure_table, and if 'camword' is specified in the override file then that is used instead.