Skip to content

Commit

Permalink
Add hist plotting to calexpMetrics
Browse files Browse the repository at this point in the history
  • Loading branch information
jrmullaney committed Nov 25, 2024
1 parent 7b3eeaa commit 6d674ec
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion python/lsst/analysis/tools/atools/calexpMetrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,15 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.
from __future__ import annotations

__all__ = ("CalexpSummaryMetrics",)
__all__ = (
"CalexpSummaryMetrics",
"CalexpMetricHists",
)

from lsst.pex.config import DictField

from ..actions.plot import HistPanel, HistPlot
from ..actions.vector import BandSelector, LoadVector
from ..interfaces import AnalysisTool


Expand Down Expand Up @@ -77,3 +84,19 @@ def setDefaults(self):

self.prep.keysToLoad = list(self._units.keys())
self.produce.metric.units = self._units


class CalexpMetricHists(AnalysisTool):

parameterizedBand: bool = False
metrics = DictField[str, str](doc="The metrics to plot and their respective labels.")

def setDefaults(self):
self.prep.selectors.bandSelector = BandSelector()
self.produce.plot = HistPlot()

def finalize(self):

for metric, label in self.metrics.items():
setattr(self.process.buildActions, metric, LoadVector(vectorKey=metric))
self.produce.plot.panels[metric] = HistPanel(hists={metric: "Number of calexps"}, label=label)

0 comments on commit 6d674ec

Please sign in to comment.