Coverage for python/lsst/analysis/tools/atools/wholeSkyPlotTool.py: 36%
31 statements
« prev ^ index » next coverage.py v7.16.2, created at 2026-10-09 11:29 +0000
« prev ^ index » next coverage.py v7.16.2, created at 2026-10-09 11:29 +0000
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__ = ("WholeSkyPlotTool",)
26from lsst.pex.config import Field
28from ..actions.keyedData import KeyedDataUnitAccessAction
29from ..actions.plot.wholeSkyPlot import WholeSkyPlot
30from ..actions.vector import LoadVector
31from ..interfaces import AnalysisTool
34class WholeSkyPlotTool(AnalysisTool):
35 """
36 WholeSkyPlot of per-tract metric values.
38 x and y axes are Right Ascension and Declination, respectively.
39 The z-axis colorbar indicates the metric value.
40 """
42 parameterizedBand = Field[bool](
43 doc="Does this AnalysisTool support band as a name parameter?", default=True
44 )
46 metric = Field[str](
47 doc="The name of the metric to plot.",
48 default="e1Diff_{band}_highSNStars_median",
49 )
51 publicationStyle = Field[bool](
52 doc="Plot a simplified plot for publication use.",
53 default=False,
54 )
56 fixAroundZero = Field[bool](
57 doc="Fix the colorbar to be symmetric around zero.",
58 default=False,
59 )
61 def setDefaults(self):
62 super().setDefaults()
64 self.process.buildActions.tract = LoadVector()
65 self.process.buildActions.tract.vectorKey = "tract"
66 self.produce.plot = WholeSkyPlot()
68 def finalize(self):
69 self.process.buildActions.z = LoadVector(vectorKey=self.metric)
70 self.process.buildActions.zUnit = KeyedDataUnitAccessAction(key=self.metric)
71 if self.publicationStyle:
72 self.produce.plot.publicationStyle = True
73 self.produce.plot.zAxisLabel = self.metric
74 sequentialMetrics = ["count", "num", "igma", "tdev", "Repeat"]
75 for seqMet in sequentialMetrics:
76 if seqMet in self.metric:
77 self.produce.plot.colorMapType = "sequential"
78 self.produce.plot.fixAroundZero = self.fixAroundZero
79 if self.fixAroundZero:
80 self.produce.plot.colorMapType = "divergent"
81 super().finalize()