Skip to content

Commit

Permalink
add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
PFLeget committed Oct 9, 2024
1 parent 3a05f0a commit 8fbbff3
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 13 deletions.
4 changes: 2 additions & 2 deletions python/lsst/meas/algorithms/computeExPsf.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import numpy.typing as npt


__all__ = "ComputeExPsfTask"
__all__ = ("ComputeExPsfTask")


class ComputeExPsfTask(Task):
Expand Down Expand Up @@ -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)
27 changes: 25 additions & 2 deletions python/lsst/meas/algorithms/treecorrUtils.py
Original file line number Diff line number Diff line change
@@ -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 <https://www.gnu.org/licenses/>.


from lsst.pex.config import ChoiceField, Config, Field, FieldValidationError


Expand All @@ -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](
Expand Down
18 changes: 9 additions & 9 deletions tests/test_computeExPsf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand All @@ -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()

Expand All @@ -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):
Expand Down

0 comments on commit 8fbbff3

Please sign in to comment.