Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v6.0.0
hooks:
- id: trailing-whitespace
- id: check-yaml

- repo: https://github.com/PyCQA/isort
rev: 5.13.2
rev: 8.0.1
hooks:
- id: isort
additional_dependencies: [toml]

- repo: https://github.com/psf/black
rev: 24.2.0
rev: 26.3.1
hooks:
- id: black

- repo: https://github.com/PyCQA/flake8
rev: 7.0.0
rev: 7.3.0
hooks:
- id: flake8
40 changes: 11 additions & 29 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

ARG STACK_TAG="w_2026_03"
ARG STACK_TAG="w_2026_13"
# For USDF, UID=17951
# For summit, UID=GID=73006?

Expand All @@ -9,15 +9,14 @@
ENV UID=73006
ENV GID=73006

ENV obs_lsst_branch="w.2026.03"
ENV drp_pipe_branch="w.2026.03"
ENV daf_butler_branch="w.2026.03"
ENV pipe_base_branch="w.2026.03"
ENV spectractor_branch="w.2026.03"
ENV atmospec_branch="w.2026.03"
ENV summit_utils_branch="w.2026.03"
ENV summit_extras_branch="w.2026.03"
ENV eo_pipe_branch="w_2025_12"
ENV obs_lsst_branch="w.2026.13"
ENV drp_pipe_branch="w.2026.13"
ENV daf_butler_branch="w.2026.13"
ENV pipe_base_branch="w.2026.13"
ENV spectractor_branch="w.2026.13"
ENV atmospec_branch="w.2026.13"
ENV summit_utils_branch="w.2026.13"
ENV summit_extras_branch="w.2026.13"
ENV ts_wep_branch="5107292b"
ENV donut_viz_branch="18ea94d"
# no tags for TARTS yet, so default to main if not using deployment branch
Expand All @@ -25,7 +24,7 @@
ENV ts_ofc_branch="develop"
ENV ts_config_mttcs_branch="develop"

ENV USER=${USER:-saluser}

Check warning on line 27 in Dockerfile

View workflow job for this annotation

GitHub Actions / Build and Push Application Container Images

Variables should be defined before their use

UndefinedVar: Usage of undefined variable '$USER' More info: https://docs.docker.com/go/dockerfile/rule/undefined-var/
ENV WORKDIR=/opt/lsst/software/stack

USER root
Expand Down Expand Up @@ -71,10 +70,9 @@
# lsstts channel required for ts-ofc
-c lsstts \
rubin-env-rsp \
astrometry \
redis-py \
batoid \
danish=0.6.0 \
danish=1.0.0 \
rubin-libradtran \
timm \
peft \
Expand Down Expand Up @@ -103,8 +101,7 @@
git clone https://github.com/lsst-ts/ts_ofc.git && \
git clone https://github.com/lsst-ts/ts_config_mttcs.git && \
git clone https://github.com/lsst-ts/donut_viz.git && \
git clone https://github.com/PetchMa/TARTS.git && \
git clone https://github.com/lsst-camera-dh/eo_pipe.git
git clone https://github.com/PetchMa/TARTS.git

# TODO: (DM-43475) Resync RA images with the rest of the summit.
RUN git clone https://github.com/lsst/obs_lsst.git && \
Expand Down Expand Up @@ -194,20 +191,6 @@
scons version


WORKDIR /repos/eo_pipe

RUN source ${WORKDIR}/loadLSST.bash && \
/home/saluser/.checkout_repo.sh ${eo_pipe_branch} && \
eups declare -r . -t saluser && \
setup lsst_distrib && \
setup obs_lsst && \
setup atmospec -j -t saluser && \
setup summit_utils -j -t saluser && \
setup summit_extras -j -t saluser && \
setup eo_pipe -j -t saluser && \
setup sconsUtils && \
scons version

WORKDIR /repos/rubintv_analysis_service

