From 6736dffd10b509702e21ec0e785e947f25cb5ef2 Mon Sep 17 00:00:00 2001 From: James Chiang Date: Fri, 30 Jul 2021 10:12:28 -0700 Subject: [PATCH] set data type of row_means array to np.float64 to avoid makeStatistics bug --- python/lsst/eotest/sensor/flatPairTask.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/lsst/eotest/sensor/flatPairTask.py b/python/lsst/eotest/sensor/flatPairTask.py index c9eb4d7..4f4bbea 100644 --- a/python/lsst/eotest/sensor/flatPairTask.py +++ b/python/lsst/eotest/sensor/flatPairTask.py @@ -51,7 +51,7 @@ def row_mean_variance(flat1, flat2, amp, nsig=10): mi_diff = afwImage.MaskedImageF(flat1.unbiased_and_trimmed_image(amp), deep=True) mi_diff -= flat2.unbiased_and_trimmed_image(amp) - row_means = np.mean(mi_diff.getImage().array, axis=1) + row_means = np.mean(mi_diff.getImage().array, axis=1, dtype=np.float64) sctrl = afwMath.StatisticsControl() sctrl.setNumSigmaClip(nsig) return afwMath.makeStatistics(row_means, afwMath.VARIANCECLIP, @@ -214,7 +214,7 @@ def _create_detresp_fits_output(self, nrows, infile): namps = len(all_amps) units = (['None'] + 3*namps*['e-'] + namps*['e-^2'] + ['None', 'None', 'None']) - columns = [np.zeros(nrows, dtype=np.float) for fmt in formats[:-1]] + columns = [np.zeros(nrows, dtype=np.float64) for fmt in formats[:-1]] columns.append(nrows*['']) fits_cols = [fits.Column(name=colnames[i], format=formats[i], unit=units[i], array=columns[i])