Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tickets/dm 47080 #8

Merged
merged 15 commits into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from 14 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
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
59 changes: 59 additions & 0 deletions pipelines/scienceDirectDetectPipeline.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# 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.isrTask.IsrTask
jbkalmbach marked this conversation as resolved.
Show resolved Hide resolved
# Below we specify the configuration settings we want to use
# when running the task in this pipeline. Since our data doesn't
# include bias or flats we only want to use doApplyGains and
# doOverscan in our isr task.
config:
connections.outputExposure: "postISRCCD"
doBias: False
doVariance: False
doLinearize: False
doCrosstalk: False
doDefect: False
doNanMasking: False
doInterpolate: False
doBrighterFatter: False
doDark: False
doFlat: False
doApplyGains: True
doFringe: False
doOverscan: True
python: OverscanCorrectionTask.ConfigClass.fitType = 'MEDIAN'
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
74 changes: 39 additions & 35 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,13 +259,9 @@ def runQuantum(
tables = []

# Iterate over the common (visit, detector) pairs
for visit, detector in keys:
for visit, detector in extra_keys:
# Determine if intra or extra
jbkalmbach marked this conversation as resolved.
Show resolved Hide resolved
if visit == pair.intra:
intra = True
elif visit == pair.extra:
intra = False
else:
if visit not in (pair.intra, pair.extra):
jbkalmbach marked this conversation as resolved.
Show resolved Hide resolved
# This visit isn't in this pair
# so we will skip for now
continue
Expand All @@ -274,35 +271,42 @@ def runQuantum(
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
Loading