From 8fbbff361ff71c7fe038af3e329536c020e66366 Mon Sep 17 00:00:00 2001 From: Pierre-Francois Leget Date: Wed, 9 Oct 2024 14:20:33 -0700 Subject: [PATCH] add comments --- python/lsst/meas/algorithms/computeExPsf.py | 4 +-- python/lsst/meas/algorithms/treecorrUtils.py | 27 ++++++++++++++++++-- tests/test_computeExPsf.py | 18 ++++++------- 3 files changed, 36 insertions(+), 13 deletions(-) diff --git a/python/lsst/meas/algorithms/computeExPsf.py b/python/lsst/meas/algorithms/computeExPsf.py index f46e70ce..e09e47be 100644 --- a/python/lsst/meas/algorithms/computeExPsf.py +++ b/python/lsst/meas/algorithms/computeExPsf.py @@ -28,7 +28,7 @@ import numpy.typing as npt -__all__ = "ComputeExPsfTask" +__all__ = ("ComputeExPsfTask") class ComputeExPsfTask(Task): @@ -100,4 +100,4 @@ def run( kk.process(cat1, cat2) kk_Ex = copy.deepcopy(kk.xi[0]) - return pipeBase.Struct(E1=kk_E1, E2=kk_E2, Ex=kk_Ex) + return pipeBase.Struct(metric_E1=kk_E1, metric_E2=kk_E2, metric_Ex=kk_Ex) diff --git a/python/lsst/meas/algorithms/treecorrUtils.py b/python/lsst/meas/algorithms/treecorrUtils.py index 75e627f4..21dffd9b 100644 --- a/python/lsst/meas/algorithms/treecorrUtils.py +++ b/python/lsst/meas/algorithms/treecorrUtils.py @@ -1,3 +1,25 @@ +# This file is part of meas_algorithms. +# +# Developed for the LSST Data Management System. +# This product includes software developed by the LSST Project +# (https://www.lsst.org). +# See the COPYRIGHT file at the top-level directory of this distribution +# for details of code ownership. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + + from lsst.pex.config import ChoiceField, Config, Field, FieldValidationError @@ -16,8 +38,9 @@ class TreecorrConfig(Config): Notes ----- - This is intended to be used in CalcRhoStatistics class. It only supports - some of the fields that are relevant for rho-statistics calculations. + This is intended to be used with correlations of PSF residuals. It only supports + some of the fields that are relevant for rho-statistics calculations and the likes + of it. """ nbins = Field[int]( diff --git a/tests/test_computeExPsf.py b/tests/test_computeExPsf.py index f3792629..b6c7a7ee 100644 --- a/tests/test_computeExPsf.py +++ b/tests/test_computeExPsf.py @@ -236,9 +236,9 @@ def test_comp_ex_psf(self) -> None: # to be close to the input variance for de1 and de2. Cross correlation # between de1 and de2 should be zeros are they are 2 indendant field. - np.testing.assert_allclose(output1.E1, 1.0, atol=2e-1) - np.testing.assert_allclose(output1.E2, 1.0, atol=2e-1) - np.testing.assert_allclose(output1.Ex, 0.0, atol=1e-1) + np.testing.assert_allclose(output1.metric_E1, 1.0, atol=2e-1) + np.testing.assert_allclose(output1.metric_E2, 1.0, atol=2e-1) + np.testing.assert_allclose(output1.metric_Ex, 0.0, atol=1e-1) config = ComputeExPsfTask.ConfigClass() @@ -253,9 +253,9 @@ def test_comp_ex_psf(self) -> None: task = ComputeExPsfTask(config) output2 = task.run(self.de1, self.de2, ra, dec, units="arcmin") - np.testing.assert_allclose(output2.E1, 0.20, atol=1e-1) - np.testing.assert_allclose(output2.E2, 0.05, atol=1e-1) - np.testing.assert_allclose(output2.Ex, 0.0, atol=1e-1) + np.testing.assert_allclose(output2.metric_E1, 0.20, atol=1e-1) + np.testing.assert_allclose(output2.metric_E2, 0.05, atol=1e-1) + np.testing.assert_allclose(output2.metric_Ex, 0.0, atol=1e-1) config = ComputeExPsfTask.ConfigClass() @@ -271,9 +271,9 @@ def test_comp_ex_psf(self) -> None: task = ComputeExPsfTask(config) output2 = task.run(self.de1, self.de2, ra, dec, units="arcmin") - np.testing.assert_allclose(output2.E1, 0.0, atol=1e-1) - np.testing.assert_allclose(output2.E2, 0.0, atol=1e-1) - np.testing.assert_allclose(output2.Ex, 0.0, atol=1e-1) + np.testing.assert_allclose(output2.metric_E1, 0.0, atol=1e-1) + np.testing.assert_allclose(output2.metric_E2, 0.0, atol=1e-1) + np.testing.assert_allclose(output2.metric_Ex, 0.0, atol=1e-1) def setup_module(module):