diff --git a/rubin_sim/maf/metrics/crowding_metric.py b/rubin_sim/maf/metrics/crowding_metric.py index d76a494c..2bd6bd49 100644 --- a/rubin_sim/maf/metrics/crowding_metric.py +++ b/rubin_sim/maf/metrics/crowding_metric.py @@ -36,6 +36,10 @@ def _comp_crowd_error(mag_vector, lum_func, seeing, single_mag=None): mag_uncert : `np.array` (N,) Magnitude uncertainties. """ + # Our saved luminosity functions are cumulative, + # so we must here convert to differential + lum_func = np.diff(lum_func) + mag_vector = mag_vector[1:] lum_area_arcsec = 3600.0**2 lum_vector = 10 ** (-0.4 * mag_vector) coeff = np.sqrt(np.pi / lum_area_arcsec) * seeing / 2.0