Skip to content

Commit

Permalink
Generalize histogram plotting task to n-panels
Browse files Browse the repository at this point in the history
  • Loading branch information
leeskelvin committed Mar 16, 2022
1 parent ce38f52 commit 245fd5d
Show file tree
Hide file tree
Showing 2 changed files with 248 additions and 208 deletions.
57 changes: 52 additions & 5 deletions pipelines/coaddQAPlots.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -265,32 +265,79 @@ tasks:
SnSelector, UnknownIdentifier)
from lsst.analysis.drp.calcFunctors import MagDiff
plot_skyObject_sky:
skyPlot_skyObject:
# Make a plot showing the 9-pixel radius circular aperture flux in units of nJy.
# This plot shows the on sky distribution of these values for sky objects.
class: lsst.analysis.drp.skyPlot.SkyPlotTask
config:
axisActions.zAction.column: "i_ap09Flux"
connections.plotName: skyObject_i
selectorActions.flagSelector: FlagSelector
selectorActions.flagSelector.selectWhenTrue: ["merge_peak_sky"]
selectorActions.flagSelector.selectWhenTrue: ["sky_object"]
sourceSelectorActions: None
statisticSelectorActions.statSelector.threshold: -1e12
axisLabels: {"x": "R.A. (Degrees)", "y": "Dec. (Degrees)", "z": "Sky Object Flux (nJy)"}
python: |
from lsst.analysis.drp.dataSelectors import (FlagSelector)
plot_skyObject_hist:
histPlot_skyObject:
# Make a plot showing histograms of the PSFlux and 9-pixel radius circular aperture flux.
# The left panel histograms show flux in units of nJy.
# The right panel histograms show the equivalent sigma flux values (flux/fluxErr)
class: lsst.analysis.drp.histPlot.HistPlotTask
config:
connections.plotName: skyObject
selectorActions.flagSelector: FlagSelector
selectorActions.flagSelector.selectWhenTrue: ["merge_peak_sky"]
selectorActions.flagSelector.selectWhenTrue: ["sky_object"]
python: |
from lsst.analysis.drp.dataSelectors import (FlagSelector)
from lsst.analysis.drp.dataSelectors import FlagSelector
from lsst.analysis.drp import calcFunctors
from lsst.pipe.tasks.dataFrameActions import SingleColumnAction
config.panels["panel1"] = HistPlotConfig
config.panels["panel1"].label = "Flux (nJy)"
config.panels["panel1"].actions.update = {
"psfFlux": SingleColumnAction(column="i_psfFlux"),
"ap09Flux": SingleColumnAction(column="i_ap09Flux"),
}
config.panels["panel1"].selectors.update = {
"flagSelector": FlagSelector(selectWhenTrue=["sky_object"]),
}
config.panels["panel2"] = HistPlotConfig
config.panels["panel2"].label = "S/N"
config.panels["panel2"].actions.update = {
"psfFlux SN": calcFunctors.SNCalculator(
colA=SingleColumnAction(column="i_psfFlux"),
colB=SingleColumnAction(column="i_psfFluxErr"),),
"ap09Flux SN": calcFunctors.SNCalculator(
colA=SingleColumnAction(column="i_ap09Flux"),
colB=SingleColumnAction(column="i_ap09FluxErr"),),
}
histPlot_magDiff_ap12Flux_psfFlux_i_calib_psf_used:
class: lsst.analysis.drp.histPlot.HistPlotTask
config:
connections.plotName: diff_ap12Flux_psfFlux_i_calib_psf_used
selectorActions.calibPointSelector: FlagSelector
selectorActions.calibPointSelector.selectWhenTrue: ["i_calib_psf_used"]
selectorActions.flagSelector: CoaddPlotFlagSelector
selectorActions.flagSelector.bands: ["i"]
selectorActions.SnSelector: SnSelector
selectorActions.SnSelector.fluxType: "psfFlux"
selectorActions.SnSelector.threshold: 100
python: |
from lsst.analysis.drp.dataSelectors import FlagSelector, CoaddPlotFlagSelector, SnSelector, StarIdentifier, GalaxyIdentifier
from lsst.analysis.drp.calcFunctors import MagDiff
config.panels["panel1"] = HistPlotConfig
config.panels["panel1"].label = "Circular Ap 12 - PS (mmag)"
config.panels["panel1"].actions.update = {
"galaxies": MagDiff(col1="i_ap12Flux", col2="i_psfFlux"),
"stars": MagDiff(col1="i_ap12Flux", col2="i_psfFlux"),
}
config.panels["panel1"].selectors.update = {
"galaxies": GalaxyIdentifier,
"stars": StarIdentifier,
}
config.panels["panel1"].yscale = "log"
plot_ri_gr_cmodel:
# Make a color color plot of gri in CModel magnitudes.
Expand Down

0 comments on commit 245fd5d

Please sign in to comment.