From 21b1caabd574200117ed3f35551cde39de6c06d4 Mon Sep 17 00:00:00 2001 From: Lynne Jones Date: Fri, 2 Feb 2024 14:49:41 -0800 Subject: [PATCH] Include change requested by @thalos23 in tickets/OPSIM-1048 --- rubin_sim/maf/metrics/crowding_metric.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/rubin_sim/maf/metrics/crowding_metric.py b/rubin_sim/maf/metrics/crowding_metric.py index 4e3e7caf..d76a494c 100644 --- a/rubin_sim/maf/metrics/crowding_metric.py +++ b/rubin_sim/maf/metrics/crowding_metric.py @@ -239,8 +239,13 @@ def run(self, data_slice, slice_point=None): mag_vector = slice_point[f"starMapBins_{self.filtername}"][1:] lum_func = slice_point[f"starLumFunc_{self.filtername}"] # Magnitude uncertainty given crowding + # Use minimum here, however this may not be appropriate in all cases. + # (minimum makes value here match MagCrowding above, however + # the minimum seeing could also correlate with poor m5 values) + # Likely there should be some comparison between errors from crowding + # and errors from photometric noise that we're just not doing. dmag_crowd = _comp_crowd_error( - mag_vector, lum_func, data_slice[self.seeing_col], single_mag=self.rmag + mag_vector, lum_func, min(data_slice[self.seeing_col]), single_mag=self.rmag ) result = np.mean(dmag_crowd) return result