diff --git a/python/lsst/analysis/tools/actions/keyedData/calcCompletenessHistogram.py b/python/lsst/analysis/tools/actions/keyedData/calcCompletenessHistogram.py index 10b550d22..d61f8223b 100644 --- a/python/lsst/analysis/tools/actions/keyedData/calcCompletenessHistogram.py +++ b/python/lsst/analysis/tools/actions/keyedData/calcCompletenessHistogram.py @@ -139,4 +139,4 @@ def getOutputSchema(self) -> KeyedDataSchema: return result def getPercentileName(self, percentile: float) -> str: - return f"{percentile:.2f}pc" + return f"{percentile:.2f}_pct".replace(".", "p") diff --git a/python/lsst/analysis/tools/atools/diffMatched.py b/python/lsst/analysis/tools/atools/diffMatched.py index a5bdbfd37..81ed16744 100644 --- a/python/lsst/analysis/tools/atools/diffMatched.py +++ b/python/lsst/analysis/tools/atools/diffMatched.py @@ -610,15 +610,10 @@ def finalize(self): action.name_purity_good_match: unit_select, } ) - setattr( - self.produce.metric.actions, - object_class, - BaseMetricAction(units=units), - ) completeness_plot = CalcCompletenessHistogramAction( action=CalcBinnedCompletenessAction( - name_prefix=f"{name_prefix_class}plot_", + name_prefix=name_prefix_class, selector_range_ref=RangeSelector(vectorKey=key_mag_ref), selector_range_target=RangeSelector(vectorKey=key_mag_target), key_mask_ref=name_selector_ref, @@ -637,6 +632,16 @@ def finalize(self): completeness_plot.getPercentileName(pct) ) units[name_pct] = unit_select + + # Make the metric action for the given object class + # This will include units for metrics from the plot histogram + # (i.e. the magnitude for a given completeness threshold) + setattr( + self.produce.metric.actions, + object_class, + BaseMetricAction(units=units), + ) + if self.make_plots: setattr( self.produce.plot.actions,