diff --git a/CHANGES.md b/CHANGES.md index 86f7549..4358687 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,10 @@ +0.12.0 (2024-12-11) +------------------- +- We now have prefer calibrations in the following order: same block, same proposal, any public calibration. +- If a block is still going, we delay the processing in case there is a calibration taken at + at the end of the block that we can use for processing +- We now only use arcs and flats taken with the same slit width as the science data + 0.11.2 (2024-11-18) ------------------- - Simplified the fitting for refining the peak centers. We no longer try to fit them all simultaneously diff --git a/banzai_floyds/frames.py b/banzai_floyds/frames.py index 35b3c3d..0bf735a 100644 --- a/banzai_floyds/frames.py +++ b/banzai_floyds/frames.py @@ -236,6 +236,10 @@ def elevation(self): def elevation(self, value): self.meta['HEIGHT'] = value + @property + def slit_width(self): + return self.meta['APERWID'] + class FLOYDSCalibrationFrame(LCOCalibrationFrame, FLOYDSObservationFrame): def __init__(self, hdu_list: list, file_path: str, frame_id: int = None, grouping_criteria: list = None, diff --git a/banzai_floyds/fringe.py b/banzai_floyds/fringe.py index 2f057fd..258a700 100644 --- a/banzai_floyds/fringe.py +++ b/banzai_floyds/fringe.py @@ -112,6 +112,7 @@ def do_stage(self, image): image.uncertainty[to_correct] /= fringe_correction[fringe_correction > 0.1] image.meta['L1FRNGOF'] = (fringe_offset, 'Fringe offset (pixels)') image.meta['L1STATFR'] = (1, 'Status flag for fringe frame correction') + image.public_date = datetime.now() return image diff --git a/banzai_floyds/settings.py b/banzai_floyds/settings.py index 5026990..142a309 100644 --- a/banzai_floyds/settings.py +++ b/banzai_floyds/settings.py @@ -52,3 +52,8 @@ CALIBRATION_IMAGE_TYPES = ['BIAS', 'DARK', 'SKYFLAT', 'BPM', 'LAMPFLAT', 'ARC', 'STANDARD'] CALIBRATION_LOOKBACK = {'LAMPFLAT': 2.5} + +CALIBRATION_SET_CRITERIA = {'SKYFLAT': [], 'LAMPFLAT': ['slit_width'], 'ARC': ['slit_width'], + 'FRINGE': ['slit_width']} + +OBSTYPES_TO_DELAY = ['STANDARD', 'SPECTRUM'] diff --git a/helm-chart/banzai-floyds/templates/cronjob.yaml b/helm-chart/banzai-floyds/templates/cronjob.yaml index f90254d..9d7d4f0 100644 --- a/helm-chart/banzai-floyds/templates/cronjob.yaml +++ b/helm-chart/banzai-floyds/templates/cronjob.yaml @@ -38,5 +38,9 @@ spec: - "--rlevel=91" - "--db-address=$(DB_ADDRESS)" - "--no-file-cache" + - "--delay-to-block-end" + - "--same-block-cals" + - "--check-public-cals" + - "--prefer-same-proposal" restartPolicy: Never {{- end }} diff --git a/helm-chart/banzai-floyds/templates/listener.yaml b/helm-chart/banzai-floyds/templates/listener.yaml index 841c1e9..37067ea 100644 --- a/helm-chart/banzai-floyds/templates/listener.yaml +++ b/helm-chart/banzai-floyds/templates/listener.yaml @@ -38,6 +38,10 @@ spec: - "--broker-url=$(FITS_BROKER)" - "--queue-name=$(QUEUE_NAME)" - "--no-file-cache" + - "--delay-to-block-end" + - "--same-block-cals" + - "--check-public-cals" + - "--prefer-same-proposal" env: {{- include "banzaiFloyds.Env" . | nindent 12}} resources: diff --git a/setup.cfg b/setup.cfg index 75382e4..12547e9 100644 --- a/setup.cfg +++ b/setup.cfg @@ -20,7 +20,7 @@ setup_requires = psycopg2-binary install_requires = astropy >= 4.3 - banzai @ git+https://github.com/lcogt/banzai.git@1.19.1 + banzai @ git+https://github.com/lcogt/banzai.git@cals-by-block matplotlib [options.extras_require]