Skip to content

Commit

Permalink
Load metric thresholds from S3.
Browse files Browse the repository at this point in the history
  • Loading branch information
ctslater committed Oct 17, 2024
1 parent 679c5d1 commit a993330
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions python/lsst/production/tools/tractTable.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,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)
Expand Down

0 comments on commit a993330

Please sign in to comment.