Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Added delay to trigger after block end and to prefer public/same block/same proposal calibrations. #403

Merged
merged 9 commits into from
Feb 5, 2025

Conversation

cmccully
Copy link
Collaborator

This PR adds functionality to choose which calibration frames are chosen and when data is processed. This is mostly for BANZAI-FLOYDS. I don't expect BANZAI imaging to use this functionality.

- Delaying processing until after the block is complete.

I added functionality that would delay processing until after the block is done observing. This helps for FLOYDS when you want to use an arc and flat taken along with the current data without waiting for the full end of the night.
This is implemented by adding retry logic into the realtime utils, need_to_be_processed. In the case that the block end date is later than now, we use a celery task retry with a delay of 5 minutes after the end of the block. This will only affect certain observation types as set in the settings and has to be manually enabled from the command line.

- Prefering same block or same proposal calibrations

For imaging, all of the calibrations are taken under a public/observatory level program so we haven't had to worry about this. For FLOYDS it is common for the user to take their own calibrations. We then don't want other observations to use that calibration (unless it's public, see below). I have added in the db queries a chain of logic to first check for observations in the same block as the frame that is being processed, then the same proposal, then everything else. The knock on of this is that we now need to store the proposal and block id in the database. The database migration for this is not very complicated but will take a while to run at this point because we have so much data.

- Only use public calibrations

If calibrations from the same block or same proposal don't exist we want to fall back to public data, i.e. we don't want to process data with someone else's proprietary data. To enable this, we need to include the L1PUBDAT from the data in the database. This database migration can be easily completed with the one above.

Copy link
Collaborator

@mgdaily mgdaily left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly looks good to me, just a note about deployment and DB migrations which should be pretty simple. Happy to help with that.

Copy link
Contributor

@sfoale sfoale left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good

Copy link
Contributor

@sfoale sfoale left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@cmccully cmccully merged commit fc3589c into main Feb 5, 2025
7 checks passed
@cmccully cmccully deleted the cals-by-block branch February 5, 2025 17:27
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants