File tree Expand file tree Collapse file tree 1 file changed +24
-1
lines changed
python/lsst/analysis/tools/atools Expand file tree Collapse file tree 1 file changed +24
-1
lines changed Original file line number Diff line number Diff line change 2020# along with this program. If not, see <https://www.gnu.org/licenses/>.
2121from __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
2532from ..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 )
You can’t perform that action at this time.
0 commit comments