RUN source ${WORKDIR}/loadLSST.bash && \
Expand Down Expand Up @@ -320,7 +303,6 @@
git config --system --add safe.directory /repos/summit_utils && \
git config --system --add safe.directory /repos/summit_extras && \
git config --system --add safe.directory /repos/rubintv_production && \
git config --system --add safe.directory /repos/eo_pipe && \
git config --system --add safe.directory /repos/rubintv_analysis_service && \
git config --system --add safe.directory /repos/ts_wep && \
git config --system --add safe.directory /repos/ts_ofc && \
Expand Down
33 changes: 23 additions & 10 deletions python/lsst/rubintv/production/aosUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

from __future__ import annotations

import warnings
from typing import Any

import batoid
Expand Down Expand Up @@ -320,17 +321,29 @@ def estimateWavefrontDataFromDofs(

# Build double Zernike model for the perturbed
# telescope and the fiducial one
doubleZernikesPerturbed = (
batoid.doubleZernike(
telescope,
field=np.deg2rad(fieldRadius),
wavelength=wavelength * 1e-6,
eps=obscuration,
jmax=jMax,
kmax=kMax,
try:
doubleZernikesPerturbed = (
batoid.doubleZernike(
telescope,
field=np.deg2rad(fieldRadius),
wavelength=wavelength * 1e-6,
eps=obscuration,
jmax=jMax,
kmax=kMax,
)
* wavelength
)
* wavelength
)
except ValueError as e:
if "Cannot compute zernike with Gaussian Quadrature with failed rays." in str(e):
warnings.warn(
"Returning NaNs for perturbed double Zernikes as "
+ "Batoid failed to compute double Zernike for the perturbed telescope. "
+ "This likely means that the DOF state is too far from the nominal state, "
+ f"causing ray tracing issues. Error details: {e}"
)
doubleZernikesPerturbed = np.full(((kMax + 1), (jMax + 1)), np.nan)
else:
raise

doubleZernikesFiducial = (
batoid.doubleZernike(
Expand Down
15 changes: 15 additions & 0 deletions python/lsst/rubintv/production/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
from typing import TYPE_CHECKING, Any, Callable, Iterator

import numpy as np
import sentry_sdk
import yaml

from lsst.daf.butler import (
Expand All @@ -64,7 +65,9 @@
from lsst.afw.image import Exposure, ExposureSummaryStats
from lsst.pipe.base import PipelineGraph


__all__ = [
"setupSentry",
"writeDimensionUniverseFile",
"getDimensionUniverse",
"expRecordToUploadFilename",
Expand Down Expand Up @@ -133,6 +136,15 @@
# only.


def setupSentry() -> None:
"""Set up sentry"""
sentry_sdk.init()
client = sentry_sdk.get_client() # never None, but inactive if failing to initialize
if not client.is_active() or client.dsn is None:
logger = logging.getLogger(__name__)
logger.warning("Sentry DSN not found or client inactive — events will not be reported")


def writeDimensionUniverseFile(butler, locationConfig: LocationConfig) -> None:
"""Run on butler watcher startup.

Expand Down Expand Up @@ -738,6 +750,7 @@ def raiseIf(doRaise: bool, error: Exception, logger: Logger, msg: str = "") -> N
AnyException
Raised if ``self.doRaise`` is True, otherwise swallows and warns.
"""
sentry_sdk.capture_exception(error)
if not msg:
msg = f"{error}"
if doRaise:
Expand Down Expand Up @@ -949,6 +962,8 @@ def writeExpRecordMetadataShard(expRecord: DimensionRecord, metadataShardPath: s
md["Zenith Angle"] = expRecord.zenith_angle if expRecord.zenith_angle else None
md["Elevation"] = 90 - expRecord.zenith_angle if expRecord.zenith_angle else None
md["Can see the sky?"] = f"{expRecord.can_see_sky}"
if expRecord.can_see_sky is None: # None is different to False, and means HeaderService/header problems
md["_Can see the sky?"] = "bad" # flag this cell as red as this should never happen

if expRecord.instrument == "LATISS":
filt, disperser = expRecord.physical_filter.split(FILTER_DELIMITER)
Expand Down
8 changes: 7 additions & 1 deletion scripts/LATISS/runButlerWatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,15 @@

from lsst.daf.butler import Butler
from lsst.rubintv.production import ButlerWatcher
from lsst.rubintv.production.utils import getAutomaticLocationConfig, getDoRaise, writeDimensionUniverseFile
from lsst.rubintv.production.utils import (
getAutomaticLocationConfig,
getDoRaise,
setupSentry,
writeDimensionUniverseFile,
)
from lsst.summit.utils.utils import setupLogging

setupSentry()
setupLogging()
instrument = "LATISS"
locationConfig = getAutomaticLocationConfig()
Expand Down
3 changes: 2 additions & 1 deletion scripts/LATISS/runHeadNode.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@

from lsst.daf.butler import Butler
from lsst.rubintv.production.processingControl import HeadProcessController
from lsst.rubintv.production.utils import getAutomaticLocationConfig
from lsst.rubintv.production.utils import getAutomaticLocationConfig, setupSentry
from lsst.summit.utils.utils import setupLogging

setupSentry()
setupLogging()
instrument = "LATISS"
locationConfig = getAutomaticLocationConfig()
Expand Down
8 changes: 7 additions & 1 deletion scripts/LATISS/runMetadataServer.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,15 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.

from lsst.rubintv.production.timedServices import TimedMetadataServer
from lsst.rubintv.production.utils import checkRubinTvExternalPackages, getAutomaticLocationConfig, getDoRaise
from lsst.rubintv.production.utils import (
checkRubinTvExternalPackages,
getAutomaticLocationConfig,
getDoRaise,
setupSentry,
)
from lsst.summit.utils.utils import setupLogging

setupSentry()
setupLogging()
checkRubinTvExternalPackages()

Expand Down
3 changes: 2 additions & 1 deletion scripts/LATISS/runOneOffExpRecord.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@
from lsst.daf.butler import Butler
from lsst.rubintv.production.oneOffProcessing import OneOffProcessor
from lsst.rubintv.production.podDefinition import PodDetails, PodFlavor
from lsst.rubintv.production.utils import getAutomaticLocationConfig, getDoRaise
from lsst.rubintv.production.utils import getAutomaticLocationConfig, getDoRaise, setupSentry
from lsst.summit.utils.utils import setupLogging

setupSentry()
setupLogging()
instrument = "LATISS"

Expand Down
3 changes: 2 additions & 1 deletion scripts/LATISS/runOneOffPostIsr.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@
from lsst.daf.butler import Butler
from lsst.rubintv.production.oneOffProcessing import OneOffProcessorAuxTel
from lsst.rubintv.production.podDefinition import PodDetails, PodFlavor
from lsst.rubintv.production.utils import getAutomaticLocationConfig, getDoRaise
from lsst.rubintv.production.utils import getAutomaticLocationConfig, getDoRaise, setupSentry
from lsst.summit.utils.utils import setupLogging

setupSentry()
setupLogging()
instrument = "LATISS"

Expand Down
3 changes: 2 additions & 1 deletion scripts/LATISS/runOneOffVisitImage.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@
from lsst.daf.butler import Butler
from lsst.rubintv.production.oneOffProcessing import OneOffProcessor
from lsst.rubintv.production.podDefinition import PodDetails, PodFlavor
from lsst.rubintv.production.utils import getAutomaticLocationConfig, getDoRaise
from lsst.rubintv.production.utils import getAutomaticLocationConfig, getDoRaise, setupSentry
from lsst.summit.utils.utils import setupLogging

setupSentry()
setupLogging()
instrument = "LATISS"

Expand Down
8 changes: 7 additions & 1 deletion scripts/LATISS/runSfmRunner.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,15 @@
from lsst.daf.butler import Butler
from lsst.rubintv.production.pipelineRunning import SingleCorePipelineRunner
from lsst.rubintv.production.podDefinition import PodDetails, PodFlavor
from lsst.rubintv.production.utils import getAutomaticLocationConfig, getDoRaise, getPodWorkerNumber
from lsst.rubintv.production.utils import (
getAutomaticLocationConfig,
getDoRaise,
getPodWorkerNumber,
setupSentry,
)
from lsst.summit.utils.utils import setupLogging

setupSentry()
setupLogging()
instrument = "LATISS"

Expand Down
8 changes: 7 additions & 1 deletion scripts/LATISS/runStep1bWorker.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,15 @@
from lsst.daf.butler import Butler
from lsst.rubintv.production.pipelineRunning import SingleCorePipelineRunner
from lsst.rubintv.production.podDefinition import PodDetails, PodFlavor
from lsst.rubintv.production.utils import getAutomaticLocationConfig, getDoRaise, getPodWorkerNumber
from lsst.rubintv.production.utils import (
getAutomaticLocationConfig,
getDoRaise,
getPodWorkerNumber,
setupSentry,
)
from lsst.summit.utils.utils import setupLogging

setupSentry()
setupLogging()
instrument = "LATISS"

Expand Down
2 changes: 2 additions & 0 deletions scripts/LSSTCam/runAosWorker.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@
getDoRaise,
getPodWorkerNumber,
mapAosWorkerNumber,
setupSentry,
)
from lsst.summit.utils.utils import setupLogging

setupSentry()
setupLogging()
instrument = "LSSTCam"
locationConfig = getAutomaticLocationConfig()
Expand Down
8 changes: 7 additions & 1 deletion scripts/LSSTCam/runBacklogWorker.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,15 @@
from lsst.daf.butler import Butler
from lsst.rubintv.production.pipelineRunning import SingleCorePipelineRunner
from lsst.rubintv.production.podDefinition import PodDetails, PodFlavor
from lsst.rubintv.production.utils import getAutomaticLocationConfig, getDoRaise, getPodWorkerNumber
from lsst.rubintv.production.utils import (
getAutomaticLocationConfig,
getDoRaise,
getPodWorkerNumber,
setupSentry,
)
from lsst.summit.utils.utils import setupLogging

setupSentry()
setupLogging()
log = logging.getLogger(__name__)
instrument = "LSSTCam"
Expand Down
3 changes: 2 additions & 1 deletion scripts/LSSTCam/runButlerCanary.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@
import time

from lsst.daf.butler import Butler, DataCoordinate
from lsst.rubintv.production.utils import getAutomaticLocationConfig
from lsst.rubintv.production.utils import getAutomaticLocationConfig, setupSentry
from lsst.summit.utils.utils import setupLogging

setupSentry()
setupLogging()

log = logging.getLogger(__name__)
Expand Down
8 changes: 7 additions & 1 deletion scripts/LSSTCam/runButlerWatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,15 @@

from lsst.daf.butler import Butler
from lsst.rubintv.production import ButlerWatcher
from lsst.rubintv.production.utils import getAutomaticLocationConfig, getDoRaise, writeDimensionUniverseFile
from lsst.rubintv.production.utils import (
getAutomaticLocationConfig,
getDoRaise,
setupSentry,
writeDimensionUniverseFile,
)
from lsst.summit.utils.utils import setupLogging

setupSentry()
setupLogging()
instrument = "LSSTCam"
locationConfig = getAutomaticLocationConfig()
Expand Down
3 changes: 2 additions & 1 deletion scripts/LSSTCam/runCleanup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.

from lsst.rubintv.production.cleanup import TempFileCleaner
from lsst.rubintv.production.utils import getAutomaticLocationConfig
from lsst.rubintv.production.utils import getAutomaticLocationConfig, setupSentry
from lsst.summit.utils.utils import setupLogging

setupSentry()
setupLogging()

locationConfig = getAutomaticLocationConfig()
Expand Down
Loading
Loading