Coverage for python/lsst/analysis/tools/analysisPlots/skySource.py: 23%
56 statements
« prev ^ index » next coverage.py v6.5.0, created at 2023-01-14 04:04 -0800
« prev ^ index » next coverage.py v6.5.0, created at 2023-01-14 04:04 -0800
1# This file is part of analysis_tools.
2#
3# Developed for the LSST Data Management System.
4# This product includes software developed by the LSST Project
5# (https://www.lsst.org).
6# See the COPYRIGHT file at the top-level directory of this distribution
7# for details of code ownership.
8#
9# This program is free software: you can redistribute it and/or modify
10# it under the terms of the GNU General Public License as published by
11# the Free Software Foundation, either version 3 of the License, or
12# (at your option) any later version.
13#
14# This program is distributed in the hope that it will be useful,
15# but WITHOUT ANY WARRANTY; without even the implied warranty of
16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17# GNU General Public License for more details.
18#
19# You should have received a copy of the GNU General Public License
20# along with this program. If not, see <https://www.gnu.org/licenses/>.
21from __future__ import annotations
23__all__ = ("SkySourceSkyPlot", "SkySourceHistPlot")
25from ..actions.plot.histPlot import HistPanel, HistPlot
26from ..actions.plot.skyPlot import SkyPlot
27from ..actions.vector import LoadVector, SNCalculator
28from ..actions.vector.selectors import SkySourceSelector, SnSelector
29from ..interfaces import AnalysisPlot
32class SkySourceSkyPlot(AnalysisPlot):
33 parameterizedBand: bool = False
35 def setDefaults(self):
36 super().setDefaults()
37 self.prep.selectors.skySourceSelector = SkySourceSelector()
39 # TODO: Can we make these defaults somewhere?
40 self.process.buildActions.x = LoadVector()
41 self.process.buildActions.x.vectorKey = "coord_ra"
42 self.process.buildActions.y = LoadVector()
43 self.process.buildActions.y.vectorKey = "coord_dec"
44 self.process.buildActions.z = LoadVector()
45 self.process.buildActions.z.vectorKey = "ap09Flux"
46 self.process.buildActions.statMask = SnSelector()
47 self.process.buildActions.statMask.threshold = -1e12
48 self.process.buildActions.statMask.fluxType = "psfFlux"
50 self.produce = SkyPlot()
51 self.produce.plotTypes = ["any"]
52 self.produce.plotName = "skySource"
53 self.produce.xAxisLabel = "R.A. (degrees)"
54 self.produce.yAxisLabel = "Dec. (degrees)"
55 self.produce.zAxisLabel = "Sky Source ap09Flux (nJy)"
56 self.produce.plotOutlines = False
57 self.produce.fixAroundZero = True
60class SkySourceHistPlot(AnalysisPlot):
61 parameterizedBand: bool = False
63 def setDefaults(self):
64 super().setDefaults()
65 self.prep.selectors.skySourceSelector = SkySourceSelector()
67 self.process.buildActions.hist_psf_flux = LoadVector(vectorKey="psfFlux")
68 self.process.buildActions.hist_ap09_flux = LoadVector(vectorKey="ap09Flux")
69 self.process.buildActions.hist_psf_sn = SNCalculator(fluxType="psfFlux")
70 self.process.buildActions.hist_ap09_sn = SNCalculator(fluxType="ap09Flux")
72 self.produce = HistPlot()
74 self.produce.panels["panel_flux"] = HistPanel()
75 self.produce.panels["panel_flux"].label = "Flux (nJy)"
76 self.produce.panels["panel_flux"].hists = dict(
77 hist_psf_flux="psfFlux",
78 hist_ap09_flux="ap09Flux",
79 )
80 self.produce.panels["panel_flux"].rangeType = "sigmaMad"
81 self.produce.panels["panel_flux"].lowerRange = 3.5
82 self.produce.panels["panel_flux"].upperRange = 3.5
83 self.produce.panels["panel_flux"].referenceValue = 0.0
84 self.produce.panels["panel_flux"].validate()
86 self.produce.panels["panel_sn"] = HistPanel()
87 self.produce.panels["panel_sn"].label = "S/N"
88 self.produce.panels["panel_sn"].hists = dict(
89 hist_psf_sn="psf S/N",
90 hist_ap09_sn="ap09 S/N",
91 )
92 self.produce.panels["panel_sn"].rangeType = "sigmaMad"
93 self.produce.panels["panel_sn"].lowerRange = 3.5
94 self.produce.panels["panel_sn"].upperRange = 3.5
95 self.produce.panels["panel_sn"].referenceValue = 0.0
96 self.produce.panels["panel_sn"].histDensity = True
97 self.produce.panels["panel_sn"].validate()