Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.