Skip to content

Commit 3e49a46

Browse files
committed
Add hist plotting to calexpMetrics
1 parent cd55863 commit 3e49a46

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

python/lsst/analysis/tools/atools/calexpMetrics.py

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,15 @@
2020
# along with this program. If not, see <https://www.gnu.org/licenses/>.
2121
from __future__ import annotations
2222

23-
__all__ = ("CalexpSummaryMetrics",)
23+
__all__ = (
24+
"CalexpSummaryMetrics",
25+
"CalexpMetricHists",
26+
)
2427

28+
from lsst.pex.config import DictField
29+
30+
from ..actions.plot import HistPanel, HistPlot
31+
from ..actions.vector import BandSelector, LoadVector
2532
from ..interfaces import AnalysisTool
2633

2734

@@ -77,3 +84,19 @@ def setDefaults(self):
7784

7885
self.prep.keysToLoad = list(self._units.keys())
7986
self.produce.metric.units = self._units
87+
88+
89+
class CalexpMetricHists(AnalysisTool):
90+
91+
parameterizedBand: bool = False
92+
metrics = DictField[str, str](doc="The metrics to plot and their respective labels.")
93+
94+
def setDefaults(self):
95+
self.prep.selectors.bandSelector = BandSelector()
96+
self.produce.plot = HistPlot()
97+
98+
def finalize(self):
99+
100+
for metric, label in self.metrics.items():
101+
setattr(self.process.buildActions, metric, LoadVector(vectorKey=metric))
102+
self.produce.plot.panels[metric] = HistPanel(hists={metric: "Number of calexps"}, label=label)

0 commit comments

Comments
 (0)