From e58a71b8a6b747e1fd28a08cfd80aa61d18b3fa2 Mon Sep 17 00:00:00 2001 From: Colin Slater Date: Thu, 17 Oct 2024 20:34:01 -0700 Subject: [PATCH] Updates for deployment on USDF. --- python/lsst/production/tools/bokeh.py | 2 +- python/lsst/production/tools/bokehPlotUtils.py | 17 ++++++++++++++--- requirements.txt | 4 ++++ 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/python/lsst/production/tools/bokeh.py b/python/lsst/production/tools/bokeh.py index 6aed530..837e6a7 100644 --- a/python/lsst/production/tools/bokeh.py +++ b/python/lsst/production/tools/bokeh.py @@ -22,7 +22,7 @@ from datetime import datetime, timezone from flask import Blueprint, Flask, render_template, url_for import urllib.parse -bp = Blueprint("bokeh", __name__, url_prefix="/bokeh") +bp = Blueprint("bokeh", __name__, url_prefix="/plot-navigator/bokeh", static_folder="../../../../static") from bokeh.embed import json_item from bokeh.plotting import figure diff --git a/python/lsst/production/tools/bokehPlotUtils.py b/python/lsst/production/tools/bokehPlotUtils.py index b8a4884..881409d 100644 --- a/python/lsst/production/tools/bokehPlotUtils.py +++ b/python/lsst/production/tools/bokehPlotUtils.py @@ -4,6 +4,7 @@ import math import numpy as np import pandas as pd +from dataclasses import dataclass import bokeh import bokeh.palettes as palettes @@ -16,8 +17,8 @@ from bokeh.plotting import figure, reset_output from bokeh.transform import factor_cmap, factor_mark, transform -from lsst.afw.cameraGeom import FOCAL_PLANE -from lsst.pipe.base import Struct +#from lsst.afw.cameraGeom import FOCAL_PLANE +#from lsst.pipe.base import Struct # This is a collection of plotting utilities, mostly for creating standalone # interactive Bokeh plots of various visit-level, per-detector parameters and @@ -260,6 +261,16 @@ def setAxisLimitsDict(instrument=None, threshStruct=None): return axisLimitsDict +@dataclass +class TaskConfigParams: + maxMeanDistanceArcsec: float + maxEllipResidual: float + maxScaledSizeScatter: float + maxPsfTraceRadiusDelta: float + maxPsfTraceRadiusSigmaScaledDelta: float + maxPsfApFluxDelta: float + maxPsfApCorrSigmaScaledDelta: float + def introspectConfigs(instrument=None, butler=None): # Stack Defaults: maxMeanDistanceArcsec = 0.5 @@ -334,7 +345,7 @@ def introspectConfigs(instrument=None, butler=None): maxPsfApFluxDelta = 0.075 maxPsfApCorrSigmaScaledDelta = 0.118 - return Struct( + return TaskConfigParams( maxMeanDistanceArcsec=maxMeanDistanceArcsec, maxEllipResidual=maxEllipResidual, maxScaledSizeScatter=maxScaledSizeScatter, diff --git a/requirements.txt b/requirements.txt index b539b11..ba53ade 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,8 +1,12 @@ flask>2 lsst-daf-butler +lsst-efd-client +lsst-pex-config gunicorn psycopg2 boto3 botocore eventlet +bokeh +numpy>=1.26.0