Skip to content

Commit

Permalink
Merge pull request #8 from lsst-ts/tickets/DM-47080
Browse files Browse the repository at this point in the history
Tickets/dm 47080
  • Loading branch information
jbkalmbach authored Oct 31, 2024
2 parents 1f38518 + 77fc281 commit 8a3d38a
Show file tree
Hide file tree
Showing 7 changed files with 369 additions and 38 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/changelog.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: ChangelogUpdated
on:
pull_request:
types: [assigned, opened, synchronize, reopened, labeled, unlabeled]
branches:
- main
jobs:
build:
name: Check Actions
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Changelog check
uses: Zomzog/[email protected]
with:
fileName: doc/versionHistory.rst
checkNotification: Simple
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
13 changes: 13 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
@Library('JenkinsShared')_
DevelopPipeline(
name: "donut_viz",
module_name: "lsst.donut.viz",
idl_names: [],
build_all_idl: false,
extra_packages: ["lsst-ts/ts_wep"],
kickoff_jobs: [],
slack_build_channel: "aos-builds",
has_doc_site: false,
require_git_lfs: true,
require_scons: true
)
10 changes: 10 additions & 0 deletions doc/versionHistory.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@
Version History
##################

.. _lsst.ts.donut.viz-1.1.0:

-------------
1.1.0
-------------

* Add tests for full donut_viz pipeline.
* Add changelog github action.
* Add Jenkinsfile.

.. _lsst.ts.donut.viz-1.0.0:

-------------
Expand Down
56 changes: 56 additions & 0 deletions pipelines/scienceDirectDetectPipeline.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# This yaml file is used to define the tasks and configuration of
# a Gen 3 pipeline used for testing in ts_wep.
description: wep basic processing test pipeline
# Here we specify the corresponding instrument for the data we
# will be using.
instrument: lsst.obs.lsst.LsstCam
# Then we can specify each task in our pipeline by a name
# and then specify the class name corresponding to that task
tasks:
isr:
class: lsst.ip.isr.IsrTaskLSST
config:
# Although we don't have to apply the amp offset corrections, we do want
# to compute them for analyzeAmpOffsetMetadata to report on as metrics.
doAmpOffset: true
ampOffset.doApplyAmpOffset: false
# Turn off slow steps in ISR
doBrighterFatter: false
doCrosstalk: false
# Turn off flats, biases, darks because we don't have these in test repo
doBias: False
doDark: False
doFlat: False
doBootstrap: True
doApplyGains: False
doLinearize: False
doDeferredCharge: False
doDefect: False
generateDonutCatalogWcsTask:
class: lsst.ts.wep.task.generateDonutCatalogWcsTask.GenerateDonutCatalogWcsTask
config:
donutSelector.unblendedSeparation: 1
cutOutDonutsScienceSensorTask:
class: lsst.ts.wep.task.CutOutDonutsScienceSensorTask
calcZernikesTask:
class: lsst.ts.wep.task.calcZernikesTask.CalcZernikesTask
config:
estimateZernikes.maxNollIndex: 28
estimateZernikes.saveHistory: False
estimateZernikes.maskKwargs: {'doMaskBlends': False}
aggregateZernikeTablesTask:
class: lsst.donut.viz.AggregateZernikeTablesTask
aggregateDonutTablesTask:
class: lsst.donut.viz.AggregateDonutTablesTask
aggregateDonutStampsTask:
class: lsst.donut.viz.AggregateDonutStampsTask
aggregateAOSVisitTableTask:
class: lsst.donut.viz.AggregateAOSVisitTableTask
plotAOSTask:
class: lsst.donut.viz.PlotAOSTask
config:
doRubinTVUpload: false
plotDonutTask:
class: lsst.donut.viz.PlotDonutTask
config:
doRubinTVUpload: false
79 changes: 41 additions & 38 deletions python/lsst/donut/viz/aggregate_visit.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,11 +241,12 @@ def runQuantum(
for ref in inputRefs.qualityTables
}

# Find common (visit, detector) pairs
keys = set(donutRefDict) & set(qualityRefDict)
# Find common (visit, detector) extra-focal pairs
# DonutQualityTables only saved under extra-focal ids
extra_keys = set(donutRefDict) & set(qualityRefDict)

# Raise error if there's no matches
if len(keys) == 0:
if len(extra_keys) == 0:
raise RuntimeError(
"No (visit, detector) matches found between "
"the donut and quality tables"
Expand All @@ -258,51 +259,53 @@ def runQuantum(
tables = []

# Iterate over the common (visit, detector) pairs
for visit, detector in keys:
# Determine if intra or extra
if visit == pair.intra:
intra = True
elif visit == pair.extra:
intra = False
else:
# This visit isn't in this pair
# so we will skip for now
for visit, detector in extra_keys:
# Check if this extra-focal visit is in this pair.
if visit != pair.extra:
# This visit isn't in this pair so we will skip for now
continue

# Get pixels -> field angle transform for this detector
det = camera[detector]
tform = det.getTransform(PIXELS, FIELD_ANGLE)

# Load the donut catalog table, and the donut quality table
donutTable = butlerQC.get(donutRefDict[(visit, detector)])
qualityTable = butlerQC.get(qualityRefDict[(visit, detector)])
intraDonutTable = butlerQC.get(donutRefDict[(pair.intra, detector)])
extraDonutTable = butlerQC.get(donutRefDict[(pair.extra, detector)])
qualityTable = butlerQC.get(qualityRefDict[(pair.extra, detector)])

# Get rows of quality table for this exposure
if intra:
qualityTable = qualityTable[qualityTable["DEFOCAL_TYPE"] == "intra"]
else:
qualityTable = qualityTable[qualityTable["DEFOCAL_TYPE"] == "extra"]

# Select donuts used in Zernike estimation
table = donutTable[qualityTable["FINAL_SELECT"]]

# Add focusZ to donut table
table["focusZ"] = (
intraVisitInfo.focusZ if intra else extraVisitInfo.focusZ
)

# Add field angle in CCS to the table
pts = tform.applyForward(
[
Point2D(x, y)
for x, y in zip(table["centroid_x"], table["centroid_y"])
]
)
table["thx_CCS"] = [pt.y for pt in pts] # Transpose from DVCS to CCS
table["thy_CCS"] = [pt.x for pt in pts]
table["detector"] = det.getName()
intraQualityTable = qualityTable[
qualityTable["DEFOCAL_TYPE"] == "intra"
]
extraQualityTable = qualityTable[
qualityTable["DEFOCAL_TYPE"] == "extra"
]

for donutTable, qualityTable in zip(
[intraDonutTable, extraDonutTable],
[intraQualityTable, extraQualityTable],
):
# Select donuts used in Zernike estimation
table = donutTable[qualityTable["FINAL_SELECT"]]

# Add focusZ to donut table
table["focusZ"] = table.meta["visit_info"]["focus_z"]

# Add field angle in CCS to the table
pts = tform.applyForward(
[
Point2D(x, y)
for x, y in zip(table["centroid_x"], table["centroid_y"])
]
)
table["thx_CCS"] = [
pt.y for pt in pts
] # Transpose from DVCS to CCS
table["thy_CCS"] = [pt.x for pt in pts]
table["detector"] = det.getName()

tables.append(table)
tables.append(table)

# Don't attempt to stack metadata
for table in tables:
Expand Down
Loading

0 comments on commit 8a3d38a

Please sign in to comment.