diff --git a/python/lsst/production/tools/tractTable.py b/python/lsst/production/tools/tractTable.py index 19c760c..06f4022 100644 --- a/python/lsst/production/tools/tractTable.py +++ b/python/lsst/production/tools/tractTable.py @@ -25,6 +25,7 @@ import numpy as np import urllib.parse import yaml +import boto3 bp = Blueprint("metrics", __name__, url_prefix="/plot-navigator/metrics", static_folder="../../../../static") NO_BUTLER = True @@ -189,8 +190,19 @@ def collection(collection_urlencoded): butler = Butler("/repo/main") dataId = {"skymap": "hsc_rings_v1", "instrument": "HSC"} t = butler.get("objectTableCore_metricsTable", collections=collection, dataId=dataId) - with open("../../metricThresholds/metricInformation.yaml", "r") as filename: - metricDefs = yaml.safe_load(filename) + + # with open("../../metricThresholds/metricInformation.yaml", "r") as filename: + # metricDefs = yaml.safe_load(filename) + + session = boto3.Session(profile_name='rubin-plot-navigator') + s3_client = session.client('s3', endpoint_url=os.getenv("S3_ENDPOINT_URL")) + + metric_threshold_filename = "metricInformation.yaml" + try: + response = s3_client.get_object('rubin-plot-navigator', metric_threshold_filename) + metricDefs = yaml.safe_load(response["Body"]) + except boto3.exceptions.ClientError as e: + print(e) headerDict, bands = mkTableHeaders(t)